[lkml]   [2004]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: keventd_create_kthread
    Srivatsa Vaddagiri <> wrote:
    > On Thu, Feb 19, 2004 at 08:12:19AM +0000, Andrew Morton wrote:
    > > 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()?
    > If wake_up_process() comes too early (when the target task is still
    > in TASK_RUNNING state), then won't wake_up_process() be a no-op?
    > In which case, the target kthread will miss a wake-up event
    > (kthread_start/kthread_stop)?

    No, that's OK - the new kernel thread sets TASK_INTERRUPTIBLE before waking
    the invoking thread via complete():

    new thread:

    /* OK, tell user we're spawned, wait for stop or wakeup */


    create->result = find_task_by_pid(pid);

    It's the window after the complete() and before the schedule() where
    wait_task_inactive() is spinning.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:01    [W:0.021 / U:0.536 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site