From mboxrd@z Thu Jan 1 00:00:00 1970 From: Changli Gao Subject: Re: [PATCH] epoll: use wrapper functions Date: Fri, 7 May 2010 10:48:05 +0800 Message-ID: References: <1273111054-10141-1-git-send-email-xiaosuo@gmail.com> <1273171863.1642.258.camel@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Davide Libenzi , 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: Peter Zijlstra Return-path: In-Reply-To: <1273171863.1642.258.camel@laptop> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, May 7, 2010 at 2:51 AM, Peter Zijlstra w= rote: > On Thu, 2010-05-06 at 11:47 -0700, Davide Libenzi wrote: >> Since we already have __add_wait_queue(), __add_wait_queue_tail() an= d >> __remove_wait_queue() (which all means "locked"), and while I agree = in >> having the exclusive-add wrapped into a function, I much better pref= er a: >> >> static inline void __add_wait_queue_excl(wait_queue_head_t *head, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0wait_queue_t *new) >> { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 new->flags |=3D WQ_FLAG_EXCLUSIVE; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 __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. > > I greped all the code, and found that add_wait_queue_head_exclusive_locked() and remove_wait_queue_locked() aren't used. It seems that no users like these APIs. So I will remove these two APIs, and add __add_wait_queue_excl() instead. Thanks. --=20 Regards=EF=BC=8C Changli Gao(xiaosuo@gmail.com)