Subject: Re: [PATCH] pseries: phyp dump: Variable size reserve space.

From: Olof Johansson <[email-masked]>
Date: Wed, 9 Apr 2008 13:30:32 -0500

On Wed, Apr 09, 2008 at 12:37:51PM -0500, Manish Ahuja wrote:
> Olof Johansson wrote:
> >> +static inline unsigned long phyp_dump_calculate_reserve_size(void)
> >> +{
> >> +	unsigned long tmp;
> >> +
> >> +	if (phyp_dump_info->phyp_dump_reserve_bootvar)
> >> +		return phyp_dump_info->phyp_dump_reserve_bootvar;
> >> +
> >> +	/* divide by 20 to get 5% of value */
> >> +	tmp = lmb_end_of_DRAM();
> >> +	do_div(tmp, 20);
> >> +
> >> +	/* round it down in multiples of 256 */
> >> +	tmp = tmp & ~0x000000001FFFFFFF;
> > 
> > That's 512MB, isn't it?
> 
> My calculations in the example I gave in the last email were wrong.
> 
> In mentally did 10% instead of 5%. But the premise is same.
> 
> So assuming 5% of some memory is 400 MB, it rounds it down to 256MB etc.

But 0x1fffffff is 512MB, not 256MB. So you're rounding it down to a
multiple of 512MB.

-Olof