mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, George Spelvin <linux@horizon.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Manfred Spraul <manfred@colorfullife.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2] ipc/msg: Implement lockless pipelined wakeups
Date: Wed, 4 Nov 2015 12:55:38 +0100	[thread overview]
Message-ID: <20151104115538.GK17308@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1446563009-9076-1-git-send-email-bigeasy@linutronix.de>

On Tue, Nov 03, 2015 at 04:03:29PM +0100, Sebastian Andrzej Siewior wrote:

> -	struct msg_msg		*volatile r_msg;
> +	struct msg_msg		*r_msg;

> +				wake_q_add(wake_q, msr->r_tsk);
>  				msr->r_msg = msg;
> +				/*
> +				 * Rely on the implicit cmpxchg barrier from
> +				 * wake_q_add such that we can ensure that

Davidlohr, didn't you want to make that cmpxchg_relaxed() or
cmpxchg_release() ?

> +				 * updating msr->r_msg is the last write
> +				 * operation: As once set, the receiver can
> +				 * continue, and if we don't have the reference

Which seems to suggest you want to at least make that WRITE_ONCE()

> +				 * count from the wake_q, yet, at that point we
> +				 * can later have a use-after-free condition and
> +				 * bogus wakeup.
> +				 */

And I agree with DAvidlohr that the comment is placed oddly, one would
expect it between wake_q_add() and the store in question.



  parent reply	other threads:[~2015-11-04 11:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 15:03 Sebastian Andrzej Siewior
2015-11-03 17:30 ` Davidlohr Bueso
2015-11-03 20:12   ` Sebastian Andrzej Siewior
2015-11-04 18:11     ` Davidlohr Bueso
2015-11-04 11:55 ` Peter Zijlstra [this message]
2015-11-04 17:32   ` Davidlohr Bueso
2015-11-04 12:02 ` Peter Zijlstra

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=20151104115538.GK17308@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=manfred@colorfullife.com \
    --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®