From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [PATCH 1/4] hugetlbfs: move free_inodes accounting Date: Wed, 21 Sep 2005 12:34:57 -0700 Message-ID: <1127331297.10664.6.camel@localhost> References: <20050921092156.GA22544@lst.de> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Andrew Morton , viro@ftp.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-mm Return-path: Received: from e6.ny.us.ibm.com ([32.97.182.146]:17344 "EHLO e6.ny.us.ibm.com") by vger.kernel.org with ESMTP id S932120AbVIUTfV (ORCPT ); Wed, 21 Sep 2005 15:35:21 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e6.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j8LJZJpO006879 for ; Wed, 21 Sep 2005 15:35:19 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j8LJZI5x084040 for ; Wed, 21 Sep 2005 15:35:18 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j8LJZIqa008417 for ; Wed, 21 Sep 2005 15:35:18 -0400 To: Christoph Hellwig In-Reply-To: <20050921092156.GA22544@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, 2005-09-21 at 11:21 +0200, Christoph Hellwig wrote: > +static inline int hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info > *sbinfo) > +{ > + if (sbinfo->free_inodes >= 0) { > + spin_lock(&sbinfo->stat_lock); > + if (unlikely(!sbinfo->free_inodes)) { > + spin_unlock(&sbinfo->stat_lock); > + return 0; > + } > + sbinfo->free_inodes--; > + spin_unlock(&sbinfo->stat_lock); > + } Does that really need the unlikely()? Doesn't seem horribly performance critical. -- Dave