From: Andrea Arcangeli <andrea@suse.de>
To: Roman Zippel <zippel@fh-brandenburg.de>
Cc: Andi Kleen <ak@suse.de>, Timur Tabi <ttabi@interactivesi.com>,
linux-kernel@vger.kernel.org
Subject: Re: [ANNOUNCE] Kernel Janitor's TODO list
Date: Fri, 16 Feb 2001 15:26:26 +0100 [thread overview]
Message-ID: <20010216152626.J14430@inspiron.random> (raw)
In-Reply-To: <20010129182633.A2522@gruyere.muc.suse.de> <Pine.GSO.4.10.10101292036070.17869-100000@zeus.fh-brandenburg.de>
In-Reply-To: <Pine.GSO.4.10.10101292036070.17869-100000@zeus.fh-brandenburg.de>; from zippel@fh-brandenburg.de on Mon, Jan 29, 2001 at 08:47:50PM +0100
On Mon, Jan 29, 2001 at 08:47:50PM +0100, Roman Zippel wrote:
> Hi,
>
> On Mon, 29 Jan 2001, Andi Kleen wrote:
>
> > You can miss wakeups. The standard pattern is:
> >
> > get locks
> >
> > add_wait_queue(&waitqueue, &wait);
> > for (;;) {
> > if (condition you're waiting for is true)
> > break;
> > unlock any non sleeping locks you need for condition
> > __set_task_state(current, TASK_UNINTERRUPTIBLE);
> > schedule();
> > __set_task_state(current, TASK_RUNNING);
> > reaquire locks
> > }
> > remove_wait_queue(&waitqueue, &wait);
>
> You still miss wakeups. :)
> Always set the task state first, then check the condition. See the
> wait_event*() macros you mentioned for the right order.
If the wakeup happens with the spinlock acquired (as the above code seems to
assume) you don't need to set the task state as uninterruptible before checking
the condition, however the above is wrong anyways because it should do
__set_task_state _before_ releasing the lock and not after.
Andrea
next prev parent reply other threads:[~2001-02-16 14:26 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-28 16:14 [ANNOUNCE] Kernel Janitor's TODO list Manfred Spraul
2001-01-28 14:36 ` Arnaldo Carvalho de Melo
2001-01-28 16:45 ` Manfred Spraul
2001-01-28 17:07 ` David Woodhouse
2001-01-28 17:40 ` Manfred Spraul
2001-01-28 18:51 ` Roman Zippel
2001-01-29 17:01 ` Timur Tabi
2001-01-29 17:10 ` John Levon
2001-01-29 18:27 ` David D.W. Downey
2001-01-29 20:44 ` davej
2001-01-29 20:51 ` Timur Tabi
2001-01-29 20:56 ` Rasmus Andersen
2001-01-30 0:29 ` Peter Samuelson
2001-01-30 0:20 ` Ingo Oeser
2001-01-30 11:11 ` David Woodhouse
2001-01-30 16:52 ` Timur Tabi
2001-01-31 0:06 ` Daniel Phillips
2001-01-31 0:09 ` Timur Tabi
2001-01-31 9:14 ` David Woodhouse
2001-01-30 17:10 ` David Woodhouse
2001-01-29 17:26 ` Andi Kleen
2001-01-29 19:47 ` Roman Zippel
2001-01-29 20:35 ` Andi Kleen
2001-02-16 14:29 ` Andrea Arcangeli
2001-02-16 14:26 ` Andrea Arcangeli [this message]
2001-01-31 17:57 ` Alan Cox
2001-01-31 19:15 ` Manfred Spraul
-- strict thread matches above, loose matches on Subject: below --
2001-01-30 1:22 Rusty Russell
2001-01-30 3:08 ` Andrew Morton
2001-01-27 17:11 Arnaldo Carvalho de Melo
2001-01-28 15:20 ` David Woodhouse
2001-01-28 14:03 ` Arnaldo Carvalho de Melo
2001-01-28 15:49 ` Michael H. Warfield
2001-01-28 16:13 ` Andrew Morton
2001-01-28 14:28 ` Arnaldo Carvalho de Melo
2001-01-28 14:33 ` Arnaldo Carvalho de Melo
2001-01-30 1:05 ` Rusty Russell
2001-01-30 11:19 ` Daniel Phillips
2001-01-30 17:49 ` Daniel Phillips
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=20010216152626.J14430@inspiron.random \
--to=andrea@suse.de \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=ttabi@interactivesi.com \
--cc=zippel@fh-brandenburg.de \
/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