[RHEL7,COMMIT] ms/fuse: Wake up req->waitq of only if not background

Submitted by Konstantin Khorenko on April 3, 2019, 9:49 a.m.


Message ID 201904030949.x339nRFf006960@finist-ce7.sw.ru
State New
Series "fuse: Backport of ms locking patches part 1"
Headers show

Commit Message

Konstantin Khorenko April 3, 2019, 9:49 a.m.
The commit is pushed to "branch-rh7-3.10.0-957.10.1.vz7.94.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.10.1.vz7.85.10
commit eb55312dac35fb34dd49ec2acd4f532b7a8d1f49
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Wed Apr 3 12:49:27 2019 +0300

    ms/fuse: Wake up req->waitq of only if not background
    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: 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);