Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965291AbbKDMCe (ORCPT ); Wed, 4 Nov 2015 07:02:34 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:59151 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965006AbbKDMCd (ORCPT ); Wed, 4 Nov 2015 07:02:33 -0500 Date: Wed, 4 Nov 2015 13:02:27 +0100 From: Peter Zijlstra To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, George Spelvin , Thomas Gleixner , Davidlohr Bueso , Manfred Spraul , Andrew Morton Subject: Re: [PATCH v2] ipc/msg: Implement lockless pipelined wakeups Message-ID: <20151104120227.GL17308@twins.programming.kicks-ass.net> References: <1446563009-9076-1-git-send-email-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1446563009-9076-1-git-send-email-bigeasy@linutronix.de> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1238 Lines: 31 On Tue, Nov 03, 2015 at 04:03:29PM +0100, Sebastian Andrzej Siewior wrote: > @@ -932,58 +924,26 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl > rcu_read_lock(); > > /* Lockless receive, part 2: This is a broken comment style, please fix that while you're there anyway. Also, the comment above ("Lockless receive, part 1:") is broken too, not only in style, but it refers to rcu_read_unlock() as disabling preemption, and avoiding preemption, which is false. > + * The work in pipelined_send() and expunge_all(): > + * - Set pointer to message > + * - Queue the receiver task for later wakeup > + * - Wake up the process after the lock is dropped. > * > + * Should the process wake up before this wakeup (due to a > + * signal) it will either see the message and continue ... > */ > > + msg = msr_d.r_msg; Since this is a lockless read, it should very much be READ_ONCE(), esp. since you killed the volatile on its type. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/