Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752271AbcDKHmP (ORCPT ); Mon, 11 Apr 2016 03:42:15 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:37002 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753185AbcDKHmL (ORCPT ); Mon, 11 Apr 2016 03:42:11 -0400 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Mon, 11 Apr 2016 16:44:52 +0900 From: Joonsoo Kim To: Alexander Potapenko Cc: adech.fo@gmail.com, cl@linux.com, dvyukov@google.com, akpm@linux-foundation.org, ryabinin.a.a@gmail.com, rostedt@goodmis.org, kcc@google.com, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v7 5/7] mm, kasan: Stackdepot implementation. Enable stackdepot for SLAB Message-ID: <20160411074452.GC26116@js1304-P5Q-DELUXE> References: <4f6880ee0c1545b3ae9c25cfe86a879d724c4e7b.1457949315.git.glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4f6880ee0c1545b3ae9c25cfe86a879d724c4e7b.1457949315.git.glider@google.com> 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 Content-Length: 798 Lines: 31 On Mon, Mar 14, 2016 at 11:43:43AM +0100, Alexander Potapenko wrote: > +depot_stack_handle_t depot_save_stack(struct stack_trace *trace, > + gfp_t alloc_flags) > +{ > + u32 hash; > + depot_stack_handle_t retval = 0; > + struct stack_record *found = NULL, **bucket; > + unsigned long flags; > + struct page *page = NULL; > + void *prealloc = NULL; > + bool *rec; > + > + if (unlikely(trace->nr_entries == 0)) > + goto fast_exit; > + > + rec = this_cpu_ptr(&depot_recursion); > + /* Don't store the stack if we've been called recursively. */ > + if (unlikely(*rec)) > + goto fast_exit; > + *rec = true; > + > + hash = hash_stack(trace->entries, trace->nr_entries); > + /* Bad luck, we won't store this stack. */ > + if (hash == 0) > + goto exit; Hello, why is hash == 0 skipped? Thanks.