From: Peter Zijlstra Subject: Re: [PATCH] epoll: use wrapper functions Date: Thu, 06 May 2010 20:51:03 +0200 Message-ID: <1273171863.1642.258.camel@laptop> References: <1273111054-10141-1-git-send-email-xiaosuo@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Changli Gao , Andrew Morton , Alexander Viro , "Eric W. Biederman" , Roland Dreier , Stefan Richter , Ingo Molnar , Takashi Iwai , David Howells , linux-fsdevel@vger.kernel.org, Linux Kernel Mailing List To: Davide Libenzi Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:32974 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752852Ab0EFSvK (ORCPT ); Thu, 6 May 2010 14:51:10 -0400 Received: from f199130.upc-f.chello.nl ([80.56.199.130] helo=dyad.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1OA6A9-0000jm-1v for linux-fsdevel@vger.kernel.org; Thu, 06 May 2010 18:51:09 +0000 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, 2010-05-06 at 11:47 -0700, Davide Libenzi wrote: > Since we already have __add_wait_queue(), __add_wait_queue_tail() and > __remove_wait_queue() (which all means "locked"), and while I agree in > having the exclusive-add wrapped into a function, I much better prefer a: > > static inline void __add_wait_queue_excl(wait_queue_head_t *head, > wait_queue_t *new) > { > new->flags |= WQ_FLAG_EXCLUSIVE; > __add_wait_queue(head, new); > } > > The patch you posted introduces a different naming, which leaves all the > other __*() untouched, and wraps the already one-liner __remove_wait_queue() > with yet another one-liner. I concur, I always get confused by the _locked postfix (and its more typing). Also, it goes against the lock data not code paradigm.