History

fs: use percpu counter for nr_dentry and nr_dentry_unused

The nr_dentry stat is a globally touched cacheline and atomic operation twice over the lifetime of a dentry. It is used for the benfit of userspace only. Turn it into a per-cpu counter and always decrement it in d_free instead of doing various batching operations to reduce lock hold times in the callers. Based on an earlier patch from Nick Piggin <npiggin@suse.de>.

Christoph Hellwig committed 16 years ago

Commit 312d3ca1 parent 9c82ab93 files · +35 −20Browse files

Showing the changes to kernel/sysctl.c (1 of 3 files). Show all

Unified · Split

kernel/sysctl.c+1−1
@@ -1377,7 +1377,7 @@ static struct ctl_table fs_table[] = { · 1376 unmodified lines
1377 .data = &dentry_stat,1377 .data = &dentry_stat,
1378 .maxlen = 6*sizeof(int),1378 .maxlen = 6*sizeof(int),
1379 .mode = 0444,1379 .mode = 0444,
1380 .proc_handler = proc_dointvec,1380 .proc_handler = proc_nr_dentry,
1381 },1381 },
1382 {1382 {
1383 .procname = "overflowuid",1383 .procname = "overflowuid",