From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Christoph Lameter <cl@linux-foundation.org>
Cc: Minchan Kim <minchan.kim@gmail.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Milton Miller <miltonm@bga.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mel@csn.ul.ie>, Johannes Weiner <hannes@cmpxchg.org>,
Kukjin Kim <kgene.kim@samsung.com>
Subject: Re: [PATCH] Tight check of pfn_valid on sparsemem - v4
Date: Thu, 29 Jul 2010 19:33:20 +0100 [thread overview]
Message-ID: <20100729183320.GH18923@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <alpine.DEB.2.00.1007291222410.17734@router.home>
On Thu, Jul 29, 2010 at 12:30:23PM -0500, Christoph Lameter wrote:
> On Fri, 30 Jul 2010, Minchan Kim wrote:
>
> > But Russell doesn't want it.
> > Please, look at the discussion.
> >
> > http://www.spinics.net/lists/arm-kernel/msg93026.html
> >
> > In fact, we didn't determine the approache at that time.
> > But I think we can't give up ARM's usecase although sparse model
> > dosn't be desinged to the such granularity. and I think this approach
>
> The sparse model goes down to page size memmap granularity. The problem
> that you may have is with aligning the maximum allocation unit of the
> page allocator with the section size of sparsemem. If you reduce your
> maximum allocation units then you can get more granularity.
Then why is there no advantage to adding 512kB memory modules in a machine
with memory spaced at 64MB apart with sparsemem - the mem_map array for
each sparsemem section is 512kB in size. So the additional 512kB memory
modules give you nothing because they're completely full of mem_map array.
_That's_ the kind of problem that makes sparsemem unsuitable for... sparse
memory layouts found in the embedded world.
And that also makes flatmem unsuitable for use on ARM when you have such
memory layouts - four banks of discrete memory spaced at 64MB over a 256MB
range, which can have a size down to 512kB each.
And no, setting the sparse section size to 512kB doesn't work - memory is
offset by 256MB already, so you need a sparsemem section array of 1024
entries just to cover that - with the full 256MB populated, that's 512
unused entries followed by 512 used entries. That too is going to waste
memory like nobodies business.
Basically, what's come out of this discussion is that the kernel really
_sucks_ when it comes to handling sparse memory layouts found in on ARM.
> > can solve ARM's FLATMEM's pfn_valid problem which is doing binar search.
>
> OMG.
No, it is NOT that expensive. Most people go "omg, binary search on
a cached architecture, that's insane". That statement is soo far from
reality that the statement itself is insane.
The binary search operates on a very small amount of data, and results
in two or possibly three cache lines at the most being loaded, assuming
a full 8 banks of memory information passed. Most systems pass one or
maybe two banks - so the _entire_ thing fits within one cache line - a
cache line which will have already been loaded.
So no, this binary search is not as expensive as you think it is.
--
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>
next prev parent reply other threads:[~2010-07-29 18:33 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-26 15:46 [PATCH] Tight check of pfn_valid on sparsemem - v4 Minchan Kim
2010-07-26 16:40 ` Christoph Lameter
2010-07-26 22:47 ` Minchan Kim
[not found] ` <pfn.valid.v4.reply.1@mdm.bga.com>
[not found] ` <AANLkTimtTVvorrR9pDVTyPKj0HbYOYY3aR7B-QWGhTei@mail.gmail.com>
2010-07-27 8:12 ` Milton Miller
2010-07-27 8:13 ` KAMEZAWA Hiroyuki
2010-07-27 10:01 ` Minchan Kim
2010-07-27 14:34 ` Christoph Lameter
2010-07-27 22:33 ` Minchan Kim
2010-07-28 15:14 ` Christoph Lameter
2010-07-28 15:56 ` Minchan Kim
2010-07-28 17:02 ` Christoph Lameter
2010-07-28 22:57 ` Minchan Kim
2010-07-29 15:46 ` Christoph Lameter
2010-07-29 16:18 ` Minchan Kim
2010-07-29 16:47 ` Christoph Lameter
2010-07-29 17:03 ` Minchan Kim
2010-07-29 17:30 ` Christoph Lameter
2010-07-29 18:33 ` Russell King - ARM Linux [this message]
2010-07-29 19:55 ` Christoph Lameter
2010-07-29 21:13 ` Russell King - ARM Linux
2010-07-29 20:55 ` Dave Hansen
2010-07-29 22:14 ` Russell King - ARM Linux
2010-07-29 22:28 ` Christoph Lameter
2010-07-30 0:38 ` Dave Hansen
2010-07-30 9:43 ` Minchan Kim
2010-07-30 12:48 ` Christoph Lameter
2010-07-30 15:43 ` Dave Hansen
2010-07-31 15:30 ` Russell King - ARM Linux
2010-08-02 15:48 ` Christoph Lameter
2010-07-30 9:32 ` Minchan Kim
2010-07-31 10:38 ` Russell King - ARM Linux
2010-08-11 15:31 ` Dave Hansen
2010-07-27 9:56 ` Minchan Kim
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=20100729183320.GH18923@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kgene.kim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=miltonm@bga.com \
--cc=minchan.kim@gmail.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;
as well as URLs for NNTP newsgroup(s).