Re: [PATCH] get rid of NR_OPEN and introduce a sysctl_nr_open

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Tuesday, November 27, 2007 - 12:58 am

Valdis.Kletnieks@vt.edu a écrit :

vmalloc failures can already happen if you start 32 processes on i386 kernels, 
each of them wanting to open file handle number 600.000 (if their 
RLIMIT_NOFILE >= 600000)

fcntl(0, F_DUPFD, 600000);

We are not going to add warnings about vmalloc on every sysctl around there 
that could allow a root user to exhaust vmalloc space. This is a vmalloc issue 
on 32bit kernel, and quite frankly I never hit this limit.

If you take a look at vmalloc() implementation, fact that it uses a 'struct 
vm_struct *vmlist;' to track all active zones show that vmalloc() is not used 
that much.


NR_OPEN is the max value that RLIMIT_NOFILE can reach, nothing more.

You can set it to 256*1024*1024 or 4*1024 it wont change memory needs on your 
machine, unless you raise RLIMIT_NOFILE and one of your program leaks file 
handles, or really want to open simultaneously many of them.

Most programs wont open more than 500 files, so their file table is allocated 
via kmalloc()

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] get rid of NR_OPEN and introduce a sysctl_nr_open, Eric Dumazet, (Tue Nov 27, 12:09 am)
Re: [PATCH] get rid of NR_OPEN and introduce a sysctl_nr_open, Valdis.Kletnieks, (Tue Nov 27, 12:25 am)
Re: [PATCH] get rid of NR_OPEN and introduce a sysctl_nr_open, Eric Dumazet, (Tue Nov 27, 12:58 am)