Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932308AbZGOU3m (ORCPT ); Wed, 15 Jul 2009 16:29:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932283AbZGOU3m (ORCPT ); Wed, 15 Jul 2009 16:29:42 -0400 Received: from smtp-out.google.com ([216.239.45.13]:25308 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932259AbZGOU3l (ORCPT ); Wed, 15 Jul 2009 16:29:41 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id: references:user-agent:mime-version:content-type:x-system-of-record; b=iWiX0IZiVxMfPxO36xZ+FfHXCgkY7dibM6Ni7GaSRsVVbAfTpW87E2Cjuq9tG80Wd cNOyCZWZIRXkutGYWoPLQ== Date: Wed, 15 Jul 2009 13:29:33 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Mel Gorman cc: Andrew Morton , Nick Piggin , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] page-allocator: Ensure that processes that have been OOM killed exit the page allocator (resend) In-Reply-To: <20090715104944.GC9267@csn.ul.ie> Message-ID: References: <20090715104944.GC9267@csn.ul.ie> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1191 Lines: 32 On Wed, 15 Jul 2009, Mel Gorman wrote: > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index f8902e7..5c98d02 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1547,6 +1547,14 @@ should_alloc_retry(gfp_t gfp_mask, unsigned int order, > if (gfp_mask & __GFP_NORETRY) > return 0; > > + /* Do not loop if OOM-killed unless __GFP_NOFAIL is specified */ > + if (test_thread_flag(TIF_MEMDIE)) { > + if (gfp_mask & __GFP_NOFAIL) > + WARN(1, "Potential infinite loop with __GFP_NOFAIL"); > + else > + return 0; > + } > + > /* > * In this implementation, order <= PAGE_ALLOC_COSTLY_ORDER > * means __GFP_NOFAIL, but that may not be true in other > This only works for GFP_ATOMIC since the next iteration of the page allocator will (probably) fail reclaim and simply invoke the oom killer again, which will notice current has TIF_MEMDIE set and choose to do nothing, at which time the allocator simply loops again. -- 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/