From: Wolfgang Wander <wwc@rentec.com>
To: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
Cc: "'Wolfgang Wander'" <wwc@rentec.com>,
"Hervé Piedvache" <herve@elma.fr>,
"'Andrew Morton'" <akpm@osdl.org>,
mingo@elte.hu, arjanv@redhat.com, linux-mm@kvack.org
Subject: RE: [PATCH] Avoiding mmap fragmentation - clean rev
Date: Fri, 20 May 2005 08:39:14 -0400 [thread overview]
Message-ID: <17037.55922.293504.352477@gargle.gargle.HOWL> (raw)
In-Reply-To: <200505200310.j4K3Aqg07353@unix-os.sc.intel.com>
Chen, Kenneth W writes:
> While working on porting the munmap free area coalescing patch on top of
> 2.6.12-rc4-mm2 Kernel, this change from wolfgang looked very strange:
>
> > @@ -1209,8 +1218,14 @@ void arch_unmap_area(struct vm_area_stru
> > * Is this a new hole at the lowest possible address?
> > */
> > if (area->vm_start >= TASK_UNMAPPED_BASE &&
> > - area->vm_start < area->vm_mm->free_area_cache)
> > - area->vm_mm->free_area_cache = area->vm_start;
> > + area->vm_start < area->vm_mm->free_area_cache) {
> > + unsigned area_size = area->vm_end-area->vm_start;
> > +
> > + if (area->vm_mm->cached_hole_size < area_size)
> > + area->vm_mm->cached_hole_size = area_size;
> > + else
> > + area->vm_mm->cached_hole_size = ~0UL;
> > + }
> > }
>
>
> First, free_area_cache won't get moved on munmap. OK fine. Secondly,
> if area that we just unmapped is smaller than cached_hole_size, instead
> of doing nothing (the condition of largest know hole size below current
> cache pointer still holds at this time), the new code will reset hole
> size to ~0UL, which will trigger a full scan next time for any mmap
> request.
>
> Wolfgang, did you tweak this area? Or this is just a simple typo or
> something? AFAWICS, this patch will trigger a lot more innocent full scan
> than what people claim it is.
Thanks for checking Ken. I believe that this logic becomes mostly
obsolete with your munmap patch anyhow.
You are perfectly right that the reset to ~0UL is not strictly
required however since the munmapped area can be joined with
neightborings hole to form something larger (which size *I* cannot
determine at this time) I wanted to be better safe and restart any
search request from base.
If the unmapped area sits between base and free_area_cache we
can then increase the cached_hole_size to the area_size if it
is indeed larger than the current cached_hole_size.
In both cases it would be nice to just calculate the real cached
hole size with some vma_find calls instead...
Wolfgang
--
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>
next prev parent reply other threads:[~2005-05-20 12:39 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
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 [this message]
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=17037.55922.293504.352477@gargle.gargle.HOWL \
--to=wwc@rentec.com \
--cc=akpm@osdl.org \
--cc=arjanv@redhat.com \
--cc=herve@elma.fr \
--cc=kenneth.w.chen@intel.com \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
/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