From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753561AbaA3PyG (ORCPT ); Thu, 30 Jan 2014 10:54:06 -0500 Received: from merlin.infradead.org ([205.233.59.134]:53650 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753108AbaA3PyE (ORCPT ); Thu, 30 Jan 2014 10:54:04 -0500 Date: Thu, 30 Jan 2014 16:53:44 +0100 From: Peter Zijlstra To: Waiman Long Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Arnd Bergmann , linux-arch@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Andrew Morton , Michel Lespinasse , Andi Kleen , Rik van Riel , "Paul E. McKenney" , Linus Torvalds , Raghavendra K T , George Spelvin , Tim Chen , aswin@hp.com, Scott J Norton Subject: Re: [PATCH v11 0/4] Introducing a queue read/write lock implementation Message-ID: <20140130155344.GE5002@laptop.programming.kicks-ass.net> References: <1390537731-45996-1-git-send-email-Waiman.Long@hp.com> <20140130130453.GB2936@laptop.programming.kicks-ass.net> <20140130151715.GA5126@laptop.programming.kicks-ass.net> <52EA7309.7070605@hp.com> <52EA74D1.3040109@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52EA74D1.3040109@hp.com> 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 On Thu, Jan 30, 2014 at 10:50:41AM -0500, Waiman Long wrote: > One more thing, I often see line like > > #define queue_write_unlock queue_write_unlock > > So exactly what effect does this macro have? Makes sure the below doesn't emit another version. #ifndef queue_write_unlock /** * queue_write_unlock - release write lock of a queue rwlock * @lock : Pointer to queue rwlock structure */ static inline void queue_write_unlock(struct qrwlock *lock) { /* * If the writer field is atomic, it can be cleared directly. * Otherwise, an atomic subtraction will be used to clear it. */ smp_mb__before_atomic_dec(); atomic_sub(_QW_LOCKED, &lock->cnts); } #endif