Re: Fwd: [Lse-tech] get_pid() performance fix

From: OGAWA Hirofumi (hirofumi@mail.parknet.co.jp)
Date: Tue Mar 05 2002 - 11:26:20 EST


Hubertus Franke <frankeh@watson.ibm.com> writes:

> @@ -153,13 +155,18 @@
> if(last_pid & 0xffff8000)
> last_pid = 300;
> next_safe = PID_MAX;
> + goto repeat;
> }
> - goto repeat;
> + if(unlikely(last_pid == beginpid))
> + goto nomorepids;
> + continue;

It isn't guaranteed that pid is unique.

In the case:
        task->pid = 300, task->xxx = 301
        pid 301 is free

        This get_pid() returns 301.

Regards.

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
-
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/



This archive was generated by hypermail 2b29 : Thu Mar 07 2002 - 21:00:43 EST