From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: cmm@us.ibm.com, dipankar@us.ibm.com, manfred@colorfullife.com,
linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] Put size in array to get rid of barriers in grow_ary()
Date: Wed, 8 Sep 2004 15:07:53 -0700 [thread overview]
Message-ID: <20040908220753.GD1240@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0409081623380.8697-100000@localhost.localdomain>
On Wed, Sep 08, 2004 at 04:39:43PM +0100, Hugh Dickins wrote:
> On Tue, 7 Sep 2004, Paul E. McKenney wrote:
> >
> > The grow_ary() code has a number of explicit memory barriers, as does
> > ipc_lock(). This patch gets rid of the need for some of these by
> > placing the array size in the same block of memory containing the
> > array itself, so that the array and the size cannot possibly get out
> > of sync. Also uses rcu_assign_pointer() to get rid of the remaining
> > smp_wmb().
>
> But Paul, if you keep removing all these examples of memory barriers,
> how can I be expected to learn how to use them properly?
But Hugh, I left quite a few smp_wmb()s in there just for you! ;-)
> Seriously, good, yes, the fewer "mb"s the better.
> I could always educate myself from the older source.
Agreed!
> > Untested, therefore probably broken.
>
> Agreed ;)
Any specifics greatly appreciated, as always...
> > Thoughts?
>
> Wouldn't it be a little nicer to start ipc_ids off pointing to a
> const ipc_id_ary of size 0, to avoid the various entries == NULL
> tests you had to add?
I like this one!!! Will put a patch together. Manfred's recent
patch applied a refcount, which negates the const part, but should
be no problem to put a size-zero structure in the struct ipc_ids.
(Having a separately allocated structure puts me back to checking
NULL pointers due to possibility of allocation failure.)
Thanx, Paul
next prev parent reply other threads:[~2004-09-08 22:12 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 [this message]
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
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=20040908220753.GD1240@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.