ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: jakub@redhat.com, ksummit-discuss@lists.linuxfoundation.org,
	ramana.radhakrishnan@arm.com
Subject: Re: [Ksummit-discuss] [TECH TOPIC] Memory model, using ISO C++11 atomic ops
Date: Wed, 3 Aug 2016 09:49:57 +0100	[thread overview]
Message-ID: <20160803084957.GB5166@arm.com> (raw)
In-Reply-To: <20160802134223.GK6862@twins.programming.kicks-ass.net>

On Tue, Aug 02, 2016 at 03:42:23PM +0200, Peter Zijlstra wrote:
> On Tue, Jul 26, 2016 at 04:11:21PM +0100, David Woodhouse wrote:
> > On Fri, 2016-07-22 at 11:34 +0100, David Howells wrote:
> > > Further, Paul McKenney and others are assembling a memory model description.
> > > Do we want to consider loosening up the kernel memory model?
> > 
> > It's not clear that 'loosening up' is what we're after.
> 
> Linus (who should also very much be present for this) always argues
> against relaxing ordering.

Even if he had an inexplicable change in heart, how on Earth do you go
about validating the existing codebase against a new memory model? It's
one thing to show that the relaxation is strictly a relaxation (and
therefore the existing backend implementations remain sound), but quite
another to show that locking implementations don't fall apart, or the
guarantees that no longer hold aren't relied upon someplace.

One might consider adding more atomic operations. For example, the
release/acquire stuff we grew recently is "weaker" than full fences but,
unlike the C11 atomics, the release/acquire primitives complement full
fences. Conversely, having two sets of fences (C11 and kernel) or two
sets of release/acquire, each with subtly different semantics sounds
like an awful maintainance burden and not somewhere we should be going.

That's why I'd be interested in building kernel-compatible operations
using C11 atomics (relaxed accesses and fences) for asm/generic, but not
more than that, at least outside of arch/*.

Will

  reply	other threads:[~2016-08-03  8:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 10:34 David Howells
2016-07-22 16:44 ` Paul E. McKenney
2016-07-25 17:14   ` Luis R. Rodriguez
2016-07-26  6:09     ` Hannes Reinecke
2016-07-26 13:10       ` Alan Stern
2016-07-26 13:35         ` Paul E. McKenney
2016-07-29  1:06           ` Steven Rostedt
2016-07-26 15:23         ` Hannes Reinecke
2016-07-26 22:40           ` Paul E. McKenney
2016-07-23 20:21 ` Benjamin Herrenschmidt
2016-07-26 15:11 ` David Woodhouse
2016-07-28 10:41   ` Will Deacon
2016-08-02 13:42   ` Peter Zijlstra
2016-08-03  8:49     ` Will Deacon [this message]
2016-07-26 15:20 ` David Howells

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=20160803084957.GB5166@arm.com \
    --to=will.deacon@arm.com \
    --cc=jakub@redhat.com \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=peterz@infradead.org \
    --cc=ramana.radhakrishnan@arm.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