[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AIX and Interix also do early PID recycling.
From: |
Michael Haubenwallner |
Subject: |
Re: AIX and Interix also do early PID recycling. |
Date: |
Wed, 25 Jul 2012 16:52:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120327 Thunderbird/10.0.3 |
On 07/25/2012 03:20 PM, Michael Haubenwallner wrote:
> On 07/25/2012 09:59 AM, Michael Haubenwallner wrote:
>> On 07/25/2012 03:05 AM, Chet Ramey wrote:
>>> Bash holds on to the status of all terminated processes, not just
>>> background ones, and only checks for the presence of a newly-forked PID
>>> in that list if the list size exceeds CHILD_MAX.
>
>> The AIX 6.1 I've debugged on has:
>> #define CHILD_MAX 128
>> #define _POSIX_CHILD_MAX 25
>> sysconf(_SC_CHILD_MAX) = 1024
> Tracing shows:
>
> The minimum fork count (including grand-childs to any depth) before PID
> recycling starts
> looks like 255 (once), but usually 256 and more.
>
> However, one process does see a PID recycled after *at least* 128 forks,
> that is exactly the value of CHILD_MAX.
Got it: The value used for js.c_childmax isn't 128, but 1024.
In lib/sh/oslib.c, getmaxchild() prefers sysconf(_SC_CHILD_MAX) over CHILD_MAX
over MAXUPRC.
But sysconf(_SC_CHILD_MAX) does return the number of "processes per real user
id" (similar to
ulimit -u), rather than the number of CHILD_MAX (whenever defined).
For Interix, things are different though:
There is no CHILD_MAX nor MAXUPRC defined, and sysconf(_SC_CHILD_MAX) does
return 512,
but PIDs start to be recycled at ~120 already...
Any idea about the "correct" fix for getmaxchild() across platforms?
/haubi/
- Re: AIX and Interix also do early PID recycling., (continued)
- Re: AIX and Interix also do early PID recycling., Chet Ramey, 2012/07/24
- Re: AIX and Interix also do early PID recycling., Michael Haubenwallner, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Greg Wooledge, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Steven W. Orr, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Michael Haubenwallner, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Chet Ramey, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Chet Ramey, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Michael Haubenwallner, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Steven W. Orr, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Chet Ramey, 2012/07/25
- Re: AIX and Interix also do early PID recycling.,
Michael Haubenwallner <=
- Re: AIX and Interix also do early PID recycling., Roman Rakus, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Chet Ramey, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Roman Rakus, 2012/07/30
- Re: AIX and Interix also do early PID recycling., Chet Ramey, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Chet Ramey, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Michael Haubenwallner, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Chet Ramey, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Michael Haubenwallner, 2012/07/26
- Re: AIX and Interix also do early PID recycling., Andreas Schwab, 2012/07/25
- Re: AIX and Interix also do early PID recycling., Chet Ramey, 2012/07/25