Skip to content

vfs scalability patches updated

[email protected] linux-fsdevel linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest52 patches 100 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/52kernel: add bl_listinclude/linux/list_bl.h include/linux/rculist_bl.h+219 -05 replies
2/52fs: fix superblock iteration racefs/dcache.c fs/super.c include/linux/list.h+23 -011 replies
3/52fs: fs_struct rwlock to spinlockdrivers/staging/pohmelfs/path_entry.c fs/cachefiles/daemon.c fs/dcache.c +8 more+48 -480 replies
4/52fs: cleanup files_lockdrivers/char/pty.c drivers/char/tty_io.c fs/file_table.c +4 more+48 -420 replies
5/52lglock: introduce special lglock and brlock spin locksinclude/linux/lglock.h+172 -04 replies
6/52fs: scale files_lockfs/file_table.c fs/super.c include/linux/fs.h+115 -182 replies
7/52fs: brlock vfsmount_lockfs/dcache.c fs/internal.h fs/namei.c +2 more+134 -770 replies
8/52fs: scale mntget/mntputdrivers/mtd/mtdchar.c fs/internal.h fs/libfs.c +3 more+144 -440 replies
9/52fs: dcache scale hashfs/dcache.c include/linux/dcache.h+31 -110 replies
10/52fs: dcache scale lrufs/dcache.c+85 -200 replies
11/52fs: dcache scale nr_dentryfs/dcache.c include/linux/dcache.h kernel/sysctl.c+17 -130 replies
12/52fs: dcache scale dentry refcountarch/powerpc/platforms/cell/spufs/inode.c drivers/infiniband/hw/ipath/ipath_fs.c drivers/infiniband/hw/qib/qib_fs.c +20 more+166 -760 replies
13/52fs: dcache scale d_unhashedarch/powerpc/platforms/cell/spufs/inode.c drivers/usb/core/inode.c fs/ceph/dir.c +6 more+102 -240 replies
14/52fs: dcache scale subdirsdrivers/usb/core/inode.c fs/autofs4/expire.c fs/autofs4/root.c +13 more+283 -893 replies
15/52fs: dcache scale inode alias listfs/affs/amigaffs.c fs/dcache.c fs/exportfs/expfs.c +5 more+70 -70 replies
16/52fs: dcache RCU for multi-step operaitonsdrivers/staging/pohmelfs/path_entry.c fs/autofs4/waitq.c fs/dcache.c +3 more+172 -365 replies
17/52fs: dcache remove dcache_lockDocumentation/filesystems/Locking arch/powerpc/platforms/cell/spufs/inode.c drivers/infiniband/hw/ipath/ipath_fs.c +32 more+67 -2390 replies
18/52fs: dcache reduce dput lockingfs/dcache.c+32 -280 replies
19/52fs: dcache per-bucket dcache hash lockingfs/dcache.c fs/super.c include/linux/dcache.h +1 more+142 -1220 replies
20/52fs: dcache reduce dcache_inode_lockfs/dcache.c+12 -120 replies
21/52fs: dcache per-inode inode alias lockingfs/affs/amigaffs.c fs/dcache.c fs/exportfs/expfs.c +5 more+85 -630 replies
22/52fs: dcache rationalise dget variantsarch/powerpc/platforms/cell/spufs/inode.c drivers/infiniband/hw/ipath/ipath_fs.c drivers/infiniband/hw/qib/qib_fs.c +9 more+24 -400 replies
23/52fs: dcache percpu nr_dentryfs/dcache.c include/linux/dcache.h+2 -50 replies
24/52fs: dcache reduce d_parent lockingfs/dcache.c+20 -177 replies
25/52fs: dcache DCACHE_REFERENCED improvefs/dcache.c+3 -30 replies
26/52fs: icache lock s_inodes listfs/drop_caches.c fs/fs-writeback.c fs/inode.c +4 more+40 -00 replies
27/52fs: icache lock inode hashfs/inode.c include/linux/writeback.h+33 -10 replies
28/52fs: icache lock i_statefs/drop_caches.c fs/fs-writeback.c fs/inode.c +2 more+118 -210 replies
29/52fs: icache lock i_countarch/powerpc/platforms/cell/spufs/file.c fs/affs/inode.c fs/afs/dir.c +50 more+205 -9716 replies
30/52fs: icache lock lru/writeback listsfs/fs-writeback.c fs/inode.c include/linux/writeback.h +1 more+92 -113 replies
31/52fs: icache atomic inodes_statdrivers/staging/pohmelfs/inode.c fs/btrfs/inode.c fs/ceph/mds_client.c +5 more+44 -340 replies
32/52fs: icache protect inode statefs/hugetlbfs/inode.c fs/inode.c+30 -40 replies
33/52fs: icache atomic last_ino, iunique lockfs/inode.c+22 -60 replies
34/52fs: icache remove inode_lockfs/buffer.c fs/drop_caches.c fs/fs-writeback.c +7 more+30 -1200 replies
35/52fs: icache factor hash lock into functionsfs/inode.c include/linux/fs.h include/linux/writeback.h+28 -160 replies
36/52fs: icache per-bucket inode hash locksfs/btrfs/inode.c fs/fs-writeback.c fs/hfs/hfs_fs.h +10 more+132 -1100 replies
37/52fs: icache lazy lrufs/fs-writeback.c fs/inode.c include/linux/fs.h +1 more+61 -936 replies
38/52fs: icache RCU free inodesfs/block_dev.c fs/ext2/super.c fs/ext3/super.c +11 more+164 -812 replies
39/52fs: icache rcu walk for i_sb_listfs/drop_caches.c fs/inode.c fs/notify/inode_mark.c +2 more+36 -710 replies
40/52fs: dcache improve scalability of pseudo filesystemsfs/anon_inodes.c fs/dcache.c fs/pipe.c +2 more+16 -30 replies
41/52fs: icache reduce atomicsfs/fs-writeback.c fs/inode.c include/linux/fs.h+23 -310 replies
42/52fs: icache per-cpu last_ino allocatorfs/inode.c+35 -74 replies
43/52fs: icache per-cpu nr_inodes counterfs/fs-writeback.c fs/inode.c include/linux/fs.h +1 more+36 -80 replies
44/52fs: icache per-CPU sb inode lists and locksfs/drop_caches.c fs/fs-writeback.c fs/inode.c +8 more+180 -694 replies
45/52fs: icache RCU hash lookupsfs/inode.c+16 -160 replies
46/52fs: icache reduce lockingfs/fs-writeback.c fs/inode.c+5 -60 replies
47/52fs: keep inode with backing-devdrivers/char/mem.c drivers/char/raw.c drivers/mtd/mtdchar.c +49 more+153 -930 replies
48/52fs: icache split IO and LRU listsfs/fs-writeback.c fs/inode.c include/linux/fs.h +1 more+56 -390 replies
49/52fs: icache scale writeback list lockingfs/fs-writeback.c fs/inode.c fs/internal.h +4 more+141 -910 replies
50/52mm: implement per-zone shrinkerarch/x86/kvm/mmu.c drivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/ttm/ttm_page_alloc.c +22 more+389 -3067 replies
51/52fs: per-zone dentry and inode LRUfs/dcache.c fs/inode.c fs/super.c +3 more+187 -1432 replies
52/52fs: icache less I_FREEING timefs/inode.c+20 -144 replies

Reviews trailers per patch

2 of 52 patches have a Reviewed-by or Acked-by.

PatchAndi KleenGreg Kroah-HartmanPaul E. McKenney
1/52R-b
2/52
3/52
4/52A-b A-b
5/52
6/52
7/52
8/52
9/52
10/52
11/52
12/52
13/52
14/52
15/52
16/52
17/52
18/52
19/52
20/52
21/52
22/52
23/52
24/52
25/52
26/52
27/52
28/52
29/52
30/52
31/52
32/52
33/52
34/52
35/52
36/52
37/52
38/52
39/52
40/52
41/52
42/52
43/52
44/52
45/52
46/52
47/52
48/52
49/52
50/52
51/52
52/52

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [patch 00/52] vfs scalability patches updated

http://www.kernel.org/pub/linux/kernel/people/npiggin/patches/fs-scale/

Update to vfs scalability patches:

- Lots of fixes, particularly RCU inode stuff
- Lots of cleanups and aesthetic to the code, ifdef reduction etc
- Use bit locks for inode and dentry hashes
- Small improvements to single-threaded performance
- Split inode LRU and writeback list locking
- Per-bdi inode writeback list locking
- Per-zone mm shrinker
- Per-zone dentry and inode LRU lists
- Several fixes brought in from -rt tree testing
- No global locks remain in any fastpaths (arguably, rename)

I have not included the store-free path walk patches in this posting. They require a bit more work and they will need to be reworked after ->d_revalidate/->follow_mount changes that Al wants to do. I prefer to concentrate on these locking patches first.

Autofs4 is sadly missing. It's a bit tricky, patches have to be reworked.

Performance:
Last time I was testing on a 32-node Altix which could be considered as not a sweet-spot for Linux performance target (ie. improvements there may not justify complexity). So recently I've been testing with a tightly interconnected 4-socket Nehalem (4s/32c/64t). Linux needs to perform well on this size of system.

*** Single-thread microbenchmark (simple syscall loops, lower is better):

Test                    Difference at 95.0% confidence (50 runs)
open/close              -6.07% +/- 1.075%
creat/unlink            27.83% +/- 0.522%

Open/close is a little faster, which should be due to one less atomic in the dput common case. Creat/unlink is significantly slower, which is due to RCU freeing inodes. We have have made the same magnitude of performance regression tradeoff when going to RCU freed dentries and files as well. Inode RCU is required for reducing inode hash lookup locking and improve lock ordering, also for store-free path-walk.

*** Let's take a look at this creat/unlink regression more closely. If we call rdtsc around the creat/unlink loop, and just run it once (so as to avoid much of the RCU induced problems):
vanilla: 5328 cycles

    vfs: 5960 cycles (+11.8%)

Not so bad when RCU is not being stressed.

*** 64 parallel git diff on 64 kernel trees fully cached (avg of 5 runs):

                vanilla         vfs
real            0m4.911s        0m0.183s
user            0m1.920s        0m1.610s
sys             4m58.670s       0m5.770s

After vfs patches, 26x increase in throughput, however parallelism is limited by test spawning and exit phases. sys time improvement shows closer to 50x improvement. vanilla is bottlenecked on dcache_lock.

*** Google sockets (http://marc.info/?l=linux-kernel&m=123215942507568&w=2):

                vanilla         vfs
real             1m 7.774s      0m 3.245s
user             0m19.230s      0m36.750s
sys             71m41.310s      2m47.320s

do_exit path for
the run took 24.755s 1.219s
After vfs patches, 20x increase in throughput for both the total duration and the do_exit (teardown) time.

*** file-ops test (people.redhat.com/mingo/file-ops-test/file-ops-test.c) Parallel open/close or creat/unlink in same or different cwds within the same ramfs mount. Relative throughput percentages are given at each parallelism point (higher is better):

open/close vanilla vfs
same cwd
1 100.0 119.1

2                       74.2        187.4
4                       38.4         40.9
8                       18.7         27.0
16                       9.0         24.9
32                       5.9         24.2
64                       6.0         27.7
different cwd
1                      100.0        119.1
2                      133.0        238.6
4                       21.2        488.6
8                       19.7        932.6
16                      18.8       1784.1
32                      18.7       3469.5
64                      19.0       2858.0

creat/unlink vanilla vfs
same cwd

1                      100.0         75.0
2                       44.1         41.8
4                       28.7         24.6
8                       16.5         14.2
16                       8.7          8.9
32                       5.5          7.8
64                       5.9          7.4
different cwd
1                      100.0         75.0
2                       89.8        137.2
4                       20.1        267.4
8                       17.2        513.0
16                      16.2        901.9
32                      15.8       1724.0
64                      17.3       1161.8

Note that at 64, we start using sibling threads on the CPU, making results jump around a bit. The drop at 64 in different-cwd cases seems to be hitting an RCU or slab allocator issue (or maybe it's just the SMT).

The scalability regression I was seeing in same-cwd tests is no longer there (is even improved now). It may still be present in some workloads doing common-element path lookups. This can be solved by making d_count atomic again, at the cost of more atomic ops in some cases, but scalability is still limited. So I prefer to do store-free path walking which is much more scalable.

In the different cwd open/close case, cost to bounce cachelines over the interconnect is putting absolute upper limit of 162K open/closes per second over the entire machine in vanilla kernel. After vfs patches, it is around 30M. On larger and less well connected machines, the lower limit will only get lower while the vfs case should continue to keep going up (assuming mm subsystem can keep up).

*** Reclaim
I have not done much reclaim testing yet. It should be more scalable and lower latency due to significant reduction in lru locks interfering with other critical sections in inode/dentry code, and because we have per-zone locks. Per-zone LRUs mean that reclaim is targetted to the correct zone, and that kswapd will operate on lists of node-local memory objects.