From patchwork Mon Aug 27 15:29:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10577363 Return-Path: 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 982D9920 for ; Mon, 27 Aug 2018 15:29:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 841E62968D for ; Mon, 27 Aug 2018 15:29:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7755229694; Mon, 27 Aug 2018 15:29:15 +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 B9B3A2968D for ; Mon, 27 Aug 2018 15:29:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727049AbeH0TQR (ORCPT ); Mon, 27 Aug 2018 15:16:17 -0400 Received: from mail-eopbgr20125.outbound.protection.outlook.com ([40.107.2.125]:13140 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726920AbeH0TQQ (ORCPT ); Mon, 27 Aug 2018 15:16:16 -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=ivv4epkORCaOLmAo+NOe1La0lhJ09fYJ7eEuL9lEWbo=; b=R/CYNiLo3gRVkMKhZ6pWkZcWEg8kD2eoz825bV/QglQX8zwMV4xLiAlGszBkmSuHbxZRcJmZLFcLl4GTPRtieWdO7P2+/AWy1/53hlArZTTj1LtvjYesETxpwbZsr0xuIjvQVkEPzDK61HyhjXh2UUXsmAIydR+zg3qJD3iQwYI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by DB6PR0801MB2021.eurprd08.prod.outlook.com (2603:10a6:4:76::14) 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:05 +0000 Subject: [PATCH 0/6] Extract bg queue logic out fuse_conn::lock From: Kirill Tkhai To: miklos@szeredi.hu, ktkhai@virtuozzo.com, linux-fsdevel@vger.kernel.org Date: Mon, 27 Aug 2018 18:29:01 +0300 Message-ID: <153538208536.18303.10732945923322972743.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: LO2P265CA0148.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::16) To DB6PR0801MB2021.eurprd08.prod.outlook.com (2603:10a6:4:76::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ddb1c68a-8a88-4e87-ffd0-08d60c31d316 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:DB6PR0801MB2021; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0801MB2021;3:7rSPDhRpWDAhPKOW0xAfIxuzGMMuCEB+R5tYrwkgsFQbh0TJHQcbLWotMsMmwrs4oveAfcU+Te3L8bYn72n1ZlD+xRnZAtBp2vNSJmqePGSbor6+ZRj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qMJG8wPTOH8ZdWuhx3xlP7t84xqOogeR7rGyZC7eo9H5Y7MqZDlPMz/mVkz4uaSP2Nf04FLBwLFMez84g0gDpbUM/mPcIkBFenrv9ZHOcZt7BWwvxktmfOwx8jPGZ3SoHaSfwp9xd2HZ4cEUnf5w3deCOW5WtsBxvv3tlDrq7zZDTROoQVsKkIKGvNiypNgDIdeCMDF5c+inqi2ErhEFhol7OybkzLOPkJUj7e58NG;4:nzUHIIRlJ/M0pWW54w9pbNRy7H/egQ4HiyBTSuiGSqpIjysNnmC181fQy4sHawb5Ajqwvj8sBdRBbHPWs23f9yCtDVKf6H+8TB+XxeVCsxYPtnT4ki80PoqzooJIKhu19PT0GVYPcANPdUza0Q9fBR9ishVT+RezAjT0mMD2Kxp9dfRYMKXOCpx5M0CvRUz4wSlbFr6o1Nfrpj4dwnvAgP09hULkVFBYpWSACkXdOx3HAu9iAVft88lHAvW4ZskjUh6SiEV/+dHy9UTddzuUbg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699016);SRVR:DB6PR0801MB2021;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0801MB2021; X-Forefront-PRVS: 07778E4001 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(979002)(6069001)(39850400004)(376002)(396003)(136003)(366004)(346002)(199004)(189003)(66066001)(97736004)(106356001)(305945005)(86362001)(61506002)(50466002)(105586002)(7736002)(25786009)(14444005)(6666003)(486006)(956004)(476003)(5660300001)(81156014)(81166006)(33896004)(58126008)(68736007)(103116003)(8676002)(7696005)(47776003)(8936002)(55016002)(230700001)(26005)(52116002)(6506007)(53936002)(386003)(6116002)(3846002)(16526019)(23676004)(2486003)(186003)(316002)(9686003)(2906002)(478600001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:DB6PR0801MB2021;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BDB6PR0801MB2021=3B23=3A9K4h5?= =?utf-8?q?GzL5iMn6zjx5PSa3kA9wi29cQONNdC6hROXbBBPzdV7i9OXkLNKzedu3SFvNEAtEF?= =?utf-8?q?qVK2Ugx7wP3KQ9OS+GV5iUka2WNp620QlrS7nkiad4VjOqUSuxtZf+Uave6QYS+RU?= =?utf-8?q?dXCHyT30WcruypKvlrHPZN22aFIZy9oxgfnzL8eAUwNMz787nUS1AQ3+2BH7SoQ48?= =?utf-8?q?/IlmFsm7+VuL9NU+ipNPqMHo9kA2GQ7qHYQnCn/6X0t2O641PvecA/uBxhWNUlDdJ?= =?utf-8?q?FKuDzsI6JXX0vs/kYoxjXm2b1QRoWIppvMR6fPGxV0AqFPdkMkHkciCNUREqnRHma?= =?utf-8?q?w/G0D1eC09QFaJYS93ZLOEuj+DH0OftQZKU25FIsvIIbKIimlb5UCtRHU/ovZDviP?= =?utf-8?q?9Ialzh75fiUekp5i/HomWJnXRyyjfvj2TMKbaAk6HD+wSFxRz+Lj/BUUZBojDwg70?= =?utf-8?q?lQ/ur3j/cx7F5tlFAcRoktmxP9ypO4U/9p1NZ1V2AmfdSZ4CznCWWIAs/Paql+QFR?= =?utf-8?q?x1veUcdbW8MBgETfhREhuFQA9NMgq/2WG/D7H7xnpGfRzv9Y6t/JbrOlq4bt2M69P?= =?utf-8?q?geffqkbtF76HQNjL2CwZEU4L8HsuJH50kXICkveKdhWrKrHO43gNlnqjNUPHqMlwq?= =?utf-8?q?XcVjSJJJLJt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R1egqYlBHdmiVcKbnAPJ0y0vjgW+le3L7UvkGKnrt01rqST/kqo8eXWsjVyU2HSLG7a2ac+sDozacVRPnrVSW52J3BFfBAwJgeW0xil733xWP/sUi0JxjCag06PUoLI7Xw/PVTMXt7CjgMFOc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2018 15:29:05.0391 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ddb1c68a-8a88-4e87-ffd0-08d60c31d316 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2021 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, Miklos, the patchset makes background queue and background-related data be protected with new bg_lock. This allows async reads not take fc->lock in fuse_request_send_background(), and this gives performace-visible increase on out async read-write test (1.7-5 % better). See [6/6] for the test results. The new lock protects max_background, congestion_threshold, num_background, active_background, bg_queue and blocked fields. See [5/6] for the details. Patches [1-3/6] are preparations. I've already sent you two of them, and you said at least one is already applied, but since they are yet no in linux-next, I add them to make kbuild test robot happy. [4/6] is a fix of existing issue. I don't know whether stable needs this fix, so I don't send it in separate. Please, say if it's needed resend it in this way. The test results is for our proprietary vstorage fuse driver. Feel free to ask me, in case of you want the patchset to be tested on some other fuse driver and with some other test. Thanks, Kirill --- Kirill Tkhai (6): fuse: Use list_first_entry() in flush_bg_queue() fuse: Move clear_bit() up in request_end() fuse: Underline congestion_threshold and max_background may be read w/o fc->lock fuse: Lock fc->lock during changing num_background and congestion_threshold fs: Introduce fuse_conn::bg_lock fuse: Do not take fuse_conn::lock on fuse_request_send_background() fs/fuse/control.c | 34 ++++++++++++++++++++++++++-------- fs/fuse/dev.c | 42 +++++++++++++++++++++++++++--------------- fs/fuse/file.c | 2 +- fs/fuse/fuse_i.h | 11 +++++++++-- fs/fuse/inode.c | 4 ++++ 5 files changed, 67 insertions(+), 26 deletions(-) -- Signed-off-by: Kirill Tkhai