Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1069823pxb; Wed, 6 Apr 2022 08:02:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg+3K8KKDASQhaJcqQ29L7JB7a64LwqDCX9mDL5PhhRln6QR9De67A/RD2pUu001PJdsXB X-Received: by 2002:a63:6bc9:0:b0:386:2e2b:41a2 with SMTP id g192-20020a636bc9000000b003862e2b41a2mr7497287pgc.444.1649257354832; Wed, 06 Apr 2022 08:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649257354; cv=none; d=google.com; s=arc-20160816; b=mHvdeYOG0Iw2jMhR11NTU/XBpzcfj1p5aM8tamXilMFdqeQoyKdHcAxMz905xawkFc 0Gy8TVe8Kv5y7817+G67CQHL4N/lYb1IoWQAAP6F52FoPjAta8kLcQQTBHwToBFTKhKs kvHlmkCC/gOHCKz6fJp2tgw62pYE3vI5I9TsHKmZMTCO/BIM5/6NhlCME9ktCWliafxt y4xZs75dxor+Sl3r62QotOeOjJInlWG7dRpCMSKpmZzyWZX26RYuM0hBsf7kqv9xsDg2 pcSruEQxDNzWcVzJ+YjI6RNCZPWk2sN7PbMnfP9S1YEkGsigkvEykheJrF4frnJ5Chtx Kq+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=SrjnSu7MjHBeqhbgwuRAlgVZcIuW8Y0moN9j8NoG/2Y=; b=ZKGr9IJ91Nh6PaffKOaXUTJNAPr29fLA5N7dpAmKlZajuz5yBbK96cGGGQsQiWjBo9 QZll+yse0SK0LMIx7kBIeKRW1Rvp1J+HPsxBCJKmIVRO6HpcuE7K0g1g55upxnybOoDM MCZF2wL3JZUu3iaY/F75gVfkQ/UjlSs+EayYNeW4scACsmxZIN7wD5Wy3lZCkHcmUlUf P2xc/HY9iFvqk4VaLq3p6JhPcnkTwJzmPTlFJaMvUa/xKgPHZiUmrfHUatGTPa/fvJO7 lwrbgHTnOyCKvj2BXbyUVNgpuWuOjiC8I6wGLhEkOfybipg7hQ42MoykILcHilF1aTAk kFzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=hK3uk7ZG; dkim=neutral (no key) header.i=@suse.cz header.b=fJQD4Pq0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p9-20020a639509000000b003816043f044si16335982pgd.569.2022.04.06.08.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:02:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=hK3uk7ZG; dkim=neutral (no key) header.i=@suse.cz header.b=fJQD4Pq0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ED75489318; Wed, 6 Apr 2022 05:48:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231434AbiDFMsS (ORCPT + 99 others); Wed, 6 Apr 2022 08:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232191AbiDFMrj (ORCPT ); Wed, 6 Apr 2022 08:47:39 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B91560F6 for ; Wed, 6 Apr 2022 02:03:26 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E32F01F38A; Wed, 6 Apr 2022 09:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1649235804; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SrjnSu7MjHBeqhbgwuRAlgVZcIuW8Y0moN9j8NoG/2Y=; b=hK3uk7ZGEbYQ9rMasmKvb/ieiNW3V8pdEqG7wto/Ka98MV5hqlcBOjjzdc4iDGvzs7y9xg 85Q40e4pWsJt06oN+1jHiFWMw2N9AjcCZWISGJWYBC84oXU5vXpDi5XizENheFcEuWsEQu dyqtnbYesQBoXzcTQPvIA7madlvgO4I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1649235804; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SrjnSu7MjHBeqhbgwuRAlgVZcIuW8Y0moN9j8NoG/2Y=; b=fJQD4Pq0hC66czHrzhbWHn2F86x6yzKpfmgdTskQvhKFEiSTcZCQumdQ1JHB4a9Q/UZX6u RBUWyQ0efG0HWVCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AEE28139F5; Wed, 6 Apr 2022 09:03:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xx4BKlxXTWKPeQAAMHmgww (envelope-from ); Wed, 06 Apr 2022 09:03:24 +0000 Message-ID: Date: Wed, 6 Apr 2022 11:03:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v3 3/6] mm/slub: use stackdepot to save stack trace in objects Content-Language: en-US To: David Rientjes Cc: Christoph Lameter , Joonsoo Kim , Pekka Enberg , Roman Gushchin , Andrew Morton , linux-mm@kvack.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org, Oliver Glitta , Marco Elver , Mike Rapoport , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Imran Khan References: <20220404164112.18372-1-vbabka@suse.cz> <20220404164112.18372-4-vbabka@suse.cz> <5f7d33ec-1e73-cdfc-54e5-e93d346ac78@google.com> From: Vlastimil Babka In-Reply-To: <5f7d33ec-1e73-cdfc-54e5-e93d346ac78@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/5/22 23:40, David Rientjes wrote: >> -static void set_track(struct kmem_cache *s, void *object, >> +static void noinline set_track(struct kmem_cache *s, void *object, >> enum track_item alloc, unsigned long addr) >> { >> struct track *p = get_track(s, object, alloc); >> >> -#ifdef CONFIG_STACKTRACE >> +#ifdef CONFIG_STACKDEPOT >> + unsigned long entries[TRACK_ADDRS_COUNT]; >> unsigned int nr_entries; >> >> - metadata_access_enable(); >> - nr_entries = stack_trace_save(kasan_reset_tag(p->addrs), >> - TRACK_ADDRS_COUNT, 3); >> - metadata_access_disable(); >> - >> - if (nr_entries < TRACK_ADDRS_COUNT) >> - p->addrs[nr_entries] = 0; >> + nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 3); >> + p->handle = stack_depot_save(entries, nr_entries, GFP_NOWAIT); > > I think this should also have __GFP_NOWARN set since this allocation could > easily fail and it would unnecessarily spam the kernel log unless we > actually care about the stack trace being printed later (and the patch > already indicates the allocation failed in print_track() when it matters). Good point. But turns out __stack_depot_save() adds it for us already. > Otherwise: > > Acked-by: David Rientjes Thanks!