mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: "'Roland Dreier'" <rdreier@cisco.com>, <hawkes@sgi.com>
Cc: "Andrew Morton" <akpm@osdl.org>, <linux-kernel@vger.kernel.org>,
	"Jack Steiner" <steiner@sgi.com>, "Jes Sorensen" <jes@sgi.com>
Subject: RE: [PATCH] fix alloc_large_system_hash roundup
Date: Wed, 15 Mar 2006 10:29:00 -0800	[thread overview]
Message-ID: <200603151828.k2FISxg19755@unix-os.sc.intel.com> (raw)
In-Reply-To: <adazmjr38t7.fsf@cisco.com>

Roland Dreier wrote on Wednesday, March 15, 2006 9:41 AM
> >  	/* rounded up to nearest power of 2 in size */
> > -	numentries = 1UL << (long_log2(numentries) + 1);
> > +	numentries = 1UL << (long_log2(2*numentries - 1));
> 
> How about just using roundup_pow_of_two()?  You could kill the comment
> too then.

roundup_pow_of_two uses fls, but fls takes an "int" argument.  I think
that function is buggy on 64-bit arch. Is it an oversight or something?


static inline unsigned long roundup_pow_of_two(unsigned long x)
{
        return (1UL << fls(x - 1));
}

- Ken


  reply	other threads:[~2006-03-15 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-15 17:36 hawkes
2006-03-15 17:40 ` Roland Dreier
2006-03-15 18:29   ` Chen, Kenneth W [this message]
2006-03-15 18:41     ` Roland Dreier

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=200603151828.k2FISxg19755@unix-os.sc.intel.com \
    --to=kenneth.w.chen@intel.com \
    --cc=akpm@osdl.org \
    --cc=hawkes@sgi.com \
    --cc=jes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdreier@cisco.com \
    --cc=steiner@sgi.com \
    /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

all inboxes | Powered by JetHome®