From: Julian Anastasov <ja@ssi.bg>
To: Josue Emmanuel Amaro <Josue.Amaro@oracle.com>
Cc: Andrea Arcangeli <andrea@suse.de>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Value of TASK_UNMAPPED_SIZE on 2.4
Date: Sat, 4 Nov 2000 01:09:42 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.04.10011040055420.834-200000@u> (raw)
[-- Attachment #1: Type: TEXT/PLAIN, Size: 548 bytes --]
Hello,
On Fri, 3 Nov 2000, Josue Emmanuel Amaro wrote:
> It would be great if it could be a kernel configuration time option.
Something like the attached old patch for 2.2. It is very
optimistic in using 64MB as min value for TASK_UNMAPPED_BASE while
the real min is above 128MB (where malloc starts). May be needs tuning for
other archs. You still need to select good value for TASK_SIZE/PAGE_OFFSET
at compile time. I run the patch safely with
echo 195887104 > /proc/sys/kernel/task_unmapped_base
Regards
--
Julian Anastasov <ja@ssi.bg>
[-- Attachment #2: /proc/sys/kernel/task_unmapped_base --]
[-- Type: TEXT/PLAIN, Size: 2139 bytes --]
--- linux/include/linux/sysctl.h.orig Fri Dec 17 00:04:36 1999
+++ linux/include/linux/sysctl.h Fri Dec 17 00:22:26 1999
@@ -106,6 +106,7 @@
KERN_SYSRQ=38, /* int: Sysreq enable */
KERN_SHMALL=41, /* int: maximum size of shared memory */
KERN_SPARC_STOP_A=44, /* int: Sparc Stop-A enable */
+ KERN_TASK_UNMAPPED_BASE=45,
};
--- linux/kernel/sysctl.c.orig Fri Dec 17 00:04:36 1999
+++ linux/kernel/sysctl.c Fri Dec 17 00:25:59 1999
@@ -51,6 +51,12 @@
extern int shmall_max;
#endif
+#if defined(CONFIG_2GB) || defined(CONFIG_3GB) || defined(CONFIG_1GB)
+extern int min_task_unmapped_base;
+extern int cur_task_unmapped_base;
+extern int max_task_unmapped_base;
+#endif
+
#ifdef __sparc__
extern char reboot_command [];
extern int stop_a_enabled;
@@ -226,6 +232,11 @@
{KERN_SHMALL, "shmall", &shmall, sizeof (int),
0644, NULL, &proc_dointvec_minmax, &sysctl_intvec,
NULL, &zero_value, &shmall_max},
+#endif
+#if defined(CONFIG_2GB) || defined(CONFIG_3GB) || defined(CONFIG_1GB)
+ {KERN_TASK_UNMAPPED_BASE, "task_unmapped_base", &cur_task_unmapped_base, sizeof (int),
+ 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec,
+ NULL, &min_task_unmapped_base, &max_task_unmapped_base},
#endif
#ifdef CONFIG_MAGIC_SYSRQ
{KERN_SYSRQ, "sysrq", &sysrq_enabled, sizeof (int),
--- linux/mm/mmap.c.orig Fri Dec 17 00:04:36 1999
+++ linux/mm/mmap.c Fri Dec 17 00:28:11 1999
@@ -41,6 +41,12 @@
int sysctl_overcommit_memory;
+#if defined(CONFIG_2GB) || defined(CONFIG_3GB) || defined(CONFIG_1GB)
+int min_task_unmapped_base = 0x04000000;
+int cur_task_unmapped_base = TASK_UNMAPPED_BASE;
+int max_task_unmapped_base = 0x7FC00000;
+#endif
+
/* Check that a process has enough memory to allocate a
* new virtual mapping.
*/
@@ -362,7 +368,11 @@
if (len > TASK_SIZE)
return 0;
if (!addr)
+#if defined(CONFIG_2GB) || defined(CONFIG_3GB) || defined(CONFIG_1GB)
+ addr = (unsigned long) cur_task_unmapped_base;
+#else
addr = TASK_UNMAPPED_BASE;
+#endif
addr = PAGE_ALIGN(addr);
for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {
next reply other threads:[~2000-11-03 23:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-04 1:09 Julian Anastasov [this message]
2000-11-04 0:51 ` Andrea Arcangeli
2000-11-04 10:37 ` Julian Anastasov
[not found] <fa.d4dt9vv.1gm6abv@ifi.uio.no>
[not found] ` <fa.ebii26v.1mgevrq@ifi.uio.no>
2000-11-03 20:27 ` Kai Harrekilde-Petersen
2000-11-03 20:46 ` Andrea Arcangeli
2000-11-03 22:36 ` Josue Emmanuel Amaro
2000-11-20 2:09 ` Andrea Arcangeli
-- strict thread matches above, loose matches on Subject: below --
2000-11-03 19:15 Josue Emmanuel Amaro
2000-11-03 19:37 ` Andrea Arcangeli
2000-11-04 7:39 ` Josue Emmanuel Amaro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.04.10011040055420.834-200000@u \
--to=ja@ssi.bg \
--cc=Josue.Amaro@oracle.com \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®