linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
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: Thu, 19 May 2005 14:38:42 -0400	[thread overview]
Message-ID: <17036.56626.994129.265926@gargle.gargle.HOWL> (raw)
In-Reply-To: <200505181757.j4IHv0g14491@unix-os.sc.intel.com>

Chen, Kenneth W writes:
 > Wolfgang Wander wrote on Wednesday, May 18, 2005 10:16 AM
 > > My goal was to place small requests close to the base while leaving
 > > larger holes open as long as possible and far from the base. 2.4
 > > kernels did this inadvertently by always starting to search from the
 > > base, my patch starts searching from the base (upward or downward)
 > > if the new request is known to fit between base and current cache
 > > pointer, thus it maintains the 2.4 quality of mixing small and large
 > > requests and maintains the huge speedups Ingo introduced with the
 > > cache pointer.
 > 
 > This algorithm tends to penalize small size request and it would do a
 > linear search from the beginning. It would also penalize large size
 > request since cache pointer will be reset to a lower address and making
 > a subsequent large request to search forward.  In your case, since all
 > mappings are anonymous mmap with same page protection, you won't notice
 > performance problem because of coalescing in the mapped area.  But other
 > app like apache web server, which mmap thousands of different files will
 > degrade. The probability of linear search is lot higher with this proposal.
 > The nice thing about the current *broken* cache pointer is that it is
 > almost an O(1) order to fulfill a request since it moves in one direction.
 > The new proposal would reduce that O(1) probability.

I do certainly see that the algorithm isn't perfect in every case
however for the test case Ingo sent me (Ingo, did you verify the
timing?)  my patch performed as well as Ingo's original solution.  I
assume that Ingo's test was requesting same map sizes for every thread
so the results would be a bit biased in my favour... ;-)

That leaves us with two scenarious for a new mmap request:

  * the new request is greater or equal than the cached_hole_size ->
    no change in behaviour
  * otherwise we start the search at a position where we know the
    new request will fit in, this could eventually even be faster
    than the required wrap.

So I don't necessarily see that the probability is reduced in all
circumstances.  Clearly mixed size requests do tend to keep the
free_area_cache pointer low and thus will likely extend the search length.

Are there test cases/benchmarks which would simulate the behaviour of an 
Apache like application under the various schemes?

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 I hope that for the time being we can
stick with my first solution, preferably extended by your munmap fix? 

Please? ;-)

            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>

  reply	other threads:[~2005-05-19 18:38 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 [this message]
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
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=17036.56626.994129.265926@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