Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753344AbbGAHcz (ORCPT ); Wed, 1 Jul 2015 03:32:55 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47112 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949AbbGAHcp (ORCPT ); Wed, 1 Jul 2015 03:32:45 -0400 Date: Wed, 1 Jul 2015 09:32:40 +0200 From: Jan Kara To: Tejun Heo Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, jack@suse.cz, hch@infradead.org, hannes@cmpxchg.org, linux-fsdevel@vger.kernel.org, vgoyal@redhat.com, lizefan@huawei.com, cgroups@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.cz, clm@fb.com, fengguang.wu@intel.com, david@fromorbit.com, gthelen@google.com, khlebnikov@yandex-team.ru Subject: Re: [PATCH 38/51] writeback: make laptop_mode_timer_fn() handle multiple bdi_writeback's Message-ID: <20150701073240.GY7252@quack.suse.cz> References: <1432329245-5844-1-git-send-email-tj@kernel.org> <1432329245-5844-39-git-send-email-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432329245-5844-39-git-send-email-tj@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1920 Lines: 62 On Fri 22-05-15 17:13:52, Tejun Heo wrote: > For cgroup writeback support, all bdi-wide operations should be > distributed to all its wb's (bdi_writeback's). > > This patch updates laptop_mode_timer_fn() so that it invokes > wb_start_writeback() on all wb's rather than just the root one. As > the intent is writing out all dirty data, there's no reason to split > the number of pages to write. > > Signed-off-by: Tejun Heo > Cc: Jens Axboe > Cc: Jan Kara Looks good. You can add: Reviewed-by: Jan Kara Honza > --- > mm/page-writeback.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > index 6301af2..682e3a6 100644 > --- a/mm/page-writeback.c > +++ b/mm/page-writeback.c > @@ -1723,14 +1723,20 @@ void laptop_mode_timer_fn(unsigned long data) > struct request_queue *q = (struct request_queue *)data; > int nr_pages = global_page_state(NR_FILE_DIRTY) + > global_page_state(NR_UNSTABLE_NFS); > + struct bdi_writeback *wb; > + struct wb_iter iter; > > /* > * We want to write everything out, not just down to the dirty > * threshold > */ > - if (bdi_has_dirty_io(&q->backing_dev_info)) > - wb_start_writeback(&q->backing_dev_info.wb, nr_pages, true, > - WB_REASON_LAPTOP_TIMER); > + if (!bdi_has_dirty_io(&q->backing_dev_info)) > + return; > + > + bdi_for_each_wb(wb, &q->backing_dev_info, &iter, 0) > + if (wb_has_dirty_io(wb)) > + wb_start_writeback(wb, nr_pages, true, > + WB_REASON_LAPTOP_TIMER); > } > > /* > -- > 2.4.0 > -- Jan Kara SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/