[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xargs with large (or zero) max-procs

From: Marc Aurele La France
Subject: Re: [PATCH] xargs with large (or zero) max-procs
Date: Sat, 5 Jan 2008 10:24:14 -0700 (Mountain Standard Time)

On Sat, 5 Jan 2008, James Youngman wrote:
On Dec 26, 2007 10:51 PM, Marc Aurele La France <address@hidden> wrote:
The -p1 patch below causes `xargs` to reap its zombied children before
attempting to fork() another child process.  This is intended to make it
more difficult for a user to fill up the process table, potentially
causing other system services to fail.

First thanks for reporting the bug.   I have recorded it at

I opted for a fix that is somewhat different to your proposal.  I
wanted to have xargs reap children a little more frequently than
provided for in your code change (for example, before fork when -P50
is in effect).   Also though, xargs had a number of variables which
were signed but not indended to hold a negative quantity; some of
these related to counting the number of outstanding child processes.
I took the opportunity to fix that too.

The change I prepared was emailed (as usual) to
address@hidden and is attached to the bug at the above URL.
I'll apply it to the CVS tree in a couple of days, once people have
had an opportunity to review it.

Looks good from here.

This means that despite your work to fix this problem, the code change
you suggested wasn't the one I used.   I hope you don't mind.

Not a problem. Expected, in fact. Although, I'm ever so slightly disappointed at the removal of support for ancient systems without waitpid().

Nevertheless your change was a good one and should you want to further
contribute to findutils, we'd be glad of the help.

I already know this to be quite true. I have submitted patches to many projects over the years, and this one has been one of the most positively responsive.

This is keyed on whether or not <sys/wait.h> #define's WNOHANG, but you
might want to key off of the existence of waitpid(), using the automangle
suite.  I am submitting this in its current form given that waitpid() is
just about as old as wait(), older than wait3() and wait4() even, and that
there is no point in WNOHANG without waitpid() or vice-versa.

I agree that waitpid is well-established.   Every bit of
autoconfiscation imposes a small extra maintenance burden.   Partly
for that reason, I decided to just assume the existence of both
waitpid() and WNOHANG.

Alright.  Not worth resurrecting my old 7th Edition system for ;-)



|  Marc Aurele La France           |  work:   1-780-492-9310          |
|  Academic Information and        |  fax:    1-780-492-1729          |
|    Communications Technologies   |  email:  address@hidden         |
|  352 General Services Building   +----------------------------------+
|  University of Alberta           |                                  |
|  Edmonton, Alberta               |    Standard disclaimers apply    |
|  T6G 2H1                         |                                  |
|  CANADA                          |                                  |
XFree86 developer and VP.  ATI driver and X server internals.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]