lkml.org 
[lkml]   [2007]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] NR_OPEN should be raised a litle bit
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;



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-17 10:19    [W:0.046 / U:1.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site