linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: 'Andrew Morton' <akpm@osdl.org>, Wolfgang Wander <wwc@rentec.com>
Cc: herve@elma.fr, mingo@elte.hu, arjanv@redhat.com, linux-mm@kvack.org
Subject: RE: [PATCH] Avoiding mmap fragmentation - clean rev
Date: Thu, 19 May 2005 19:02:15 -0700	[thread overview]
Message-ID: <200505200202.j4K22Fg06686@unix-os.sc.intel.com> (raw)
In-Reply-To: <20050519155441.7a8e94f9.akpm@osdl.org>

Andrew Morton wrote on Thursday, May 19, 2005 3:55 PM
> Wolfgang Wander <wwc@rentec.com> wrote:
> >
> > Clearly one has to weight the performance issues against the memory
> >  efficiency but since we demonstratibly throw away 25% (or 1GB) of the
> >  available address space in the various accumulated holes a long
> >  running application can generate
> 
> That sounds pretty bad.
> 
> > I hope that for the time being we can
> >  stick with my first solution,
> 
> I'm inclined to do this.

Oh well, I guess we have to take a performance hit here in favor of
functionality.  Though this is a problem specific to 32-bit address
space, please don't unnecessarily penalize 64-bit arch.  If Andrew is
going to take Wolfgang's patch, then we should minimally take the
following patch.  This patch revert changes made in arch/ia64 and make
x86_64 to use alternate cache algorithm for 32-bit app.


Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>

--- linux-2.6.11/arch/ia64/kernel/sys_ia64.c.orig	2005-05-19 18:35:31.468087777 -0700
+++ linux-2.6.11/arch/ia64/kernel/sys_ia64.c	2005-05-19 18:35:46.521798000 -0700
@@ -38,14 +38,8 @@ arch_get_unmapped_area (struct file *fil
 	if (REGION_NUMBER(addr) == REGION_HPAGE)
 		addr = 0;
 #endif
-	if (!addr) {
-	        if (len > mm->cached_hole_size) {
-		        addr = mm->free_area_cache;
-		} else {
-		        addr = TASK_UNMAPPED_BASE;
-			mm->cached_hole_size = 0;
-		}
-	}
+	if (!addr)
+		addr = mm->free_area_cache;
 
 	if (map_shared && (TASK_SIZE > 0xfffffffful))
 		/*
@@ -65,7 +59,6 @@ arch_get_unmapped_area (struct file *fil
 			if (start_addr != TASK_UNMAPPED_BASE) {
 				/* Start a new search --- just in case we missed some holes.  */
 				addr = TASK_UNMAPPED_BASE;
-				mm->cached_hole_size = 0;
 				goto full_search;
 			}
 			return -ENOMEM;
@@ -75,8 +68,6 @@ arch_get_unmapped_area (struct file *fil
 			mm->free_area_cache = addr + len;
 			return addr;
 		}
-		if (addr + mm->cached_hole_size < vma->vm_start)
-		        mm->cached_hole_size = vma->vm_start - addr;
 		addr = (vma->vm_end + align_mask) & ~align_mask;
 	}
 }
--- linux-2.6.11/arch/x86_64/kernel/sys_x86_64.c.orig	2005-05-19 18:37:32.202461298 -0700
+++ linux-2.6.11/arch/x86_64/kernel/sys_x86_64.c	2005-05-19 18:39:03.110663309 -0700
@@ -111,7 +111,7 @@ arch_get_unmapped_area(struct file *filp
 		    (!vma || addr + len <= vma->vm_start))
 			return addr;
 	}
-	if (len <= mm->cached_hole_size) {
+	if (if begin != TASK_UNMAPPED_64 && len <= mm->cached_hole_size) {
 	        mm->cached_hole_size = 0;
 		mm->free_area_cache = begin;
 	}


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2005-05-20  2:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E4BA51C8E4E9634993418831223F0A49291F06E1@scsmsx401.amr.corp.intel.com>
2005-05-17 22:28 ` Chen, Kenneth W
2005-05-18  7:28   ` Arjan van de Ven
2005-05-18  7:43     ` Ingo Molnar
2005-05-18  7:37   ` Ingo Molnar
2005-05-18 13:05   ` Wolfgang Wander
2005-05-18 15:47   ` Wolfgang Wander
2005-05-18 16:18     ` Chen, Kenneth W
2005-05-18 17:16       ` Wolfgang Wander
2005-05-18 17:57         ` Chen, Kenneth W
2005-05-19 18:38           ` Wolfgang Wander
2005-05-19 22:54             ` Andrew Morton
2005-05-20  2:02               ` Chen, Kenneth W [this message]
2005-05-20 23:51               ` Chen, Kenneth W
2005-05-23 18:25                 ` Wolfgang Wander
2005-05-26 17:32                 ` Wolfgang Wander
2005-05-26 17:44                   ` Chen, Kenneth W
2005-05-20  3:10             ` Chen, Kenneth W
2005-05-20 12:39               ` Wolfgang Wander
2005-05-20  2:14 Chen, Kenneth W
2005-05-20 12:47 ` Wolfgang Wander
2005-05-25  7:30 linux
2005-05-27 16:37 Chen, Kenneth W

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=200505200202.j4K22Fg06686@unix-os.sc.intel.com \
    --to=kenneth.w.chen@intel.com \
    --cc=akpm@osdl.org \
    --cc=arjanv@redhat.com \
    --cc=herve@elma.fr \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=wwc@rentec.com \
    /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