From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030197AbWF0GLs (ORCPT ); Tue, 27 Jun 2006 02:11:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030228AbWF0GLs (ORCPT ); Tue, 27 Jun 2006 02:11:48 -0400 Received: from smtp109.mail.mud.yahoo.com ([209.191.85.219]:37477 "HELO smtp109.mail.mud.yahoo.com") by vger.kernel.org with SMTP id S1030197AbWF0GLr (ORCPT ); Tue, 27 Jun 2006 02:11:47 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.au; h=Received:Message-ID:Date:From:User-Agent:X-Accept-Language:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Vdt/5E9F/xRu5YSXlwIEmXNyqCm9ho6uDLm6oHIaLkYeLWZwG0gggwP7IYvJesWsjGfEflSVNPZr4FMonZwp5/pVt1ItmBf66liYwJybselGm2IovWSR6nUkIiRXZXMDa3CMDfqMkXW26uV9AFWFzt/B4Hd28HmmwAxg1dtgEC8= ; Message-ID: <44A0CC28.5030508@yahoo.com.au> Date: Tue, 27 Jun 2006 16:11:52 +1000 From: Nick Piggin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051007 Debian/1.7.12-1 X-Accept-Language: en MIME-Version: 1.0 To: Nigel Cunningham CC: linux-kernel@vger.kernel.org Subject: Re: [Suspend2][ 07/13] [Suspend2] Page_alloc paranoia. References: <20060627044226.15066.7403.stgit@nigel.suspend2.net> <20060627044248.15066.52507.stgit@nigel.suspend2.net> In-Reply-To: <20060627044248.15066.52507.stgit@nigel.suspend2.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Nigel Cunningham wrote: > Add paranoia to the page_alloc code to ensure we don't start page reclaim > during suspending. > Nack. Set PF_MEMALLOC if you must. > Signed-off-by: Nigel Cunningham > > mm/page_alloc.c | 18 +++++++++++++----- > 1 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 253a450..838ae19 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -37,6 +38,7 @@ > #include > #include > #include > +#include "../kernel/power/pageflags.h" > > #include > #include > @@ -905,7 +907,8 @@ get_page_from_freelist(gfp_t gfp_mask, u > else > mark = (*z)->pages_high; > if (!zone_watermark_ok(*z, order, mark, > - classzone_idx, alloc_flags)) > + classzone_idx, alloc_flags) && > + likely(!test_freezer_state(FREEZER_ON))) > if (!zone_reclaim_mode || > !zone_reclaim(*z, gfp_mask, order)) > continue; > @@ -950,10 +953,12 @@ restart: > if (page) > goto got_pg; > > - do { > - if (cpuset_zone_allowed(*z, gfp_mask|__GFP_HARDWALL)) > - wakeup_kswapd(*z, order); > - } while (*(++z)); > + if (likely(!test_freezer_state(FREEZER_ON))) { > + do { > + if (cpuset_zone_allowed(*z, gfp_mask|__GFP_HARDWALL)) > + wakeup_kswapd(*z, order); > + } while (*(++z)); > + } > > /* > * OK, we're below the kswapd watermark and have kicked background > @@ -997,6 +1002,7 @@ nofail_alloc: > if (page) > goto got_pg; > if (gfp_mask & __GFP_NOFAIL) { > + BUG_ON(unlikely(test_freezer_state(FREEZING_COMPLETE))); > blk_congestion_wait(WRITE, HZ/50); > goto nofail_alloc; > } > @@ -1009,6 +1015,8 @@ nofail_alloc: > goto nopage; > > rebalance: > + BUG_ON(unlikely(test_freezer_state(FREEZER_ON))); > + > cond_resched(); > > /* We now go into synchronous reclaim */ > > -- > Nigel Cunningham nigel at suspend2 dot net -- SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com