Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: move max_map_count bits into mm.h

max_map_count sysctl unrelated to scheduler. Move its bits from
include/linux/sched/sysctl.h to include/linux/mm.h.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrey Ryabinin and committed by
Linus Torvalds
ea606cf5 f9719a03

+21 -24
+21
include/linux/mm.h
··· 82 82 #define mm_forbids_zeropage(X) (0) 83 83 #endif 84 84 85 + /* 86 + * Default maximum number of active map areas, this limits the number of vmas 87 + * per mm struct. Users can overwrite this number by sysctl but there is a 88 + * problem. 89 + * 90 + * When a program's coredump is generated as ELF format, a section is created 91 + * per a vma. In ELF, the number of sections is represented in unsigned short. 92 + * This means the number of sections should be smaller than 65535 at coredump. 93 + * Because the kernel adds some informative sections to a image of program at 94 + * generating coredump, we need some margin. The number of extra sections is 95 + * 1-3 now and depends on arch. We use "5" as safe margin, here. 96 + * 97 + * ELF extended numbering allows more than 65535 sections, so 16-bit bound is 98 + * not a hard limit any more. Although some userspace tools can be surprised by 99 + * that. 100 + */ 101 + #define MAPCOUNT_ELF_CORE_MARGIN (5) 102 + #define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN) 103 + 104 + extern int sysctl_max_map_count; 105 + 85 106 extern unsigned long sysctl_user_reserve_kbytes; 86 107 extern unsigned long sysctl_admin_reserve_kbytes; 87 108
-21
include/linux/sched/sysctl.h
··· 14 14 enum { sysctl_hung_task_timeout_secs = 0 }; 15 15 #endif 16 16 17 - /* 18 - * Default maximum number of active map areas, this limits the number of vmas 19 - * per mm struct. Users can overwrite this number by sysctl but there is a 20 - * problem. 21 - * 22 - * When a program's coredump is generated as ELF format, a section is created 23 - * per a vma. In ELF, the number of sections is represented in unsigned short. 24 - * This means the number of sections should be smaller than 65535 at coredump. 25 - * Because the kernel adds some informative sections to a image of program at 26 - * generating coredump, we need some margin. The number of extra sections is 27 - * 1-3 now and depends on arch. We use "5" as safe margin, here. 28 - * 29 - * ELF extended numbering allows more than 65535 sections, so 16-bit bound is 30 - * not a hard limit any more. Although some userspace tools can be surprised by 31 - * that. 32 - */ 33 - #define MAPCOUNT_ELF_CORE_MARGIN (5) 34 - #define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN) 35 - 36 - extern int sysctl_max_map_count; 37 - 38 17 extern unsigned int sysctl_sched_latency; 39 18 extern unsigned int sysctl_sched_min_granularity; 40 19 extern unsigned int sysctl_sched_wakeup_granularity;
-1
mm/mmap.c
··· 37 37 #include <linux/khugepaged.h> 38 38 #include <linux/uprobes.h> 39 39 #include <linux/rbtree_augmented.h> 40 - #include <linux/sched/sysctl.h> 41 40 #include <linux/notifier.h> 42 41 #include <linux/memory.h> 43 42 #include <linux/printk.h>
-1
mm/mremap.c
··· 20 20 #include <linux/security.h> 21 21 #include <linux/syscalls.h> 22 22 #include <linux/mmu_notifier.h> 23 - #include <linux/sched/sysctl.h> 24 23 #include <linux/uaccess.h> 25 24 #include <linux/mm-arch-hooks.h> 26 25
-1
mm/nommu.c
··· 33 33 #include <linux/security.h> 34 34 #include <linux/syscalls.h> 35 35 #include <linux/audit.h> 36 - #include <linux/sched/sysctl.h> 37 36 #include <linux/printk.h> 38 37 39 38 #include <asm/uaccess.h>