Re: [PATCH] refs.c: enable large transactions

2015-04-21 Thread Junio C Hamano
Stefan Beller sbel...@google.com writes: This replaces the latest patch on origin/sb/remove-fd-from-ref-lock Thanks, will replace. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH] refs.c: enable large transactions

2015-04-21 Thread Junio C Hamano
Stefan Beller sbel...@google.com writes: I thought about putting a cap on it to not let it go negative in the first place, but I did not find an easily accessible max() function, as I'd like to write it as int remaining_fds = max(get_max_fd_limit() - 32, 0); to have it in one line. The

Re: [PATCH] refs.c: enable large transactions

2015-04-21 Thread Stefan Beller
On Tue, Apr 21, 2015 at 10:16 AM, Junio C Hamano gits...@pobox.com wrote: Stefan Beller sbel...@google.com writes: + /* + * We may want to open many files in a large transaction, so come up with + * a reasonable maximum, keep some spares for stdin/out and other open + *

Re: [PATCH] refs.c: enable large transactions

2015-04-21 Thread Junio C Hamano
Stefan Beller sbel...@google.com writes: + /* + * We may want to open many files in a large transaction, so come up with + * a reasonable maximum, keep some spares for stdin/out and other open + * files. + */ + int remaining_fds = get_max_fd_limit() - 32; Can

[PATCH] refs.c: enable large transactions

2015-04-20 Thread Stefan Beller
This is another attempt on enabling large transactions (large in terms of open file descriptors). We keep track of how many lock files are opened by the ref_transaction_commit function. When more than a reasonable amount of files is open, we close the file descriptors to make sure the transaction