From: "David S. Miller" <davem@redhat.com>
To: tytso@mit.edu
Cc: torvalds@transmeta.com, linux-kernel@vger.rutgers.edu
Subject: Re: set_current_state
Date: Wed, 1 Sep 1999 13:41:22 -0700 [thread overview]
Message-ID: <199909012041.NAA02138@pizda.davem.net> (raw)
In-Reply-To: <199909012017.QAA18692@tsx-prime.MIT.EDU> (tytso@mit.edu)
Date: Wed, 1 Sep 1999 16:17:07 -0400
From: "Theodore Y. Ts'o" <tytso@mit.edu>
Are there any circumstances where we should keep the old usage?
Fundamentally it only matters when you are going into a "sleep until
condition" polling loop such that:
add_wait_queue(...);
for(;;) {
set_current_state(...);
if (some asynchronous state)
break;
schedule();
}
remove_wait_queue(...);
The idea being that you wish the task state to propagate into the view
of all cpus in the system before other cpus can potentially cause the
asynronous event to occur _and_ check your task state while performing
the wake_up(...)
What we're trying to prevent here is the asynchronous state test load
not bypassing the store of the new task state. If the cpu reorders
these, the wakeup event can be missed.
Later,
David S. Miller
davem@redhat.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
prev parent reply other threads:[~1999-09-01 20:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-01 20:17 set_current_state Theodore Y. Ts'o
1999-09-01 20:41 ` David S. Miller [this message]
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=199909012041.NAA02138@pizda.davem.net \
--to=davem@redhat.com \
--cc=linux-kernel@vger.rutgers.edu \
--cc=torvalds@transmeta.com \
--cc=tytso@mit.edu \
/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®