Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753791AbbLCUcK (ORCPT ); Thu, 3 Dec 2015 15:32:10 -0500 Received: from casper.infradead.org ([85.118.1.10]:39802 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753636AbbLCUcJ (ORCPT ); Thu, 3 Dec 2015 15:32:09 -0500 Date: Thu, 3 Dec 2015 21:31:59 +0100 From: Peter Zijlstra To: Davidlohr Bueso Cc: mingo@kernel.org, oleg@redhat.com, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, boqun.feng@gmail.com, corbet@lwn.net, mhocko@kernel.org, dhowells@redhat.com, torvalds@linux-foundation.org, will.deacon@arm.com, waiman.long@hpe.com, pjt@google.com Subject: Re: [PATCH 3/4] locking: Introduce smp_cond_acquire() Message-ID: <20151203203159.GW17308@twins.programming.kicks-ass.net> References: <20151203124010.627312076@infradead.org> <20151203124339.552838970@infradead.org> <20151203194139.GA5650@linux-uzut.site> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151203194139.GA5650@linux-uzut.site> 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: 869 Lines: 21 On Thu, Dec 03, 2015 at 11:41:39AM -0800, Davidlohr Bueso wrote: > >+#define smp_cond_acquire(cond) do { \ > >+ while (!(cond)) \ > >+ cpu_relax(); \ > >+ smp_rmb(); /* ctrl + rmb := acquire */ \ > >+} while (0) > > So this hides the fact that we actually are waiting on the cond, as opposed > to conditional acquiring. Could it be renamed to something like smp_waitcond_acquire()? Right, I'm conflicted about that. On the one hand you're right, on the other hand we spin-wait so the next person will want it called smp_spin_wait_cond_acquire(), also it gets terribly long either way :/ bike-shed away I imagine. -- 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/