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

Submitted by Kirill Tkhai on April 2, 2019, 9:16 a.m.

Details

Message ID 155419660325.4212.11993498993951807105.stgit@localhost.localdomain
State New
Series "fuse: Backport of ms locking patches part 1"
Headers show

Commit Message

Kirill Tkhai April 2, 2019, 9:16 a.m.
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@virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/dev.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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);