Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030799AbbD1Q7f (ORCPT ); Tue, 28 Apr 2015 12:59:35 -0400 Received: from cantor2.suse.de ([195.135.220.15]:32942 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030298AbbD1Q7e (ORCPT ); Tue, 28 Apr 2015 12:59:34 -0400 Message-ID: <1430240361.2004.13.camel@stgolabs.net> Subject: Re: [PATCH v2] ipc/mqueue: remove STATE_PENDING From: Davidlohr Bueso To: Peter Zijlstra Cc: Thomas Gleixner , Sebastian Andrzej Siewior , Manfred Spraul , LKML , Ingo Molnar , Darren Hart , Steven Rostedt , fredrik.markstrom@windriver.com, "Paul E. McKenney" Date: Tue, 28 Apr 2015 09:59:21 -0700 In-Reply-To: <20150428164329.GK5029@twins.programming.kicks-ass.net> References: <1428419030-20030-1-git-send-email-bigeasy@linutronix.de> <1428419030-20030-4-git-send-email-bigeasy@linutronix.de> <55241851.7060704@colorfullife.com> <20150410143726.GD3057@linutronix.de> <1430191493.2050.3.camel@stgolabs.net> <20150428123738.GY23123@twins.programming.kicks-ass.net> <1430239010.2004.6.camel@stgolabs.net> <20150428164329.GK5029@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 872 Lines: 22 On Tue, 2015-04-28 at 18:43 +0200, Peter Zijlstra wrote: > Well, if you can 'guarantee' the cmpxchg will not fail, you can then > rely on the fact that cmpxchg implies a full barrier, which would > obviate the need for the wmb. Yes, assuming it implies barriers on both sides. And we could obviously remove the need for pairing. With wake_q being local to wq_sleep() I cannot see duplicate tasks trying to add themselves in the list. Failed cmpxchg should only occur when users start misusing the wake_q. Manfred, do you have any objections to this? Perhaps I've missed the real purpose of the barriers. Thanks, Davidlohr -- 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/