From: Andrew Morton <akpm@linux-foundation.org>
To: Mel Gorman <mel@csn.ul.ie>
Cc: linux@arm.linux.org.uk, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, hartleys@visionengravers.com,
mcrapet@gmail.com, fred99@carolina.rr.com,
linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: [PATCH] Double check memmap is actually valid with a memmap has unexpected holes V2
Date: Wed, 13 May 2009 12:48:05 -0700 [thread overview]
Message-ID: <20090513124805.9c70c43c.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090513163448.GA18006@csn.ul.ie>
On Wed, 13 May 2009 17:34:48 +0100
Mel Gorman <mel@csn.ul.ie> wrote:
> pfn_valid() is meant to be able to tell if a given PFN has valid memmap
> associated with it or not. In FLATMEM, it is expected that holes always
> have valid memmap as long as there is valid PFNs either side of the hole.
> In SPARSEMEM, it is assumed that a valid section has a memmap for the
> entire section.
>
> However, ARM and maybe other embedded architectures in the future free
> memmap backing holes to save memory on the assumption the memmap is never
> used. The page_zone linkages are then broken even though pfn_valid()
> returns true. A walker of the full memmap must then do this additional
> check to ensure the memmap they are looking at is sane by making sure the
> zone and PFN linkages are still valid. This is expensive, but walkers of
> the full memmap are extremely rare.
>
> This was caught before for FLATMEM and hacked around but it hits again for
> SPARSEMEM because the page_zone linkages can look ok where the PFN linkages
> are totally screwed. This looks like a hatchet job but the reality is that
> any clean solution would end up consumning all the memory saved by punching
> these unexpected holes in the memmap. For example, we tried marking the
> memmap within the section invalid but the section size exceeds the size of
> the hole in most cases so pfn_valid() starts returning false where valid
> memmap exists. Shrinking the size of the section would increase memory
> consumption offsetting the gains.
>
> This patch identifies when an architecture is punching unexpected holes
> in the memmap that the memory model cannot automatically detect and sets
> ARCH_HAS_HOLES_MEMORYMODEL. At the moment, this is restricted to EP93xx
> which is the model sub-architecture this has been reported on but may expand
> later. When set, walkers of the full memmap must call memmap_valid_within()
> for each PFN and passing in what it expects the page and zone to be for
> that PFN. If it finds the linkages to be broken, it assumes the memmap is
> invalid for that PFN.
It's unclear to me whether this patch is needed in 2.6.30 or even
2.6.29 or whatever.
It applies OK to 2.6.28, 2.6.29, current mainline and mmotm, so I'll
just sit tight until I'm told what to do.
--
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:[~2009-05-13 19:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-05 8:29 [PATCH] Double check memmap is actually valid with a memmap has unexpected holes Mel Gorman
2009-05-05 8:36 ` Russell King - ARM Linux
2009-05-05 8:49 ` Mel Gorman
2009-05-13 16:34 ` [PATCH] Double check memmap is actually valid with a memmap has unexpected holes V2 Mel Gorman
2009-05-13 19:48 ` Andrew Morton [this message]
2009-05-14 8:39 ` Mel Gorman
2009-05-17 16:27 ` Russell King - ARM Linux
2009-05-05 11:06 ` [PATCH] Double check memmap is actually valid with a memmap has unexpected holes Johannes Weiner
2009-05-06 14:31 ` Mel Gorman
2009-05-06 15:50 ` Johannes Weiner
2009-05-07 5:29 ` Yasunori Goto
2009-05-14 17:02 ` Paul Mundt
2009-05-06 19:20 ` Russell King - ARM Linux
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=20090513124805.9c70c43c.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=fred99@carolina.rr.com \
--cc=hartleys@visionengravers.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@arm.linux.org.uk \
--cc=mcrapet@gmail.com \
--cc=mel@csn.ul.ie \
/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).