public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom•net>
To: Manish Ahuja <ahuja@austin•ibm.com>
Cc: mahuja@us•ibm.com, linuxppc-dev@ozlabs•org,
	linasvepstas@gmail•com, paulus@samba•org
Subject: Re: [PATCH] pseries: phyp dump: Variable size reserve space.
Date: Wed, 9 Apr 2008 13:30:32 -0500	[thread overview]
Message-ID: <20080409183032.GA2360@lixom.net> (raw)
In-Reply-To: <47FCFEEF.6020607@austin.ibm.com>

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

  reply	other threads:[~2008-04-09 18:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-07 23:45 [PATCH] pseries: phyp dump: Variable size reserve space Manish Ahuja
2008-04-08  2:43 ` Olof Johansson
2008-04-09 17:32   ` Manish Ahuja
2008-04-09 19:39     ` Segher Boessenkool
2008-04-10  1:36       ` Paul Mackerras
2008-04-10  3:10         ` Segher Boessenkool
2008-04-09 17:37   ` Manish Ahuja
2008-04-09 18:30     ` Olof Johansson [this message]
2008-04-09 18:43       ` Manish Ahuja
2008-04-09 18:59         ` Olof Johansson
2008-04-11 23:31 ` Manish Ahuja
2008-04-15  6:24   ` Paul Mackerras
2008-04-15 22:56     ` Manish Ahuja
2008-04-16 19:42       ` Joel Schopp
2008-04-16 20:22 ` Linas Vepstas
2008-04-18 19:08   ` Manish Ahuja

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=20080409183032.GA2360@lixom.net \
    --to=olof@lixom$(echo .)net \
    --cc=ahuja@austin$(echo .)ibm.com \
    --cc=linasvepstas@gmail$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=mahuja@us$(echo .)ibm.com \
    --cc=paulus@samba$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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