2004-09-02 11:32:47

by Kirill Korotaev

[permalink] [raw]
Subject: [PATCH] fixed pidhashing patch

>>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 ([email protected])
-------------------------------------------------------------------

Kirill


Attachments:
diff-pid-sent2 (18.47 kB)

2004-09-02 18:20:39

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [PATCH] fixed pidhashing patch

On Thu, Sep 02, 2004 at 03:32:22PM +0400, Kirill Korotaev wrote:
> 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()

Heh, looks like I flubbed the loop condition too. For some reason I
thought pid_list was headed at the leader instead of being headerless,
which upon a rereading I see now, so explaining my confusion there.
The semicolon-requiring bits don't appear to be used by any of the
other do { ... } while(...) -style iterators, so I won't press that.

This patch appears sound and stylistically good. Linus, please add:

Signed-off-by: William Irwin <[email protected]>


-- wli