Re: [PATCH] do_sched_setscheduler: don't take tasklist_lock

From: Oleg Nesterov
Date: Sun Aug 13 2006 - 08:56:32 EST


On 08/13, Oleg Nesterov wrote:
>
> We don't need to take tasklist_lock or disable irqs for
> find_task_by_pid() + get_task_struct(). Use RCU locks
> instead.

On the other hand, I think sched_setscheduler() does need tasklist_lock!

It is unsafe do dereference ->signal unless tasklist_lock or ->siglock
is held (or p == current). Yes, we pin the task structure, but this can't
prevent from release_task()->__exit_signal() which sets ->signal = NULL.

So, I think this patch

[PATCH] Drop tasklist lock in do_sched_setscheduler
commit e74c69f46d93d29eea0ad8647863d1c6488f0f55

is not correct.

Am I missed something?

Oleg.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/