Re: /proc/sys/kernel/pid_max issues
From: William Lee Irwin III (wli_at_holomorphy.com)
Date: 09/12/04
- Previous message: Tejun Heo: "[PATCH] patsubstfor LOCALVERSION and -fno-omit-frame-pointer"
- Maybe in reply to: Anton Blanchard: "/proc/sys/kernel/pid_max issues"
- Next in thread: Arjan van de Ven: "Re: /proc/sys/kernel/pid_max issues"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 12 Sep 2004 02:43:33 -0700 To: Ingo Molnar <mingo@elte.hu>
On Sun, Sep 12, 2004 at 11:39:43AM +0200, Ingo Molnar wrote:
> --- linux/kernel/pid.c.orig
> +++ linux/kernel/pid.c
> @@ -103,7 +103,7 @@ int alloc_pidmap(void)
> pidmap_t *map;
>
> pid = last_pid + 1;
> - if (pid >= pid_max)
> + if (unlikely(pid >= pid_max))
> pid = RESERVED_PIDS;
Well, this part won't change the wrapping behavior.
On Sun, Sep 12, 2004 at 11:39:43AM +0200, Ingo Molnar wrote:
> offset = pid & BITS_PER_PAGE_MASK;
> @@ -116,6 +116,10 @@ int alloc_pidmap(void)
> * slowpath and that fixes things up.
> */
> return_pid:
> + if (unlikely(pid >= pid_max)) {
> + clear_bit(offset, map->page);
> + goto failure;
> + }
> atomic_dec(&map->nr_free);
> last_pid = pid;
> return pid;
This is too late; it hands back a hard failure without resetting last_pid.
-- wli
-
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/
- Previous message: Tejun Heo: "[PATCH] patsubstfor LOCALVERSION and -fno-omit-frame-pointer"
- Maybe in reply to: Anton Blanchard: "/proc/sys/kernel/pid_max issues"
- Next in thread: Arjan van de Ven: "Re: /proc/sys/kernel/pid_max issues"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|