[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091001151723.GA8028@localhost>
Date: Thu, 1 Oct 2009 23:17:23 +0800
From: Wu Fengguang <fengguang.wu@...el.com>
To: Jens Axboe <jens.axboe@...cle.com>
Cc: Jan Kara <jack@...e.cz>, Peter Zijlstra <peterz@...radead.org>,
Chris Mason <chris.mason@...cle.com>,
Artem Bityutskiy <dedekind1@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"david@...morbit.com" <david@...morbit.com>,
"hch@...radead.org" <hch@...radead.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
Theodore Ts'o <tytso@....edu>
Subject: Re: [PATCH 8/8] vm: Add an tuning knob for vm.max_writeback_mb
On Wed, Sep 30, 2009 at 08:10:30PM +0800, Jens Axboe wrote:
> On Wed, Sep 30 2009, Jan Kara wrote:
> > > +void bdi_writeback_wait(struct backing_dev_info *bdi, long nr_pages)
> > > +{
> > > + struct dirty_throttle_task tt = {
> > > + .nr_pages = nr_pages,
> > > + .complete = COMPLETION_INITIALIZER_ONSTACK(tt.complete),
> > > + };
> > > + struct wb_writeback_args args = {
> > > + .sync_mode = WB_SYNC_NONE,
> > > + .nr_pages = LONG_MAX,
> > > + .range_cyclic = 1,
> > > + .for_background = 1,
> > > + };
> > > + struct bdi_work work;
> > > +
> > > + bdi_work_init(&work, &args);
> > > + work.state |= WS_ONSTACK;
> > > +
> > > + /*
> > > + * make sure we will be waken up by someone
> > > + */
> > > + bdi_queue_work(bdi, &work);
> > This is wrong, you shouldn't submit the work like this because you'll
> > have to wait for completion (wb_clear_pending below is just bogus). You
> > should rather do bdi_start_writeback(bdi, NULL, 0).
>
> Indeed, the above will die a horrible death fairly soon. But we can add
> some "barrier" like synchronization, if you just wish to wait for
> previously submitted work to have been completed.
Thanks, I just purged that hack and go for bdi_start_writeback :)
Thanks,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists