From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754015AbdJILDg (ORCPT ); Mon, 9 Oct 2017 07:03:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:44001 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751581AbdJILDe (ORCPT ); Mon, 9 Oct 2017 07:03:34 -0400 Date: Mon, 9 Oct 2017 13:03:32 +0200 From: Jan Kara To: Yafang Shao Cc: Jan Kara , Andrew Morton , mhocko@suse.com, Johannes Weiner , vdavydov.dev@gmail.com, jlayton@redhat.com, nborisov@suse.com, "Theodore Ts'o" , mawilcox@microsoft.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, axboe@kernel.dk Subject: Re: [PATCH] mm/page-writeback.c: fix bug caused by disable periodic writeback Message-ID: <20171009110332.GG17917@quack2.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 09-10-17 18:44:23, Yafang Shao wrote: > 2017-10-09 17:56 GMT+08:00 Jan Kara : > > On Sat 07-10-17 06:58:04, Yafang Shao wrote: > >> After disable periodic writeback by writing 0 to > >> dirty_writeback_centisecs, the handler wb_workfn() will not be > >> entered again until the dirty background limit reaches or > >> sync syscall is executed or no enough free memory available or > >> vmscan is triggered. > >> So the periodic writeback can't be enabled by writing a non-zero > >> value to dirty_writeback_centisecs > >> As it can be disabled by sysctl, it should be able to enable by > >> sysctl as well. > >> > >> Signed-off-by: Yafang Shao > >> --- > >> mm/page-writeback.c | 8 +++++++- > >> 1 file changed, 7 insertions(+), 1 deletion(-) > >> > >> diff --git a/mm/page-writeback.c b/mm/page-writeback.c > >> index 0b9c5cb..e202f37 100644 > >> --- a/mm/page-writeback.c > >> +++ b/mm/page-writeback.c > >> @@ -1972,7 +1972,13 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb) > >> int dirty_writeback_centisecs_handler(struct ctl_table *table, int write, > >> void __user *buffer, size_t *length, loff_t *ppos) > >> { > >> - proc_dointvec(table, write, buffer, length, ppos); > >> + unsigned int old_interval = dirty_writeback_interval; > >> + int ret; > >> + > >> + ret = proc_dointvec(table, write, buffer, length, ppos); > >> + if (!ret && !old_interval && dirty_writeback_interval) > >> + wakeup_flusher_threads(0, WB_REASON_PERIODIC); > >> + > > > > I agree it is good to schedule some writeback. However Jens has some > > changes queued in linux-block tree in this area so your change won't apply. > > So please base your changes on his tree. > > > > Do you mean this tree > git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git ? > > I have checked his tree and find nothing need to change on my patch. Yes, I mean that tree. Check the wb_start_all branch. Honza -- Jan Kara SUSE Labs, CR