diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-10-23 05:03:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-25 21:26:09 -0400 |
commit | cffbc8aa334f55c9ed42d25202eb3ebf3a97c195 (patch) | |
tree | dab046695754e2cec1a7ab7a64b236e976d94360 /kernel | |
parent | be1a16a0ae29a7c90081a657b64aa51cb1a65a27 (diff) |
fs: Convert nr_inodes and nr_unused to per-cpu counters
The number of inodes allocated does not need to be tied to the
addition or removal of an inode to/from a list. If we are not tied
to a list lock, we could update the counters when inodes are
initialised or destroyed, but to do that we need to convert the
counters to be per-cpu (i.e. independent of a lock). This means that
we have the freedom to change the list/locking implementation
without needing to care about the counters.
Based on a patch originally from Eric Dumazet.
[AV: cleaned up a bit, fixed build breakage on weird configs
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sysctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 694b140852c2..99a510cbfbb3 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -1340,14 +1340,14 @@ static struct ctl_table fs_table[] = { | |||
1340 | .data = &inodes_stat, | 1340 | .data = &inodes_stat, |
1341 | .maxlen = 2*sizeof(int), | 1341 | .maxlen = 2*sizeof(int), |
1342 | .mode = 0444, | 1342 | .mode = 0444, |
1343 | .proc_handler = proc_dointvec, | 1343 | .proc_handler = proc_nr_inodes, |
1344 | }, | 1344 | }, |
1345 | { | 1345 | { |
1346 | .procname = "inode-state", | 1346 | .procname = "inode-state", |
1347 | .data = &inodes_stat, | 1347 | .data = &inodes_stat, |
1348 | .maxlen = 7*sizeof(int), | 1348 | .maxlen = 7*sizeof(int), |
1349 | .mode = 0444, | 1349 | .mode = 0444, |
1350 | .proc_handler = proc_dointvec, | 1350 | .proc_handler = proc_nr_inodes, |
1351 | }, | 1351 | }, |
1352 | { | 1352 | { |
1353 | .procname = "file-nr", | 1353 | .procname = "file-nr", |