From: Robert Love <rml@tech9.net>
To: "Perez-Gonzalez, Inaky" <inaky.perez-gonzalez@intel.com>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: RE: [PATCH 2.5.52] Use __set_current_state() instead of current-> state = (take 1)
Date: 18 Dec 2002 21:04:04 -0500 [thread overview]
Message-ID: <1040263444.854.118.camel@phantasy> (raw)
In-Reply-To: <A46BBDB345A7D5118EC90002A5072C7806CACA2D@orsmsx116.jf.intel.com>
On Wed, 2002-12-18 at 20:53, Perez-Gonzalez, Inaky wrote:
> - any setting before a return should be barriered unless we
> return to a place[s] known to be harmless
Not sure.
> - any setting to TASK_RUNNING should be kind of safe
Yes, I agree. It may race, but with what?
> - exec.c:de_thread(),
>
> while (atomic_read(&oldsig->count) > count) {
> oldsig->group_exit_task = current;
> - current->state = TASK_UNINTERRUPTIBLE;
> + __set_current_state(TASK_UNINTERRUPTIBLE);
> spin_unlock_irq(&oldsig->siglock);
>
> Should be safe, as spin_unlock_irq() will do memory clobber
> on sti() [undependant from UP/SMP].
The memory clobber only acts as a compiler barrier and insures the
compiler does not reorder the statements from the order in the C code.
What we need is a memory barrier to ensure the processor does not
reorder statements. In other words, the processor can completely
rearrange loads and stores as they are issued to it, as long as it does
not break obvious data dependencies. On a weakly ordered processor,
sans memory barrier, there is no telling when and where a store will
actually reach memory. This is regardless of the order of the C code or
anything else.
That said, I do not know if the above example is a problem or not. On a
very quick glance, the only issue I saw is the one I pointed out
earlier, and you fixed it.
Robert Love
next prev parent reply other threads:[~2002-12-19 1:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-19 1:53 [PATCH 2.5.52] Use __set_current_state() instead of current-> state = (take 1) Perez-Gonzalez, Inaky
2002-12-19 2:04 ` Robert Love [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-12-19 19:04 Perez-Gonzalez, Inaky
2002-12-20 3:08 ` Alan Cox
2002-12-20 19:36 ` Oliver Xymoron
2002-12-19 2:40 Perez-Gonzalez, Inaky
2002-12-19 3:19 ` Robert Love
2002-12-19 0:46 Perez-Gonzalez, Inaky
2002-12-19 1:03 ` Robert Love
2002-12-18 23:56 [PATCH 2.5.52] Use __set_current_state() instead of current->state " Inaky Perez-Gonzalez
2002-12-19 0:11 ` Robert Love
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=1040263444.854.118.camel@phantasy \
--to=rml@tech9.net \
--cc=inaky.perez-gonzalez@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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