Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932261AbWAZDuV (ORCPT ); Wed, 25 Jan 2006 22:50:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932265AbWAZDuP (ORCPT ); Wed, 25 Jan 2006 22:50:15 -0500 Received: from [202.53.187.9] ([202.53.187.9]:26347 "EHLO cust8446.nsw01.dataco.com.au") by vger.kernel.org with ESMTP id S932235AbWAZDtq (ORCPT ); Wed, 25 Jan 2006 22:49:46 -0500 From: Nigel Cunningham Subject: [ 23/23] [Suspend2] Don't scan LRU while freezer is on. Date: Thu, 26 Jan 2006 13:46:12 +1000 To: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Message-Id: <20060126034612.3178.23890.stgit@localhost.localdomain> In-Reply-To: <20060126034518.3178.55397.stgit@localhost.localdomain> References: <20060126034518.3178.55397.stgit@localhost.localdomain> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1502 Lines: 42 Stop processes from initiating scanning of the LRU while the freezer is on. This is primarily for the benefit of Suspend2, which could conceivably trigger LRU scanning through this path while writing the image, and would thus generate an inconsistent image and through it all sorts of trouble. Signed-off-by: Nigel Cunningham mm/page_alloc.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f9151b9..713d773 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -957,8 +958,8 @@ restart: /* This allocation should allow future memory freeing. */ - if (((p->flags & PF_MEMALLOC) || unlikely(test_thread_flag(TIF_MEMDIE))) - && !in_interrupt()) { + if ((((p->flags & PF_MEMALLOC) || unlikely(test_thread_flag(TIF_MEMDIE))) && + !in_interrupt()) || (test_freezer_state(FREEZER_ON))) { if (!(gfp_mask & __GFP_NOMEMALLOC)) { nofail_alloc: /* go through the zonelist yet again, ignoring mins */ -- Nigel Cunningham nigel at suspend2 dot net - 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/