[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cc80596c-f08d-465e-a503-bdb42fddbbae@samba.org>
Date: Mon, 17 Nov 2025 15:52:24 +0100
From: Stefan Metzmacher <metze@...ba.org>
To: Qingfang Deng <dqfext@...il.com>, Namjae Jeon <linkinjeon@...nel.org>,
Steve French <smfrench@...il.com>,
Sergey Senozhatsky <senozhatsky@...omium.org>, Tom Talpey <tom@...pey.com>,
Ronnie Sahlberg <lsahlber@...hat.com>, Hyunchul Lee <hyc.lee@...il.com>,
linux-cifs@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: netdev@...r.kernel.org, Simon Horman <horms@...nel.org>
Subject: Re: [PATCH v3] ksmbd: server: avoid busy polling in accept loop
Am 17.11.25 um 09:59 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. 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.
>
> Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
> Signed-off-by: Qingfang Deng <dqfext@...il.com>
Reviewed-by: Stefan Metzmacher <metze@...ba.org>
Powered by blists - more mailing lists