Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933115AbbGJPDJ (ORCPT ); Fri, 10 Jul 2015 11:03:09 -0400 Received: from smtprelay0138.hostedemail.com ([216.40.44.138]:43930 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933044AbbGJPCs (ORCPT ); Fri, 10 Jul 2015 11:02:48 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:966:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2553:2559:2562:2731:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3872:4321:4385:5007:6119:6261:7875:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12438:12517:12519:12740:13069:13311:13357:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: knee94_525b29d671d30 X-Filterd-Recvd-Size: 3068 Date: Fri, 10 Jul 2015 11:02:42 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: LKML , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, Sebastian Andrzej Siewior , Peter Zijlstra Subject: Re: [patch] mm/slub: Move slab initialization into irq enabled region Message-ID: <20150710110242.25c84965@gandalf.local.home> In-Reply-To: <20150710120259.836414367@linutronix.de> References: <20150710120259.836414367@linutronix.de> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2122 Lines: 89 On Fri, 10 Jul 2015 12:07:13 -0000 Thomas Gleixner wrote: > /* > * Slab allocation and freeing > */ > @@ -1336,6 +1347,8 @@ static struct page *allocate_slab(struct > struct page *page; > struct kmem_cache_order_objects oo = s->oo; > gfp_t alloc_gfp; > + void *start, *p; > + int idx, order; > > flags &= gfp_allowed_mask; > > @@ -1364,8 +1377,11 @@ static struct page *allocate_slab(struct > stat(s, ORDER_FALLBACK); > } > > - if (kmemcheck_enabled && page > - && !(s->flags & (SLAB_NOTRACK | DEBUG_DEFAULT_FLAGS))) { > + if (!page) > + goto out; Since the above now looks like this: page = alloc_slab_page(s, alloc_gfp, node, oo); if (unlikely(!page)) { oo = s->min; alloc_gfp = flags; /* * Allocation may have failed due to fragmentation. * Try a lower order alloc if possible */ page = alloc_slab_page(s, alloc_gfp, node, oo); if (page) stat(s, ORDER_FALLBACK); } if (!page) goto out; Why not have it do this: page = alloc_slab_page(s, alloc_gfp, node, oo); if (unlikely(!page)) { oo = s->min; alloc_gfp = flags; /* * Allocation may have failed due to fragmentation. * Try a lower order alloc if possible */ page = alloc_slab_page(s, alloc_gfp, node, oo); if (unlikely(!page)) goto out; stat(s, ORDER_FALLBACK); } And get rid of the double check for !page in the fast path. -- Steve > + > + if (kmemcheck_enabled && > + !(s->flags & (SLAB_NOTRACK | DEBUG_DEFAULT_FLAGS))) { > int pages = 1 << oo_order(oo); > > kmemcheck_alloc_shadow(page, oo_order(oo), alloc_gfp, node); > @@ -1380,51 +1396,12 @@ static struct page *allocate_slab(struct > kmemcheck_mark_unallocated_pages(page, pages); > } > > - if (flags & __GFP_WAIT) > - local_irq_disable(); > if (!page) > - return NULL; > + goto out; > > page->objects = oo_objects(oo); -- 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/