From: Andrea Parri <parri.andrea@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org, mingo@kernel.org,
jiangshanlai@gmail.com, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org,
dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com,
oleg@redhat.com
Subject: Re: [PATCH tip/core/rcu 1/9] rcu: Provide GP ordering in face of migrations and delays
Date: Mon, 9 Oct 2017 16:37:44 +0200 [thread overview]
Message-ID: <20171009143744.GA5238@andrea> (raw)
In-Reply-To: <20171009081637.cpqxh27x5pqirscc@hirez.programming.kicks-ass.net>
On Mon, Oct 09, 2017 at 10:16:37AM +0200, Peter Zijlstra wrote:
> On Sat, Oct 07, 2017 at 11:28:57AM -0700, Paul E. McKenney wrote:
> > But if you are saying that it would be good to have wait_for_completion()
> > and complete() directly modeled at some point, no argument. In addition,
> > I hope that the memory model is applied to other tools that analyze kernel
> > code.
>
> > > I'm not sure I got the point across; so I'll try once more. Without
> > > providing this ordering the completion would be fundamentally broken. It
> > > _must_ provide this ordering.
> >
> > OK, I now understand what you are getting at, and I do very much like
> > that guarantee.
>
> Right, so maybe we should update the completion comments a bit to call
> out this property, because I'm not sure its there.
>
> Also, with this, I think the smp_store_release() / smp_load_acquire() is
> a perfectly fine abstraction of it, I don't think the model needs to be
> taught about the completion interface.
>
> > > Why not? In what sort of cases does it go wobbly?
> >
> > For one, when it conflicts with maintainability. For example, it would
> > probably be OK for some of RCU's rcu_node ->lock acquisitions to skip the
> > smp_mb__after_unlock_lock() invocations. But those are slowpaths, and the
> > small speedup on only one architecture is just not worth the added pain.
> > Especially given the nice wrapper functions that you provided.
> >
> > But of course if this were instead (say) rcu_read_lock() or common-case
> > rcu_read_unlock(), I would be willing to undergo much more pain. On the
> > other hand, for that exact reason, that common-case code path doesn't
> > acquire locks in the first place. ;-)
>
> Ah, so for models I would go absolutely minimal; it helps understand
> what the strict requirements are and where we over-provide etc..
Except, maybe, that simplicity and maintainability do apply to "models"
(design) as well... ;-)
As Ingo once put it [1] (referring to the "Linux-kernel memory model"):
"it's not true that Linux has to offer a barrier and locking model
that panders to the weakest (and craziest!) memory ordering model
amongst all the possible Linux platforms - theoretical or real metal.
Instead what we want to do is to consciously, intelligently _pick_
a sane, maintainable memory model and offer primitives for that -
at least as far as generic code is concerned. Each architecture can
map those primitives to the best of its abilities."
Andrea
[1] https://marc.info/?l=linux-mm&m=138513336717990&w=2
>
> For actual code you're entirely right, there's no point in trying to be
> cute with the rcu-node locks. Simplicity rules etc..
next prev parent reply other threads:[~2017-10-09 14:37 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-04 21:29 [PATCH tip/core/rcu 0/9] Miscellaneous fixes for v4.15 Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 1/9] rcu: Provide GP ordering in face of migrations and delays Paul E. McKenney
2017-10-05 9:41 ` Peter Zijlstra
2017-10-05 14:55 ` Paul E. McKenney
2017-10-05 15:39 ` Peter Zijlstra
2017-10-05 16:19 ` Paul E. McKenney
2017-10-05 16:25 ` Peter Zijlstra
2017-10-05 18:22 ` Paul E. McKenney
2017-10-06 9:07 ` Peter Zijlstra
2017-10-06 19:18 ` Paul E. McKenney
2017-10-06 20:15 ` Peter Zijlstra
2017-10-07 3:31 ` Paul E. McKenney
2017-10-07 9:29 ` Peter Zijlstra
2017-10-07 18:28 ` Paul E. McKenney
2017-10-09 8:16 ` Peter Zijlstra
2017-10-09 14:37 ` Andrea Parri [this message]
2017-10-09 23:15 ` Paul E. McKenney
2017-10-05 13:17 ` Steven Rostedt
2017-10-05 13:40 ` Peter Zijlstra
2017-10-05 14:13 ` Steven Rostedt
2017-10-04 21:29 ` [PATCH tip/core/rcu 2/9] rcu: Fix up pending cbs check in rcu_prepare_for_idle Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 3/9] rcu: Create call_rcu_tasks() kthread at boot time Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 4/9] irq_work: Map irq_work_on_queue() to irq_work_on() in !SMP Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 5/9] srcu: Add parameters to SRCU docbook comments Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 6/9] sched: Make resched_cpu() unconditional Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 7/9] rcu: Pretend ->boost_mtx acquired legitimately Paul E. McKenney
2017-10-05 9:50 ` Peter Zijlstra
2017-10-05 15:06 ` Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 8/9] rcu: Add extended-quiescent-state testing advice Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 9/9] rcu/segcblist: Include rcupdate.h 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=20171009143744.GA5238@andrea \
--to=parri.andrea@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=edumazet@google.com \
--cc=fweisbec@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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