lkml.org 
[lkml]   [2004]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: /proc/sys/kernel/pid_max issues
On Sun, Sep 12, 2004 at 03:43:14AM -0700, William Lee Irwin III wrote:
> I like the update. But I see other issues. For instance (also untested):
> pid wrapping doesn't honor RESERVED_PIDS.

Also:

last_pid is not honored because next_free_map(map - 1, ...) may return
the same map and so restart with a lesser offset.

Index: mm4-2.6.9-rc1/kernel/pid.c
===================================================================
--- mm4-2.6.9-rc1.orig/kernel/pid.c 2004-09-12 03:26:50.063164288 -0700
+++ mm4-2.6.9-rc1/kernel/pid.c 2004-09-12 03:32:11.501298264 -0700
@@ -120,10 +120,12 @@
last_pid = pid;
return pid;
}
-
- if (!offset || !atomic_read(&map->nr_free)) {
- if (!offset)
- map--;
+ if (!offset) {
+ if (!atomic_read(&map->nr_free))
+ goto next_map;
+ else
+ goto scan_more;
+ } else if (!atomic_read(&map->nr_free)) {
next_map:
map = next_free_map(map, &max_steps);
if (!map)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.057 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site