Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 1:02 PM, Junio C Hamano wrote: > Brandon Casey writes: > >> On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano wrote: >>> That makes me feel somewhat uneasy. Yes, you can open/mmap/close >>> and hold onto the contents of a file still mapped in-core, and it >>> may not count

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Junio C Hamano
Brandon Casey writes: > On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano wrote: >> That makes me feel somewhat uneasy. Yes, you can open/mmap/close >> and hold onto the contents of a file still mapped in-core, and it >> may not count as "open filedescriptor", but do OSes allow infinite >> such m

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 12:16 PM, Brandon Casey wrote: > On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano wrote: >> Brandon Casey writes: >> >>> I've been looking closer at uses of p->windows everywhere, and it >>> seems that we always open_packed_git() before we try to create new >>> windows. Th

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano wrote: > Brandon Casey writes: > >> I've been looking closer at uses of p->windows everywhere, and it >> seems that we always open_packed_git() before we try to create new >> windows. There doesn't seem to be any reason that we can't continue >> to

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Junio C Hamano
Brandon Casey writes: > I've been looking closer at uses of p->windows everywhere, and it > seems that we always open_packed_git() before we try to create new > windows. There doesn't seem to be any reason that we can't continue > to use the existing open windows even after closing the pack file

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 10:12 AM, Junio C Hamano wrote: > Brandon Casey writes: > >> If the refs are loose, then upload-pack will read each ref from the >> pack (allocating one or more mmap windows) so it can peel tags and >> advertise the underlying object. If the refs are packed and peeled, >> t

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Junio C Hamano
Brandon Casey writes: > If the refs are loose, then upload-pack will read each ref from the > pack (allocating one or more mmap windows) so it can peel tags and > advertise the underlying object. If the refs are packed and peeled, > then upload-pack will use the peeled sha1 in the packed-refs fil

[PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-07-31 Thread Brandon Casey
From: Brandon Casey When the number of open packs exceeds pack_max_fds, unuse_one_window() is called repeatedly to attempt to release the least-recently-used pack windows, which, as a side-effect, will also close a pack file after closing its last open window. If a pack file has been opened, but