Skip to content

vfs: Use dlock list for SB's s_inodes list

Waiman Long linux-fsdevel lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest5 patches 5 repliesIn review
  2. v86 patches 14 repliesSuperseded
  3. v76 patches 17 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v66 patches9 repliesSuperseded

Changes in v9 from the cover letter

- 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.

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5lib/dlock-list: Distributed and lock-protected listsinclude/linux/dlock-list.h lib/Makefile lib/dlock-list.c+477 -10 replies
2/5vfs: Remove unnecessary list_for_each_entry_safe() variantsfs/inode.c+4 -40 replies
3/5vfs: Use dlock list for superblock's inode listfs/block_dev.c fs/drop_caches.c fs/inode.c +4 more+39 -512 replies
4/5lib/dlock-list: Make sibling CPUs share the same linked listlib/dlock-list.c+59 -150 replies
5/5lib/dlock-list: Scale dlock_lists_empty()include/linux/dlock-list.h lib/dlock-list.c+65 -103 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchJan KaraWaiman Long
1/5R-b
2/5
3/5R-b
4/5R-b
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v9 thread

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

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
Signature · 1 line
1.8.3.1