Re: keventd_create_kthread

From: Andrew Morton
Date: Thu Feb 19 2004 - 03:12:11 EST


Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>
> i'd strongly advise against using wait_task_inactive() in
> keventd_create_kthread() - it's _polling_. We must not do any polling like
> that in any modern interface. Why does keventd_create_kthread() need
> wait_task_inactive()?

The way it's designed, we _have_ to wait until the new kthread has gone to
sleep, because we poke him again with wake_up_process().

However, if that wake_up_process() comes too early we'll just flip the new
thread out of TASK_INTERUPTIBLE into TASK_RUNNING and the schedule() in
kthread() will fall straight through. So perhaps we can simply remove the
wait_task_inactive()?

-
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/