From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: Re: [PATCH 1/2] mm: Make task in balance_dirty_pages() killable Date: Mon, 14 Nov 2011 20:12:45 +0800 Message-ID: <20111114121245.GA4616@localhost> References: <1321269030-6019-1-git-send-email-jack@suse.cz> <1321269030-6019-2-git-send-email-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "linux-fsdevel@vger.kernel.org" , Al Viro , "k-mio@sx.jp.nec.com" , Andrew Morton , Christoph Hellwig To: Jan Kara Return-path: Received: from mga14.intel.com ([143.182.124.37]:11554 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753361Ab1KNMMv (ORCPT ); Mon, 14 Nov 2011 07:12:51 -0500 Content-Disposition: inline In-Reply-To: <1321269030-6019-2-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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? > 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. > dirty_thresh = hard_dirty_limit(dirty_thresh); > /* > -- > 1.7.1