git: 7e2a45111937 - main - linprocfs: Add /proc/vm/max_map_count
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 31 May 2022 08:59:34 UTC
The branch main has been updated by dchagin:
URL: https://cgit.FreeBSD.org/src/commit/?id=7e2a451119373b7d3f2b3fd062d4ccb099dde022
commit 7e2a451119373b7d3f2b3fd062d4ccb099dde022
Author: Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-05-31 08:42:06 +0000
Commit: Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-05-31 08:42:06 +0000
linprocfs: Add /proc/vm/max_map_count
On Linux this limits the number of maps per mm struct.
We don't limit mappings, return a suitable large value.
Reviewed by: emaste
Differential revision: https://reviews.freebsd.org/D35351
MFC after: 2 weeks
---
sys/compat/linprocfs/linprocfs.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index f930c1d71987..62fa797ae875 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -1978,6 +1978,21 @@ linprocfs_do_oom_score_adj(PFS_FILL_ARGS)
return (0);
}
+/*
+ * Filler function for proc/sys/vm/max_map_count
+ *
+ * Maximum number of active map areas, on Linux this limits the number
+ * of vmaps per mm struct. We don't limit mappings, return a suitable
+ * large value.
+ */
+static int
+linprocfs_domax_map_cnt(PFS_FILL_ARGS)
+{
+
+ sbuf_printf(sb, "%d\n", INT32_MAX);
+ return (0);
+}
+
/*
* Constructor
*/
@@ -2122,6 +2137,8 @@ linprocfs_init(PFS_INIT_ARGS)
dir = pfs_create_dir(sys, "vm", NULL, NULL, NULL, 0);
pfs_create_file(dir, "min_free_kbytes", &linprocfs_dominfree,
NULL, NULL, NULL, PFS_RD);
+ pfs_create_file(dir, "max_map_count", &linprocfs_domax_map_cnt,
+ NULL, NULL, NULL, PFS_RD);
return (0);
}