Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4401092rwb; Mon, 16 Jan 2023 23:47:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXuv5LAXGEtFrkXf3ekGrGmpIZ3J1rGowR45l7mPGF2cGh49j057YUGxBn0ZQ7gYyg/VFnzk X-Received: by 2002:a05:6a21:1643:b0:b5:e639:2833 with SMTP id no3-20020a056a21164300b000b5e6392833mr28031530pzb.20.1673941632831; Mon, 16 Jan 2023 23:47:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673941632; cv=none; d=google.com; s=arc-20160816; b=e1tIfxzzAgHKfrFBZoyDzmUO1MfNhVq78w1CUsKhWMDQUOFN7F4gLr5gEeIY4U3Ud9 lJBmjrBaAmK/SFhxJTN/dbVCXcVJZY/7baqbJYYpTfOYfHW9Nypv9QBF8FVL42kdpJ6x 2YQ6aYDw6SCTmwrj1pKidvSGdtgPcUDFiv2kO8Ilk22LzkZwBLHg29cD41rN6Eve40Js LtJYnhK/E2Rtfzz2kPaECfQdhxluJFbLIrrpz2InylcyAToiBuwXeEtACC4UQFzu0Kau DJ+D+mqSowKtdlQfsjp4P9vLDUVjlhkIulp+yiBTuTes2TU1pjuMJGBzVMND1DiORg5q 9miw== 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 :content-language:references:to:subject:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=U0mBcioZaX4vf05VyQP2/c5bzQDfLI3vqPDrd98/xE0=; b=yFjBPE0EnY0pl/u85uI+YX0VzVOL5cafcbXXcqYCqP8wFNZjjQg6GUMmFmsTD/GR2i mZyr+IpfsRPNNbDGblq7wWA8BEFA47GxfrXOC+NAmU223Ba+bn0I0VhG1OkeXYnzkIwB kVtfxCqrRV7d9iETpyJ/51byPRF72jDvN4BPpr2bdepmbpVLuzKLGwMfXRt4AVxCeows QNTMT1mCgNMtkoVt0o+H1LU9UDJWqAjHTVeALsve/u0UHA5yDgGJAnlHrEbY744aiZR7 ffgnedjg+8ZGXlNV5+S2Ka7HklHxa2MNIi96sHuNVGaEZHXbify3ZVi/iQr3VE/Bxnfi 7gpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=cBRdVAWV; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=eCovFWZW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o12-20020a63f14c000000b00477aa9a43d5si31224501pgk.616.2023.01.16.23.47.05; Mon, 16 Jan 2023 23:47:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=cBRdVAWV; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=eCovFWZW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235620AbjAQH2h (ORCPT + 51 others); Tue, 17 Jan 2023 02:28:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235491AbjAQH2f (ORCPT ); Tue, 17 Jan 2023 02:28:35 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E95C22A38 for ; Mon, 16 Jan 2023 23:28:34 -0800 (PST) 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-out1.suse.de (Postfix) with ESMTPS id D5EF63801F; Tue, 17 Jan 2023 07:28:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1673940512; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U0mBcioZaX4vf05VyQP2/c5bzQDfLI3vqPDrd98/xE0=; b=cBRdVAWVauQu+ma+pgmWpgKDB50C9YxN56HyyUV0BBuyMKCSqojnRukr37eDN3yJDHvGaX VJl6+ahzBgsCkWdrogKfhBI0fruoc1jF+dA0xMzHgb46D8X6T7eV57VvyhBuwz9q5tJxsB I/Cu6JY9A5RAPAYLGUAco86zLWP7DxI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1673940512; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U0mBcioZaX4vf05VyQP2/c5bzQDfLI3vqPDrd98/xE0=; b=eCovFWZWudSp4fISHCKSx8qMutH78yK8Aa3TCOvwL/0QLa+INl8y8Q1GaGnVA+nJymMCDX n+CAx46zc0hs0dCw== 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 ACE6C13357; Tue, 17 Jan 2023 07:28:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NkwSKSBOxmN8NQAAMHmgww (envelope-from ); Tue, 17 Jan 2023 07:28:32 +0000 Message-ID: <7506d259-1e07-eb74-332b-c0a9064a4a1b@suse.cz> Date: Tue, 17 Jan 2023 08:28:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] mm: use stack_depot_early_init for kmemleak To: "zhaoyang.huang" , Andrew Morton , Catalin Marinas , Nathan Chancellor , Peter Zijlstra , Zhaoyang Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ke.wang@unisoc.com, Mirsad Todorovac , Borislav Petkov References: <1673935169-30019-1-git-send-email-zhaoyang.huang@unisoc.com> Content-Language: en-US From: Vlastimil Babka In-Reply-To: <1673935169-30019-1-git-send-email-zhaoyang.huang@unisoc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_SOFTFAIL autolearn=ham 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 1/17/23 06:59, zhaoyang.huang wrote: > From: Zhaoyang Huang > > Mirsad report bellow error which caused by stack_depot_init failed in kvcalloc. > Solve this by having stackdepot use stack_depot_early_init. This is not ideal because kmemleak can be configured so that it's only enabled on boot with kmemleak=on and not always. Please look into stack_depot_want_early_init() as suggested: https://lore.kernel.org/all/f53653bd-aab1-637e-c034-62761f262a03@suse.cz/ > On 1/4/23 17:08, Mirsad Goran Todorovac wrote: > I hate to bring bad news again, but there seems to be a problem with the output of /sys/kernel/debug/kmemleak: > > [root@pc-mtodorov ~]# cat /sys/kernel/debug/kmemleak > unreferenced object 0xffff951c118568b0 (size 16): > comm "kworker/u12:2", pid 56, jiffies 4294893952 (age 4356.548s) > hex dump (first 16 bytes): > 6d 65 6d 73 74 69 63 6b 30 00 00 00 00 00 00 00 memstick0....... > backtrace: > [root@pc-mtodorov ~]# > Apparently, backtrace of called functions on the stack is no longer printed with the list of memory leaks. > This appeared on Lenovo desktop 10TX000VCR, with AlmaLinux 8.7 and BIOS version M22KT49A (11/10/2022) > and 6.2-rc1 and 6.2-rc2 builds. > This worked on 6.1 with the same CONFIG_KMEMLEAK=y and MGLRU enabled on a vanilla mainstream kernel > from Mr. Torvalds' tree. I don't know if this is deliberate feature for some reason or a bug. > Please find attached the config, lshw and kmemleak output. > > reported-by: Mirsad Todorovac > Signed-off-by: Zhaoyang Huang > --- > lib/Kconfig.debug | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > index 401ad4b..50cc9f5 100644 > --- a/lib/Kconfig.debug > +++ b/lib/Kconfig.debug > @@ -727,6 +727,7 @@ config DEBUG_KMEMLEAK > select KALLSYMS > select CRC32 > select STACKDEPOT > + select STACKDEPOT_ALWAYS_INIT > help > Say Y here if you want to enable the memory leak > detector. The memory allocation/freeing is traced in a way