lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090513124805.9c70c43c.akpm@linux-foundation.org>
Date:	Wed, 13 May 2009 12:48:05 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Mel Gorman <mel@....ul.ie>
Cc:	linux@....linux.org.uk, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, hartleys@...ionengravers.com,
	mcrapet@...il.com, fred99@...olina.rr.com,
	linux-arm-kernel@...ts.arm.linux.org.uk
Subject: Re: [PATCH] Double check memmap is actually valid with a memmap has
 unexpected holes V2

On Wed, 13 May 2009 17:34:48 +0100
Mel Gorman <mel@....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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ