Received: by 10.223.164.202 with SMTP id h10csp4512581wrb; Wed, 29 Nov 2017 07:30:47 -0800 (PST) X-Google-Smtp-Source: AGs4zMbhkL6x7ILKbIx4RfKGunQj3ca/ShcV4iIP5thaEOjIyyrYOMUAxAxVDa4gckBi/GKZ8JDJ X-Received: by 10.159.196.151 with SMTP id c23mr3219436plo.29.1511969447696; Wed, 29 Nov 2017 07:30:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511969447; cv=none; d=google.com; s=arc-20160816; b=DZH3kPfq7v06EFPsaO1fLIAPNT3CKbSb5rUaB+cDrLc6NUMwe2XpmcNqEJlCrNmTrb 8S5v25/3TGSXV/0Q0LIvfj8OGLFcUQj91bZj1PKpO4d+YIOan3sVobbNYDX+N2zSx5X9 GyzMnXpdtvSg/cYuDXeOs1RAqniM9NnTkqFcKcBcN6PAl9G5S8uaHVgX2V97bEIRWIW/ 8BowDfYbxvCRjk5XTZpuJAigk7hvOy4OC5DB0Q5J0Tv/nAusxsBz7AisthPaIGW2hVNy 3HGcZjsqfLU7+OGFgx5h/XqsFHC8bgr0VIkN7raOWSnRCFJo6Zdf+8O30rAEF6HkNoJI /uRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=pIdJdB9L/XIfj7fRPaFVpzy65JuDxMyKzY0I2y6hKTU=; b=R8M5Zr2nNc5dhNyB/vvIg+w5MVcT80m7GtrAJAB6ooEeNEku4mW3nDviJzoxbbvXBi 7Zmno2TBYJA/MIFfqRRBU6W+47KcoEqBSARefPW/7yF5EjTf9Uy3dJWBKBSishl74S8p HT2DMtwsLIIkJv8JBf+wp287a12NQokGAn71bMMXmZ4serEtxzpG18YW6qU0sdxAUX0W 3h2Ee1doAGQnSkD1UvtSuxfgk35KURUfnpkwMjgRYA31MhK+RqRwnMQJ9j1i+vM7ArYd 9Ia9FHiDKoUQ9+0WulSWdPcCvH/Yk/7O6x63JDfRGTnoigugefJ+cCQMumn1PRxehnVL OSSg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay8si1350419plb.215.2017.11.29.07.30.36; Wed, 29 Nov 2017 07:30:47 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755513AbdK2P3W (ORCPT + 69 others); Wed, 29 Nov 2017 10:29:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:40689 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752829AbdK2P3V (ORCPT ); Wed, 29 Nov 2017 10:29:21 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C98E0AE0B; Wed, 29 Nov 2017 15:29:17 +0000 (UTC) Date: Wed, 29 Nov 2017 07:26:02 -0800 From: Davidlohr Bueso To: Waiman Long Cc: Alexander Viro , Jan Kara , Jeff Layton , "J. Bruce Fields" , Tejun Heo , Christoph Lameter , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Andi Kleen , Dave Chinner , Boqun Feng Subject: Re: [PATCH v8 0/6] vfs: Use dlock list for SB's s_inodes list Message-ID: <20171129152602.p4dzxhoaruza47ol@linux-n805> References: <1509475860-16139-1-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1509475860-16139-1-git-send-email-longman@redhat.com> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Are you planning on sending a v9 with the discussed changes? afaict: - Drop last two patches - Fix tearing (WRITE/READ_ONCE()) - Reduce barrier usage for dlock_lists_empty() -- which I'll be sending you shortly. Thanks, Davidlohr On Tue, 31 Oct 2017, Waiman Long wrote: >v7->v8: > - Integrate the additional patches 8, 9 and 10 sent to fix issues in > the original v7 patchset into patch 1 and adjust the other patches > accordingly. > >v6->v7: > - Fix outdated email address. > - Add a comment to patch 4 to explain allocation issue & fix a > compilation problem with cpumask. > - Replace patch 6 with another one that adds an irqsafe mode argument > in alloc_dlock_list_heads() instead of adding new APIs. > >v5->v6: > - Rebased the patch to 4.14-rc3. > - Drop the fsnotify patch as it had been merged somehow. > - Add a new patch 5 with alternative way of selecting list by hashing > instead of cpu #. > - Add a new patch 6 to proivde a set irq safe APIs to be used in > interrupt context. > - Update the CPU to index mapping code. > >v4->v5: > - Rebased the patch to 4.8-rc1 (changes to fs/fs-writeback.c was > dropped). > - Use kcalloc() instead of percpu_alloc() to allocate the dlock list > heads structure as suggested by Christoph Lameter. > - Replaced patch 5 by another one that made sibling CPUs use the same > dlock list head thus reducing the number of list heads that needed > to be maintained. > >v3->v4: > - As suggested by Al, encapsulate the dlock list mechanism into > the dlist_for_each_entry() and dlist_for_each_entry_safe() > which are the equivalent of list_for_each_entry() and > list_for_each_entry_safe() for regular linked list. That simplifies > the changes in the call sites that perform dlock list iterations. > - Add a new patch to make the percpu head structure cacheline aligned > to prevent cacheline contention from disrupting the performance > of nearby percpu variables. > >v2->v3: > - Remove the 2 persubnode API patches. > - Merge __percpu tag patch 2 into patch 1. > - As suggested by Tejun Heo, restructure the dlock_list_head data > structure to hide the __percpu tag and rename some of the functions > and structures. > - Move most of the code from dlock_list.h to dlock_list.c and export > the symbols. > >v1->v2: > - Add a set of simple per-subnode APIs that is between percpu and > per-node in granularity. > - Make dlock list to use the per-subnode APIs so as to reduce the > total number of separate linked list that needs to be managed > and iterated. > - There is no change in patches 1-5. > >This patchset provides new APIs for a set of distributed locked lists >(one/CPU core) to minimize lock and cacheline contention. Insertion >and deletion to the list will be cheap and relatively contention free. >Lookup, on the other hand, may be a bit more costly as there are >multiple lists to iterate. This is not really a problem for the >replacement of superblock's inode list by dlock list included in >the patchset as lookup isn't needed. > >For use cases that need to do lookup, the dlock list can also be >treated as a set of hashed lists that scales with the number of CPU >cores in the system. > >Both patches 5 and 6 are added to support other use cases like epoll >nested callbacks, for example, which could use the dlock-list to >reduce lock contention problem. > >Patch 1 introduces the dlock list. The list heads are allocated >by kcalloc() instead of percpu_alloc(). Each list head entry is >cacheline aligned to minimize contention. > >Patch 2 replaces the use of list_for_each_entry_safe() in >evict_inodes() and invalidate_inodes() by list_for_each_entry(). > >Patch 3 modifies the superblock and inode structures to use the dlock >list. The corresponding functions that reference those structures >are modified. > >Patch 4 makes the sibling CPUs use the same dlock list head to reduce >the number of list heads that need to be iterated. > >Patch 5 enables alternative use case of as a set of hashed lists. > >Patch 6 provides an irq safe mode specified at dlock-list allocation >time so that it can be used within interrupt context. > >Jan Kara (1): > vfs: Remove unnecessary list_for_each_entry_safe() variants > >Waiman Long (5): > lib/dlock-list: Distributed and lock-protected lists > vfs: Use dlock list for superblock's inode list > lib/dlock-list: Make sibling CPUs share the same linked list > lib/dlock-list: Enable faster lookup with hashing > lib/dlock-list: Add an IRQ-safe mode to be used in interrupt handler > > fs/block_dev.c | 9 +- > fs/drop_caches.c | 9 +- > fs/inode.c | 38 ++---- > fs/notify/fsnotify.c | 9 +- > fs/quota/dquot.c | 14 +- > fs/super.c | 7 +- > include/linux/dlock-list.h | 263 +++++++++++++++++++++++++++++++++++ > include/linux/fs.h | 8 +- > lib/Makefile | 2 +- > lib/dlock-list.c | 333 +++++++++++++++++++++++++++++++++++++++++++++ > 10 files changed, 638 insertions(+), 54 deletions(-) > create mode 100644 include/linux/dlock-list.h > create mode 100644 lib/dlock-list.c > >-- >1.8.3.1 > From 1582800359364716298@xxx Tue Oct 31 18:54:10 +0000 2017 X-GM-THRID: 1582800359364716298 X-Gmail-Labels: Inbox,Category Forums