From 56d93842e4840f371cb9acc8e5a628496b615a96 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 31 Mar 2004 21:51:54 -0800 Subject: [PATCH] Replace MAX_MAP_COUNT with /proc/sys/vm/max_map_count From: David Mosberger Below is a warmed up version of a patch originally done by Werner Almesberger (see http://tinyurl.com/25zra) to replace the MAX_MAP_COUNT limit with a sysctl variable. I thought this had gone into the tree a long time ago but alas it has not and as luck would have it, the hard limit bit someone today once again with a large app on a large machine. Here is a small test app: --- include/linux/sched.h | 4 +++- include/linux/sysctl.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/sched.h b/include/linux/sched.h index eb5bc2f12788..f5fa0c07a7f8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -179,7 +179,9 @@ asmlinkage void schedule(void); struct namespace; /* Maximum number of active map areas.. This is a random (large) number */ -#define MAX_MAP_COUNT (65536) +#define DEFAULT_MAX_MAP_COUNT 65536 + +extern int sysctl_max_map_count; #include diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index dbd57168ac61..3767428df94d 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -158,6 +158,7 @@ enum VM_SWAPPINESS=19, /* Tendency to steal mapped memory */ VM_LOWER_ZONE_PROTECTION=20,/* Amount of protection of lower zones */ VM_MIN_FREE_KBYTES=21, /* Minimum free kilobytes to maintain */ + VM_MAX_MAP_COUNT=22, /* int: Maximum number of mmaps/address-space */ }; -- cgit v1.2.3