From: David Rientjes <rientjes@google.com>
To: David Cohen <dacohen@gmail.com>
Cc: linux-mm@kvack.org
Subject: Re: [RFC] Try pages allocation from higher to lower orders
Date: Mon, 17 Sep 2012 02:12:54 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.00.1209170206300.25095@chino.kir.corp.google.com> (raw)
In-Reply-To: <CAPqfFkCGuoJhkyyAJzxPo0VQJR6t7h1pCacKUa6PDiwWW7j5EA@mail.gmail.com>
On Sun, 9 Sep 2012, David Cohen wrote:
> Requesting pages with order > 0 is faster than requesting a single
> page 20k times if memory isn't fragmented. But in case memory is
> fragmented, at some point order > 0 may not be available and page
> allocation process go through more expensive path, which ends up being
> slower than requesting 20k single pages. I'd like to have a way to
> choose faster option depending on fragmentation scenario.
> Is there currently a reliable solution for this case? Couldn't find one.
> If the answer is really "no", what does it sound like to implement a
> function e.g. alloc_pages_try_orders(mask, min_order, max_order).
I don't think that's generally useful, so it would have to be isolated to
the driver you're working on. But what I would suggest would be to avoid
doing memory compaction and reclaim on higher orders and rather fallback
to allocating smaller and smaller orders first. Try using
fragmentation_index() and determine the optimal order to allocate
depending on the current state of fragmentation; if that's insufficient,
then you'll have to fallback to using memory compaction. You'll want to
compact much more than a single order-9 page allocation, though, so
perhaps explicitly trigger compact_node() beforehand and try to incur the
penalty only once.
--
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:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2012-09-17 9:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-08 22:16 David Cohen
2012-09-17 9:12 ` David Rientjes [this message]
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=alpine.DEB.2.00.1209170206300.25095@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=dacohen@gmail.com \
--cc=linux-mm@kvack.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