[REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

17 messages, 3 authors, 2017-09-19 · open the first message on its own page

[REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Oleksandr Natalenko <hidden>
Date: 2017-09-10 20:53:49

Hello.

Since, IIRC, v4.11, there is some regression in TCP stack resulting in the 
warning shown below. Most of the time it is harmless, but rarely it just 
causes either freeze or (I believe, this is related too) panic in 
tcp_sacktag_walk() (because sk_buff passed to this function is NULL). 
Unfortunately, I still do not have proper stacktrace from panic, but will try 
to capture it if possible.

Also, I have custom settings regarding TCP stack, shown below as well. ifb is 
used to shape traffic with tc.

Please note this regression was already reported as BZ [1] and as a letter to 
ML [2], but got neither attention nor resolution. It is reproducible for (not 
only) me on my home router since v4.11 till v4.13.1 incl.

Please advise on how to deal with it. I'll provide any additional info if 
necessary, also ready to test patches if any.

Thanks.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=195835
[2] https://www.spinics.net/lists/netdev/msg436158.html

=== warning
[14407.060066] ------------[ cut here ]------------
[14407.060353] WARNING: CPU: 0 PID: 719 at net/ipv4/tcp_input.c:2826 
tcp_fastretrans_alert+0x7c8/0x990
[14407.060747] Modules linked in: netconsole ctr ccm cls_bpf sch_htb 
act_mirred cls_u32 sch_ingress sit tunnel4 ip_tunnel 8021q mrp nf
_conntrack_ipv6 nf_defrag_ipv6 nft_ct nft_set_bitmap nft_set_hash 
nft_set_rbtree nf_tables_inet nf_tables_ipv6 nft_masq_ipv4 nf_nat_ma
squerade_ipv4 nft_masq nft_nat nft_counter nft_meta nft_chain_nat_ipv4 
nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrac
k libcrc32c crc32c_generic nf_tables_ipv4 tun nf_tables nfnetlink nct6775 
hwmon_vid nls_iso8859_1 nls_cp437 vfat fat ext4 mbcache jbd2
 arc4 f2fs snd_hda_codec_hdmi fscrypto snd_hda_codec_realtek 
snd_hda_codec_generic intel_rapl intel_powerclamp coretemp iTCO_wdt iTCO_
vendor_support ath9k ath9k_common kvm_intel ath9k_hw kvm ath irqbypass 
intel_cstate mac80211 pcspkr snd_intel_sst_acpi i2c_i801 i915 s
nd_hda_intel
[14407.063800]  snd_intel_sst_core r8169 cfg80211 evdev mii snd_hda_codec 
joydev mousedev input_leds snd_soc_rt5670 mei_txe snd_soc_ss
t_atom_hifi2_platform snd_hda_core snd_soc_rl6231 snd_soc_sst_match mac_hid 
mei lpc_ich shpchp drm_kms_helper snd_hwdep snd_soc_core s
nd_compress battery snd_pcm_dmaengine drm hci_uart ov2722(C) snd_pcm lm3554(C) 
ov5693(C) snd_timer v4l2_common btbcm snd intel_gtt btq
ca btintel videodev syscopyarea bluetooth video soundcore sysfillrect media 
sysimgblt ac97_bus ecdh_generic rfkill_gpio i2c_hid rfkill
 tpm_tis crc16 fb_sys_fops i2c_algo_bit 8250_dw tpm_tis_core tpm 
soc_button_array pinctrl_cherryview intel_int0002_vgpio acpi_pad butt
on sch_fq_codel tcp_bbr ifb ip_tables x_tables btrfs xor raid6_pq 
algif_skcipher af_alg hid_logitech_hidpp hid_logitech_dj usbhid hid
uas usb_storage
[14407.066873]  dm_crypt dm_mod dax raid10 md_mod sd_mod crct10dif_pclmul 
crc32_pclmul crc32c_intel ghash_clmulni_intel pcbc aesni_int
el aes_x86_64 crypto_simd glue_helper cryptd ahci xhci_pci libahci xhci_hcd 
libata usbcore scsi_mod usb_common serio sdhci_acpi sdhci
led_class mmc_core
[14407.068034] CPU: 0 PID: 719 Comm: irq/123-enp3s0 Tainted: G         C      
4.13.0-pf2 #1
[14407.068403] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./
J3710-ITX, BIOS P1.30 03/30/2016
[14407.068827] task: ffff98b1c0a05400 task.stack: ffffbb59c15c0000
[14407.069111] RIP: 0010:tcp_fastretrans_alert+0x7c8/0x990
[14407.069358] RSP: 0018:ffff98b1ffc03a78 EFLAGS: 00010202
[14407.069607] RAX: 0000000000000000 RBX: ffff98b135ae0000 RCX: 
ffff98b1ffc03b0c
[14407.069928] RDX: 0000000000000001 RSI: 0000000000000001 RDI: 
ffff98b135ae0000
[14407.070248] RBP: ffff98b1ffc03ab8 R08: 0000000000000000 R09: 
ffff98b1ffc03b60
[14407.070565] R10: 0000000000000000 R11: 0000000000000000 R12: 
0000000000005120
[14407.070884] R13: ffff98b1ffc03b10 R14: 0000000000000001 R15: 
ffff98b1ffc03b0c
[14407.071205] FS:  0000000000000000(0000) GS:ffff98b1ffc00000(0000) knlGS:
0000000000000000
[14407.071564] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[14407.071827] CR2: 00007ffc580b2f0f CR3: 0000000010a09000 CR4: 
00000000001006f0
[14407.072146] Call Trace:
[14407.072279]  <IRQ>
[14407.072412]  ? sk_reset_timer+0x18/0x30
[14407.072610]  tcp_ack+0x741/0x1110
[14407.072810]  tcp_rcv_established+0x325/0x770
[14407.073033]  ? sk_filter_trim_cap+0xd4/0x1a0
[14407.073249]  tcp_v4_do_rcv+0x90/0x1e0
[14407.073449]  tcp_v4_rcv+0x950/0xa10
[14407.073647]  ? nf_ct_deliver_cached_events+0xb8/0x110 [nf_conntrack]
[14407.073955]  ip_local_deliver_finish+0x68/0x210
[14407.074183]  ip_local_deliver+0xfa/0x110
[14407.074385]  ? ip_rcv_finish+0x410/0x410
[14407.074589]  ip_rcv_finish+0x120/0x410
[14407.074782]  ip_rcv+0x28e/0x3b0
[14407.074952]  ? inet_del_offload+0x40/0x40
[14407.075154]  __netif_receive_skb_core+0x39b/0xb00
[14407.075389]  ? netif_receive_skb_internal+0xa0/0x480
[14407.075635]  ? skb_release_all+0x24/0x30
[14407.075832]  ? consume_skb+0x38/0xa0
[14407.076025]  __netif_receive_skb+0x18/0x60
[14407.076230]  netif_receive_skb_internal+0x98/0x480
[14407.076470]  netif_receive_skb+0x1c/0x80
[14407.087463]  ifb_ri_tasklet+0x109/0x26a [ifb]
[14407.090528]  tasklet_action+0x63/0x120
[14407.093258]  __do_softirq+0xdf/0x2e5
[14407.095974]  ? irq_finalize_oneshot.part.39+0xe0/0xe0
[14407.098708]  do_softirq_own_stack+0x1c/0x30
[14407.101437]  </IRQ>
[14407.104139]  do_softirq.part.17+0x4e/0x60
[14407.106854]  __local_bh_enable_ip+0x77/0x80
[14407.109671]  irq_forced_thread_fn+0x5c/0x70
[14407.112407]  irq_thread+0x131/0x1a0
[14407.115120]  ? wake_threads_waitq+0x30/0x30
[14407.117836]  kthread+0x126/0x140
[14407.120541]  ? irq_thread_check_affinity+0x90/0x90
[14407.123244]  ? kthread_create_on_node+0x70/0x70
[14407.125913]  ret_from_fork+0x25/0x30
[14407.128548] Code: 05 00 00 3b 83 30 05 00 00 0f 88 ca 01 00 00 0f b6 83 3c 
06 00 00 80 a3 cd 05 00 00 7f c0 e8 04 0f 85 3b fb ff ff
 e9 2c fb ff ff <0f> ff e9 46 f9 ff ff 31 d2 48 89 df e8 47 aa ff ff e9 f9 f9 
ff
[14407.133867] ---[ end trace 4bb223d8deb9f077 ]---
===

=== code
2823     /* D. Check state exit conditions. State can be terminated
2824      *    when high_seq is ACKed. */
2825     if (icsk->icsk_ca_state == TCP_CA_Open) {
2826         WARN_ON(tp->retrans_out != 0); // here
2827         tp->retrans_stamp = 0;
===

=== sysctl custom settings
net.ipv4.ip_nonlocal_bind = 1
net.ipv4.ip_local_port_range = 1026 59999
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
net.ipv6.route.max_size = 16384
net.ipv4.ip_dynaddr = 1
net.ipv4.tcp_mtu_probing = 1
net.ipv4.tcp_congestion_control = bbr
net.ipv4.tcp_fack = 1
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_low_latency = 1
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_rmem = 4096 262143 4194304
net.ipv4.tcp_wmem = 4096 262143 4194304
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_intvl = 60
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_retries2 = 5
net.core.rmem_max = 4194304
net.core.rmem_default = 262143
net.core.wmem_max = 4194304
net.core.wmem_default = 262143
net.core.bpf_jit_enable = 1
net.ipv4.tcp_ecn = 1
===

=== kernel cmdline
BOOT_IMAGE=/vmlinuz-linux-pf root=/dev/mapper/system-root rw cryptdevice=/dev/
md0:system:allow-discards resume=/dev/mapper/system-swap quiet zswap.enabled=1 
threadirqs
===

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Neal Cardwell <ncardwell@google.com>
Date: 2017-09-10 23:59:34

On Sun, Sep 10, 2017 at 4:53 PM, Oleksandr Natalenko
[off-list ref] wrote:
Hello.

Since, IIRC, v4.11, there is some regression in TCP stack resulting in the
warning shown below. Most of the time it is harmless, but rarely it just
causes either freeze or (I believe, this is related too) panic in
tcp_sacktag_walk() (because sk_buff passed to this function is NULL).
Unfortunately, I still do not have proper stacktrace from panic, but will try
to capture it if possible.
...
[14407.060066] ------------[ cut here ]------------
[14407.060353] WARNING: CPU: 0 PID: 719 at net/ipv4/tcp_input.c:2826
tcp_fastretrans_alert+0x7c8/0x990
...
2823     /* D. Check state exit conditions. State can be terminated
2824      *    when high_seq is ACKed. */
2825     if (icsk->icsk_ca_state == TCP_CA_Open) {
2826         WARN_ON(tp->retrans_out != 0); // here
2827         tp->retrans_stamp = 0;
Thanks for the detailed report!

I suspect this is due to the following commit, which happened between
4.10 and 4.11:

  89fe18e44f7e tcp: extend F-RTO to catch more spurious timeouts
  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=89fe18e44f7e

This commit expanded the set of scenarios where we would undo a
CA_Loss cwnd reduction and return to TCP_CA_Open, but did not include
a check to see if there were any in-flight retransmissions. I think we
need a fix like the following:
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 659d1baefb2b..730a2de9d2b0 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2439,7 +2439,7 @@ static bool tcp_try_undo_loss(struct sock *sk,
bool frto_undo)
 {
        struct tcp_sock *tp = tcp_sk(sk);

-       if (frto_undo || tcp_may_undo(tp)) {
+       if ((frto_undo || tcp_may_undo(tp)) && !tp->retrans_out) {
                tcp_undo_cwnd_reduction(sk, true);

                DBGUNDO(sk, "partial loss");

I will try a packetdrill test to see if I can reproduce this issue and
verify the fix.

thanks,
neal

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Oleksandr Natalenko <hidden>
Date: 2017-09-15 05:03:29

Hi.

I've applied your test patch but it doesn't fix the issue for me since the 
warning is still there.

Were you able to reproduce it?

On pondělí 11. září 2017 1:59:02 CEST Neal Cardwell wrote:
quoted hunk
Thanks for the detailed report!

I suspect this is due to the following commit, which happened between
4.10 and 4.11:

  89fe18e44f7e tcp: extend F-RTO to catch more spurious timeouts
 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?
id=89fe18e44f7e

This commit expanded the set of scenarios where we would undo a
CA_Loss cwnd reduction and return to TCP_CA_Open, but did not include
a check to see if there were any in-flight retransmissions. I think we
need a fix like the following:
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 659d1baefb2b..730a2de9d2b0 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2439,7 +2439,7 @@ static bool tcp_try_undo_loss(struct sock *sk,
bool frto_undo)
 {
        struct tcp_sock *tp = tcp_sk(sk);

-       if (frto_undo || tcp_may_undo(tp)) {
+       if ((frto_undo || tcp_may_undo(tp)) && !tp->retrans_out) {
                tcp_undo_cwnd_reduction(sk, true);

                DBGUNDO(sk, "partial loss");

I will try a packetdrill test to see if I can reproduce this issue and
verify the fix.

thanks,
neal

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Neal Cardwell <ncardwell@google.com>
Date: 2017-09-15 14:03:22

On Fri, Sep 15, 2017 at 1:03 AM, Oleksandr Natalenko
[off-list ref] wrote:
Hi.

I've applied your test patch but it doesn't fix the issue for me since the
warning is still there.

Were you able to reproduce it?
Hi,

Thanks for testing that. That is a very useful data point.

I was able to cook up a packetdrill test that could put the connection
in CA_Disorder with retransmitted packets out, but not in CA_Open. So
we do not yet have a test case to reproduce this.

We do not see this warning on our fleet at Google. One significant
difference I see between our environment and yours is that it seems
you run with FACK enabled:

  net.ipv4.tcp_fack = 1

Note that FACK was disabled by default (since it was replaced by RACK)
between kernel v4.10 and v4.11. And this is exactly the time when this
bug started manifesting itself for you and some others, but not our
fleet. So my new working hypothesis would be that this warning is due
to a behavior that only shows up in kernels >=4.11 when FACK is
enabled.

Would you be able to disable FACK ("sysctl net.ipv4.tcp_fack=0" at
boot, or net.ipv4.tcp_fack=0 in /etc/sysctl.conf, or equivalent),
reboot, and test the kernel for a few days to see if the warning still
pops up?

thanks,
neal

[ps: apologies for the previous, mis-formatted post...]

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Oleksandr Natalenko <hidden>
Date: 2017-09-15 19:04:38

Hello.

With net.ipv4.tcp_fack set to 0 the warning still appears:

===
» sysctl net.ipv4.tcp_fack     
net.ipv4.tcp_fack = 0

» LC_TIME=C dmesg -T | grep WARNING
[Fri Sep 15 20:40:30 2017] WARNING: CPU: 1 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:40:30 2017] WARNING: CPU: 0 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:48:37 2017] WARNING: CPU: 1 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:48:55 2017] WARNING: CPU: 0 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990

» ps -up 711
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       711  4.3  0.0      0     0 ?        S    18:12   7:23 [irq/123-
enp3s0]
===

Any suggestions?

On pátek 15. září 2017 16:03:00 CEST Neal Cardwell wrote:
Thanks for testing that. That is a very useful data point.

I was able to cook up a packetdrill test that could put the connection
in CA_Disorder with retransmitted packets out, but not in CA_Open. So
we do not yet have a test case to reproduce this.

We do not see this warning on our fleet at Google. One significant
difference I see between our environment and yours is that it seems
you run with FACK enabled:

  net.ipv4.tcp_fack = 1

Note that FACK was disabled by default (since it was replaced by RACK)
between kernel v4.10 and v4.11. And this is exactly the time when this
bug started manifesting itself for you and some others, but not our
fleet. So my new working hypothesis would be that this warning is due
to a behavior that only shows up in kernels >=4.11 when FACK is
enabled.

Would you be able to disable FACK ("sysctl net.ipv4.tcp_fack=0" at
boot, or net.ipv4.tcp_fack=0 in /etc/sysctl.conf, or equivalent),
reboot, and test the kernel for a few days to see if the warning still
pops up?

thanks,
neal

[ps: apologies for the previous, mis-formatted post...]

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Oleksandr Natalenko <hidden>
Date: 2017-09-17 18:43:25

Hi.

Just to note that it looks like disabling RACK and re-enabling FACK prevents 
warning from happening:

net.ipv4.tcp_fack = 1
net.ipv4.tcp_recovery = 0

Hope I get semantics of these tunables right.

On pátek 15. září 2017 21:04:36 CEST Oleksandr Natalenko wrote:
Hello.

With net.ipv4.tcp_fack set to 0 the warning still appears:

===
» sysctl net.ipv4.tcp_fack
net.ipv4.tcp_fack = 0

» LC_TIME=C dmesg -T | grep WARNING
[Fri Sep 15 20:40:30 2017] WARNING: CPU: 1 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:40:30 2017] WARNING: CPU: 0 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:48:37 2017] WARNING: CPU: 1 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:48:55 2017] WARNING: CPU: 0 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990

» ps -up 711
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       711  4.3  0.0      0     0 ?        S    18:12   7:23 [irq/123-
enp3s0]
===

Any suggestions?

On pátek 15. září 2017 16:03:00 CEST Neal Cardwell wrote:
quoted
Thanks for testing that. That is a very useful data point.

I was able to cook up a packetdrill test that could put the connection
in CA_Disorder with retransmitted packets out, but not in CA_Open. So
we do not yet have a test case to reproduce this.

We do not see this warning on our fleet at Google. One significant
difference I see between our environment and yours is that it seems

you run with FACK enabled:
  net.ipv4.tcp_fack = 1

Note that FACK was disabled by default (since it was replaced by RACK)
between kernel v4.10 and v4.11. And this is exactly the time when this
bug started manifesting itself for you and some others, but not our
fleet. So my new working hypothesis would be that this warning is due
to a behavior that only shows up in kernels >=4.11 when FACK is
enabled.

Would you be able to disable FACK ("sysctl net.ipv4.tcp_fack=0" at
boot, or net.ipv4.tcp_fack=0 in /etc/sysctl.conf, or equivalent),
reboot, and test the kernel for a few days to see if the warning still
pops up?

thanks,
neal

[ps: apologies for the previous, mis-formatted post...]

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Yuchung Cheng <hidden>
Date: 2017-09-18 17:19:19

On Sun, Sep 17, 2017 at 11:43 AM, Oleksandr Natalenko
[off-list ref] wrote:
Hi.

Just to note that it looks like disabling RACK and re-enabling FACK prevents
warning from happening:

net.ipv4.tcp_fack = 1
net.ipv4.tcp_recovery = 0

Hope I get semantics of these tunables right.
Thanks.

One difference between RACK and FACK is that RACK can detect lost
retransmission in CA_Recovery (fast recovery) and CA_Loss  (post RTO)
mode, while the current FACK can not. A previous FACK version can also
detect lost retransmission in CA_recovery with limited-transmit. I
suspect it is RACK's special ability that triggers this warning.

IMO, however, this warning itself is questionably valid: with undo
(TCP Eifel), the sender can detect and revert a false CA_Recovery /
CA_Loss to CA_Open, with spurious retransmission in-flight
(tp->retrans_out > 0). Then another SACK after undo triggers this
warning. Neal and I are not sure if this is causing the panics you're
seeing, but personally I'd argue this warning is false, or at least
should be revised to skip undo case.

On pátek 15. září 2017 21:04:36 CEST Oleksandr Natalenko wrote:
quoted
Hello.

With net.ipv4.tcp_fack set to 0 the warning still appears:

===
» sysctl net.ipv4.tcp_fack
net.ipv4.tcp_fack = 0

» LC_TIME=C dmesg -T | grep WARNING
[Fri Sep 15 20:40:30 2017] WARNING: CPU: 1 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:40:30 2017] WARNING: CPU: 0 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:48:37 2017] WARNING: CPU: 1 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:48:55 2017] WARNING: CPU: 0 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990

» ps -up 711
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       711  4.3  0.0      0     0 ?        S    18:12   7:23 [irq/123-
enp3s0]
===

Any suggestions?

On pátek 15. září 2017 16:03:00 CEST Neal Cardwell wrote:
quoted
Thanks for testing that. That is a very useful data point.

I was able to cook up a packetdrill test that could put the connection
in CA_Disorder with retransmitted packets out, but not in CA_Open. So
we do not yet have a test case to reproduce this.

We do not see this warning on our fleet at Google. One significant
difference I see between our environment and yours is that it seems

you run with FACK enabled:
  net.ipv4.tcp_fack = 1

Note that FACK was disabled by default (since it was replaced by RACK)
between kernel v4.10 and v4.11. And this is exactly the time when this
bug started manifesting itself for you and some others, but not our
fleet. So my new working hypothesis would be that this warning is due
to a behavior that only shows up in kernels >=4.11 when FACK is
enabled.

Would you be able to disable FACK ("sysctl net.ipv4.tcp_fack=0" at
boot, or net.ipv4.tcp_fack=0 in /etc/sysctl.conf, or equivalent),
reboot, and test the kernel for a few days to see if the warning still
pops up?

thanks,
neal

[ps: apologies for the previous, mis-formatted post...]

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Yuchung Cheng <hidden>
Date: 2017-09-18 17:52:03

On Mon, Sep 18, 2017 at 10:18 AM, Yuchung Cheng [off-list ref] wrote:
On Sun, Sep 17, 2017 at 11:43 AM, Oleksandr Natalenko
[off-list ref] wrote:
quoted
Hi.

Just to note that it looks like disabling RACK and re-enabling FACK prevents
warning from happening:

net.ipv4.tcp_fack = 1
net.ipv4.tcp_recovery = 0

Hope I get semantics of these tunables right.
Thanks.

One difference between RACK and FACK is that RACK can detect lost
retransmission in CA_Recovery (fast recovery) and CA_Loss  (post RTO)
mode, while the current FACK can not. A previous FACK version can also
detect lost retransmission in CA_recovery with limited-transmit. I
suspect it is RACK's special ability that triggers this warning.

IMO, however, this warning itself is questionably valid: with undo
(TCP Eifel), the sender can detect and revert a false CA_Recovery /
CA_Loss to CA_Open, with spurious retransmission in-flight
(tp->retrans_out > 0). Then another SACK after undo triggers this
warning. Neal and I are not sure if this is causing the panics you're
seeing, but personally I'd argue this warning is false, or at least
should be revised to skip undo case.
Can you try this patch to verify my theory with tcp_recovery=0 and 1? thanks
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 5af2f04f8859..9253d9ee7d0e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2381,6 +2381,7 @@ static void tcp_undo_cwnd_reduction(struct sock
*sk, bool unmark_loss)
        }
        tp->snd_cwnd_stamp = tcp_time_stamp;
        tp->undo_marker = 0;
+       WARN_ON(tp->retrans_out);
 }



quoted
On pátek 15. září 2017 21:04:36 CEST Oleksandr Natalenko wrote:
quoted
Hello.

With net.ipv4.tcp_fack set to 0 the warning still appears:

===
» sysctl net.ipv4.tcp_fack
net.ipv4.tcp_fack = 0

» LC_TIME=C dmesg -T | grep WARNING
[Fri Sep 15 20:40:30 2017] WARNING: CPU: 1 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:40:30 2017] WARNING: CPU: 0 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:48:37 2017] WARNING: CPU: 1 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990
[Fri Sep 15 20:48:55 2017] WARNING: CPU: 0 PID: 711 at net/ipv4/tcp_input.c:
2826 tcp_fastretrans_alert+0x7c8/0x990

» ps -up 711
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       711  4.3  0.0      0     0 ?        S    18:12   7:23 [irq/123-
enp3s0]
===

Any suggestions?

On pátek 15. září 2017 16:03:00 CEST Neal Cardwell wrote:
quoted
Thanks for testing that. That is a very useful data point.

I was able to cook up a packetdrill test that could put the connection
in CA_Disorder with retransmitted packets out, but not in CA_Open. So
we do not yet have a test case to reproduce this.

We do not see this warning on our fleet at Google. One significant
difference I see between our environment and yours is that it seems

you run with FACK enabled:
  net.ipv4.tcp_fack = 1

Note that FACK was disabled by default (since it was replaced by RACK)
between kernel v4.10 and v4.11. And this is exactly the time when this
bug started manifesting itself for you and some others, but not our
fleet. So my new working hypothesis would be that this warning is due
to a behavior that only shows up in kernels >=4.11 when FACK is
enabled.

Would you be able to disable FACK ("sysctl net.ipv4.tcp_fack=0" at
boot, or net.ipv4.tcp_fack=0 in /etc/sysctl.conf, or equivalent),
reboot, and test the kernel for a few days to see if the warning still
pops up?

thanks,
neal

[ps: apologies for the previous, mis-formatted post...]

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Oleksandr Natalenko <hidden>
Date: 2017-09-18 17:59:56

OK. Should I keep FACK disabled?

On pondělí 18. září 2017 19:51:21 CEST Yuchung Cheng wrote:
quoted hunk
Can you try this patch to verify my theory with tcp_recovery=0 and 1? thanks
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 5af2f04f8859..9253d9ee7d0e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2381,6 +2381,7 @@ static void tcp_undo_cwnd_reduction(struct sock
*sk, bool unmark_loss)
        }
        tp->snd_cwnd_stamp = tcp_time_stamp;
        tp->undo_marker = 0;
+       WARN_ON(tp->retrans_out);
 }

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Yuchung Cheng <hidden>
Date: 2017-09-18 18:02:24

On Mon, Sep 18, 2017 at 10:59 AM, Oleksandr Natalenko
[off-list ref] wrote:
OK. Should I keep FACK disabled?
Yes since it is disabled in the upstream by default. Although you can
experiment FACK enabled additionally.

Do we know the crash you first experienced is tied to this issue?
On pondělí 18. září 2017 19:51:21 CEST Yuchung Cheng wrote:
quoted
Can you try this patch to verify my theory with tcp_recovery=0 and 1? thanks
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 5af2f04f8859..9253d9ee7d0e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2381,6 +2381,7 @@ static void tcp_undo_cwnd_reduction(struct sock
*sk, bool unmark_loss)
        }
        tp->snd_cwnd_stamp = tcp_time_stamp;
        tp->undo_marker = 0;
+       WARN_ON(tp->retrans_out);
 }

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Oleksandr Natalenko <hidden>
Date: 2017-09-18 18:04:02

On pondělí 18. září 2017 20:01:42 CEST Yuchung Cheng wrote:
Yes since it is disabled in the upstream by default. Although you can
experiment FACK enabled additionally.
OK.
Do we know the crash you first experienced is tied to this issue?
No, unfortunately. I wasn't able to re-create it again, so lets focus on 
tcp_fastretrans_alert warning only.

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Oleksandr Natalenko <hidden>
Date: 2017-09-18 20:41:14

OK,

with:

net.ipv4.tcp_recovery = 0
net.ipv4.tcp_fack = 0

and your patch I got the following warning within 10 min uptime:

===
Sep 18 22:18:34 defiant kernel: ------------[ cut here ]------------
Sep 18 22:18:34 defiant kernel: WARNING: CPU: 0 PID: 702 at net/ipv4/
tcp_input.c:2392 tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 18 22:18:34 defiant kernel: Modules linked in: netconsole ctr ccm cls_bpf 
sch_htb act_mirred cls_u32 sch_ingress sit tunnel4 ip_tunnel 8021q mrp 
nf_conntrack_ipv6 nf_defrag_ipv6 nft_ct nft_set_bitmap nft_set_hash 
nft_set_rbtree nf_tables_inet nf_tables_ipv6 nft_masq_ipv4 
nf_nat_masquerade_ipv4 nft_masq nft_nat nft_counter nft_meta 
nft_chain_nat_ipv4 nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat 
nf_conntrack libcrc32c crc32c_generic nf_tables_ipv4 nf_tables tun nct6775 
nfnetlink hwmon_vid nls_iso8859_1 nls_cp437 vfat fat ext4 snd_hda_codec_hdmi 
mbcache jbd2 snd_hda_codec_realtek snd_hda_codec_generic f2fs arc4 fscrypto 
intel_rapl iTCO_wdt ath9k iTCO_vendor_support intel_powerclamp ath9k_common 
ath9k_hw coretemp kvm_intel ath mac80211 kvm irqbypass intel_cstate cfg80211 
pcspkr snd_hda_intel snd_hda_codec r8169
Sep 18 22:18:34 defiant kernel:  joydev evdev mii snd_hda_core mousedev 
mei_txe input_leds i2c_i801 mac_hid i915 lpc_ich mei shpchp snd_hwdep 
snd_intel_sst_acpi snd_intel_sst_core snd_soc_rt5670 
snd_soc_sst_atom_hifi2_platform battery snd_soc_sst_match snd_soc_rl6231 
drm_kms_helper hci_uart ov5693(C) ov2722(C) lm3554(C) btbcm btqca v4l2_common 
snd_soc_core btintel snd_compress videodev snd_pcm_dmaengine snd_pcm video 
bluetooth snd_timer drm media tpm_tis snd i2c_hid soundcore tpm_tis_core 
rfkill_gpio ac97_bus soc_button_array ecdh_generic rfkill crc16 tpm 8250_dw 
intel_gtt syscopyarea sysfillrect acpi_pad sysimgblt intel_int0002_vgpio 
fb_sys_fops pinctrl_cherryview i2c_algo_bit button sch_fq_codel tcp_bbr ifb 
ip_tables x_tables btrfs xor raid6_pq algif_skcipher af_alg hid_logitech_hidpp 
hid_logitech_dj usbhid hid uas
Sep 18 22:18:34 defiant kernel:  usb_storage dm_crypt dm_mod dax raid10 md_mod 
sd_mod crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel pcbc 
ahci aesni_intel xhci_pci libahci aes_x86_64 crypto_simd glue_helper xhci_hcd 
cryptd libata usbcore scsi_mod usb_common serio sdhci_acpi sdhci led_class 
mmc_core
Sep 18 22:18:34 defiant kernel: CPU: 0 PID: 702 Comm: irq/123-enp3s0 Tainted: 
G         C      4.13.0-pf4 #1
Sep 18 22:18:34 defiant kernel: Hardware name: To Be Filled By O.E.M. To Be 
Filled By O.E.M./J3710-ITX, BIOS P1.30 03/30/2016
Sep 18 22:18:34 defiant kernel: task: ffff88923a738000 task.stack: 
ffff958001500000
Sep 18 22:18:34 defiant kernel: RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 18 22:18:34 defiant kernel: RSP: 0018:ffff88927fc03a48 EFLAGS: 00010202
Sep 18 22:18:34 defiant kernel: RAX: 0000000000000001 RBX: ffff889241130800 
RCX: ffff88927fc03b0c
Sep 18 22:18:34 defiant kernel: RDX: 000000007fffffff RSI: 0000000000000001 
RDI: ffff889241130800
Sep 18 22:18:34 defiant kernel: RBP: ffff88927fc03a50 R08: 0000000000000000 
R09: 000000007b3e89be
Sep 18 22:18:34 defiant kernel: R10: 000000007b3ea2f6 R11: 000000007b3e89be 
R12: 0000000000005320
Sep 18 22:18:34 defiant kernel: R13: ffff88927fc03b10 R14: 0000000000000001 
R15: ffff88927fc03b0c
Sep 18 22:18:34 defiant kernel: FS:  0000000000000000(0000) 
GS:ffff88927fc00000(0000) knlGS:0000000000000000
Sep 18 22:18:34 defiant kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 
0000000080050033
Sep 18 22:18:34 defiant kernel: CR2: 00007fe9c4106898 CR3: 0000000114a09000 
CR4: 00000000001006f0
Sep 18 22:18:34 defiant kernel: Call Trace:
Sep 18 22:18:34 defiant kernel:  <IRQ>
Sep 18 22:18:34 defiant kernel:  tcp_try_undo_loss+0xb3/0xf0
Sep 18 22:18:34 defiant kernel:  tcp_fastretrans_alert+0x746/0x990
Sep 18 22:18:34 defiant kernel:  tcp_ack+0x741/0x1110
Sep 18 22:18:34 defiant kernel:  tcp_rcv_established+0x325/0x770
Sep 18 22:18:34 defiant kernel:  ? sk_filter_trim_cap+0xd4/0x1a0
Sep 18 22:18:34 defiant kernel:  tcp_v4_do_rcv+0x90/0x1e0
Sep 18 22:18:34 defiant kernel:  tcp_v4_rcv+0x950/0xa10
Sep 18 22:18:34 defiant kernel:  ? nf_ct_deliver_cached_events+0xb8/0x110 
[nf_conntrack]
Sep 18 22:18:34 defiant kernel:  ip_local_deliver_finish+0x68/0x210
Sep 18 22:18:34 defiant kernel:  ip_local_deliver+0xfa/0x110
Sep 18 22:18:34 defiant kernel:  ? ip_rcv_finish+0x410/0x410
Sep 18 22:18:34 defiant kernel:  ip_rcv_finish+0x120/0x410
Sep 18 22:18:34 defiant kernel:  ip_rcv+0x28e/0x3b0
Sep 18 22:18:34 defiant kernel:  ? inet_del_offload+0x40/0x40
Sep 18 22:18:34 defiant kernel:  __netif_receive_skb_core+0x39b/0xb00
Sep 18 22:18:34 defiant kernel:  ? skb_release_all+0x24/0x30
Sep 18 22:18:34 defiant kernel:  ? consume_skb+0x38/0xa0
Sep 18 22:18:34 defiant kernel:  __netif_receive_skb+0x18/0x60
Sep 18 22:18:34 defiant kernel:  netif_receive_skb_internal+0x98/0x480
Sep 18 22:18:34 defiant kernel:  netif_receive_skb+0x1c/0x80
Sep 18 22:18:34 defiant kernel:  ifb_ri_tasklet+0x109/0x26a [ifb]
Sep 18 22:18:34 defiant kernel:  tasklet_action+0x63/0x120
Sep 18 22:18:34 defiant kernel:  __do_softirq+0xdf/0x2e5
Sep 18 22:18:34 defiant kernel:  ? irq_finalize_oneshot.part.39+0xe0/0xe0
Sep 18 22:18:34 defiant kernel:  do_softirq_own_stack+0x1c/0x30
Sep 18 22:18:34 defiant kernel:  </IRQ>
Sep 18 22:18:34 defiant kernel:  do_softirq.part.17+0x4e/0x60
Sep 18 22:18:34 defiant kernel:  __local_bh_enable_ip+0x77/0x80
Sep 18 22:18:34 defiant kernel:  irq_forced_thread_fn+0x5c/0x70
Sep 18 22:18:34 defiant kernel:  irq_thread+0x131/0x1a0
Sep 18 22:18:34 defiant kernel:  ? wake_threads_waitq+0x30/0x30
Sep 18 22:18:34 defiant kernel:  kthread+0x126/0x140
Sep 18 22:18:34 defiant kernel:  ? irq_thread_check_affinity+0x90/0x90
Sep 18 22:18:34 defiant kernel:  ? kthread_create_on_node+0x70/0x70
Sep 18 22:18:34 defiant kernel:  ret_from_fork+0x25/0x30
Sep 18 22:18:34 defiant kernel: Code: 5d c3 80 60 35 fb 48 8b 00 48 39 c2 74 
85 48 3b 83 50 01 00 00 75 eb e9 77 ff ff ff 89 83 48 06 00 00 80 a3 1e 06 00 
00 fb eb b3 <0f> ff 5b 5d c3 0f 1f 40 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 
Sep 18 22:18:34 defiant kernel: ---[ end trace 1aea180efeedb473 ]---
===

Should I continue with net.ipv4.tcp_recovery = 1, or this is enough?

On pondělí 18. září 2017 20:01:42 CEST Yuchung Cheng wrote:
On Mon, Sep 18, 2017 at 10:59 AM, Oleksandr Natalenko

[off-list ref] wrote:
quoted
OK. Should I keep FACK disabled?
Yes since it is disabled in the upstream by default. Although you can
experiment FACK enabled additionally.

Do we know the crash you first experienced is tied to this issue?
quoted
On pondělí 18. září 2017 19:51:21 CEST Yuchung Cheng wrote:
quoted
Can you try this patch to verify my theory with tcp_recovery=0 and 1?
thanks
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 5af2f04f8859..9253d9ee7d0e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2381,6 +2381,7 @@ static void tcp_undo_cwnd_reduction(struct sock
*sk, bool unmark_loss)

        }
        tp->snd_cwnd_stamp = tcp_time_stamp;
        tp->undo_marker = 0;

+       WARN_ON(tp->retrans_out);

 }

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Oleksandr Natalenko <hidden>
Date: 2017-09-18 20:46:40

Actually, same warning was just triggered with RACK enabled. But main warning 
was not triggered in this case.

===
Sep 18 22:44:32 defiant kernel: ------------[ cut here ]------------
Sep 18 22:44:32 defiant kernel: WARNING: CPU: 1 PID: 702 at net/ipv4/
tcp_input.c:2392 tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 18 22:44:32 defiant kernel: Modules linked in: netconsole ctr ccm cls_bpf 
sch_htb act_mirred cls_u32 sch_ingress sit tunnel4 ip_tunnel 8021q mrp 
nf_conntrack_ipv6 nf_defrag_ipv6 nft_ct nft_set_bitmap nft_set_hash 
nft_set_rbtree nf_tables_inet nf_tables_ipv6 nft_masq_ipv4 
nf_nat_masquerade_ipv4 nft_masq nft_nat nft_counter nft_meta 
nft_chain_nat_ipv4 nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat 
nf_conntrack libcrc32c crc32c_generic nf_tables_ipv4 nf_tables tun nct6775 
nfnetlink hwmon_vid nls_iso8859_1 nls_cp437 vfat fat ext4 snd_hda_codec_hdmi 
mbcache jbd2 snd_hda_codec_realtek snd_hda_codec_generic f2fs arc4 fscrypto 
intel_rapl iTCO_wdt ath9k iTCO_vendor_support intel_powerclamp ath9k_common 
ath9k_hw coretemp kvm_intel ath mac80211 kvm irqbypass intel_cstate cfg80211 
pcspkr snd_hda_intel snd_hda_codec r8169
Sep 18 22:44:32 defiant kernel:  joydev evdev mii snd_hda_core mousedev 
mei_txe input_leds i2c_i801 mac_hid i915 lpc_ich mei shpchp snd_hwdep 
snd_intel_sst_acpi snd_intel_sst_core snd_soc_rt5670 
snd_soc_sst_atom_hifi2_platform battery snd_soc_sst_match snd_soc_rl6231 
drm_kms_helper hci_uart ov5693(C) ov2722(C) lm3554(C) btbcm btqca v4l2_common 
snd_soc_core btintel snd_compress videodev snd_pcm_dmaengine snd_pcm video 
bluetooth snd_timer drm media tpm_tis snd i2c_hid soundcore tpm_tis_core 
rfkill_gpio ac97_bus soc_button_array ecdh_generic rfkill crc16 tpm 8250_dw 
intel_gtt syscopyarea sysfillrect acpi_pad sysimgblt intel_int0002_vgpio 
fb_sys_fops pinctrl_cherryview i2c_algo_bit button sch_fq_codel tcp_bbr ifb 
ip_tables x_tables btrfs xor raid6_pq algif_skcipher af_alg hid_logitech_hidpp 
hid_logitech_dj usbhid hid uas
Sep 18 22:44:32 defiant kernel:  usb_storage dm_crypt dm_mod dax raid10 md_mod 
sd_mod crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel pcbc 
ahci aesni_intel xhci_pci libahci aes_x86_64 crypto_simd glue_helper xhci_hcd 
cryptd libata usbcore scsi_mod usb_common serio sdhci_acpi sdhci led_class 
mmc_core
Sep 18 22:44:32 defiant kernel: CPU: 1 PID: 702 Comm: irq/123-enp3s0 Tainted: 
G        WC      4.13.0-pf4 #1
Sep 18 22:44:32 defiant kernel: Hardware name: To Be Filled By O.E.M. To Be 
Filled By O.E.M./J3710-ITX, BIOS P1.30 03/30/2016
Sep 18 22:44:32 defiant kernel: task: ffff88923a738000 task.stack: 
ffff958001500000
Sep 18 22:44:32 defiant kernel: RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 18 22:44:32 defiant kernel: RSP: 0018:ffff88927fc83a48 EFLAGS: 00010202
Sep 18 22:44:32 defiant kernel: RAX: 0000000000000001 RBX: ffff8892412d9800 
RCX: ffff88927fc83b0c
Sep 18 22:44:32 defiant kernel: RDX: 000000007fffffff RSI: 0000000000000001 
RDI: ffff8892412d9800
Sep 18 22:44:32 defiant kernel: RBP: ffff88927fc83a50 R08: 0000000000000000 
R09: 0000000018dfb063
Sep 18 22:44:32 defiant kernel: R10: 0000000018dfd223 R11: 0000000018dfb063 
R12: 0000000000005320
Sep 18 22:44:32 defiant kernel: R13: ffff88927fc83b10 R14: 0000000000000001 
R15: ffff88927fc83b0c
Sep 18 22:44:32 defiant kernel: FS:  0000000000000000(0000) 
GS:ffff88927fc80000(0000) knlGS:0000000000000000
Sep 18 22:44:32 defiant kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 
0000000080050033
Sep 18 22:44:32 defiant kernel: CR2: 00007f1cd1a43620 CR3: 0000000114a09000 
CR4: 00000000001006e0
Sep 18 22:44:32 defiant kernel: Call Trace:
Sep 18 22:44:32 defiant kernel:  <IRQ>
Sep 18 22:44:32 defiant kernel:  tcp_try_undo_loss+0xb3/0xf0
Sep 18 22:44:32 defiant kernel:  tcp_fastretrans_alert+0x746/0x990
Sep 18 22:44:32 defiant kernel:  tcp_ack+0x741/0x1110
Sep 18 22:44:32 defiant kernel:  tcp_rcv_established+0x325/0x770
Sep 18 22:44:32 defiant kernel:  ? sk_filter_trim_cap+0xd4/0x1a0
Sep 18 22:44:32 defiant kernel:  tcp_v4_do_rcv+0x90/0x1e0
Sep 18 22:44:32 defiant kernel:  tcp_v4_rcv+0x950/0xa10
Sep 18 22:44:32 defiant kernel:  ? nf_ct_deliver_cached_events+0xb8/0x110 
[nf_conntrack]
Sep 18 22:44:32 defiant kernel:  ip_local_deliver_finish+0x68/0x210
Sep 18 22:44:32 defiant kernel:  ip_local_deliver+0xfa/0x110
Sep 18 22:44:32 defiant kernel:  ? ip_rcv_finish+0x410/0x410
Sep 18 22:44:32 defiant kernel:  ip_rcv_finish+0x120/0x410
Sep 18 22:44:32 defiant kernel:  ip_rcv+0x28e/0x3b0
Sep 18 22:44:32 defiant kernel:  ? inet_del_offload+0x40/0x40
Sep 18 22:44:32 defiant kernel:  __netif_receive_skb_core+0x39b/0xb00
Sep 18 22:44:32 defiant kernel:  ? netif_receive_skb_internal+0xa0/0x480
Sep 18 22:44:32 defiant kernel:  ? dev_gro_receive+0x2eb/0x4a0
Sep 18 22:44:32 defiant kernel:  __netif_receive_skb+0x18/0x60
Sep 18 22:44:32 defiant kernel:  netif_receive_skb_internal+0x98/0x480
Sep 18 22:44:32 defiant kernel:  netif_receive_skb+0x1c/0x80
Sep 18 22:44:32 defiant kernel:  ifb_ri_tasklet+0x109/0x26a [ifb]
Sep 18 22:44:32 defiant kernel:  tasklet_action+0x63/0x120
Sep 18 22:44:32 defiant kernel:  __do_softirq+0xdf/0x2e5
Sep 18 22:44:32 defiant kernel:  ? irq_finalize_oneshot.part.39+0xe0/0xe0
Sep 18 22:44:32 defiant kernel:  do_softirq_own_stack+0x1c/0x30
Sep 18 22:44:32 defiant kernel:  </IRQ>
Sep 18 22:44:32 defiant kernel:  do_softirq.part.17+0x4e/0x60
Sep 18 22:44:32 defiant kernel:  __local_bh_enable_ip+0x77/0x80
Sep 18 22:44:32 defiant kernel:  irq_forced_thread_fn+0x5c/0x70
Sep 18 22:44:32 defiant kernel:  irq_thread+0x131/0x1a0
Sep 18 22:44:32 defiant kernel:  ? wake_threads_waitq+0x30/0x30
Sep 18 22:44:32 defiant kernel:  kthread+0x126/0x140
Sep 18 22:44:32 defiant kernel:  ? irq_thread_check_affinity+0x90/0x90
Sep 18 22:44:32 defiant kernel:  ? kthread_create_on_node+0x70/0x70
Sep 18 22:44:32 defiant kernel:  ret_from_fork+0x25/0x30
Sep 18 22:44:32 defiant kernel: Code: 5d c3 80 60 35 fb 48 8b 00 48 39 c2 74 
85 48 3b 83 50 01 00 00 75 eb e9 77 ff ff ff 89 83 48 06 00 00 80 a3 1e 06 00 
00 fb eb b3 <0f> ff 5b 5d c3 0f 1f 40 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 
Sep 18 22:44:32 defiant kernel: ---[ end trace 1aea180efeedb474 ]---
===

On pondělí 18. září 2017 20:01:42 CEST Yuchung Cheng wrote:
On Mon, Sep 18, 2017 at 10:59 AM, Oleksandr Natalenko

[off-list ref] wrote:
quoted
OK. Should I keep FACK disabled?
Yes since it is disabled in the upstream by default. Although you can
experiment FACK enabled additionally.

Do we know the crash you first experienced is tied to this issue?
quoted
On pondělí 18. září 2017 19:51:21 CEST Yuchung Cheng wrote:
quoted
Can you try this patch to verify my theory with tcp_recovery=0 and 1?
thanks
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 5af2f04f8859..9253d9ee7d0e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2381,6 +2381,7 @@ static void tcp_undo_cwnd_reduction(struct sock
*sk, bool unmark_loss)

        }
        tp->snd_cwnd_stamp = tcp_time_stamp;
        tp->undo_marker = 0;

+       WARN_ON(tp->retrans_out);

 }

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Yuchung Cheng <hidden>
Date: 2017-09-18 21:40:51

On Mon, Sep 18, 2017 at 1:46 PM, Oleksandr Natalenko
[off-list ref] wrote:
Actually, same warning was just triggered with RACK enabled. But main warning
was not triggered in this case.
Thanks.

I assume this kernel does not have the patch that Neal proposed in his
first reply?

The main warning needs to be triggered by another peculiar SACK that
kicks the sender into recovery again (after undo). Please let it run
longer if possible to see if we can get both. But the new data does
indicate the we can (validly) be in CA_Open with retrans_out > 0.
===
Sep 18 22:44:32 defiant kernel: ------------[ cut here ]------------
Sep 18 22:44:32 defiant kernel: WARNING: CPU: 1 PID: 702 at net/ipv4/
tcp_input.c:2392 tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 18 22:44:32 defiant kernel: Modules linked in: netconsole ctr ccm cls_bpf
sch_htb act_mirred cls_u32 sch_ingress sit tunnel4 ip_tunnel 8021q mrp
nf_conntrack_ipv6 nf_defrag_ipv6 nft_ct nft_set_bitmap nft_set_hash
nft_set_rbtree nf_tables_inet nf_tables_ipv6 nft_masq_ipv4
nf_nat_masquerade_ipv4 nft_masq nft_nat nft_counter nft_meta
nft_chain_nat_ipv4 nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat
nf_conntrack libcrc32c crc32c_generic nf_tables_ipv4 nf_tables tun nct6775
nfnetlink hwmon_vid nls_iso8859_1 nls_cp437 vfat fat ext4 snd_hda_codec_hdmi
mbcache jbd2 snd_hda_codec_realtek snd_hda_codec_generic f2fs arc4 fscrypto
intel_rapl iTCO_wdt ath9k iTCO_vendor_support intel_powerclamp ath9k_common
ath9k_hw coretemp kvm_intel ath mac80211 kvm irqbypass intel_cstate cfg80211
pcspkr snd_hda_intel snd_hda_codec r8169
Sep 18 22:44:32 defiant kernel:  joydev evdev mii snd_hda_core mousedev
mei_txe input_leds i2c_i801 mac_hid i915 lpc_ich mei shpchp snd_hwdep
snd_intel_sst_acpi snd_intel_sst_core snd_soc_rt5670
snd_soc_sst_atom_hifi2_platform battery snd_soc_sst_match snd_soc_rl6231
drm_kms_helper hci_uart ov5693(C) ov2722(C) lm3554(C) btbcm btqca v4l2_common
snd_soc_core btintel snd_compress videodev snd_pcm_dmaengine snd_pcm video
bluetooth snd_timer drm media tpm_tis snd i2c_hid soundcore tpm_tis_core
rfkill_gpio ac97_bus soc_button_array ecdh_generic rfkill crc16 tpm 8250_dw
intel_gtt syscopyarea sysfillrect acpi_pad sysimgblt intel_int0002_vgpio
fb_sys_fops pinctrl_cherryview i2c_algo_bit button sch_fq_codel tcp_bbr ifb
ip_tables x_tables btrfs xor raid6_pq algif_skcipher af_alg hid_logitech_hidpp
hid_logitech_dj usbhid hid uas
Sep 18 22:44:32 defiant kernel:  usb_storage dm_crypt dm_mod dax raid10 md_mod
sd_mod crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel pcbc
ahci aesni_intel xhci_pci libahci aes_x86_64 crypto_simd glue_helper xhci_hcd
cryptd libata usbcore scsi_mod usb_common serio sdhci_acpi sdhci led_class
mmc_core
Sep 18 22:44:32 defiant kernel: CPU: 1 PID: 702 Comm: irq/123-enp3s0 Tainted:
G        WC      4.13.0-pf4 #1
Sep 18 22:44:32 defiant kernel: Hardware name: To Be Filled By O.E.M. To Be
Filled By O.E.M./J3710-ITX, BIOS P1.30 03/30/2016
Sep 18 22:44:32 defiant kernel: task: ffff88923a738000 task.stack:
ffff958001500000
Sep 18 22:44:32 defiant kernel: RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 18 22:44:32 defiant kernel: RSP: 0018:ffff88927fc83a48 EFLAGS: 00010202
Sep 18 22:44:32 defiant kernel: RAX: 0000000000000001 RBX: ffff8892412d9800
RCX: ffff88927fc83b0c
Sep 18 22:44:32 defiant kernel: RDX: 000000007fffffff RSI: 0000000000000001
RDI: ffff8892412d9800
Sep 18 22:44:32 defiant kernel: RBP: ffff88927fc83a50 R08: 0000000000000000
R09: 0000000018dfb063
Sep 18 22:44:32 defiant kernel: R10: 0000000018dfd223 R11: 0000000018dfb063
R12: 0000000000005320
Sep 18 22:44:32 defiant kernel: R13: ffff88927fc83b10 R14: 0000000000000001
R15: ffff88927fc83b0c
Sep 18 22:44:32 defiant kernel: FS:  0000000000000000(0000)
GS:ffff88927fc80000(0000) knlGS:0000000000000000
Sep 18 22:44:32 defiant kernel: CS:  0010 DS: 0000 ES: 0000 CR0:
0000000080050033
Sep 18 22:44:32 defiant kernel: CR2: 00007f1cd1a43620 CR3: 0000000114a09000
CR4: 00000000001006e0
Sep 18 22:44:32 defiant kernel: Call Trace:
Sep 18 22:44:32 defiant kernel:  <IRQ>
Sep 18 22:44:32 defiant kernel:  tcp_try_undo_loss+0xb3/0xf0
Sep 18 22:44:32 defiant kernel:  tcp_fastretrans_alert+0x746/0x990
Sep 18 22:44:32 defiant kernel:  tcp_ack+0x741/0x1110
Sep 18 22:44:32 defiant kernel:  tcp_rcv_established+0x325/0x770
Sep 18 22:44:32 defiant kernel:  ? sk_filter_trim_cap+0xd4/0x1a0
Sep 18 22:44:32 defiant kernel:  tcp_v4_do_rcv+0x90/0x1e0
Sep 18 22:44:32 defiant kernel:  tcp_v4_rcv+0x950/0xa10
Sep 18 22:44:32 defiant kernel:  ? nf_ct_deliver_cached_events+0xb8/0x110
[nf_conntrack]
Sep 18 22:44:32 defiant kernel:  ip_local_deliver_finish+0x68/0x210
Sep 18 22:44:32 defiant kernel:  ip_local_deliver+0xfa/0x110
Sep 18 22:44:32 defiant kernel:  ? ip_rcv_finish+0x410/0x410
Sep 18 22:44:32 defiant kernel:  ip_rcv_finish+0x120/0x410
Sep 18 22:44:32 defiant kernel:  ip_rcv+0x28e/0x3b0
Sep 18 22:44:32 defiant kernel:  ? inet_del_offload+0x40/0x40
Sep 18 22:44:32 defiant kernel:  __netif_receive_skb_core+0x39b/0xb00
Sep 18 22:44:32 defiant kernel:  ? netif_receive_skb_internal+0xa0/0x480
Sep 18 22:44:32 defiant kernel:  ? dev_gro_receive+0x2eb/0x4a0
Sep 18 22:44:32 defiant kernel:  __netif_receive_skb+0x18/0x60
Sep 18 22:44:32 defiant kernel:  netif_receive_skb_internal+0x98/0x480
Sep 18 22:44:32 defiant kernel:  netif_receive_skb+0x1c/0x80
Sep 18 22:44:32 defiant kernel:  ifb_ri_tasklet+0x109/0x26a [ifb]
Sep 18 22:44:32 defiant kernel:  tasklet_action+0x63/0x120
Sep 18 22:44:32 defiant kernel:  __do_softirq+0xdf/0x2e5
Sep 18 22:44:32 defiant kernel:  ? irq_finalize_oneshot.part.39+0xe0/0xe0
Sep 18 22:44:32 defiant kernel:  do_softirq_own_stack+0x1c/0x30
Sep 18 22:44:32 defiant kernel:  </IRQ>
Sep 18 22:44:32 defiant kernel:  do_softirq.part.17+0x4e/0x60
Sep 18 22:44:32 defiant kernel:  __local_bh_enable_ip+0x77/0x80
Sep 18 22:44:32 defiant kernel:  irq_forced_thread_fn+0x5c/0x70
Sep 18 22:44:32 defiant kernel:  irq_thread+0x131/0x1a0
Sep 18 22:44:32 defiant kernel:  ? wake_threads_waitq+0x30/0x30
Sep 18 22:44:32 defiant kernel:  kthread+0x126/0x140
Sep 18 22:44:32 defiant kernel:  ? irq_thread_check_affinity+0x90/0x90
Sep 18 22:44:32 defiant kernel:  ? kthread_create_on_node+0x70/0x70
Sep 18 22:44:32 defiant kernel:  ret_from_fork+0x25/0x30
Sep 18 22:44:32 defiant kernel: Code: 5d c3 80 60 35 fb 48 8b 00 48 39 c2 74
85 48 3b 83 50 01 00 00 75 eb e9 77 ff ff ff 89 83 48 06 00 00 80 a3 1e 06 00
00 fb eb b3 <0f> ff 5b 5d c3 0f 1f 40 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f
Sep 18 22:44:32 defiant kernel: ---[ end trace 1aea180efeedb474 ]---
===

On pondělí 18. září 2017 20:01:42 CEST Yuchung Cheng wrote:
quoted
On Mon, Sep 18, 2017 at 10:59 AM, Oleksandr Natalenko

[off-list ref] wrote:
quoted
OK. Should I keep FACK disabled?
Yes since it is disabled in the upstream by default. Although you can
experiment FACK enabled additionally.

Do we know the crash you first experienced is tied to this issue?
quoted
On pondělí 18. září 2017 19:51:21 CEST Yuchung Cheng wrote:
quoted
Can you try this patch to verify my theory with tcp_recovery=0 and 1?
thanks
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 5af2f04f8859..9253d9ee7d0e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2381,6 +2381,7 @@ static void tcp_undo_cwnd_reduction(struct sock
*sk, bool unmark_loss)

        }
        tp->snd_cwnd_stamp = tcp_time_stamp;
        tp->undo_marker = 0;

+       WARN_ON(tp->retrans_out);

 }

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Oleksandr Natalenko <hidden>
Date: 2017-09-19 11:04:12

Hi.

18.09.2017 23:40, Yuchung Cheng wrote:
I assume this kernel does not have the patch that Neal proposed in his
first reply?
Correct.
The main warning needs to be triggered by another peculiar SACK that
kicks the sender into recovery again (after undo). Please let it run
longer if possible to see if we can get both. But the new data does
indicate the we can (validly) be in CA_Open with retrans_out > 0.
OK, here it is:

===
» LC_TIME=C jctl -kb | grep RIP
…
Sep 19 12:54:03 defiant kernel: RIP: 
0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 19 12:54:22 defiant kernel: RIP: 
0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 19 12:54:25 defiant kernel: RIP: 
0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 19 12:56:00 defiant kernel: RIP: 
0010:tcp_fastretrans_alert+0x7c8/0x990
Sep 19 12:57:07 defiant kernel: RIP: 
0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 19 12:57:14 defiant kernel: RIP: 
0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 19 12:58:04 defiant kernel: RIP: 
0010:tcp_undo_cwnd_reduction+0xbd/0xd0
…
===

Note timestamps — two types of warning are distant in time, so didn't 
happen at once.

While still running this kernel, anything else I can check for you?

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Oleksandr Natalenko <hidden>
Date: 2017-09-19 16:05:59

And 2 more events:

===
$ dmesg --time-format iso | grep RIP
…
2017-09-19T16:52:21,623328+0200 RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
2017-09-19T16:52:40,455296+0200 RIP: 0010:tcp_fastretrans_alert+0x7c8/0x990
2017-09-19T16:52:41,047378+0200 RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
…
2017-09-19T16:54:59,930726+0200 RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
2017-09-19T16:55:07,985767+0200 RIP: 0010:tcp_fastretrans_alert+0x7c8/0x990
2017-09-19T16:55:41,911527+0200 RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
…
===

On pondělí 18. září 2017 23:40:08 CEST Yuchung Cheng wrote:
On Mon, Sep 18, 2017 at 1:46 PM, Oleksandr Natalenko

[off-list ref] wrote:
quoted
Actually, same warning was just triggered with RACK enabled. But main
warning was not triggered in this case.
Thanks.

I assume this kernel does not have the patch that Neal proposed in his
first reply?

The main warning needs to be triggered by another peculiar SACK that
kicks the sender into recovery again (after undo). Please let it run
longer if possible to see if we can get both. But the new data does
indicate the we can (validly) be in CA_Open with retrans_out > 0.
quoted
===
Sep 18 22:44:32 defiant kernel: ------------[ cut here ]------------
Sep 18 22:44:32 defiant kernel: WARNING: CPU: 1 PID: 702 at net/ipv4/
tcp_input.c:2392 tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 18 22:44:32 defiant kernel: Modules linked in: netconsole ctr ccm
cls_bpf sch_htb act_mirred cls_u32 sch_ingress sit tunnel4 ip_tunnel
8021q mrp nf_conntrack_ipv6 nf_defrag_ipv6 nft_ct nft_set_bitmap
nft_set_hash nft_set_rbtree nf_tables_inet nf_tables_ipv6 nft_masq_ipv4
nf_nat_masquerade_ipv4 nft_masq nft_nat nft_counter nft_meta
nft_chain_nat_ipv4 nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat
nf_conntrack libcrc32c crc32c_generic nf_tables_ipv4 nf_tables tun nct6775
nfnetlink hwmon_vid nls_iso8859_1 nls_cp437 vfat fat ext4
snd_hda_codec_hdmi mbcache jbd2 snd_hda_codec_realtek
snd_hda_codec_generic f2fs arc4 fscrypto intel_rapl iTCO_wdt ath9k
iTCO_vendor_support intel_powerclamp ath9k_common ath9k_hw coretemp
kvm_intel ath mac80211 kvm irqbypass intel_cstate cfg80211 pcspkr
snd_hda_intel snd_hda_codec r8169
Sep 18 22:44:32 defiant kernel:  joydev evdev mii snd_hda_core mousedev
mei_txe input_leds i2c_i801 mac_hid i915 lpc_ich mei shpchp snd_hwdep
snd_intel_sst_acpi snd_intel_sst_core snd_soc_rt5670
snd_soc_sst_atom_hifi2_platform battery snd_soc_sst_match snd_soc_rl6231
drm_kms_helper hci_uart ov5693(C) ov2722(C) lm3554(C) btbcm btqca
v4l2_common snd_soc_core btintel snd_compress videodev snd_pcm_dmaengine
snd_pcm video bluetooth snd_timer drm media tpm_tis snd i2c_hid soundcore
tpm_tis_core rfkill_gpio ac97_bus soc_button_array ecdh_generic rfkill
crc16 tpm 8250_dw intel_gtt syscopyarea sysfillrect acpi_pad sysimgblt
intel_int0002_vgpio fb_sys_fops pinctrl_cherryview i2c_algo_bit button
sch_fq_codel tcp_bbr ifb ip_tables x_tables btrfs xor raid6_pq
algif_skcipher af_alg hid_logitech_hidpp hid_logitech_dj usbhid hid uas
Sep 18 22:44:32 defiant kernel:  usb_storage dm_crypt dm_mod dax raid10
md_mod sd_mod crct10dif_pclmul crc32_pclmul crc32c_intel
ghash_clmulni_intel pcbc ahci aesni_intel xhci_pci libahci aes_x86_64
crypto_simd glue_helper xhci_hcd cryptd libata usbcore scsi_mod
usb_common serio sdhci_acpi sdhci led_class mmc_core
Sep 18 22:44:32 defiant kernel: CPU: 1 PID: 702 Comm: irq/123-enp3s0
Tainted: G        WC      4.13.0-pf4 #1
Sep 18 22:44:32 defiant kernel: Hardware name: To Be Filled By O.E.M. To
Be
Filled By O.E.M./J3710-ITX, BIOS P1.30 03/30/2016
Sep 18 22:44:32 defiant kernel: task: ffff88923a738000 task.stack:
ffff958001500000
Sep 18 22:44:32 defiant kernel: RIP:
0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 18 22:44:32 defiant kernel: RSP: 0018:ffff88927fc83a48 EFLAGS:
00010202
Sep 18 22:44:32 defiant kernel: RAX: 0000000000000001 RBX:
ffff8892412d9800
RCX: ffff88927fc83b0c
Sep 18 22:44:32 defiant kernel: RDX: 000000007fffffff RSI:
0000000000000001
RDI: ffff8892412d9800
Sep 18 22:44:32 defiant kernel: RBP: ffff88927fc83a50 R08:
0000000000000000
R09: 0000000018dfb063
Sep 18 22:44:32 defiant kernel: R10: 0000000018dfd223 R11:
0000000018dfb063
R12: 0000000000005320
Sep 18 22:44:32 defiant kernel: R13: ffff88927fc83b10 R14:
0000000000000001
R15: ffff88927fc83b0c
Sep 18 22:44:32 defiant kernel: FS:  0000000000000000(0000)
GS:ffff88927fc80000(0000) knlGS:0000000000000000
Sep 18 22:44:32 defiant kernel: CS:  0010 DS: 0000 ES: 0000 CR0:
0000000080050033
Sep 18 22:44:32 defiant kernel: CR2: 00007f1cd1a43620 CR3:
0000000114a09000
CR4: 00000000001006e0
Sep 18 22:44:32 defiant kernel: Call Trace:
Sep 18 22:44:32 defiant kernel:  <IRQ>
Sep 18 22:44:32 defiant kernel:  tcp_try_undo_loss+0xb3/0xf0
Sep 18 22:44:32 defiant kernel:  tcp_fastretrans_alert+0x746/0x990
Sep 18 22:44:32 defiant kernel:  tcp_ack+0x741/0x1110
Sep 18 22:44:32 defiant kernel:  tcp_rcv_established+0x325/0x770
Sep 18 22:44:32 defiant kernel:  ? sk_filter_trim_cap+0xd4/0x1a0
Sep 18 22:44:32 defiant kernel:  tcp_v4_do_rcv+0x90/0x1e0
Sep 18 22:44:32 defiant kernel:  tcp_v4_rcv+0x950/0xa10
Sep 18 22:44:32 defiant kernel:  ? nf_ct_deliver_cached_events+0xb8/0x110
[nf_conntrack]
Sep 18 22:44:32 defiant kernel:  ip_local_deliver_finish+0x68/0x210
Sep 18 22:44:32 defiant kernel:  ip_local_deliver+0xfa/0x110
Sep 18 22:44:32 defiant kernel:  ? ip_rcv_finish+0x410/0x410
Sep 18 22:44:32 defiant kernel:  ip_rcv_finish+0x120/0x410
Sep 18 22:44:32 defiant kernel:  ip_rcv+0x28e/0x3b0
Sep 18 22:44:32 defiant kernel:  ? inet_del_offload+0x40/0x40
Sep 18 22:44:32 defiant kernel:  __netif_receive_skb_core+0x39b/0xb00
Sep 18 22:44:32 defiant kernel:  ? netif_receive_skb_internal+0xa0/0x480
Sep 18 22:44:32 defiant kernel:  ? dev_gro_receive+0x2eb/0x4a0
Sep 18 22:44:32 defiant kernel:  __netif_receive_skb+0x18/0x60
Sep 18 22:44:32 defiant kernel:  netif_receive_skb_internal+0x98/0x480
Sep 18 22:44:32 defiant kernel:  netif_receive_skb+0x1c/0x80
Sep 18 22:44:32 defiant kernel:  ifb_ri_tasklet+0x109/0x26a [ifb]
Sep 18 22:44:32 defiant kernel:  tasklet_action+0x63/0x120
Sep 18 22:44:32 defiant kernel:  __do_softirq+0xdf/0x2e5
Sep 18 22:44:32 defiant kernel:  ? irq_finalize_oneshot.part.39+0xe0/0xe0
Sep 18 22:44:32 defiant kernel:  do_softirq_own_stack+0x1c/0x30
Sep 18 22:44:32 defiant kernel:  </IRQ>
Sep 18 22:44:32 defiant kernel:  do_softirq.part.17+0x4e/0x60
Sep 18 22:44:32 defiant kernel:  __local_bh_enable_ip+0x77/0x80
Sep 18 22:44:32 defiant kernel:  irq_forced_thread_fn+0x5c/0x70
Sep 18 22:44:32 defiant kernel:  irq_thread+0x131/0x1a0
Sep 18 22:44:32 defiant kernel:  ? wake_threads_waitq+0x30/0x30
Sep 18 22:44:32 defiant kernel:  kthread+0x126/0x140
Sep 18 22:44:32 defiant kernel:  ? irq_thread_check_affinity+0x90/0x90
Sep 18 22:44:32 defiant kernel:  ? kthread_create_on_node+0x70/0x70
Sep 18 22:44:32 defiant kernel:  ret_from_fork+0x25/0x30
Sep 18 22:44:32 defiant kernel: Code: 5d c3 80 60 35 fb 48 8b 00 48 39 c2
74 85 48 3b 83 50 01 00 00 75 eb e9 77 ff ff ff 89 83 48 06 00 00 80 a3
1e 06 00 00 fb eb b3 <0f> ff 5b 5d c3 0f 1f 40 00 66 2e 0f 1f 84 00 00 00
00 00 0f 1f Sep 18 22:44:32 defiant kernel: ---[ end trace
1aea180efeedb474 ]--- ===

On pondělí 18. září 2017 20:01:42 CEST Yuchung Cheng wrote:
quoted
On Mon, Sep 18, 2017 at 10:59 AM, Oleksandr Natalenko

[off-list ref] wrote:
quoted
OK. Should I keep FACK disabled?
Yes since it is disabled in the upstream by default. Although you can
experiment FACK enabled additionally.

Do we know the crash you first experienced is tied to this issue?
quoted
On pondělí 18. září 2017 19:51:21 CEST Yuchung Cheng wrote:
quoted
Can you try this patch to verify my theory with tcp_recovery=0 and 1?
thanks
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 5af2f04f8859..9253d9ee7d0e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2381,6 +2381,7 @@ static void tcp_undo_cwnd_reduction(struct sock
*sk, bool unmark_loss)

        }
        tp->snd_cwnd_stamp = tcp_time_stamp;
        tp->undo_marker = 0;

+       WARN_ON(tp->retrans_out);

 }

Re: [REGRESSION] Warning in tcp_fastretrans_alert() of net/ipv4/tcp_input.c

From: Yuchung Cheng <hidden>
Date: 2017-09-19 18:16:45

On Tue, Sep 19, 2017 at 4:04 AM, Oleksandr Natalenko
[off-list ref] wrote:
Hi.

18.09.2017 23:40, Yuchung Cheng wrote:
quoted
I assume this kernel does not have the patch that Neal proposed in his
first reply?

Correct.
quoted
The main warning needs to be triggered by another peculiar SACK that
kicks the sender into recovery again (after undo). Please let it run
longer if possible to see if we can get both. But the new data does
indicate the we can (validly) be in CA_Open with retrans_out > 0.

OK, here it is:

===
» LC_TIME=C jctl -kb | grep RIP
…
Sep 19 12:54:03 defiant kernel: RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 19 12:54:22 defiant kernel: RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 19 12:54:25 defiant kernel: RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 19 12:56:00 defiant kernel: RIP: 0010:tcp_fastretrans_alert+0x7c8/0x990
Sep 19 12:57:07 defiant kernel: RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 19 12:57:14 defiant kernel: RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
Sep 19 12:58:04 defiant kernel: RIP: 0010:tcp_undo_cwnd_reduction+0xbd/0xd0
…
===

Note timestamps — two types of warning are distant in time, so didn't happen
at once.

While still running this kernel, anything else I can check for you?
Thanks. Based on all the experiments you did I believe there's other
code path than my hypothesis that'd cause the warning:
1) Neal's proposed F-RTO fix didn't work
2) the main warning is not being triggered together with the newly-instrumented
warning in undo
3) Disabling RACK stopped the warning

We couldn't figure out exactly what. So we'll do a bit code auditing
first to find more suspects
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help