From patchwork Fri Nov 9 10:33:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10675705 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 ADC4C14D6 for ; Fri, 9 Nov 2018 10:33:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DC4E2E91B for ; Fri, 9 Nov 2018 10:33:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 921312E932; Fri, 9 Nov 2018 10:33:14 +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=-7.9 required=2.0 tests=BAYES_00,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 968962E91B for ; Fri, 9 Nov 2018 10:33:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727807AbeKIUNK (ORCPT ); Fri, 9 Nov 2018 15:13:10 -0500 Received: from relay.sw.ru ([185.231.240.75]:56788 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727560AbeKIUNK (ORCPT ); Fri, 9 Nov 2018 15:13:10 -0500 Received: from [172.16.25.169] (helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1gL466-00030i-Gi; Fri, 09 Nov 2018 13:33:06 +0300 Subject: [PATCH v2 0/5] fuse: Further reducing contention of fc->lock From: Kirill Tkhai To: miklos@szeredi.hu, ktkhai@virtuozzo.com, linux-fsdevel@vger.kernel.org Date: Fri, 09 Nov 2018 13:33:06 +0300 Message-ID: <154175935554.21228.11270624605198037428.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 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 v2: Removed patch [1/6] from v1, and [4/6] from v1 is replaced with new patch (which is [2/5] in this v2). There was introduced fc->bg_lock to reduce the contention, and this patchset continues this efforts. This patchset introduces per fuse_inode lock to protect inode metadata, synchronization with background writes, etc. All of the above is related to a single inode, and there is no a reason, that inodes are concurrents of each other to make some of actions exclusive. So, here we introduce fuse_inode::lock spinlock and get rid of fc->lock in many places. --- Kirill Tkhai (5): fuse: Add fuse_inode argument to fuse_prepare_release() fuse: Convert fuse_conn::attr_version into atomic64_t fuse: Introduce fuse_inode::lock to protect write related fields and statistics fuse: Protect fuse_inode::nlookup with fuse_inode::lock fuse: Protect fuse_file::reserved_req via corresponding fuse_inode::lock fs/fuse/cuse.c | 3 + fs/fuse/dev.c | 10 +++-- fs/fuse/dir.c | 54 ++++++++++---------------- fs/fuse/file.c | 111 ++++++++++++++++++++++++++++------------------------- fs/fuse/fuse_i.h | 23 ++++++++--- fs/fuse/inode.c | 17 +++++--- fs/fuse/readdir.c | 4 +- 7 files changed, 115 insertions(+), 107 deletions(-) -- Signed-off-by: Kirill Tkhai