Re: 2.6.9-rc1-mm5

Kirill Korotaev
2004-09-14T06:32:03Z

[-- Attachment #1: Type: text/plain, Size: 1650 bytes --]

Andrew Morton wrote:
> Kirill Korotaev <dev@sw.ru> wrote:

>>Please replace patch next_thread-bug-fixes.patch in -mm5 tree with the
>>last diff-next_thread I sent to you.
>
> I was planning on replacing it with Ingo's patch.
1. next_thread-bug-fixes.patch has nothing to do with Ingo's patch.
next_thread-bug-fixes.patch is cosmetic and a bit unfull (it should
better check that the process is still hashed, which I added in my patch).
So I ask you to replace it with diff-next_thread (I resend it once
again), which fixes original kernel and should replace the above patch
in your tree.

The comments for this patch
~~~~~~~~~~~~~~~~~~~~~~~~~~~
This patch changes obscure BUG() checks in next_thread()
with pid checks meaning exactly the same (It simply checks if the task
is still hashed). Also original check was incorrect since it required
ANY of the locks (siglock or tasklist_lock) while siglock is not
required at all and tasklist_lock is ALWAYS required.

Signed-Off-By: Kirill Korotaev <dev@sw.ru>

2. The BUG() which is resolved in Ingo's patch is fixed in -mm5 tree
with show-aggregate-per-process-counters-in-proc-pid-stat-2.patch
So you needn't to apply Ingo's patch.

> --- linux/fs/proc/array.c.orig
> +++ linux/fs/proc/array.c
> @@ -356,7 +356,7 @@ static int do_task_stat(struct task_stru
> stime = task->signal->stime;
> }
> }
> - if (whole) {
> + if (whole && task->sighand) {
>
> Is there some reason why your patch is better? If so, please do a full
> resend.

My patch was a bit more self explaining as we discussed with Ingo.
But due to being already fixed, I don't think you have to bother with it.

Kirill

[-- Attachment #2: diff-next_thread --]
[-- Type: text/plain, Size: 524 bytes --]

--- ./kernel/exit.c.nt 2004-09-13 18:00:12.727181136 +0400
+++ ./kernel/exit.c 2004-09-13 18:00:51.864231400 +0400
@@ -848,10 +848,7 @@ asmlinkage long sys_exit(int error_code)
task_t fastcall *next_thread(const task_t *p)
{
#ifdef CONFIG_SMP
- if (!p->sighand)
- BUG();
- if (!spin_is_locked(&p->sighand->siglock) &&
- !rwlock_is_locked(&tasklist_lock))
+ if (!rwlock_is_locked(&tasklist_lock) || p->pids[PIDTYPE_TGID].nr == 0)
BUG();
#endif
return pid_task(p->pids[PIDTYPE_TGID].pid_list.next, PIDTYPE_TGID);