From 910bd8c627ea16ea9bcf70c153197aaba473b6b9 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Sun, 28 Apr 2024 09:06:54 +0000 Subject: [PATCH 12/18] XANMOD: mm: Raise max_map_count default value Signed-off-by: Alexandre Frade --- Documentation/admin-guide/sysctl/vm.rst | 2 +- include/linux/mm.h | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) --- a/Documentation/admin-guide/sysctl/vm.rst +++ b/Documentation/admin-guide/sysctl/vm.rst @@ -461,7 +461,7 @@ While most applications need less than a programs, particularly malloc debuggers, may consume lots of them, e.g., up to one or two maps per allocation. -The default value is 65530. +The XanMod default value is 2147483642. mem_profiling --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -191,17 +191,18 @@ static inline void __mm_zero_struct_page * * When a program's coredump is generated as ELF format, a section is created * per a vma. In ELF, the number of sections is represented in unsigned short. - * This means the number of sections should be smaller than 65535 at coredump. + * This means the number of sections should be smaller than 2147483647 at + * coredump. * Because the kernel adds some informative sections to a image of program at * generating coredump, we need some margin. The number of extra sections is * 1-3 now and depends on arch. We use "5" as safe margin, here. * - * ELF extended numbering allows more than 65535 sections, so 16-bit bound is - * not a hard limit any more. Although some userspace tools can be surprised by - * that. + * ELF extended numbering allows more than 2147483647 sections, so 16-bit bound + * is not a hard limit any more. Although some userspace tools can be surprised + * by that. */ #define MAPCOUNT_ELF_CORE_MARGIN (5) -#define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN) +#define DEFAULT_MAX_MAP_COUNT (INT_MAX - MAPCOUNT_ELF_CORE_MARGIN) extern int sysctl_max_map_count;