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>.
Showing the changes to kernel/sysctl.c (1 of 3 files). Show all
Unified · Split
| @@ -1377,7 +1377,7 @@ static struct ctl_table fs_table[] = { · 1376 unmodified lines | ||
| 1377 | 1377 | .data = &dentry_stat, |
| 1378 | 1378 | .maxlen = 6*sizeof(int), |
| 1379 | 1379 | .mode = 0444, |
| 1380 | − .proc_handler = proc_dointvec, | |
| 1380 | + .proc_handler = proc_nr_dentry, | |
| 1381 | 1381 | }, |
| 1382 | 1382 | { |
| 1383 | 1383 | .procname = "overflowuid", |