projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b24a70
)
fs: Make file-nr output the total allocated file handles
author
Li RongQing
<lirongqing@baidu.com>
Thu, 10 Apr 2025 11:21:17 +0000
(19:21 +0800)
committer
Christian Brauner
<brauner@kernel.org>
Mon, 21 Apr 2025 08:27:58 +0000
(10:27 +0200)
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 <lirongqing@baidu.com>
Link:
https://lore.kernel.org/20250410112117.2851-1-lirongqing@baidu.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/file_table.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/file_table.c
b/fs/file_table.c
index c04ed94cdc4b26daa8fa52efa2cc3bdb932e6de1..138114d643077118948b4902cffb933ff7ee901e 100644
(file)
--- 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);
}