From: Robert Hancock <hancockr@shaw.ca>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Volatile vs Non-Volatile Spin Locks on SMP.
Date: Sat, 16 Jul 2005 12:58:14 -0600 [thread overview]
Message-ID: <42D958C6.7030809@shaw.ca> (raw)
In-Reply-To: <4qEcy-1CX-21@gated-at.bofh.it>
multisyncfe991@hotmail.com wrote:
> Hello,
>
> By using volatile keyword for spin lock defined by in spinlock_t, it
> seems Linux choose to always
> reload the value of spin locks from cache instead of using the content
> from registers. This may be
> helpful for synchronization between multithreads in a single CPU.
>
> I use two Xeon cpus with HyperThreading being disabled on both cpus. I
> think the MESI
> protocol will enforce the cache coherency and update the spin lock value
> automatically between
> these two cpus. So maybe we don't need to use the volatile any more, right?
The value must always be loaded from memory. If the value is cached in a
register it will not update when another CPU changes it.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
next parent reply other threads:[~2005-07-16 19:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4q1Ec-5KI-9@gated-at.bofh.it>
[not found] ` <4q4sq-7HQ-15@gated-at.bofh.it>
[not found] ` <4qeLl-7lW-11@gated-at.bofh.it>
[not found] ` <4qEcy-1CX-21@gated-at.bofh.it>
2005-07-16 18:58 ` Robert Hancock [this message]
2005-07-14 2:20 About a change to the implementation of spin lock in 2.6.12 kernel multisyncfe991
2005-07-14 5:16 ` Willy Tarreau
2005-07-14 16:21 ` multisyncfe991
2005-07-15 19:22 ` Volatile vs Non-Volatile Spin Locks on SMP multisyncfe991
2005-07-17 12:51 ` Joe Seigh
2005-07-18 13:40 ` Joe Seigh
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=42D958C6.7030809@shaw.ca \
--to=hancockr@shaw.ca \
--cc=linux-kernel@vger.kernel.org \
/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