From: Eric Dumazet <dada1@cosmosbay.com>
To: Vadim Lobanov <vlobanov@speakeasy.net>
Cc: Kirill Korotaev <dev@openvz.org>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, devel@openvz.org,
kuznet@ms2.inr.ac.ru
Subject: Re: [PATCH] fdset's leakage
Date: Tue, 11 Jul 2006 19:26:36 +0200 [thread overview]
Message-ID: <200607111926.36388.dada1@cosmosbay.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0607110912490.16191@shell3.speakeasy.net>
On Tuesday 11 July 2006 18:13, Vadim Lobanov wrote:
> > unsinged long round_up_pow_of_two(unsigned long x)
> > {
> > unsigned long res = 1 << BITS_PER_LONG;
>
> You'll get a zero here. Should be 1 << (BITS_PER_LONG - 1).
>
Nope. It wont work on 64 bits platform :)
You want 1UL << (BITS_PER_LONG - 1).
But the roundup_pow_of_two() function is already defined in
include/linux/kernel.h and uses fls_long()
Eric
next prev parent reply other threads:[~2006-07-11 17:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-10 13:40 Kirill Korotaev
2006-07-11 8:01 ` Andrew Morton
2006-07-11 9:02 ` Rene Scharfe
2006-07-11 9:05 ` Kirill Korotaev
2006-07-11 9:28 ` Andrew Morton
2006-07-11 16:13 ` Vadim Lobanov
2006-07-11 17:26 ` Eric Dumazet [this message]
2006-07-12 10:49 ` Kirill Korotaev
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=200607111926.36388.dada1@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=akpm@osdl.org \
--cc=dev@openvz.org \
--cc=devel@openvz.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=vlobanov@speakeasy.net \
/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
Powered by JetHome