Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754042Ab0HYUns (ORCPT ); Wed, 25 Aug 2010 16:43:48 -0400 Received: from smtp-out.google.com ([74.125.121.35]:42357 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753255Ab0HYUnl (ORCPT ); Wed, 25 Aug 2010 16:43: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=SYudKBrDFT9W+nvGMP8i1jVM9dVIIkkMNZYzcVQqKC5WjZDxmVsWvGuLo+lq7l35r y47eXIqseO3ouVPtJFmXg== Date: Wed, 25 Aug 2010 13:43:34 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Peter Zijlstra cc: Theodore Tso , Jens Axboe , Andrew Morton , Neil Brown , Alasdair G Kergon , Chris Mason , Steven Whitehouse , Jan Kara , Frederic Weisbecker , "linux-raid@vger.kernel.org" , "linux-btrfs@vger.kernel.org" , "cluster-devel@redhat.com" , "linux-ext4@vger.kernel.org" , "reiserfs-devel@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [patch 1/5] mm: add nofail variants of kmalloc kcalloc and kzalloc In-Reply-To: <1282743090.2605.3696.camel@laptop> Message-ID: References: <1282656558.2605.2742.camel@laptop> <4C73CA24.3060707@fusionio.com> <20100825112433.GB4453@thunk.org> <1282736132.2605.3563.camel@laptop> <20100825115709.GD4453@thunk.org> <1282740516.2605.3644.camel@laptop> <1282740778.2605.3652.camel@laptop> <1282743090.2605.3696.camel@laptop> 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: 1281 Lines: 29 On Wed, 25 Aug 2010, Peter Zijlstra wrote: > I'm not sure, but I think the cgroup thing doesn't account kernel > allocations, in which case the above problem doesn't exist. > Right, the only cgroup that does is cpusets because it binds the memory allocations to a set of nodes. > For the cpuset case we punch through the cpuset constraints for kernel > allocations (unless __GFP_HARDWALL). > __GFP_HARDWALL doesn't mean that the allocation won't be constrained, this is a common misconception. __GFP_HARDWALL only prevents us from looking at our cpuset.mem_exclusive flag and checking our nearest common ancestor cpuset if we can block. The cpusets case is actually the easiest to fix: use GFP_ATOMIC. GFP_ATOMIC allocations aren't bound by any cpuset and, in the general case, can allocate below the min watermark because of ALLOC_HARD | ALLOC_HARDER in the page allocator which creates the notion of "memory reserves" available to these tasks. Then, success really depends on the setting of the watermarks instead. -- 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/