[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241123180901.181825-1-alexjlzheng@tencent.com>
Date: Sun, 24 Nov 2024 02:08:55 +0800
From: Jinliang Zheng <alexjlzheng@...il.com>
To: viro@...iv.linux.org.uk,
brauner@...nel.org,
jack@...e.cz,
mcgrof@...nel.org,
kees@...nel.org,
joel.granados@...nel.org,
adobriyan@...il.com
Cc: linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
flyingpeng@...cent.com,
Jinliang Zheng <alexjlzheng@...cent.com>
Subject: [PATCH 0/6] Maintain the relative size of fs.file-max and fs.nr_open
According to Documentation/admin-guide/sysctl/fs.rst, fs.nr_open and
fs.file-max represent the number of file-handles that can be opened
by each process and the entire system, respectively.
Therefore, it's necessary to maintain a relative size between them,
meaning we should ensure that files_stat.max_files is not less than
sysctl_nr_open.
However, this point is overlooked in the current kernel code, and
this patchset aims to rectify this. Additionally, patch 0001 fixes
the type issue with the sysctl_nr_open handler.
Jinliang Zheng (6):
fs: fix proc_handler for sysctl_nr_open
fs: make files_stat globally visible
sysctl: refactor __do_proc_doulongvec_minmax()
sysctl: ensure files_stat.max_files is not less than sysctl_nr_open
sysctl: ensure sysctl_nr_open is not greater than files_stat.max_files
fs: synchronize the access of fs.file-max and fs.nr_open
fs/file_table.c | 15 ++++++++---
include/linux/fs.h | 2 ++
include/linux/sysctl.h | 4 +++
kernel/sysctl.c | 59 ++++++++++++++++++++++++++++++++++++++----
4 files changed, 71 insertions(+), 9 deletions(-)
--
2.41.1
Powered by blists - more mailing lists