From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757374AbZEAWU0 (ORCPT ); Fri, 1 May 2009 18:20:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753222AbZEAWUH (ORCPT ); Fri, 1 May 2009 18:20:07 -0400 Received: from ey-out-2122.google.com ([74.125.78.24]:41699 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753143AbZEAWUF (ORCPT ); Fri, 1 May 2009 18:20:05 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=vaAx9BHBnGVRAZ9NOIQK44cE8NhOwcwD0zBZPP+DeI00zn4c1VRIOQI0TbS5ZEJN5p +yw4utcJtd6I8Qc4hZxlD8x5gwR5JNuWzmFfvYIKBRZyT1yelnGJjKKzhKVfhmh8UT8a 9B8vnoTZJTrYPrESicxCPZ1CMjqUfw+4z06sQ= Date: Sat, 2 May 2009 00:20:02 +0200 From: Frederic Weisbecker To: Ingo Molnar Cc: LKML , Jeff Mahoney , ReiserFS Development List , Chris Mason , Alexander Beregalov , Alessio Igor Bogani , Jonathan Corbet , Alexander Viro Subject: Re: [PATCH 2/6] kill-the-BKL/reiserfs: release the write lock before rescheduling on do_journal_end() Message-ID: <20090501222001.GD6404@nowhere> References: <1241145862-21700-1-git-send-email-fweisbec@gmail.com> <1241145862-21700-3-git-send-email-fweisbec@gmail.com> <20090501070911.GG5983@elte.hu> <20090501133147.GF6011@nowhere> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090501133147.GF6011@nowhere> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 01, 2009 at 03:31:48PM +0200, Frederic Weisbecker wrote: > On Fri, May 01, 2009 at 09:09:11AM +0200, Ingo Molnar wrote: > > > > * Frederic Weisbecker wrote: > > > > > When do_journal_end() copies data to the journal blocks buffers in memory, > > > it reschedules if needed between each block copied and dirtyfied. > > > > > > We can also release the write lock at this rescheduling stage, > > > like did the bkl implicitly. > > > > > > [ Impact: release the reiserfs write lock when it is not needed ] > > > > > > Cc: Jeff Mahoney > > > Cc: Chris Mason > > > Cc: Alexander Beregalov > > > Signed-off-by: Frederic Weisbecker > > > --- > > > fs/reiserfs/journal.c | 2 ++ > > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > > > diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c > > > index 7976d7d..373d080 100644 > > > --- a/fs/reiserfs/journal.c > > > +++ b/fs/reiserfs/journal.c > > > @@ -4232,7 +4232,9 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, > > > next = cn->next; > > > free_cnode(sb, cn); > > > cn = next; > > > + reiserfs_write_unlock(sb); > > > cond_resched(); > > > + reiserfs_write_lock(sb); > > > > There's 8 cond_resched()'s in the code - i'd suggest to introduce a > > helper for this - reiserfs_write_cond_resched(sb) or so? > > > > Ingo > > Indeed, that + the pattern suggested by Al. s/Al/Andi Sorry for the confusion. > Thanks. >