From: Stefan Metzmacher <metze@samba.org>
To: Qingfang Deng <dqfext@gmail.com>,
Namjae Jeon <linkinjeon@kernel.org>,
Steve French <smfrench@gmail.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Tom Talpey <tom@talpey.com>,
Ronnie Sahlberg <lsahlber@redhat.com>,
Hyunchul Lee <hyc.lee@gmail.com>,
linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ksmbd: server: avoid busy polling in accept loop
Date: Tue, 11 Nov 2025 07:55:53 +0100 [thread overview]
Message-ID: <2516ed5d-fed2-47a3-b1eb-656d79d242f3@samba.org> (raw)
In-Reply-To: <20251030064736.24061-1-dqfext@gmail.com>
Am 30.10.25 um 07:47 schrieb Qingfang Deng:
> 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.
>
> Also remove:
> - TCP_NODELAY, which has no effect on a listening socket.
> - sk_rcvtimeo and sk_sndtimeo assignments, which only caused accept()
> to return -EAGAIN prematurely.
Aren't these inherited to the accepted sockets?
So we need to apply them to the accepted sockets now
instead of dropping them completely?
metze
next prev parent reply other threads:[~2025-11-11 6:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 6:47 [PATCH] ksmbd: server: avoid busy polling in accept loop Qingfang Deng
2025-10-30 8:11 ` Namjae Jeon
2025-10-31 7:32 ` Qingfang Deng
2025-10-31 7:44 ` Greg Kroah-Hartman
2025-10-31 7:49 ` Qingfang Deng
2025-10-31 23:50 ` Namjae Jeon
2025-11-11 6:55 ` Stefan Metzmacher [this message]
2025-11-11 7:16 ` Stefan Metzmacher
2025-11-11 8:03 ` Qingfang Deng
2025-11-11 8:47 ` Namjae Jeon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2516ed5d-fed2-47a3-b1eb-656d79d242f3@samba.org \
--to=metze@samba.org \
--cc=dqfext@gmail.com \
--cc=hyc.lee@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lsahlber@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=senozhatsky@chromium.org \
--cc=smfrench@gmail.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).