public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: Hugh Dickins <hugh@veritas.com>,
	cmm@us.ibm.com, dipankar@us.ibm.com,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] Put size in array to get rid of barriers in grow_ary()
Date: Mon, 13 Sep 2004 11:57:21 -0700	[thread overview]
Message-ID: <20040913185721.GG1241@us.ibm.com> (raw)
In-Reply-To: <4145E98F.4050106@colorfullife.com>

On Mon, Sep 13, 2004 at 08:40:15PM +0200, Manfred Spraul wrote:
> Paul E. McKenney wrote:
> 
> >And here, finally, is the updated patch.  Still untested.
> >
> >Thoughts?
> >
> > 
> >
> Looks good.
> I've even tried to test it, but doesn't compile with -rc1-bk11 due to 
> missing rcu_assign_pointer.

My bad!  It needs the rcu_assign_pointer() patch as pre-req.

http://marc.theaimsgroup.com/?l=linux-kernel&m=109459678719365&w=2

Below is the part of that patch that is actually supplies
rcu_assign_pointer(), which should be all that is needed.

						Thanx, Paul

diff -urpN -X ../dontdiff linux-2.5/include/linux/rcupdate.h linux-2.5-rap/include/linux/rcupdate.h
--- linux-2.5/include/linux/rcupdate.h	Tue Sep  7 10:04:29 2004
+++ linux-2.5-rap/include/linux/rcupdate.h	Tue Sep  7 12:12:09 2004
@@ -238,6 +238,24 @@ static inline int rcu_pending(int cpu)
 				(_________p1); \
 				})
 
+/**
+ * rcu_assign_pointer - assign (publicize) a pointer to a newly
+ * initialized structure that will be dereferenced by RCU read-side
+ * critical sections.  Returns the value assigned.
+ *
+ * Inserts memory barriers on architectures that require them
+ * (pretty much all of them other than x86), and also prevents
+ * the compiler from reordering the code that initializes the
+ * structure after the pointer assignment.  More importantly, this
+ * call documents which pointers will be dereferenced by RCU read-side
+ * code.
+ */
+
+#define rcu_assign_pointer(p, v)	({ \
+						smp_wmb(); \
+						(p) = (v); \
+					})
+
 extern void rcu_init(void);
 extern void rcu_check_callbacks(int cpu, int user);
 extern void rcu_restart_cpu(int cpu);

      reply	other threads:[~2004-09-13 19:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-07 23:09 [RFC][PATCH] Put size in array to get rid of barriers in grow_ary() Paul E. McKenney
2004-09-08 15:39 ` Hugh Dickins
2004-09-08 22:07   ` Paul E. McKenney
2004-09-11  3:40     ` Paul E. McKenney
2004-09-13 11:41       ` Hugh Dickins
2004-09-13 18:40       ` Manfred Spraul
2004-09-13 18:57         ` Paul E. McKenney [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=20040913185721.GG1241@us.ibm.com \
    --to=paulmck@us.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=dipankar@us.ibm.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.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