summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/enrich_formatter.py
diff options
context:
space:
mode:
authorQingfang Deng <dqfext@gmail.com>2025-11-17 16:59:00 +0800
committerSteve French <stfrench@microsoft.com>2025-11-30 21:11:45 -0600
commit3316a8fc840d82fad5efcf76ad0ea3f76fdca209 (patch)
treefdba40238c9cfd570f3579ea272291dd854f3e68 /tools/lib/python/kdoc/enrich_formatter.py
parent5003ad718af7705d6a519445a897843fac88167a (diff)
ksmbd: server: avoid busy polling in accept loop
The ksmbd listener thread was using busy waiting on a listening socket by calling kernel_accept() with SOCK_NONBLOCK and retrying every 100ms on -EAGAIN. Since this thread is dedicated to accepting new connections, there is no need for non-blocking mode. Switch to a blocking accept() call instead, allowing the thread to sleep until a new connection arrives. This avoids unnecessary wakeups and CPU usage. During teardown, call shutdown() on the listening socket so that accept() returns -EINVAL and the thread exits cleanly. The socket release mutex is redundant because kthread_stop() blocks until the listener thread returns, guaranteeing safe teardown ordering. Also remove sk_rcvtimeo and sk_sndtimeo assignments, which only caused accept() to return -EAGAIN prematurely. Signed-off-by: Qingfang Deng <dqfext@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'tools/lib/python/kdoc/enrich_formatter.py')
0 files changed, 0 insertions, 0 deletions