[PATCH] fixed pidhashing patch

From: Kirill Korotaev
Date: Thu Sep 02 2004 - 06:33:47 EST


>>I've only compiletested my changes, though I have strong reasons to
>>believe they're correct. If Kirill signs off on this, I will too.
>
>
> Kirill?

I cleanuped it once again. It compiles/works fine.
Hope there will be no more problems with it.

list of small changes:
- FIXED bug in do_each_task_pid() made by Lee. last task was skipped in the loop, removed __list__ var.
- remade patch against latest tree (there was a conflict in exit.c)
- returned 'extern' in find_pid() declaration
- fixed style a bit in detach_pid(), find_task_by_pid_type()

Original comment:
-------------------------------------------------------------------
This patch fixes strange and obscure pid implementation in current kernels:
- it removes calling of put_task_struct() from detach_pid()
under tasklist_lock. This allows to use blocking calls
in security_task_free() hooks (in __put_task_struct()).
- it saves some space = 5*5 ints = 100 bytes in task_struct
- it's smaller and tidy, more straigthforward and doesn't use
any knowledge about pids using and assignment.
- it removes pid_links and pid_struct doesn't hold reference counters
on task_struct. instead, new pid_structs and linked altogether and
only one of them is inserted in hash_list.

Signed-off-by: Kirill Korotaev (kksx@xxxxxxx)
-------------------------------------------------------------------

Kirill

Attachment: diff-pid-sent2
Description: Binary data