From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: [PATCH 04/12] writeback: switch to per-bdi threads for flushing data Date: Tue, 26 May 2009 11:07:42 +0200 Message-ID: <20090526090741.GE11363@kernel.dk> References: <1243236887-3931-1-git-send-email-jens.axboe@oracle.com> <1243236887-3931-5-git-send-email-jens.axboe@oracle.com> <20090525095816.GC23546@duck.suse.cz> <20090526085648.GD11363@kernel.dk> <20090526085905.GA5094@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, chris.mason@oracle.com, david@fromorbit.com, akpm@linux-foundation.org, yanmin_zhang@linux.intel.com To: Christoph Hellwig Return-path: Received: from brick.kernel.dk ([93.163.65.50]:42935 "EHLO kernel.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753331AbZEZJHl (ORCPT ); Tue, 26 May 2009 05:07:41 -0400 Content-Disposition: inline In-Reply-To: <20090526085905.GA5094@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, May 26 2009, Christoph Hellwig wrote: > On Tue, May 26, 2009 at 10:56:48AM +0200, Jens Axboe wrote: > > > Hmm, so each BDI flusher thread is going to sync all the superblocks? > > > Isn't there a better way? I suppose we *should* be able to somehow go > > > from a BDI to a superblock (or maybe a list of those) so that we can write > > > per-fs metadata not bound to inodes. > > > > I just moved the sync_supers() to the bdi_forker_task(). That makes it > > global at the same interval of wakeups, instead of doing in the bdi > > threads. It would be nice to sync locally instead, but that's something > > that can wait for later (if ever). > > For now it might be easier to just have a separate thread for calling > sync_supers instead of interwinding it with the data writeback. > > Btw, XFS currently has a per-device thread for that, to avoid any global > contention. That's basically what the mentioned change does. bdi_forker_task() is a the default_backing_dev task, it does little more than simply setup new threads and such. -- Jens Axboe