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: Wed, 16 Nov 2011 19:28:19 +0800 Message-ID: <20111116112819.GB6898@localhost> References: <1321441935-6802-1-git-send-email-jack@suse.cz> <1321441935-6802-2-git-send-email-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Christoph Hellwig , Al Viro , "linux-fsdevel@vger.kernel.org" , Neil Brown , KOSAKI Motohiro , Anton Altaparmakov To: Jan Kara Return-path: Received: from mga03.intel.com ([143.182.124.21]:2567 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756090Ab1KPL2X (ORCPT ); Wed, 16 Nov 2011 06:28:23 -0500 Content-Disposition: inline In-Reply-To: <1321441935-6802-2-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Nov 16, 2011 at 07:12:14PM +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). Here I'd like to add a paragraph from my original patch: The follow up patches will further abort the generic_perform_write() and other filesystem write loops, to avoid large write + SIGKILL combination exceeding the dirty limit and possibly strange OOM. Thanks, Fengguang > Reported-by: Kazuya Mio > Tested-by: Kazuya Mio > Signed-off-by: Jan Kara > --- > mm/page-writeback.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > index 0360d1b..39f5805 100644 > --- a/mm/page-writeback.c > +++ b/mm/page-writeback.c > @@ -1133,7 +1133,7 @@ pause: > pages_dirtied, > pause, > start_time); > - __set_current_state(TASK_UNINTERRUPTIBLE); > + __set_current_state(TASK_KILLABLE); > io_schedule_timeout(pause); > > dirty_thresh = hard_dirty_limit(dirty_thresh); > @@ -1145,6 +1145,9 @@ pause: > */ > if (nr_dirty < dirty_thresh) > break; > + > + if (fatal_signal_pending(current)) > + break; > } > > if (!dirty_exceeded && bdi->dirty_exceeded) > -- > 1.7.1