From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753355Ab0EGCs3 (ORCPT ); Thu, 6 May 2010 22:48:29 -0400 Received: from mail-pz0-f204.google.com ([209.85.222.204]:56328 "EHLO mail-pz0-f204.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751329Ab0EGCs2 convert rfc822-to-8bit (ORCPT ); Thu, 6 May 2010 22:48:28 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=g2bg0gNHIx4z6jDekc92Qb4NiuBS5FPVazj8LOLcjW95lf8/gkVWSp/mLaWnTTGIYg 5J8cMvxzo/qIJgI5IYEnGtlU0TkkImmua1JJbcHECuTHcClq7mvwbOJqnbFsrdgA7bcr nqxJ2/uIk0xchyZYunE7dUhvkPfxk6DAMkNBA= MIME-Version: 1.0 In-Reply-To: <1273171863.1642.258.camel@laptop> References: <1273111054-10141-1-git-send-email-xiaosuo@gmail.com> <1273171863.1642.258.camel@laptop> From: Changli Gao Date: Fri, 7 May 2010 10:48:05 +0800 Message-ID: Subject: Re: [PATCH] epoll: use wrapper functions To: Peter Zijlstra 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 7, 2010 at 2:51 AM, Peter Zijlstra wrote: > 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. > > 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. -- Regards, Changli Gao(xiaosuo@gmail.com)