mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "George Spelvin" <linux@horizon.com>
To: bigeasy@linutronix.de, tglx@linutronix.de
Cc: akpm@linux-foundation.org, dave@stgolabs.net,
	linux-kernel@vger.kernel.org, linux@horizon.com,
	manfred@colorfullife.com, peterz@infradead.org
Subject: Re: [PATCH] ipc/msg: Implement lockless pipelined wakeups
Date: 31 Oct 2015 09:02:14 -0400	[thread overview]
Message-ID: <20151031130214.10598.qmail@ns.horizon.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1510311118250.4032@nanos>

> Don't we need to keep that NULL init? I might be missing something.

I wondered the same thing, but on reading it, the cleanup is that he's
gotten rid of the need for the entire thing.  Previously, there was a
mechanism for detecting "wakeup not quite finished" that used a NULL
value, but it's no longer needed.

The resultant busy-waiting on the part of the woken-up task was the
entire problem this patch aims to fix.  So it gets rid of a whole lot
of code and barriers.  And, as you noticed, the comments explaining them.

As the old code explained, the issue is that a task may exit as
soon as r_msg is set, so the wakeup procedure has to be:
- Ensure r_msg is set to NULL (special-case flag)
- Do the wake up
- Set r_msg to the final value

The woken-up task has to spin as long as r_msg is NULL.  Ick.

However, a wake_q keeps a reference to a task, so exiting is
not a danger.  As long as wake_q_add precedes setting r_msg,
all is well.

  reply	other threads:[~2015-10-31 13:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 11:26 Sebastian Andrzej Siewior
2015-10-30 22:30 ` George Spelvin
2015-11-03 14:01   ` Sebastian Andrzej Siewior
2015-10-31 10:31 ` Thomas Gleixner
2015-10-31 13:02   ` George Spelvin [this message]
2015-10-31 15:17     ` Thomas Gleixner
2015-10-31 18:54     ` Davidlohr Bueso
2015-10-31 19:06       ` Davidlohr Bueso
2015-11-03 14:15         ` Sebastian Andrzej Siewior
2015-11-03 14:11       ` Sebastian Andrzej Siewior
2015-11-01  4:32 ` Manfred Spraul
2015-11-03 14:51   ` Sebastian Andrzej Siewior

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=20151031130214.10598.qmail@ns.horizon.com \
    --to=linux@horizon.com \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=peterz@infradead.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

all inboxes | Powered by JetHome®