Re: [PATCH 0/11] Per-bdi writeback flusher threads v8

From: Jens Axboe
Date: Wed May 27 2009 - 15:45:55 EST


On Wed, May 27 2009, Jens Axboe wrote:
> On Wed, May 27 2009, Jens Axboe wrote:
> > On Wed, May 27 2009, Theodore Tso wrote:
> > > On Wed, May 27, 2009 at 01:53:53PM -0400, Theodore Tso wrote:
> > > > On Wed, May 27, 2009 at 10:47:54AM -0400, Theodore Tso wrote:
> > > > >
> > > > > I'll retry the test with your stock writeback-v8 git branch w/o any
> > > > > ext4 patches planned the next mere window mainline to see if I get the
> > > > > same soft lockup, but I thought I should give you an early heads up.
> > > >
> > > > Confirmed. I had to run fsstress twice, but I was able to trigger a
> > > > soft hangup with just the per-bdi v8 patches using ext4.
> > >
> > > As you requested, here's the .config file which I used. This was on a
> > > Lenovo S10 (N270 Atom dual-core CPU, 1.5 gigs of memory, 5400 rpm hdd).
> >
> > If you have time, can you rerun with this little patch? It moves the
> > super sync to a separate thread. Thanks!

This one has been tested good, where good means that it boots and
functions normally at least. Whether it fixes your issue, that would be
interesting to know :-)

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index f71588c..cc246df 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -218,10 +218,14 @@ static __init int bdi_class_init(void)
}
postcore_initcall(bdi_class_init);

+static int bdi_sync_supers(void *unused);
+
static int __init default_bdi_init(void)
{
int err;

+ kthread_run(bdi_sync_supers, NULL, "bdi-super");
+
err = bdi_init(&default_backing_dev_info);
if (!err)
bdi_register(&default_backing_dev_info, NULL, "default");
@@ -412,6 +416,23 @@ static void bdi_flush_io(struct backing_dev_info *bdi)
generic_sync_bdi_inodes(NULL, &wbc);
}

+static int bdi_sync_supers(void *unused)
+{
+ set_user_nice(current, 0);
+
+ while (!kthread_should_stop()) {
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(msecs_to_jiffies(dirty_expire_interval * 10));
+
+ /*
+ * Do this periodically, like kupdated() did before.
+ */
+ sync_supers();
+ }
+
+ return 0;
+}
+
static int bdi_forker_task(void *ptr)
{
struct bdi_writeback *me = ptr;
@@ -424,11 +445,6 @@ static int bdi_forker_task(void *ptr)
struct bdi_writeback *wb;

/*
- * Do this periodically, like kupdated() did before.
- */
- sync_supers();
-
- /*
* Temporary measure, we want to make sure we don't see
* dirty data on the default backing_dev_info
*/

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/