Message ID | 153538375088.18303.12624556981175203201.stgit@localhost.localdomain (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-fsdevel-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B86B920 for <patchwork-linux-fsdevel@patchwork.kernel.org>; Mon, 27 Aug 2018 15:29:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 791F72968D for <patchwork-linux-fsdevel@patchwork.kernel.org>; Mon, 27 Aug 2018 15:29:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D3F129694; Mon, 27 Aug 2018 15:29:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B7A82968D for <patchwork-linux-fsdevel@patchwork.kernel.org>; Mon, 27 Aug 2018 15:29:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727233AbeH0TQX (ORCPT <rfc822;patchwork-linux-fsdevel@patchwork.kernel.org>); Mon, 27 Aug 2018 15:16:23 -0400 Received: from mail-ve1eur01on0128.outbound.protection.outlook.com ([104.47.1.128]:59616 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727226AbeH0TQX (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); Mon, 27 Aug 2018 15:16:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OXy8/7X0TSXhboCFL2wrXXdxJybxn47IBgvvLdh1hg4=; b=Sn6JmWLWGsWQ/RV7banFniPadqt3xqmFzpUFbda+pe9rqwAyND3rqlDSyYk03Er22Bi2aO5i8eNFcZMbpQmgGcAdG2GCfSVUCjnI/Xztkn0IJ6rfivgGjG2fa0Vz6P3Owk3ZIMoiW1l2ecaNSu+EEBpO/vH8BozR/+xlqmEGtZE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by AM5PR0801MB2019.eurprd08.prod.outlook.com (2603:10a6:203:4b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Mon, 27 Aug 2018 15:29:13 +0000 Subject: [PATCH 1/6] fuse: Use list_first_entry() in flush_bg_queue() From: Kirill Tkhai <ktkhai@virtuozzo.com> To: miklos@szeredi.hu, ktkhai@virtuozzo.com, linux-fsdevel@vger.kernel.org Date: Mon, 27 Aug 2018 18:29:10 +0300 Message-ID: <153538375088.18303.12624556981175203201.stgit@localhost.localdomain> In-Reply-To: <153538208536.18303.10732945923322972743.stgit@localhost.localdomain> References: <153538208536.18303.10732945923322972743.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: HE1PR0701CA0046.eurprd07.prod.outlook.com (2603:10a6:3:9e::14) To AM5PR0801MB2019.eurprd08.prod.outlook.com (2603:10a6:203:4b::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 05c602ea-1947-49cd-cf7e-08d60c31d856 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM5PR0801MB2019; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB2019;3:TPaTy1UYQi1gKWw1FPY6rPy3FGnwMHsjfGYQ2byGbshQ6QlvG5qOlDo/okHC8kdPfq3Qk0zC4drdrH+NptPLcNSqBHwOTHG7yFUfi2CfrZJRP7dIeHkE2vxkr0hXHprqzpWUxGct8XH0fYie4Az3MmddIlVgUljQNI6eV48gCQpg22gpfVJXiampZm8K2KioHxXT9Divf4NFnebdduiSjgki06ZtR2iZFEdbklbOiNIL8t1r2lX/7A86ev0/bFSO;25:NB+3p//xfGinNPCRIkoB+Z1enZ/r4LnpSKb+l2tvxC5A21t+Q7jXlpcaivPi+vK23uMFppPbhxpt4GuJCSKceEm0iPSMG01cT12Oxc4U2pUIQs57E9uLDN6Ki9tdJOrabiJjRlbSPid48sxjk2Z3OtzYkP0KNltVt3e+7fUUcHFCNtzg2s0/zGhoNoNdCYbz8XwLdoVkvFqHAI+OHY46xLRTe/d5eUH+rUsduZVk4jW+wYm7d9xGeDic51YI7H2hk9cxQeGdnToyLkBHXGGLzjay2AOJAxrS0JngL6X5Itg0fOz0rd75zQU7zf75A9/VI0j5elJXFz26O2lo2F4A/A==;31:Svzoe9BmmJOfQyqrveay4KefkStgXt0CJnS1zb3WzQ7YgVmhMOsmmugr5oM9HshcppKTiejU/TP0I7MTn+IFvkubf78uVVDhUxd3e2ObDCXr0b8bFjF5+x7ERgjzqwVfusTuA+HKGRHHS6OX8+3lOYLLUIByukuyrjGTC/aASSov6D6mhLPH1y0PwYLRlokHVNj/24kXtz/uYzxWEFrUVqSGMhPou+W7qyhDE7sQyJY= X-MS-TrafficTypeDiagnostic: AM5PR0801MB2019: X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB2019;20:sG0Qoiv0NGPdjWrOTAZy7tkLWzAgo+K3YgM5syQds58qYGueH5UGnpe2WBDxXcYk6jNh3gWo7ReVztA+HcH7WTzhgHsQoujvTKBUYADfBLrSdvJebV3ojcQPwmJow3PFiNX95vxeQ6DRQPILIsYoE08tRc6mRSWl5XwrItBr7LTaYuq3oUik9AQNI3HVKKCpUsSUi/Y8ZqNIePKBCu+3g4n3D3TamUnovDRCdzVafojfcuf2/Cn5Zxwh6A+ShgWUhPvUVtIXIcZxROMsbJxx+CYdNO3myaRw1xswkmVsDNC5aMEflUEgUuZlxtHGWVOvYGxXC8gn7NKvEAsgauX8ClOlz6Zz1nVniah/DYGSAyxRxHqHKJDgXEdYdEm1wwIhQLfD2Avjbsk32878lcKtZZXW1kqcB1f5OGA2u88fY3EYz63d6Mm81nPxxXl9lag1bPvEyGkZFH4E1ZU/gJc88HU9LGqfuV5QCg3H2PQ3+K5sUcwcA1Y/R3Rru5lw8rXw;4:TtqDn/VzSDUuvfcsCMDcgniWVaZPB2RZPhk02rBXfZxAHp0MxNksGAi9DHkiJrMXGGz0oNcMr9n+AyESI0xbu8wAqhA+SM5jdvcJaJrHxadUrhh7Wpx1Rn8k4tla4qpaArv+nnoKgLm3fM4HqSBcHoQwDHlAFyYygo8quNyYR0lQ1fS8ozxgqHWfE4+eTXQoQSJF7wDfjaYVs4ppKyr7TGenvFeZKTRztt6SPlldofTMzoEPIAQp2zkv4UHWOWvUFJ7sv7oDVzpt9tRlE9RbHQ== X-Microsoft-Antispam-PRVS: <AM5PR0801MB2019F07E1A70F9CD5DC46907CD0B0@AM5PR0801MB2019.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699016);SRVR:AM5PR0801MB2019;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0801MB2019; X-Forefront-PRVS: 07778E4001 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(396003)(366004)(346002)(376002)(136003)(39850400004)(189003)(199004)(7736002)(14444005)(11346002)(446003)(86362001)(50466002)(61506002)(316002)(956004)(486006)(478600001)(476003)(68736007)(305945005)(16526019)(186003)(8936002)(26005)(2906002)(97736004)(103116003)(9686003)(53936002)(55016002)(81166006)(81156014)(386003)(8676002)(6506007)(230700001)(105586002)(25786009)(106356001)(23676004)(2486003)(7696005)(52116002)(76176011)(58126008)(5660300001)(66066001)(33896004)(47776003)(3846002)(6116002);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5PR0801MB2019;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BAM5PR0801MB2019=3B23=3AH56gF?= =?utf-8?q?kBLphqLo0dT74Sxrcdtele3VPBOt7UVghPUFrgCKJ1wuqRYLB6SLNkQEDaNoKBQKx?= =?utf-8?q?Kicf++TM0nEToLtNdY6hatebYMOIKO+keug1pDAlUfDPp4Vr5SDT+bwPk5SX3Gtgt?= =?utf-8?q?dMCdSxKAMnY6ldDW2I+77kB/t/xSdPnJdzzmBM3Q3GFBfhi1hb4e8VebBpmRA/Nk3?= =?utf-8?q?Rq4mWOCSxI/Xdj5SbNdmqoLFVhFHHFjWaiw4hMB6POeWdaXd2YX91pAhCB4PiTtjT?= =?utf-8?q?N1rnZA7fXtGJjBYpBKfZDNBKPRasNsdWitbSkUjC5zuPzf5OJV7SUkhxm2mod4p5y?= =?utf-8?q?Be+LoXv8NNFjWVQQOlHNcLVzH725/n1l6gY5oGM5qldnxIdujnyV4voydV/9IKQME?= =?utf-8?q?uo7jFr/eAfCATSCVgVLW0swHswT2tTx/c08gKR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Hlm6oxMd/FvvKSUgtFAQYEvRPwBUDkY2B8Lsewv0wPB9lgUxA5KIJt54Oyzo3Otw3wVXbdErGJkJIuCdEnn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB2019;20:FmypGJun/GCHfwn63pxEIH7c5799xG7uam0cWPHT4IvQ/DDWZBCu3badJrMqFjwmcoA/cV3svB4TxZq4lmv7eGMz1JFwrpXKelwgKbqqNG5zkRHm+mNyZuIxF0/2NuH/NLp5HPJKnwvYr6FUGwx8hNk1B70pk4vUnXX/wrVhhfg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2018 15:29:13.8169 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05c602ea-1947-49cd-cf7e-08d60c31d856 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB2019 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-fsdevel.vger.kernel.org> X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Extract bg queue logic out fuse_conn::lock
|
expand
|
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 11ea2c4a38ab..214ce96b1d26 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -353,12 +353,13 @@ void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget, static void flush_bg_queue(struct fuse_conn *fc) { + struct fuse_iqueue *fiq = &fc->iq; + while (fc->active_background < fc->max_background && !list_empty(&fc->bg_queue)) { struct fuse_req *req; - struct fuse_iqueue *fiq = &fc->iq; - req = list_entry(fc->bg_queue.next, struct fuse_req, list); + req = list_first_entry(&fc->bg_queue, struct fuse_req, list); list_del(&req->list); fc->active_background++; spin_lock(&fiq->waitq.lock);
This cleanup patch makes the function to use the primitive instead of direct dereferencing. Also, move fiq dereferencing out of cycle, since it's always constant. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> --- fs/fuse/dev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)