[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Findutils-patches] ./configure-time setting of default arg size
From: |
Eric Blake |
Subject: |
Re: [Findutils-patches] ./configure-time setting of default arg size |
Date: |
Tue, 31 Jul 2007 06:59:33 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.5) Gecko/20070716 Thunderbird/2.0.0.5 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to James Youngman on 7/30/2007 10:11 AM:
> On 7/30/07, Eric Blake <address@hidden> wrote:
>> OK, I'll rework the patch along those lines. Would the macro name
>> DEFAULT_ARG_SIZE be better than ARG_SIZE here?
>
> Sure.
>
>> Based on my additional
>> comments to #20594, I think it is still worth tying this patch to 20594; I
>> just have to be careful to not call it a bug fix (because it is not a
>> findutils bug that cygwin's current choice of _SC_ARG_MAX values doesn't
>> work when invoking non-cygwin apps), but instead call it an enhancement.
>
> That seems sound to me.
With that, here's the revised patch. OK to commit?
2007-07-31 Eric Blake <address@hidden>
Allow choice of default arg size, Savannah bug #20594.
* configure.ac (DEFAULT_ARG_SIZE): Check environment for a default
size override.
* lib/buildcmd.c (bc_use_sensible_arg_max): Use default size from
configure, if requested.
* README (DEFAULT_ARG_SIZE): Mention the ability to tune this at
configure time.
* NEWS: Document the change.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGrzIz84KuGfSFAYARAtH2AKDVSMObGBnmxcQzCxrUH1rWcvtE9gCfT4rZ
wdKUcRszHc00Tlx4gqMM2/8=
=ajZS
-----END PGP SIGNATURE-----
Index: NEWS
===================================================================
RCS file: /sources/findutils/findutils/NEWS,v
retrieving revision 1.198
diff -u -p -r1.198 NEWS
--- NEWS 22 Jul 2007 13:52:51 -0000 1.198
+++ NEWS 31 Jul 2007 12:56:46 -0000
@@ -7,6 +7,7 @@ Findutils version 4.3.9 is released unde
Public License.
** Bug Fixes
+
#20310: configure uses hosts's support status for "sort -z" when
generating the updatedb script for use on the target. This is
inappropriate when cross-compiling, so avoid doing that.
@@ -26,6 +27,11 @@ does not follow the POSIX rules of doing
updatedb, frcode and code now complies with the GNU Project's coding
standards.
+** Enhancements
+
+#20594: Allow fine-tuning of the default argument size used by xargs
+and find at ./configure time.
+
** Documentation Fixes
Point out more explicitly that the subsecond timestamp support
Index: README
===================================================================
RCS file: /sources/findutils/findutils/README,v
retrieving revision 1.6
diff -u -p -r1.6 README
--- README 27 Feb 2005 22:04:44 -0000 1.6
+++ README 31 Jul 2007 12:56:46 -0000
@@ -36,6 +36,13 @@ doing. This information includes detail
has been parsed and what files have been stat()ed. This output is
normally interesting only to the maintainer, and so is off by default.
+DEFAULT_ARG_SIZE=<value>
+ If this environment variable is defined to a numeric expression
+during configure, it determines the default argument size limits used
+by xargs without -s, and by find, when spawning child processes.
+Otherwise, the default is set at 128 kibibytes. If the system cannot
+support the default limit, the system's limit will be used instead.
+
To gain speed, GNU find avoids statting files whenever possible.
It does this by:
Index: lib/buildcmd.c
===================================================================
RCS file: /sources/findutils/findutils/lib/buildcmd.c,v
retrieving revision 1.27
diff -u -p -r1.27 buildcmd.c
--- lib/buildcmd.c 2 Jul 2007 08:25:43 -0000 1.27
+++ lib/buildcmd.c 31 Jul 2007 12:56:46 -0000
@@ -500,8 +500,12 @@ bc_init_controlinfo(struct buildcmd_cont
void
bc_use_sensible_arg_max(struct buildcmd_control *ctl)
{
+#ifdef DEFAULT_ARG_SIZE
+ enum { arg_size = DEFAULT_ARG_SIZE };
+#else
enum { arg_size = (128u * 1024u) };
-
+#endif
+
/* Check against the upper and lower limits. */
if (arg_size > ctl->posix_arg_size_max)
ctl->arg_max = ctl->posix_arg_size_max;
@@ -547,4 +551,3 @@ bc_clear_args(const struct buildcmd_cont
state->todo = 0;
state->dirfd = -1;
}
-
Index: configure.ac
===================================================================
RCS file: /sources/findutils/findutils/configure.ac,v
retrieving revision 1.1
diff -u -p -b -r1.1 configure.ac
--- configure.ac 18 Jul 2007 03:40:46 -0000 1.1
+++ configure.ac 31 Jul 2007 12:56:49 -0000
@@ -61,6 +61,13 @@ else
AC_DEFINE(LEAF_OPTIMISATION, 1, [Define if you want to use the leaf
optimisation (this can still be turned off with -noleaf)])
fi
+AC_ARG_VAR([DEFAULT_ARG_SIZE], [Default size of arguments to child processes
+of find and xargs, 128k if unspecified])
+if test -n "$DEFAULT_ARG_SIZE"; then
+ AC_DEFINE_UNQUOTED([DEFAULT_ARG_SIZE], [$DEFAULT_ARG_SIZE],
+ [If defined, the default argument size used in child processes])
+fi
+
dnl Checks for programs.