From: Benjamin LaHaise <bcrl@kvack.org>
To: Roland McGrath <roland@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 1/2] avoid OPEN_MAX in SCM_MAX_FD
Date: Tue, 13 Mar 2007 10:17:50 -0400 [thread overview]
Message-ID: <20070313141750.GH6209@kvack.org> (raw)
In-Reply-To: <20070313083912.89D891801C5@magilla.sf.frob.com>
On Tue, Mar 13, 2007 at 01:39:12AM -0700, Roland McGrath wrote:
> The OPEN_MAX constant is an arbitrary number with no useful relation to
> anything. Nothing should be using it. This patch changes SCM_MAX_FD to
> use NR_OPEN instead of OPEN_MAX. This increases the size of the struct
> scm_fp_list type fourfold, to make it big enough to contain as many file
> descriptors as could be asked of it. This size increase may not be very
> worthwhile, but at any rate if an arbitrary limit unrelated to anything
> else is being defined it should be done explicitly here with:
> -#define SCM_MAX_FD (OPEN_MAX-1)
> +#define SCM_MAX_FD (NR_OPEN-1)
This is a bad idea. From linux/fs.h:
#undef NR_OPEN
#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */
There isn't anything I can see guaranteeing that net/scm.h is included
before fs.h. This affects networking and should really be Cc'd to
netdev@vger.kernel.org, which will raise the issue that if SCM_MAX_FD is
raised, the resulting simple kmalloc() must be changed. That said, I
doubt SCM_MAX_FD really needs to be raised, as applications using many
file descriptors are unlikely to try to send their entire file table to
another process in one go -- they have to handle the limits imposed by
SCM_MAX_FD anyways.
-ben
--
"Time is of no importance, Mr. President, only life is important."
Don't Email: <zyntrop@kvack.org>.
next prev parent reply other threads:[~2007-03-13 14:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-13 8:39 [PATCH 1/2] avoid OPEN_MAX in SCM_MAX_FD Roland McGrath
2007-03-13 14:17 ` Benjamin LaHaise [this message]
2007-03-13 20:02 ` Roland McGrath
2007-03-13 21:28 ` Linus Torvalds
2007-03-14 0:55 ` Roland McGrath
2007-03-14 1:15 ` Linus Torvalds
2007-03-14 9:45 ` Jochen Voß
2007-03-14 19:52 ` Olaf Kirch
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=20070313141750.GH6209@kvack.org \
--to=bcrl@kvack.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=roland@redhat.com \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).