[Devel] [PATCH 3/3] fuse: Wake up req->waitq of only if not background

Kirill Tkhai ktkhai at virtuozzo.com
Tue Apr 2 12:16:43 MSK 2019


ms commit 5e0fed717a38

Currently, we wait on req->waitq in request_wait_answer() function only,
and it's never used for background requests.  Since wake_up() is not a
light-weight macros, instead of this, it unfolds in really called function,
which makes locking operations taking some cpu cycles, let's avoid its call
for the case we definitely know it's completely useless.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 fs/fuse/dev.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 18379fa9ca12..269753235c60 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -472,7 +472,8 @@ void request_end(struct fuse_conn *fc, struct fuse_req *req)
 		if (!bg)
 			req->end = NULL;
 	}
-	wake_up(&req->waitq);
+	if (!bg)
+		wake_up(&req->waitq);
 	fuse_put_request(fc, req);
 }
 EXPORT_SYMBOL_GPL(request_end);



More information about the Devel mailing list