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 bca...@nvidia.com 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

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 gits...@pobox.com wrote: Brandon Casey bca...@nvidia.com 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

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 draf...@gmail.com 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

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 gits...@pobox.com wrote: Brandon Casey draf...@gmail.com 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

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 draf...@gmail.com wrote: On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: I've been looking closer at uses of p-windows everywhere, and it seems that we always open_packed_git()

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 draf...@gmail.com writes: On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano gits...@pobox.com 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

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 gits...@pobox.com wrote: Brandon Casey draf...@gmail.com writes: On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano gits...@pobox.com wrote: That makes me feel somewhat uneasy. Yes, you can open/mmap/close and hold onto the contents of a file still

[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 draf...@gmail.com 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