From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D31BC6379F for ; Tue, 17 Jan 2023 07:28:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E127E6B0074; Tue, 17 Jan 2023 02:28:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DC26F6B0075; Tue, 17 Jan 2023 02:28:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C63C36B0078; Tue, 17 Jan 2023 02:28:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B06906B0074 for ; Tue, 17 Jan 2023 02:28:36 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8EFF1140377 for ; Tue, 17 Jan 2023 07:28:36 +0000 (UTC) X-FDA: 80363463432.01.FCF37D4 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf29.hostedemail.com (Postfix) with ESMTP id 9FFF9120002 for ; Tue, 17 Jan 2023 07:28:34 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=cBRdVAWV; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=eCovFWZW; spf=pass (imf29.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673940515; h=from:from:sender:reply-to:subject:subject: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:dkim-signature; bh=U0mBcioZaX4vf05VyQP2/c5bzQDfLI3vqPDrd98/xE0=; b=0jJphPeSOMuwVF70Jvlv/BAhQDtGOKLviSZNRGgmWu20dnuAtavvFYLZmNHCl/mEefXNPP 5WqJ90MKEooOJg4828vccc93psksNMKl0hc/E2oChBvUKqa7AiHKdTTFfHBuxZXE8KLPEc euZEI2YUGwwMKXaLrhbDzxXsn8mIlDg= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=cBRdVAWV; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=eCovFWZW; spf=pass (imf29.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673940515; a=rsa-sha256; cv=none; b=HLuY2u5cRyKSKF0+wdY0SsiFDjOh/ARjVgTez+UqFa+175LJ2v3uxTTRBmL7MY1fZ+oPpI NA+VylLRtswudBFdke/OjCWQkY7vp4ShkSvrLEbT5cQkIz3M/n0wDvsavAjIddtfiTo4tI 3aabsfdZVpC5Adsit2xt8GCSnOefJQk= 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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9FFF9120002 X-Stat-Signature: s5oi9kkxsowqrzoscjzkmc5hxtscraa1 X-HE-Tag: 1673940514-213815 X-HE-Meta: U2FsdGVkX18SJ77EAmgrp4wzdTJYUbMRclHr8g9JYE8mdQShqoANPtl9rYpk19C1yPG8qYqwf73LoL3lv3DA9zlvR2xbmyXRT5U8hCnsEVtNEUrS5/G+tQIQ4zKNlgkmpvCat6FAQZdLD5lyNL3IfsIhnvb6qIB55Zhyjr31wPa9ScYXvjnWOBKkpSjSuVl6MlQXZTUxU7StZVgH1zvFJ5sHobGdooGR9yv+FzC9VSA79Fjrk3p+J8F/I2JmNGwMxLYo30wWmAmEcEhnIQEj6fqe7EAV8fr9ZfcjJ8oEAiZLfu4nU+eMzmfZ9Onl8FzO8NkfBrLlVLZMaLmWJQOYG4mqIA5oo2OLbXEMurvXNTGe82J/io1BbgiV+KCNRS8syPBek+dBKxrcLLkT21A6lU01FbqfvpvbyOlpuGgl3teNtZu1NiDDkJQURdaD6/FFqCt3MPhI7Z3KP8q9zBGlS3J9Z2RX3Io6lGg9VP0qxSIqYJa4Wel6hiPVqLDkGLJMANyoqr3n3XYZqAsj1+EIoa6Sey6ihjYUp0szl0NE1cFNmr3oprHENth1s4u2cTiba4vt4Nb/L7iOSqPPKqnqr+nKXwyOL3VM6BkRgHuH/x1y2Ypwzk4bCCPAlXgR4PJ8DbUGt0JUNlLHtlGJ6RV4I20244b3vF7Xe00VURLlQ6Gp9VRg53RxWGtn3Zy8L7EqzvlvoITfQEb1GfQt7/nR9YWcz60+3w06973xKKPSJ4iQ52A23aiZt0fSO/r6NF/qbHZXRRg3dwf+xYR9z5KnxYAyDpY8p3wfxBAM6750NnwH7GHFWPn7mJ0StJEOh4iQVPKpg5HfKGLzUJ09ijOYIq6hoWaTZfvWxcWSyOrcMnWOGKQMQtkXKeDW6DWXaOl2+5fXSu088IGrvtQQ63oO/xTZNRfqehGAtwHUhS5yw3NqFjT9+3MbEXwhygID5JbWficG4908HExr42+HYJ1 MGg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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