From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: RE: oops in 2.4.25 prune_icache() called from kswapd Date: Tue, 26 Jul 2005 08:01:32 -0300 Message-ID: <20050726110132.GE28003@dmt.cnet> References: <717252EC3E37AE4392E2614EA24E9F2B0CF4F9CA@txnexc01.americas.cpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Velupula, Prakash" , Albert Chu , David Woodhouse , Al Viro , linux-fsdevel@vger.kernel.org, lwoodman@redhat.com Return-path: Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:1953 "EHLO parcelfarce.linux.theplanet.co.uk") by vger.kernel.org with ESMTP id S261818AbVGZXfS (ORCPT ); Tue, 26 Jul 2005 19:35:18 -0400 To: Chris Caputo Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org FYI commit cc54d1333e409f714aa9c7db63f7f9ed07cc57a9 tree f301f581dd4389028f8b2588940d456904e552f1 parent 2e8f68c45925123d33d476ce369b570bd989dd9a author Larry Woodman Fri, 15 Jul 2005 11:32:08 -0400 committer Marcelo Tosatti Tue, 26 Jul 2005 07:52:46 -0300 [PATCH] workaround inode cache (prune_icache/__refile_inode) SMP races Over the past couple of weeks we have seen two races in the inode cache code. The first is between [dispose_list()] and __refile_inode() and the second is between prune_icache() and truncate_inodes(). I posted both of these patches but wanted to make sure they got properly reviewed and included in RHEL3-U6. --- a/fs/inode.c +++ b/fs/inode.c @@ -297,7 +297,7 @@ static inline void __refile_inode(struct { struct list_head *to; - if (inode->i_state & I_FREEING) + if (inode->i_state & (I_FREEING|I_CLEAR)) return; if (list_empty(&inode->i_hash)) return; @@ -634,7 +634,9 @@ void clear_inode(struct inode *inode) cdput(inode->i_cdev); inode->i_cdev = NULL; } + spin_lock(&inode_lock); inode->i_state = I_CLEAR; + spin_unlock(&inode_lock); } /* On Sun, Jun 19, 2005 at 11:07:44PM +0000, Chris Caputo wrote: > My basic repro method was: > > -- > 0) start irqbalance > 1) run loop_dbench, which is the following dbench script which uses > client_plain.txt: > > #!/bin/sh > > while [ 1 ] > do > date > dbench 2 > 2) wait for oops > -- > > I think I was using dbench-2.1: > > http://samba.org/ftp/tridge/dbench/dbench-2.1.tar.gz > > In my case irqbalance was key. If I didn't run it I never got the > problem. I think irqbalance just did a good job of exasperating a race > condition in some way.