From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: [PATCH 2/3] fs: move i_wb_list out from under inode_lock Date: Fri, 29 Oct 2010 08:47:44 +1100 Message-ID: <20101028214744.GF2715@dastard> References: <1288266161-28897-1-git-send-email-david@fromorbit.com> <1288266161-28897-3-git-send-email-david@fromorbit.com> <20101028141949.GB19174@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Christoph Hellwig Return-path: Content-Disposition: inline In-Reply-To: <20101028141949.GB19174@infradead.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Oct 28, 2010 at 10:19:49AM -0400, Christoph Hellwig wrote: > > + * Write out an inode's dirty pages. Called under inode_wb_list_l= ock. Either > > + * the caller has ref on the inode (either via __iget or via sysca= ll against an > > + * fd) or the inode has I_WILL_FREE set. >=20 > Just drop mentioning of how we got the reference ,it's rather pointle= ss. OK. > > writeback_single_inode(struct inode *inode, struct writeback_contr= ol *wbc) > > @@ -354,7 +368,7 @@ writeback_single_inode(struct inode *inode, str= uct writeback_control *wbc) > > inode->i_state |=3D I_SYNC; > > inode->i_state &=3D ~I_DIRTY_PAGES; > > spin_unlock(&inode->i_lock); > > - spin_unlock(&inode_lock); > > + spin_unlock(&inode_wb_list_lock); >=20 > We don't actually need inode_wb_list_lock here. But I guess we can > fix this later and be conservative for now. Hmmm - I think you are right. However, there are lots of opportunities for cleaning up the locking in this area=C5=9F so leaving it for later is probably best. > > @@ -963,63 +976,62 @@ void __mark_inode_dirty(struct inode *inode, = int flags) >=20 > I think the __mark_inode_dirty cleanup should be a separate patch, > it's rather confusing in the current form. Ok. I'll leave it out for now - there's various other cleanups needed here now as well (e.g. the unlocked flags check is not needed to avoid a global lock anymore) so I'll leave that for later, too. > > + if (was_dirty) { > > +out_unlock_inode: > > spin_unlock(&inode->i_lock); > > + return; > > + } >=20 > Please just move the label to the end of the function and add another > goto here. Will do. Cheers, Dave. --=20 Dave Chinner david@fromorbit.com