]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: use wait_event instead of schedule_timeout()
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 18 Dec 2023 15:33:05 +0000 (00:33 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Dec 2023 09:41:52 +0000 (10:41 +0100)
commitc7aff8b8ffdb70e1bfd2be9f122f410c20ff6af1
tree341c728f4240c44a4cf411d5885ad03db3160f45
parent1f82ecbc7f1e779ee974aca72de550414a74f4ea
ksmbd: use wait_event instead of schedule_timeout()

[ Upstream commit a14c573870a664386adc10526a6c2648ea56dae1 ]

ksmbd threads eating masses of cputime when connection is disconnected.
If connection is disconnected, ksmbd thread waits for pending requests
to be processed using schedule_timeout. schedule_timeout() incorrectly
is used, and it is more efficient to use wait_event/wake_up than to check
r_count every time with timeout.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/connection.c
fs/ksmbd/connection.h
fs/ksmbd/oplock.c
fs/ksmbd/server.c