Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932681AbcCKQKj (ORCPT ); Fri, 11 Mar 2016 11:10:39 -0500 Received: from smtprelay0014.hostedemail.com ([216.40.44.14]:53011 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932153AbcCKQKi (ORCPT ); Fri, 11 Mar 2016 11:10:38 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::::,RULES_HIT:41:355:379:421:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2731:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:5007:6261:6742:7514:7875:7903:8603:10004:10400:10848:10967:11026:11232:11473:11658:11914:12296:12438:12517:12519:12663:12740:13069:13255:13311:13357:13439:14659:14721:21080:21220,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,LFtime:2,LUA_SUMMARY:none X-HE-Tag: eye79_5c724482d2546 X-Filterd-Recvd-Size: 2653 Date: Fri, 11 Mar 2016 11:10:34 -0500 From: Steven Rostedt To: Andrey Ryabinin Cc: Alexander Potapenko , Dmitry Vyukov , Andrey Konovalov , Christoph Lameter , Andrew Morton , Joonsoo Kim , JoonSoo Kim , Kostya Serebryany , kasan-dev , LKML , "linux-mm@kvack.org" Subject: Re: [PATCH v4 5/7] mm, kasan: Stackdepot implementation. Enable stackdepot for SLAB Message-ID: <20160311111034.2255e3b3@gandalf.local.home> In-Reply-To: <56E2AF71.2050800@gmail.com> References: <00e9fa7d4adeac2d37a42cf613837e74850d929a.1456504662.git.glider@google.com> <56D471F5.3010202@gmail.com> <56D58398.2010708@gmail.com> <56E2AF71.2050800@gmail.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; 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: 975 Lines: 24 On Fri, 11 Mar 2016 14:43:45 +0300 Andrey Ryabinin wrote: > >> This is not about size, this about fragmentation. vmalloc allows to > >> utilize available low-order pages, > >> hence reduce the fragmentation. > > I've attempted to add __vmalloc(STACK_ALLOC_SIZE, alloc_flags, > > PAGE_KERNEL) (also tried vmalloc(STACK_ALLOC_SIZE)) instead of > > page_alloc() and am now getting a crash in > > kmem_cache_alloc_node_trace() in mm/slab.c, because it doesn't allow > > the kmem_cache pointer to be NULL (it's dereferenced when calling > > trace_kmalloc_node()). > > > > Steven, do you know if this because of my code violating some contract > > (e.g. I'm calling vmalloc() too early, when kmalloc_caches[] haven't > > been initialized), > > Probably. kmem_cache_init() goes before vmalloc_init(). Agreed, that function can not be called with cachep NULL, nor can it be called before kmem_cache is set up to point to kmem_cache_boot. -- Steve