public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Value of TASK_UNMAPPED_SIZE on 2.4
@ 2000-11-04  1:09 Julian Anastasov
  2000-11-04  0:51 ` Andrea Arcangeli
  0 siblings, 1 reply; 10+ messages in thread
From: Julian Anastasov @ 2000-11-04  1:09 UTC (permalink / raw)
  To: Josue Emmanuel Amaro; +Cc: Andrea Arcangeli, linux-kernel

[-- 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) {

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Value of TASK_UNMAPPED_SIZE on 2.4
@ 2000-11-03 19:15 Josue Emmanuel Amaro
  2000-11-03 19:37 ` Andrea Arcangeli
  2000-11-04  7:39 ` Josue Emmanuel Amaro
  0 siblings, 2 replies; 10+ messages in thread
From: Josue Emmanuel Amaro @ 2000-11-03 19:15 UTC (permalink / raw)
  To: Linux-Kernel

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

All,

TASK_UNMAPPED_SIZE is defined in include/asm-i386/processor.h as:

#define TASK_UNMAPPED_SIZE    (TASK_SIZE / 3)

The value of TASK_SIZE is defined as PAGE_OFFSET which is set to 0xC0000000
(page.h).  This works out to be a value of 0x4000000.

The question is:
Are there any negative side effects in defining TASK_UNMAPPED_SIZE to 0x1000000?

By doing this we allow a process to access more memory.  On Oracle it allows us
to grow our buffer size from 1.7 GB to 2.4 GB improving overall performance by
reducing I/O.

Thanks in advance,

--
=======================================================================
  Josue Emmanuel Amaro                         Josue.Amaro@oracle.com
  Linux Products Manager                       Phone:   650.506.1239
  Intel and Linux Technologies Group           Fax:     650.413.0167
=======================================================================


[-- Attachment #2: Card for Josue Emmanuel Amaro --]
[-- Type: text/x-vcard, Size: 390 bytes --]

begin:vcard 
n:Amaro;Josue Emmanuel
tel;cell:650-245-5131
tel;fax:650-413-0167
tel;work:650-506-1239
x-mozilla-html:FALSE
url:http://www.oracle.com
org:Intel and Linux Technologies
version:2.1
email;internet:Josue.Amaro@oracle.com
title:Sr.Product Manager - Linux
adr;quoted-printable:;;500 Oracle Parkway=0D=0AMS1ip4;Redwood Shores;CA;94065;United States
fn:Josue Emmanuel Amaro
end:vcard

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2000-11-20  2:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.d4dt9vv.1gm6abv@ifi.uio.no>
     [not found] ` <fa.ebii26v.1mgevrq@ifi.uio.no>
2000-11-03 20:27   ` Value of TASK_UNMAPPED_SIZE on 2.4 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
2000-11-04  1:09 Julian Anastasov
2000-11-04  0:51 ` Andrea Arcangeli
2000-11-04 10:37   ` Julian Anastasov
  -- 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox