Skip to content

Commit 363357c

Browse files
committed
Cygwin: pinfo: raise MAX_PID to 4194304
Reportedly, the maximum pid of 65536 is much too small in bigger environments. Raise the maximum PID to 4194304, whihc is the maximum pid on Linux (PID_MAX_LIMIT defined in include/linux/threads.h). Signed-off-by: Corinna Vinschen <[email protected]>
1 parent 67bef16 commit 363357c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

winsup/cygwin/local_includes/pinfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class pinfo: public pinfo_minimal
223223
DWORD status_exit (DWORD);
224224
};
225225

226-
#define MAX_PID 65536
226+
#define MAX_PID 4194304
227227

228228
#define ISSTATE(p, f) (!!((p)->process_state & f))
229229
#define NOTSTATE(p, f) (!((p)->process_state & f))

winsup/cygwin/pinfo.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ pinfo::exit (DWORD n)
239239
}
240240
# undef self
241241

242-
/* Return next free Cygwin PID between 2 and 65535, round-robin. Each new
242+
/* Return next free Cygwin PID between 2 and MAX_PID, round-robin. Each new
243243
PID is checked that it doesn't collide with an existing PID. For that,
244244
just check if the "cygpid.PID" section exists. */
245245
pid_t

winsup/cygwin/release/3.6.0

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,7 @@ What changed:
7474
'(18) priority' is now set to the negated sched_policy minus one.
7575
If SCHED_IDLE is selected, this field is set to 39. The '(19) nice'
7676
field is now set to the originally requested nice value.
77+
78+
- Raise maximum pid from 65536 to 4194304 to account for scenarios
79+
with lots of CPUs and lots of tasks.
80+
Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256927.html

0 commit comments

Comments
 (0)