Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5877830imm; Wed, 12 Sep 2018 12:32:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYK2arywCfOCUFwRBJ/Q/kbsMtbuCxLa63O0PYXaCVSPllLawQp6NwocjcG732qmGY6cZ9G X-Received: by 2002:a63:2c01:: with SMTP id s1-v6mr2218003pgs.367.1536780725561; Wed, 12 Sep 2018 12:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536780725; cv=none; d=google.com; s=arc-20160816; b=Pd1do2sY2/7/kELNZiAH8J4fWs4QgsBuCXt6ap6HjXHzmSh1JnPN7B4FAysPJjgvEM Q07SFD08OhqD6dZgWG8ZNmazutr98jakbmpkcV2pWwHr2U7xEq5T7QyaJH84eUWrI4FJ qTbXFQyXiDw6Emu6kW1UHauIfEez8ets0h6tTzrzXFvbQl4FEgf4I+K05ZcNsbGmI1cM wmpG5RFwwVL7YNvMRa4iFuW4IjgIGKImA4lS7Y9oWK7T8Lz/im4rgGMuHt4cVlsdVQgY V5ygmqmx2xaFZWoD0rz9R1yFTI98xJN1BdfPKtmN4XY4PioLU/VwG6ahGe9yYwhNn7Zt eD3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=sseiUs9logGaFDwXd+tIsXL4aqPve3Yfn4Kl766dKrQ=; b=VIqE1RmHe5Ds329te0F6ogPkTvN99f1YDLAWC0LCVttHecfm8/QzRjqByBmWc8x30p qoPYpl5besLAkvGSjAgKeYKov/ujvDRqF67E4o4GXA8QZz531BBETSYd+Xng5Hno7md7 vamTQ3bq0EXKQuGy+VZpLrd+OD7U/idbYYm3wsxT9S1gmoif1wBtqoMni+4d5mW3pWSn B2roxPYDyn4C/0V2vrTtXhnvId8U1o2MS7vTPoadCT9V0dldwNi7UFLiMzoy8qEbfAHY qLS3LG7q7wdl5kDQW7zwe1r/AfRiquJ6j3PvqMs5K6HLK2mMRCQcEoiyY94A4WJfzz9z h0Vw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9-v6si1686229ply.16.2018.09.12.12.31.50; Wed, 12 Sep 2018 12:32:05 -0700 (PDT) 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728260AbeIMAfG (ORCPT + 99 others); Wed, 12 Sep 2018 20:35:06 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50880 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728139AbeIMAfG (ORCPT ); Wed, 12 Sep 2018 20:35:06 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3FB9080401CC; Wed, 12 Sep 2018 19:29:06 +0000 (UTC) Received: from llong.com (dhcp-17-55.bos.redhat.com [10.18.17.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33D0210EE6D8; Wed, 12 Sep 2018 19:29:03 +0000 (UTC) From: Waiman Long To: Alexander Viro , Jan Kara , Jeff Layton , "J. Bruce Fields" , Tejun Heo , Christoph Lameter Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Andi Kleen , Dave Chinner , Boqun Feng , Davidlohr Bueso , Waiman Long Subject: [PATCH v9 0/5] vfs: Use dlock list for SB's s_inodes list Date: Wed, 12 Sep 2018 15:28:47 -0400 Message-Id: <1536780532-4092-1-git-send-email-longman@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 12 Sep 2018 19:29:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 12 Sep 2018 19:29:06 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v8->v9: - The last 2 patches in v8 were dropped because there is no more user that can use them. - Include Davidlohr's dlock_lists_empty() scaling patch. - Rebase the code to 4.19-rc3. v8 patch: https://lkml.org/lkml/2017/10/31/776 This patchset has been dormant for almost a year. Now I am going to restart it again. 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. 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 improves the performance of dlock_lists_empty() call. See patch 3 for some performance data for this patchset. Davidlohr Bueso (1): lib/dlock-list: Scale dlock_lists_empty() Jan Kara (1): vfs: Remove unnecessary list_for_each_entry_safe() variants Waiman Long (3): 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 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 | 250 ++++++++++++++++++++++++++++++++++ include/linux/fs.h | 8 +- lib/Makefile | 2 +- lib/dlock-list.c | 325 +++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 617 insertions(+), 54 deletions(-) create mode 100644 include/linux/dlock-list.h create mode 100644 lib/dlock-list.c -- 1.8.3.1