Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756163AbYK2LPk (ORCPT ); Sat, 29 Nov 2008 06:15:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756024AbYK2LPS (ORCPT ); Sat, 29 Nov 2008 06:15:18 -0500 Received: from lazybastard.de ([212.112.238.170]:45719 "EHLO longford.logfs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755996AbYK2LPP (ORCPT ); Sat, 29 Nov 2008 06:15:15 -0500 Date: Sat, 29 Nov 2008 12:14:53 +0100 From: =?utf-8?B?SsO2cm4=?= Engel To: Eric Dumazet Cc: Ingo Molnar , Christoph Hellwig , David Miller , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, "kernel-testers@vger.kernel.org >> Kernel Testers List" , Mike Galbraith , Peter Zijlstra , Linux Netdev List , Christoph Lameter , linux-fsdevel@vger.kernel.org, Al Viro Subject: Re: [PATCH v2 5/5] fs: new_inode_single() and iput_single() Message-ID: <20081129111452.GB11959@logfs.org> References: <20081121083044.GL16242@elte.hu> <49267694.1030506@cosmosbay.com> <20081121.010508.40225532.davem@davemloft.net> <4926AEDB.10007@cosmosbay.com> <4926D022.5060008@cosmosbay.com> <20081121152148.GA20388@elte.hu> <4926D39D.9050603@cosmosbay.com> <20081121153453.GA23713@elte.hu> <492DDB6A.8090806@cosmosbay.com> <49310115.8010306@cosmosbay.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <49310115.8010306@cosmosbay.com> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1267 Lines: 38 On Sat, 29 November 2008 09:45:09 +0100, Eric Dumazet wrote: > > +void iput_single(struct inode *inode) > +{ > + if (atomic_dec_and_test(&inode->i_count)) { > + destroy_inode(inode); > + percpu_counter_dec(&nr_inodes); > + } > +} I wonder if it is possible to avoid the atomic_dec_and_test() here, at least in the common case, and combine it with the atomic_dec_and_test() of the dentry. A quick look at fs/inode.c indicates that inode->i_count may never get changed for a SINGLE inode, except during creation or deletion. It might be worth to - remove the conditional from iput_single() and measure that it makes a difference, - poison SINGLE inodes with some value and - put a BUG_ON() in __iget() that checks for the poison value. I _think_ the BUG_ON() is unnecessary, but at least my brain is not sufficient to convince me. Can inotify somehow get a hold of a socket? Or dquot (how insane would that be?) Jörn -- Mac is for working, Linux is for Networking, Windows is for Solitaire! -- stolen from dc -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/