From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753845AbbKCOLo (ORCPT ); Tue, 3 Nov 2015 09:11:44 -0500 Received: from www.linutronix.de ([62.245.132.108]:44337 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880AbbKCOLk (ORCPT ); Tue, 3 Nov 2015 09:11:40 -0500 Subject: Re: [PATCH] ipc/msg: Implement lockless pipelined wakeups To: Davidlohr Bueso , George Spelvin References: <20151031130214.10598.qmail@ns.horizon.com> <20151031185457.GC7947@linux-uzut.site> Cc: tglx@linutronix.de, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, manfred@colorfullife.com, peterz@infradead.org From: Sebastian Andrzej Siewior Message-ID: <5638C099.3040706@linutronix.de> Date: Tue, 3 Nov 2015 15:11:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151031185457.GC7947@linux-uzut.site> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/31/2015 07:54 PM, Davidlohr Bueso wrote: >> 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. > > Yes, and this confirms that we still rely on the implicit barrier > from the cmpxchg as tglx mentioned. As such, we also need to keep > the pairing when reading 'r_msg' in do_msgrcv(), instead of dropping > the comments. Okay, I took the memory-barrier comment from your mqueue patch and adjusted. > > Thanks, > Davidlohr Sebastian