From: "Paul E. McKenney" <paulmck@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Micah Morton <mortonm@chromium.org>, Jann Horn <jannh@google.com>,
Bart Van Assche <bart.vanassche@wdc.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-security-module <linux-security-module@vger.kernel.org>
Subject: Re: [GIT PULL] SafeSetID LSM changes for 5.4
Date: Mon, 21 Oct 2019 19:13:06 -0700 [thread overview]
Message-ID: <20191022021306.GB2479@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20191021065811.GA17098@gmail.com>
On Mon, Oct 21, 2019 at 08:58:11AM +0200, Ingo Molnar wrote:
>
> * Paul E. McKenney <paulmck@kernel.org> wrote:
>
> > --- a/include/linux/rcupdate.h
> > +++ b/include/linux/rcupdate.h
> > @@ -383,20 +383,22 @@ do { \
> > } while (0)
> >
> > /**
> > - * rcu_swap_protected() - swap an RCU and a regular pointer
> > - * @rcu_ptr: RCU pointer
> > + * rcu_replace() - replace an RCU pointer, returning its old value
> > + * @rcu_ptr: RCU pointer, whose old value is returned
> > * @ptr: regular pointer
> > - * @c: the conditions under which the dereference will take place
> > + * @c: the lockdep conditions under which the dereference will take place
> > *
> > - * Perform swap(@rcu_ptr, @ptr) where @rcu_ptr is an RCU-annotated pointer and
> > - * @c is the argument that is passed to the rcu_dereference_protected() call
> > - * used to read that pointer.
> > + * Perform a replacement, where @rcu_ptr is an RCU-annotated
> > + * pointer and @c is the lockdep argument that is passed to the
> > + * rcu_dereference_protected() call used to read that pointer. The old
> > + * value of @rcu_ptr is returned, and @rcu_ptr is set to @ptr.
> > */
> > -#define rcu_swap_protected(rcu_ptr, ptr, c) do { \
> > +#define rcu_replace(rcu_ptr, ptr, c) \
> > +({ \
> > typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c)); \
> > rcu_assign_pointer((rcu_ptr), (ptr)); \
> > - (ptr) = __tmp; \
> > -} while (0)
> > + __tmp; \
> > +})
>
> One small suggestion, would it make sense to name it "rcu_replace_pointer()"?
>
> This would make it fit into the pointer handling family of RCU functions:
> rcu_assign_pointer(), rcu_access_pointer(), RCU_INIT_POINTER() et al?
Easy enough to make the change. I will do that tomorrow and test over
the following night.
> rcu_swap() would also look a bit weird if used in MM code. ;-)
How much RCU swap should we configure on this system? About same amount
as reader-writer swap! ;-)
Thanx, Paul
next prev parent reply other threads:[~2019-10-22 2:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-18 17:41 [GIT PULL] SafeSetID LSM changes for 5.4 Micah Morton
2019-09-23 19:01 ` Linus Torvalds
2019-09-23 19:28 ` Linus Torvalds
2019-09-23 23:35 ` James Morris
2019-09-24 0:45 ` Linus Torvalds
2019-09-24 3:30 ` Micah Morton
2019-09-26 18:21 ` Linus Torvalds
2019-09-23 23:30 ` Paul E. McKenney
2019-09-24 0:44 ` Linus Torvalds
2019-10-21 6:58 ` Ingo Molnar
2019-10-22 2:13 ` Paul E. McKenney [this message]
2019-09-23 19:05 ` pr-tracker-bot
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=20191022021306.GB2479@paulmck-ThinkPad-P72 \
--to=paulmck@kernel.org \
--cc=bart.vanassche@wdc.com \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mortonm@chromium.org \
--cc=torvalds@linux-foundation.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