[PATCH v9 0/5] vfs: Use dlock list for SB's s_inodes list

From: Waiman Long
Date: Wed Sep 12 2018 - 15:29:44 EST


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