mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dmitriy V'jukov" <dvyukov@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: RCU: Number of grace-periods
Date: Wed, 11 Mar 2009 10:58:41 +0000 (UTC)	[thread overview]
Message-ID: <loom.20090311T104939-544@post.gmane.org> (raw)

In the article "The design of preemptible read-copy-update":
http://lwn.net/Articles/253651

Paul McKenney explains why number of grace periods before executing callbacks is
set to 2:
#define GP_STAGES 2

There are following statements in the reasoning:
"Note that because rcu_read_lock() does not contain any memory barriers, the
contents of the critical section might be executed early by the CPU"
and:
"However, because rcu_read_unlock() contains no memory barriers, the contents of
the corresponding RCU read-side critical section (possibly including a reference
to the item deleted by CPU 0) can be executed late by CPU 1"

But on some architectures (IA-32, Intel 64, SPARC TSO) acquire and release
fences are implied with every load/store (read - costless), so isn't it possible
to reduce the number of required grace periods before executing callbacks on
these architectures?
I.e. something like:
#ifdef ACQUIRE_RELEASE_FENCES_ARE_IMPLIED_ON_ARCH // defined for x86 etc
#define GP_STAGES 1
#else
#define GP_STAGES 2
#endif
Have someone considered such variant? Is it worth doing?
Thank you.

--
Best regards,
Dmitriy V'jukov


             reply	other threads:[~2009-03-11 10:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11 10:58 Dmitriy V'jukov [this message]
2009-03-11 15:50 ` Paul E. McKenney
2009-03-11 17:50   ` Dmitriy V'jukov

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=loom.20090311T104939-544@post.gmane.org \
    --to=dvyukov@gmail.com \
    --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

all inboxes | Powered by JetHome®