# \[PATCH v2 2/5\] fs: Use a percpu\_counter to track nr\_inodes

- From: Eric Dumazet \<hidden\>
- Date: 2008-11-29 08:43:39 
- List: netdev
- Page: https://ratatoskr.run/netdev/2008/11/27587
- Thread: https://ratatoskr.run/linux-fsdevel/2008/11/27587/t.md

```text
Avoids cache line ping pongs between cpus and prepare next patch,
because updates of nr_inodes dont need inode_lock anymore.

(socket8 bench result : no difference at this point)

Signed-off-by: Eric Dumazet <redacted>
---
fs/fs-writeback.c   |    2 +-
fs/inode.c          |   39 +++++++++++++++++++++++++++++++--------
include/linux/fs.h  |    3 +++
kernel/sysctl.c     |    4 ++--
mm/page-writeback.c |    2 +-
5 files changed, 38 insertions(+), 12 deletions(-)
```

## Attachments

- [nr\_inodes.patch](https://ratatoskr.run/netdev/2008/11/27587/attachment/0) (text/plain, 5626 bytes)
