From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751942Ab1GTNns (ORCPT ); Wed, 20 Jul 2011 09:43:48 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55230 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754Ab1GTNnr (ORCPT ); Wed, 20 Jul 2011 09:43:47 -0400 Date: Wed, 20 Jul 2011 14:43:42 +0100 From: Mel Gorman To: Pekka Enberg Cc: Konstantin Khlebnikov , Andrew Morton , linux-mm@kvack.org, Christoph Lameter , linux-kernel@vger.kernel.org, Matt Mackall Subject: Re: [PATCH] mm-slab: allocate kmem_cache with __GFP_REPEAT Message-ID: <20110720134342.GK5349@suse.de> References: <20110720121612.28888.38970.stgit@localhost6> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 20, 2011 at 04:14:51PM +0300, Pekka Enberg wrote: > On Wed, 20 Jul 2011, Konstantin Khlebnikov wrote: > >Order of sizeof(struct kmem_cache) can be bigger than PAGE_ALLOC_COSTLY_ORDER, > >thus there is a good chance of unsuccessful allocation. > >With __GFP_REPEAT buddy-allocator will reclaim/compact memory more aggressively. > > > >Signed-off-by: Konstantin Khlebnikov > >--- > >mm/slab.c | 2 +- > >1 files changed, 1 insertions(+), 1 deletions(-) > > > >diff --git a/mm/slab.c b/mm/slab.c > >index d96e223..53bddc8 100644 > >--- a/mm/slab.c > >+++ b/mm/slab.c > >@@ -2304,7 +2304,7 @@ kmem_cache_create (const char *name, size_t size, size_t align, > > gfp = GFP_NOWAIT; > > > > /* Get cache's description obj. */ > >- cachep = kmem_cache_zalloc(&cache_cache, gfp); > >+ cachep = kmem_cache_zalloc(&cache_cache, gfp | __GFP_REPEAT); > > if (!cachep) > > goto oops; > > The changelog isn't that convincing, really. This is > kmem_cache_create() so I'm surprised we'd ever get NULL here in > practice. Does this fix some problem you're seeing? If this is > really an issue, I'd blame the page allocator as GFP_KERNEL should > just work. > Besides, is allocating from cache_cache really a PAGE_ALLOC_COSTLY_ORDER allocation? On my laptop at least, it's an order-2 allocation which is supporting up to 512 CPUs and 512 nodes. -- Mel Gorman SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with ESMTP id C7C406B004A for ; Wed, 20 Jul 2011 09:43:53 -0400 (EDT) Date: Wed, 20 Jul 2011 14:43:42 +0100 From: Mel Gorman Subject: Re: [PATCH] mm-slab: allocate kmem_cache with __GFP_REPEAT Message-ID: <20110720134342.GK5349@suse.de> References: <20110720121612.28888.38970.stgit@localhost6> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Pekka Enberg Cc: Konstantin Khlebnikov , Andrew Morton , linux-mm@kvack.org, Christoph Lameter , linux-kernel@vger.kernel.org, Matt Mackall On Wed, Jul 20, 2011 at 04:14:51PM +0300, Pekka Enberg wrote: > On Wed, 20 Jul 2011, Konstantin Khlebnikov wrote: > >Order of sizeof(struct kmem_cache) can be bigger than PAGE_ALLOC_COSTLY_ORDER, > >thus there is a good chance of unsuccessful allocation. > >With __GFP_REPEAT buddy-allocator will reclaim/compact memory more aggressively. > > > >Signed-off-by: Konstantin Khlebnikov > >--- > >mm/slab.c | 2 +- > >1 files changed, 1 insertions(+), 1 deletions(-) > > > >diff --git a/mm/slab.c b/mm/slab.c > >index d96e223..53bddc8 100644 > >--- a/mm/slab.c > >+++ b/mm/slab.c > >@@ -2304,7 +2304,7 @@ kmem_cache_create (const char *name, size_t size, size_t align, > > gfp = GFP_NOWAIT; > > > > /* Get cache's description obj. */ > >- cachep = kmem_cache_zalloc(&cache_cache, gfp); > >+ cachep = kmem_cache_zalloc(&cache_cache, gfp | __GFP_REPEAT); > > if (!cachep) > > goto oops; > > The changelog isn't that convincing, really. This is > kmem_cache_create() so I'm surprised we'd ever get NULL here in > practice. Does this fix some problem you're seeing? If this is > really an issue, I'd blame the page allocator as GFP_KERNEL should > just work. > Besides, is allocating from cache_cache really a PAGE_ALLOC_COSTLY_ORDER allocation? On my laptop at least, it's an order-2 allocation which is supporting up to 512 CPUs and 512 nodes. -- Mel Gorman SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org