From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 1/2] mm: Make task in balance_dirty_pages() killable Date: Mon, 14 Nov 2011 13:37:50 +0100 Message-ID: <20111114123750.GF5230@quack.suse.cz> References: <1321269030-6019-1-git-send-email-jack@suse.cz> <1321269030-6019-2-git-send-email-jack@suse.cz> <20111114121245.GA4616@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , "linux-fsdevel@vger.kernel.org" , Al Viro , "k-mio@sx.jp.nec.com" , Andrew Morton , Christoph Hellwig To: Wu Fengguang Return-path: Received: from cantor2.suse.de ([195.135.220.15]:56594 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752787Ab1KNMiN (ORCPT ); Mon, 14 Nov 2011 07:38:13 -0500 Content-Disposition: inline In-Reply-To: <20111114121245.GA4616@localhost> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon 14-11-11 20:12:45, Wu Fengguang wrote: > On Mon, Nov 14, 2011 at 07:10:29PM +0800, Jan Kara wrote: > > There is no reason why task in balance_dirty_pages() shouldn't be killable > > and it helps in recovering from some error conditions (like when filesystem > > goes in error state and cannot accept writeback anymore but we still want to > > kill processes using it to be able to unmount it). > > > > Reported-by: Kazuya Mio > > Tested-by: Kazuya Mio > > Signed-off-by: Jan Kara > > --- > > mm/page-writeback.c | 4 +++- > > 1 files changed, 3 insertions(+), 1 deletions(-) > > > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > > index 0360d1b..e83c286 100644 > > --- a/mm/page-writeback.c > > +++ b/mm/page-writeback.c > > @@ -1133,8 +1133,10 @@ pause: > > pages_dirtied, > > pause, > > start_time); > > - __set_current_state(TASK_UNINTERRUPTIBLE); > > + __set_current_state(TASK_KILLABLE); > > Dumb question: will the task continue to show up as 'D' in ps? Yes, it will. The only difference is that the task will be woken when SIGKILL arrives. > > io_schedule_timeout(pause); > > + if (fatal_signal_pending(current)) > > + break; > > I'd like to move that several lines below, to the end of the loop, > so that the condition is not tested at all in normal executions. OK, will do that. > > dirty_thresh = hard_dirty_limit(dirty_thresh); > > /* Honza -- Jan Kara SUSE Labs, CR