Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1627220imu; Tue, 6 Nov 2018 01:31:42 -0800 (PST) X-Google-Smtp-Source: AJdET5eqcVJEv9tp6czWcmo5pQo3ApAbrYq39g4HuiTN7VdxNFjWDp9rG7pTwIeGHkC0v5kQKbsc X-Received: by 2002:a17:902:70c9:: with SMTP id l9-v6mr5119410plt.329.1541496702113; Tue, 06 Nov 2018 01:31:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541496702; cv=none; d=google.com; s=arc-20160816; b=q7iIGlvTFCBU58s0ZUtKiWdcTobiMeRDhU1IRiR9Yr+ROXgW7qFWOOSv5+8JQpgp3p 1sNYluA5SCqXQklI92UTRIumc9WkBKX1vW1IjcjHAPXxSMuXCrMBedan4dqhmB7uinKb 8277f/X8NLRsNwxwslgGh+cu2IYRWsqPLL/wMCKqDMBMN7/7f4g7mI2ZZrEyuV0Xb4/B V9syJBqzOQCiZEFuqG45H0N9F656/wAmYcRPLzNcyxjnq5+9fLoZlWvH/x6ln2LRTLJ9 y+SZxlzQ0nnysMPz8iO8f/ahJ01Cw3ia4j6um1viYzT+h72Do9put0Liv0zjEpxuRvZa RKog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject; bh=G9/o0zzi17DaubtR53TNluqlQ4gBTzLEKAp0TJ7uz8k=; b=n3NRk0c60DIrLLl0h663Tj0a8scvytMl6BoFwSR+CoLaMaoj8IwrmhLYC9FX8LY9c5 Hb5Ti3RF+fsG75t1fwEzn4A+SVbGeFEzP9Vwob4K34JaIdPptXmG5PJ+s9bJXNEEoJDo hhYQ/b9I5XiWYaeGt+ZMBCjSFKnu2PV7SRfv6O0WkMHZkeyhuChltWdiy7SDkItoiRqj zvGhWVoGfcJpBsJWobypxpwRAVpKdMFgG6ZZQWr9jW8dyg8crGqCu9jJbJobooNe1Xmu 2QVDYzJjYhQWXyYvBV5fKKw8h271RLi/nZSfzdlszyxm6g2gTmj4l0T9kv+gDxhD5CEI 7QFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i66-v6si47156265pfc.173.2018.11.06.01.31.27; Tue, 06 Nov 2018 01:31:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730324AbeKFSzK (ORCPT + 99 others); Tue, 6 Nov 2018 13:55:10 -0500 Received: from relay.sw.ru ([185.231.240.75]:59158 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729430AbeKFSzJ (ORCPT ); Tue, 6 Nov 2018 13:55:09 -0500 Received: from [172.16.25.169] (helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1gJxh6-0002vt-Jo; Tue, 06 Nov 2018 12:30:44 +0300 Subject: [PATCH 3/6] fuse: Wake up req->waitq of only not background requests in request_end() From: Kirill Tkhai To: miklos@szeredi.hu, ktkhai@virtuozzo.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 06 Nov 2018 12:30:44 +0300 Message-ID: <154149664427.17764.8657194274267023078.stgit@localhost.localdomain> In-Reply-To: <154149586524.17764.5252013294539109287.stgit@localhost.localdomain> References: <154149586524.17764.5252013294539109287.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/fuse/dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 391498e680ec..739968ee8b0c 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -464,8 +464,11 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) fc->active_background--; flush_bg_queue(fc); spin_unlock(&fc->bg_lock); + } else { + /* Wake up waiter sleeping in request_wait_answer() */ + wake_up(&req->waitq); } - wake_up(&req->waitq); + if (req->end) req->end(fc, req); put_request: