vfs scalability patches updated
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest52 patches 100 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/52 | kernel: add bl_listinclude/ include/ | +219 | 5 replies | |
| 2/52 | fs: fix superblock iteration racefs/ fs/ include/ | +23 | 11 replies | |
| 3/52 | fs: fs_struct rwlock to spinlockdrivers/ fs/ fs/ +8 more | +48 | 0 replies | |
| 4/52 | fs: cleanup files_lockdrivers/ drivers/ fs/ +4 more | +48 | 0 replies | |
| 5/52 | lglock: introduce special lglock and brlock spin locksinclude/ | +172 | 4 replies | |
| 6/52 | fs: scale files_lockfs/ fs/ include/ | +115 | 2 replies | |
| 7/52 | fs: brlock vfsmount_lockfs/ fs/ fs/ +2 more | +134 | 0 replies | |
| 8/52 | fs: scale mntget/mntputdrivers/ fs/ fs/ +3 more | +144 | 0 replies | |
| 9/52 | fs: dcache scale hashfs/ include/ | +31 | 0 replies | |
| 10/52 | fs: dcache scale lrufs/ | +85 | 0 replies | |
| 11/52 | fs: dcache scale nr_dentryfs/ include/ kernel/ | +17 | 0 replies | |
| 12/52 | fs: dcache scale dentry refcountarch/ drivers/ drivers/ +20 more | +166 | 0 replies | |
| 13/52 | fs: dcache scale d_unhashedarch/ drivers/ fs/ +6 more | +102 | 0 replies | |
| 14/52 | fs: dcache scale subdirsdrivers/ fs/ fs/ +13 more | +283 | 3 replies | |
| 15/52 | fs: dcache scale inode alias listfs/ fs/ fs/ +5 more | +70 | 0 replies | |
| 16/52 | fs: dcache RCU for multi-step operaitonsdrivers/ fs/ fs/ +3 more | +172 | 5 replies | |
| 17/52 | fs: dcache remove dcache_lockDocumentation/ arch/ drivers/ +32 more | +67 | 0 replies | |
| 18/52 | fs: dcache reduce dput lockingfs/ | +32 | 0 replies | |
| 19/52 | fs: dcache per-bucket dcache hash lockingfs/ fs/ include/ +1 more | +142 | 0 replies | |
| 20/52 | fs: dcache reduce dcache_inode_lockfs/ | +12 | 0 replies | |
| 21/52 | fs: dcache per-inode inode alias lockingfs/ fs/ fs/ +5 more | +85 | 0 replies | |
| 22/52 | fs: dcache rationalise dget variantsarch/ drivers/ drivers/ +9 more | +24 | 0 replies | |
| 23/52 | fs: dcache percpu nr_dentryfs/ include/ | +2 | 0 replies | |
| 24/52 | fs: dcache reduce d_parent lockingfs/ | +20 | 7 replies | |
| 25/52 | fs: dcache DCACHE_REFERENCED improvefs/ | +3 | 0 replies | |
| 26/52 | fs: icache lock s_inodes listfs/ fs/ fs/ +4 more | +40 | 0 replies | |
| 27/52 | fs: icache lock inode hashfs/ include/ | +33 | 0 replies | |
| 28/52 | fs: icache lock i_statefs/ fs/ fs/ +2 more | +118 | 0 replies | |
| 29/52 | fs: icache lock i_countarch/ fs/ fs/ +50 more | +205 | 16 replies | |
| 30/52 | fs: icache lock lru/writeback listsfs/ fs/ include/ +1 more | +92 | 3 replies | |
| 31/52 | fs: icache atomic inodes_statdrivers/ fs/ fs/ +5 more | +44 | 0 replies | |
| 32/52 | fs: icache protect inode statefs/ fs/ | +30 | 0 replies | |
| 33/52 | fs: icache atomic last_ino, iunique lockfs/ | +22 | 0 replies | |
| 34/52 | fs: icache remove inode_lockfs/ fs/ fs/ +7 more | +30 | 0 replies | |
| 35/52 | fs: icache factor hash lock into functionsfs/ include/ include/ | +28 | 0 replies | |
| 36/52 | fs: icache per-bucket inode hash locksfs/ fs/ fs/ +10 more | +132 | 0 replies | |
| 37/52 | fs: icache lazy lrufs/ fs/ include/ +1 more | +61 | 6 replies | |
| 38/52 | fs: icache RCU free inodesfs/ fs/ fs/ +11 more | +164 | 2 replies | |
| 39/52 | fs: icache rcu walk for i_sb_listfs/ fs/ fs/ +2 more | +36 | 0 replies | |
| 40/52 | fs: dcache improve scalability of pseudo filesystemsfs/ fs/ fs/ +2 more | +16 | 0 replies | |
| 41/52 | fs: icache reduce atomicsfs/ fs/ include/ | +23 | 0 replies | |
| 42/52 | fs: icache per-cpu last_ino allocatorfs/ | +35 | 4 replies | |
| 43/52 | fs: icache per-cpu nr_inodes counterfs/ fs/ include/ +1 more | +36 | 0 replies | |
| 44/52 | fs: icache per-CPU sb inode lists and locksfs/ fs/ fs/ +8 more | +180 | 4 replies | |
| 45/52 | fs: icache RCU hash lookupsfs/ | +16 | 0 replies | |
| 46/52 | fs: icache reduce lockingfs/ fs/ | +5 | 0 replies | |
| 47/52 | fs: keep inode with backing-devdrivers/ drivers/ drivers/ +49 more | +153 | 0 replies | |
| 48/52 | fs: icache split IO and LRU listsfs/ fs/ include/ +1 more | +56 | 0 replies | |
| 49/52 | fs: icache scale writeback list lockingfs/ fs/ fs/ +4 more | +141 | 0 replies | |
| 50/52 | mm: implement per-zone shrinkerarch/ drivers/ drivers/ +22 more | +389 | 7 replies | |
| 51/52 | fs: per-zone dentry and inode LRUfs/ fs/ fs/ +3 more | +187 | 2 replies | |
| 52/52 | fs: icache less I_FREEING timefs/ | +20 | 4 replies |
Reviews trailers per patch
2 of 52 patches have a Reviewed-by or Acked-by.
| Patch | Andi Kleen | Greg Kroah-Hartman | Paul E. McKenney |
|---|---|---|---|
| 1/52 | R-b | ||
| 2/52 | |||
| 3/52 | |||
| 4/52 | A-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.
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.