git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Limit file descriptors used by packs

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 28, 2011, 20:44 UTC
Message-ID
<20110228204406.GA26052@spearce.org>
In-Reply-To
<20110228203557.GA8189@pcpool00.mathematik.uni-freiburg.de>
"Bernhard R. Link" <brl+ccmadness@pcpool00.mathematik.uni-freiburg.de> wrote:
Show 10 quoted lines
> * Shawn O. Pearce <spearce@spearce.org> [110228 21:27]:
> > By using a hard upper limit that is below the rlimit of the current
> > process, it is not necessary to check for EMFILE on every single
> > fd-allocating system call.  Instead reserving 8 file descriptors
> > makes it safe to assume the system call won't fail due to being
> > over limit in the filedescriptor limit.
> 
> Isn't 8 quite a bit low for a reserve? Couldn't some libc stuff
> (especially nss modules perhaps activated by something) easily surpass
> that?

Originally I proposed 25 to Junio, but he scoffed and said that was quite high. So I went with 8, 3 for std{in,out,err} and 5 as a WAG for everything else.

Its arbitrary, 25 might be a better WAG than 8...
-- 
Shawn.
Previous: Bernhard R. LinkNext: Junio C Hamano
Message 3 of 10 in “Limit file descriptors used by packs”
  1. Limit file descriptors used by packsShawn O. Pearce, Feb 28, 2011
  2. Bernhard R. LinkFeb 28, 2011
  3. Shawn O. PearceFeb 28, 2011
  4. Junio C HamanoFeb 28, 2011
  5. Shawn O. PearceFeb 28, 2011
  6. Limit file descriptors used by packsShawn O. Pearce, Feb 28, 2011
  7. Erik Faye-LundFeb 28, 2011
  8. Junio C HamanoMar 1, 2011
  9. Shawn PearceMar 1, 2011
  10. 2/1 sha1_file.c: Don't retain open fds on small packsShawn O. Pearce, Mar 2, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.