netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] fix OOM and order check in msg_zerocopy selftest
@ 2024-07-01 22:53 zijianzhang
  2024-07-01 22:53 ` [PATCH net 1/2] selftests: fix OOM " zijianzhang
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: zijianzhang @ 2024-07-01 22:53 UTC (permalink / raw)
  To: netdev; +Cc: willemdebruijn.kernel, cong.wang, xiaochun.lu, Zijian Zhang

From: Zijian Zhang <zijianzhang@bytedance.com>

In selftests/net/msg_zerocopy.c, it has a while loop keeps calling sendmsg
on a socket with MSG_ZEROCOPY flag, and it will recv the notifications
until the socket is not writable. Typically, it will start the receiving
process after around 30+ sendmsgs. However, as the introduction of commit
dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale"), the sender is
always writable and does not get any chance to run recv notifications.
The selftest always exits with OUT_OF_MEMORY because the memory used by
opt_skb exceeds the net.core.optmem_max. Meanwhile, it could be set to a
different value to trigger OOM on older kernels too.

Thus, we introduce "cfg_notification_limit" to force sender to receive
notifications after some number of sendmsgs.

And, we find that when lock debugging is on, notifications may not come in
order. Thus, we have order checking outputs managed by cfg_verbose, to
avoid too many outputs in this case.

Zijian Zhang (2):
  selftests: fix OOM in msg_zerocopy selftest
  selftests: make order checking verbose in msg_zerocopy selftest

 tools/testing/selftests/net/msg_zerocopy.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-07-04  2:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 22:53 [PATCH net 0/2] fix OOM and order check in msg_zerocopy selftest zijianzhang
2024-07-01 22:53 ` [PATCH net 1/2] selftests: fix OOM " zijianzhang
2024-07-02 13:17   ` Willem de Bruijn
2024-07-04  1:50   ` Jakub Kicinski
2024-07-04  2:32     ` Zijian Zhang
2024-07-04  2:42       ` Jakub Kicinski
2024-07-01 22:53 ` [PATCH net 2/2] selftests: make order checking verbose " zijianzhang
2024-07-02 13:18   ` Willem de Bruijn
2024-07-02 18:05     ` Zijian Zhang
2024-07-04  2:50 ` [PATCH net 0/2] fix OOM and order check " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).