All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Tom Gundersen <teg@jklm.no>
Cc: David Herrmann <dh.herrmann@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	Jiri Kosina <jikos@kernel.org>, Greg KH <greg@kroah.com>,
	Hannes Reinecke <hare@suse.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Josh Triplett <josh@joshtriplett.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC v1 06/14] bus1: util - queue utility library
Date: Fri, 28 Oct 2016 15:33:35 +0200	[thread overview]
Message-ID: <20161028133335.GF3142@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CAG-2HqVEW=KqwK7C9zd9aNTM0efVbfg1QycmWYLhv9C1-LzdpQ@mail.gmail.com>

On Fri, Oct 28, 2016 at 01:33:25PM +0200, Tom Gundersen wrote:
> On Thu, Oct 27, 2016 at 6:43 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Wed, Oct 26, 2016 at 09:18:02PM +0200, David Herrmann wrote:
> >
> >> A bus1 message queue is a FIFO, i.e., messages are linearly ordered by
> >> the time they were sent. Moreover, atomic delivery of messages to
> >> multiple queues are supported, without any global synchronization, i.e.,
> >> the order of message delivery is consistent across queues.
> >>
> >> Messages can be destined for multiple queues, hence, we need to be
> >> careful that all queues get a consistent order of incoming messages.
> >
> > So I read that to mean that if A and B both send a multi-cast message to
> > C and D, the messages will appear in the same order for both C and D.
> 
> That is one of the ordering guarantees, yes.
> 
> > Why is this important? It seem that this multi-cast ordering generates
> > much of the complexity of this patch while this Changelog fails to
> > explain why this is a desired property.
> 
> I don't think this is the case. The most important guarantee we give
> is causal ordering.

C and D not observing the message in the same order is consistent with
causality (and actual physics). The cause is A sending something the
effect is C receiving something. These two events must be ordered (which
yields the partial order). But there is no guarantee that different
observers would observe the same order. Esp. since A and B do not share
a clock and these events are not in fact ordered themselves.

When we go back to the example of special relativity, as per the paper,
this is trivially observable if we put A and C together in a frame of
reference and B and D in a different frame and have the two frames move
(at a significant fraction of the speed of light) relative to one
another. The signal, being an emission of light, would not arrive at
both observers in the same order (if the signal was given sufficiently
'simultaneous')

> To make this work with multicast, we must stage messages first, then
> commit on a second round. That is, we must find some way to iterate
> over all clocks before committing, but at the same time preventing any
> races. The multicast-stability as you just described we get for free
> by introducing the second-level ordering via sender-address.

And this, precisely, is what generates all the complexity found in this
patch.  You want to strictly provide more than causality, which does
not, as per the argument above, provide this at all.

You're providing a semi-global ordering of things that are themselves
not actually ordered.

> Stability in multicasts without causal order is not necessarily a crucial
> feature. However, note that if this ordering is given, it allows reducing
> the number of round-trips in dependent systems. Imagine a daemon
> reacting to a set of events from different sources. If the actions of that
> daemon are solely defined by incoming events, someone else can
> deduce the actions the daemon took without requiring the daemon to
> send out events by itself. That is, you can just watch the events on the
> system, and validly deduce the state of such daemon.
> 
> Example: There is a configuration daemon that sends events when
> configuration is changed. And there is a hotplug daemon that sends
> events when devices are hotplugged. You get an event that the "default
> mute-state" for audio devices was changed, after it you get a
> hotplugged audio device. You can now rely on the audio daemon to get
> the events in the same order, and hence apply the new "default
> mute-state" to the new device. No need to query the audio daemon
> whether the new device is muted.

Which is cute; but is it worth the pain?

> But as I said, the causal ordering is what we really want.
> Multicast-stability is just a nice side-effect.

I'm saying they're not the same thing and multi-cast stability isn't at
all implied.

  reply	other threads:[~2016-10-28 13:33 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 19:17 [RFC v1 00/14] Bus1 Kernel Message Bus David Herrmann
2016-10-26 19:17 ` [RFC v1 01/14] bus1: add bus1(7) man-page David Herrmann
2016-10-27 23:12   ` Kirill A. Shutemov
2016-10-26 19:17 ` [RFC v1 02/14] bus1: provide stub cdev /dev/bus1 David Herrmann
2016-10-26 23:19   ` Andy Lutomirski
2016-10-26 23:54     ` Tom Gundersen
2016-10-27  9:11       ` Arnd Bergmann
2016-10-27 15:25         ` Tom Gundersen
2016-10-27 16:37           ` Linus Torvalds
2016-10-27 16:39             ` Tom Gundersen
2016-10-29 22:13           ` Arnd Bergmann
2016-10-26 19:17 ` [RFC v1 03/14] bus1: util - active reference utility library David Herrmann
2016-10-26 19:18 ` [RFC v1 04/14] bus1: util - fixed list " David Herrmann
2016-10-27 12:37   ` Peter Zijlstra
2016-10-27 12:48     ` David Herrmann
2016-10-27 12:56       ` Arnd Bergmann
2016-10-27 13:31         ` David Herrmann
2016-10-26 19:18 ` [RFC v1 05/14] bus1: util - pool " David Herrmann
2016-10-27 12:54   ` Peter Zijlstra
2016-10-27 12:59   ` Peter Zijlstra
2016-10-27 15:00     ` Peter Zijlstra
2016-10-27 15:14   ` Peter Zijlstra
2016-10-26 19:18 ` [RFC v1 06/14] bus1: util - queue " David Herrmann
2016-10-27 15:27   ` Peter Zijlstra
2016-10-27 16:43   ` Peter Zijlstra
2016-10-28 11:33     ` Tom Gundersen
2016-10-28 13:33       ` Peter Zijlstra [this message]
2016-10-28 13:47         ` Tom Gundersen
2016-10-28 13:58           ` Peter Zijlstra
2016-10-28 14:33             ` Tom Gundersen
2016-10-28 16:49               ` Peter Zijlstra
2016-10-26 19:18 ` [RFC v1 07/14] bus1: tracking user contexts David Herrmann
2016-10-26 19:18 ` [RFC v1 08/14] bus1: implement peer management context David Herrmann
2016-10-28 12:06   ` Richard Weinberger
2016-10-28 13:18     ` Tom Gundersen
2016-10-28 13:21       ` Richard Weinberger
2016-10-28 13:05   ` Richard Weinberger
2016-10-28 13:23     ` Tom Gundersen
2016-10-28 13:54       ` Richard Weinberger
2016-10-26 19:18 ` [RFC v1 09/14] bus1: provide transaction context for multicasts David Herrmann
2016-10-28 14:37   ` Peter Zijlstra
2016-10-26 19:18 ` [RFC v1 10/14] bus1: add handle management David Herrmann
2016-10-26 19:18 ` [RFC v1 11/14] bus1: implement message transmission David Herrmann
2016-10-26 19:18 ` [RFC v1 12/14] bus1: hook up file-operations David Herrmann
2016-10-26 19:18 ` [RFC v1 13/14] bus1: limit and protect resources David Herrmann
2016-10-26 19:18 ` [RFC v1 14/14] bus1: basic user-space kselftests David Herrmann
2016-10-26 19:39 ` [RFC v1 00/14] Bus1 Kernel Message Bus Linus Torvalds
2016-10-26 20:34   ` David Herrmann
2016-10-27  0:45     ` Kirill A. Shutemov
2016-10-29 21:04       ` Josh Triplett
2016-11-02 14:45       ` David Herrmann
2017-01-30 22:11     ` Pavel Machek
2016-10-27 11:10 ` Michael Kerrisk
2016-10-28 13:11 ` Richard Weinberger
2016-10-28 13:37   ` Tom Gundersen

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=20161028133335.GF3142@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=dh.herrmann@gmail.com \
    --cc=greg@kroah.com \
    --cc=hare@suse.com \
    --cc=jikos@kernel.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=rostedt@goodmis.org \
    --cc=teg@jklm.no \
    --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 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.