diff options
| author | Li RongQing <[email protected]> | 2025-04-10 11:21:17 +0000 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2025-04-21 08:27:58 +0000 |
| commit | ef181fa11d9e09d3741525937d7bab4c5ab91ef7 (patch) | |
| tree | 31f9e5b5c5b3d406365cea8a64ca48089b38db1c | |
| parent | select: core_sys_select add unlikely branch hint on return path (diff) | |
| download | kernel-ef181fa11d9e09d3741525937d7bab4c5ab91ef7.tar.gz kernel-ef181fa11d9e09d3741525937d7bab4c5ab91ef7.zip | |
fs: Make file-nr output the total allocated file handles
Make file-nr output the total allocated file handles, not per-cpu
cache number, it's more precise, and not in hot path
Signed-off-by: Li RongQing <[email protected]>
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Christian Brauner <[email protected]>
| -rw-r--r-- | fs/file_table.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index c04ed94cdc4b..138114d64307 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -102,7 +102,7 @@ EXPORT_SYMBOL_GPL(get_max_files); static int proc_nr_files(const struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { - files_stat.nr_files = get_nr_files(); + files_stat.nr_files = percpu_counter_sum_positive(&nr_files); return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); } |
