From: Ingo Molnar <mingo@redhat.com>
To: Andrew Morton <akpm@osdl.org>
Cc: rusty@rustcorp.com.au, linux-kernel@vger.kernel.org
Subject: Re: keventd_create_kthread
Date: Thu, 19 Feb 2004 03:16:33 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.58.0402190310550.10411@devserv.devel.redhat.com> (raw)
In-Reply-To: <20040219001011.6245f163.akpm@osdl.org>
On Thu, 19 Feb 2004, Andrew Morton 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()?
yep. There's almost never any good reason to use wait_task_inactive().
The only excusable special case is ptrace: there are some inherent
assumptions in the ptrace framework that need the task to unschedule at
least once before the parent can modify the user state. (eg. on x86 the
lazy FPU state and the fs/gs selectors need to be saved before the parent
can read/write them, plus changed debug registers need a real
context-switch to take effect, etc.)
Ingo
next prev parent reply other threads:[~2004-02-19 8:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040218004648.7471bb37.akpm@osdl.org>
2004-02-18 23:12 ` keventd_create_kthread Rusty Russell
2004-02-19 7:46 ` keventd_create_kthread Ingo Molnar
2004-02-19 8:10 ` keventd_create_kthread Andrew Morton
2004-02-19 8:16 ` Ingo Molnar [this message]
2004-02-19 10:05 ` keventd_create_kthread Srivatsa Vaddagiri
2004-02-19 10:10 ` keventd_create_kthread Andrew Morton
2004-02-19 9:46 ` keventd_create_kthread Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.58.0402190310550.10411@devserv.devel.redhat.com \
--to=mingo@redhat.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®