ksmbd: use wait_event instead of schedule_timeout()
authorNamjae Jeon <linkinjeon@kernel.org>
Thu, 28 Jul 2022 14:35:18 +0000 (23:35 +0900)
committerSteve French <stfrench@microsoft.com>
Mon, 1 Aug 2022 04:14:32 +0000 (23:14 -0500)
commita14c573870a664386adc10526a6c2648ea56dae1
treeb7d174950764bbaa0a81d0c927ef27d73b6db7cd
parent17ea92a9f6d0b9a97aaec5ab748e4591d70a562c
ksmbd: use wait_event instead of schedule_timeout()

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>
fs/ksmbd/connection.c
fs/ksmbd/connection.h
fs/ksmbd/oplock.c
fs/ksmbd/server.c