From: Eric Dumazet <dada1@cosmosbay.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] NR_OPEN should be raised a litle bit
Date: Sat, 17 Nov 2007 10:15:36 +0100 [thread overview]
Message-ID: <473EB138.80603@cosmosbay.com> (raw)
In-Reply-To: <20071116234902.75fdef5c@the-village.bc.nu>
Alan Cox a écrit :
> On Fri, 16 Nov 2007 22:53:08 +0100
> Eric Dumazet <dada1@cosmosbay.com> wrote:
>
>> Time has come to change NR_OPEN value, some production servers hit the
>> not so 'ridiculously high value' of 1024*1024 file descriptors per process.
>
> Why fiddle with the kernel defaults when every distribution can manage
> this in user space - including picking defaults by memory size or
> platform ?
Please note I am not speaking about the standard 1024 filedescriptors limit,
but the hardcoded 1024*1024 one.
Tell me more how a user space can overcome this limit ?
Dynamically patching kernel text ?
static struct fdtable * alloc_fdtable(unsigned int nr)
{
...
nr /= (1024 / sizeof(struct file *));
nr = roundup_pow_of_two(nr + 1);
nr *= (1024 / sizeof(struct file *));
if (nr > NR_OPEN)
nr = NR_OPEN;
and :
int expand_files(struct files_struct *files, int nr)
{
struct fdtable *fdt;
fdt = files_fdtable(files);
/* Do we need to expand? */
if (nr < fdt->max_fds)
return 0;
/* Can we expand? */
if (nr >= NR_OPEN)
return -EMFILE;
prev parent reply other threads:[~2007-11-17 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-16 21:53 [PATCH] NR_OPEN should be raised a litle bit Eric Dumazet
2007-11-16 23:49 ` Alan Cox
2007-11-17 9:15 ` Eric Dumazet [this message]
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=473EB138.80603@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.