diff options
| author | Ingo Molnar <mingo@elte.hu> | 2002-09-19 00:25:45 -0700 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2002-09-19 00:25:45 -0700 |
| commit | 64cf8edb62434d9efe3ae4ebdb4d73716ad27d9a (patch) | |
| tree | fc4400a9a94fd7f810d2bacec967aa23c3c2b482 /fs/exec.c | |
| parent | a3a132ea1d82242539aa89143fb70cf864f6a7d5 (diff) | |
[PATCH] generic-pidhash-2.5.36-J2, BK-curr
This is the latest version of the generic pidhash patch. The biggest
change is the removal of separately allocated pid structures: they are
now part of the task structure and the first task that uses a PID will
provide the pid structure. Task refcounting is used to avoid the
freeing of the task structure before every member of a process group or
session has exited.
This approach has a number of advantages besides the performance gains.
Besides simplifying the whole hashing code significantly, attach_pid()
is now fundamentally atomic and can be called during create_process()
without worrying about task-list side-effects. It does not have to
re-search the pidhash to find out about raced PID-adding either, and
attach_pid() cannot fail due to OOM. detach_pid() can do a simple
put_task_struct() instead of the kmem_cache_free().
The only minimal downside is the potential pending task structures after
session leaders or group leaders have exited - but the number of orphan
sessions and process groups is usually very low - and even if it's
higher, this can be regarded as a slow execution of the final
deallocation of the session leader, not some additional burden.
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/exec.c b/fs/exec.c index ec95e796ec22..21222017549d 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -609,8 +609,6 @@ static inline int de_thread(struct signal_struct *oldsig) ptrace_unlink(leader); ptrace_unlink(current); - unhash_pid(current); - unhash_pid(leader); remove_parent(current); remove_parent(leader); /* @@ -631,8 +629,6 @@ static inline int de_thread(struct signal_struct *oldsig) current->ptrace = ptrace; __ptrace_link(current, parent); } - hash_pid(current); - hash_pid(leader); list_add_tail(¤t->tasks, &init_task.tasks); state = leader->state; |
