Re: /proc/sys/kernel/pid_max issues

From: William Lee Irwin III (wli_at_holomorphy.com)
Date: 09/12/04

  • Next message: Ingo Molnar: "Re: /proc/sys/kernel/pid_max issues"
    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/


  • Next message: Ingo Molnar: "Re: /proc/sys/kernel/pid_max issues"

    Relevant Pages