bug in lmb_enforce_memory_limit()

Michael Ellerman michael at ellerman.id.au
Sat Aug 16 10:46:22 EST 2008


On Fri, 2008-08-15 at 15:25 -0700, David Miller wrote:
> From: Michael Ellerman <michael at ellerman.id.au>
> Date: Thu, 14 Aug 2008 21:26:53 +1000
> 
> > Perhaps after the first loop we should set memory_limit to equal
> > lmb_end_of_DRAM(), then the second loop should work as it is.
> 
> Sounds great.  Mind if I push the following to Linus?

Looks good to me.

I'll test it on Monday. I don't know if I have a system with memory
holes to test on, but I take it you do?

I notice some of our 32-bit code is using lmb_enforce_memory_limit() to
enforce an address limit, which is technically broken, but is probably
fine because it doesn't need to worry about holes.


> lmb: Fix reserved region handling in lmb_enforce_memory_limit().
> 
> The idea of the implementation of this fix is from Michael Ellerman.
> 
> This function has two loops, but they each interpret the memory_limit
> value differently.  The first loop interprets it as a "size limit"
> whereas the second loop interprets it as an "address limit".
> 
> Before the second loop runs, reset memory_limit to lmb_end_of_DRAM()
> so that it all works out.
> 
> Signed-off-by: David S. Miller <davem at davemloft.net>

Acked-by: Michael Ellerman <michael at ellerman.id.au>

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080816/601bbf45/attachment.pgp>


More information about the Linuxppc-dev mailing list