WSL2-Linux-Kernel/include
Eric Dumazet 7aef5082c5 once: add DO_ONCE_SLOW() for sleepable contexts
[ Upstream commit 62c07983be ]

Christophe Leroy reported a ~80ms latency spike
happening at first TCP connect() time.

This is because __inet_hash_connect() uses get_random_once()
to populate a perturbation table which became quite big
after commit 4c2c8f03a5 ("tcp: increase source port perturb table to 2^16")

get_random_once() uses DO_ONCE(), which block hard irqs for the duration
of the operation.

This patch adds DO_ONCE_SLOW() which uses a mutex instead of a spinlock
for operations where we prefer to stay in process context.

Then __inet_hash_connect() can use get_random_slow_once()
to populate its perturbation table.

Fixes: 4c2c8f03a5 ("tcp: increase source port perturb table to 2^16")
Fixes: 190cc82489 ("tcp: change source port randomizarion at connect() time")
Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/netdev/CANn89iLAEYBaoYajy0Y9UmGFff5GPxDUoG-ErVB2jDdRNQ5Tug@mail.gmail.com/T/#t
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willy Tarreau <w@1wt.eu>
Tested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 12:34:49 +02:00
..
acpi ACPI: CPPC: Do not prevent CPPC from working in the future 2022-08-17 14:24:25 +02:00
asm-generic vmlinux.lds.h: CFI: Reduce alignment of jump-table to function alignment 2022-09-28 11:11:45 +02:00
clocksource
crypto crypto: blake2s - remove shash module 2022-08-17 14:24:19 +02:00
drm drm/bridge: Add stubs for devm_drm_of_get_bridge when OF is disabled 2022-09-05 10:30:03 +02:00
dt-bindings clk: qcom: gcc-msm8939: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC 2022-08-17 14:23:45 +02:00
keys
kunit
kvm
linux once: add DO_ONCE_SLOW() for sleepable contexts 2022-10-26 12:34:49 +02:00
math-emu
media
memory
misc
net tcp: fix tcp_cwnd_validate() to not forget is_cwnd_limited 2022-10-26 12:34:48 +02:00
pcmcia
ras Revert "mm/memory-failure.c: fix race with changing page compound again" 2022-07-12 16:35:17 +02:00
rdma
scsi scsi: stex: Properly zero out the passthrough command structure 2022-10-15 07:59:01 +02:00
soc ARM: at91: ddr: remove CONFIG_SOC_SAMA7 dependency 2022-09-15 11:30:08 +02:00
sound ALSA: control: Use deferred fasync helper 2022-08-25 11:40:44 +02:00
target
trace tracing/perf: Avoid -Warray-bounds warning for __rel_loc macro 2022-08-17 14:24:30 +02:00
uapi btrfs: remove no longer needed logic for replaying directory deletes 2022-09-05 10:30:09 +02:00
vdso
video video: of_display_timing.h: include errno.h 2022-07-12 16:35:10 +02:00
xen