From: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, devel@openvz.org,
kuznet@ms2.inr.ac.ru, Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH] fdset's leakage
Date: Tue, 11 Jul 2006 11:02:08 +0200 [thread overview]
Message-ID: <44B36910.3010801@lsrfire.ath.cx> (raw)
In-Reply-To: <20060711010104.16ed5d4b.akpm@osdl.org>
[strange loop snipped]
> That's going to take a long time to compute if nr > NR_OPEN. I just fixed
> a similar infinite loop in this function.
That other fix looks buggy btw. Here it is:
- nfds = 8 * L1_CACHE_BYTES;
- /* Expand to the max in easy steps */
- while (nfds <= nr) {
- nfds = nfds * 2;
- if (nfds > NR_OPEN)
- nfds = NR_OPEN;
- }
+ nfds = max_t(int, 8 * L1_CACHE_BYTES, roundup_pow_of_two(nfds));
+ if (nfds > NR_OPEN)
+ nfds = NR_OPEN;
Surely you meant to say "roundup_pow_of_two(nr + 1)"?
René
next prev parent reply other threads:[~2006-07-11 9:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-10 13:40 [PATCH] fdset's leakage Kirill Korotaev
2006-07-11 8:01 ` Andrew Morton
2006-07-11 9:02 ` Rene Scharfe [this message]
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
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=44B36910.3010801@lsrfire.ath.cx \
--to=rene.scharfe@lsrfire.ath.cx \
--cc=akpm@osdl.org \
--cc=devel@openvz.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/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