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 AA2D0C00A5A for ; Thu, 19 Jan 2023 10:03:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4650E6B0075; Thu, 19 Jan 2023 05:03:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3EEB66B007B; Thu, 19 Jan 2023 05:03:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 290886B007E; Thu, 19 Jan 2023 05:03:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 156416B0075 for ; Thu, 19 Jan 2023 05:03:53 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id DCD5CAAB22 for ; Thu, 19 Jan 2023 10:03:52 +0000 (UTC) X-FDA: 80371112304.22.29B5119 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id 53DD040010 for ; Thu, 19 Jan 2023 10:03:51 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=GxSyjf7n; spf=pass (imf27.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674122631; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WW8nAeaUjBnYgvr+9asyE4PmsFFRHV6OzDwWyuD6CFQ=; b=iDcXyNri+lCghU/M8nRLJIvYWbqFhwKw7Tz2FIcEUCQT+MKGiigDk/a47sWQGyJrmV7XLq cVBluxoCZKPRGUTNy1BqfCB+VmZp7V5eN7bJJjr0rr0drEGWE0bZQ7fjJyQvf7GBe8LMSI EQJqe5UyrrWs8t3bvW8RiLS7shuqZbA= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=GxSyjf7n; spf=pass (imf27.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674122631; a=rsa-sha256; cv=none; b=opvISsZmQmhwteAYhzryVZElwepkb8+wN7bDMyiVC8A5F2QwzsBmTPWMj6FCqevoB/Swtb MMxTXrLRivLU5485KUuphMSdE9R3jN1MdNEaMRE6ru/aWa+z97cAdri5xqFibTG1ra4+BR 58juQwzpdHW3AcHNbbdbhoij6Vzx1/Y= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 64CA06136E; Thu, 19 Jan 2023 10:03:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F14A5C433EF; Thu, 19 Jan 2023 10:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674122629; bh=ma+Mar42lsl3yZ7nWZfqFtFMlViQb4qX34+6FZ69xPE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GxSyjf7n8S91C06majQMmhfVTKjvLge5Mf1Y5KNMQwSY/A80bYFdE7Sam8WnCDSiZ 8Qzainugf/7yUmfrAaEIGjmoPZ2IyJw6Xb+ye9IwLTFi6BqPrWHQRAV1cfaMDwMITl vfCkhsgBic3AqUVcG1OSi5iDyGwGXD1SCRze20s2+WejbvougaUWyLLvKk+/8CCuPX PQtT2jpOhwlH2rCty5tjPHGUqpt0yupa/1XinV99xOUnsjCUYPEz8OU1sJnZJzozYM /Z/tiJs9VfrXs7JZQnuhhKaje+sqGlnAh5AtpEUpbH2EGRrjcGbIt/JP1dand5nJZW 1O0jt6/g6HdFQ== Date: Thu, 19 Jan 2023 12:03:38 +0200 From: Mike Rapoport To: "zhaoyang.huang" Cc: Andrew Morton , Catalin Marinas , Vlastimil Babka , Nathan Chancellor , Peter Zijlstra , Zhaoyang Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ke.wang@unisoc.com, Mirsad Todorovac Subject: Re: [PATCHv4 2/2] mm: use stack_depot_early_init for kmemleak Message-ID: References: <1674091345-14799-1-git-send-email-zhaoyang.huang@unisoc.com> <1674091345-14799-2-git-send-email-zhaoyang.huang@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1674091345-14799-2-git-send-email-zhaoyang.huang@unisoc.com> X-Rspamd-Queue-Id: 53DD040010 X-Stat-Signature: tc6ytos87ayh4tg8haupuyfbs1yy6hf9 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1674122631-613170 X-HE-Meta: U2FsdGVkX18er/XV/+7t3UtxNpB3hbLDDMDZNXdSYiRAgg9pRSQg+KL1m/f5krECcYbENATshOQKVBdKmKR8DPOa+qfkRp0zYdDYIiOraOJETw9jS/0OHP2uCmT9SMymOZ1wg4nxTHXIWIAfkckpPtwkiBVAPrn4ktN7JnayAKI1CJc/nXXNNgGAAbvp0K9QB7jQq8WB+qMKM2Z4wj0ot/Fon+inAo3L3QtbnpUl49ir30IngQIk3R4YQzDIFnnsAE5zEuw/YOJcrKbCpN8Lqeqc+1K9q7TvOgk9nyVz3PJzUqHJqejlkdA4KRQwy4abScXremg65DvaSnBNEblSP2iCdDcOXblM0XtJT6hydqFZS85rcfQUngMpTWWw5PElAldsIlQgiWGmQA6vF6hjhOCqhmAxMFn9Gr7a0K1e9IK1D16+4XJUWdx8t7ndpDfEo7LIzMduY6266rs/8MZFaPar/vbwn6y5ZURzlLsi4lUw5XYpIgbnsD/Bh0I81OzPk2rX9fCx59SjKFLoX/n9B1z2bbP+6fxsBBTK+f2oVopez/9BopnuBevd/kOQX4N36itKdtzKGz/cpdcOJ4tGDzZgKsd9HYs/P9QwpDVnfVeMx3OKCioV/Jchck2NAtbOBKoYduISFhsrzo3zqBsiYmndXyVVjtlqLn9Fs8npU3unRf8qxZP3QLe4lODcY808SWNPcZEbz1jWXpov/90dV0eePFPb0YoKAByon03Milkar0TpVQ/ZE9RGi87tycJhyUuThMg+FVhtwW3SJerieN5TsqiOvHF4IS/rkNfFVrzvYj8envGOWMVLNOXewfWCeDWD7xzno0LH/8/ge700e5Z249oibrhA3SR+3pQkAPfWexbc0WgnS4cchti3Si44HoEbqAVwp8qsTIr3YH9/+wVItBwn7Bcdt29WTDZzKGNhIb+IXGGtNY7OTqO0zP/f+CS0oWRb2OC5T5WzZHf cNvQukYv FxNa19IpJqE3wI7TjmMJycodPNG2I9n6vT/CPMuV1ab4HLfWx28LvJ2PJJpXwcUsRkyJFzaHG+tMWn4I= 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 Thu, Jan 19, 2023 at 09:22:25AM +0800, 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. > > 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 > suggested-by: Vlastimil Babka > Signed-off-by: Zhaoyang Huang Acked-by: Mike Rapoport (IBM) > --- > v2: use stack_depot_want_early_init instead of CONFIG_STACKDEPOT_ALWAYS_INIT > v3: have the Kconfig changes commited in another patch > v4: select CONFIG_STACKDEPOT_ALWAYS_INIT when DEBUG_KMEMLEAK_DEFAULT_OFF is off > --- > > Signed-off-by: Zhaoyang Huang > --- > mm/Kconfig.debug | 1 + > mm/kmemleak.c | 4 +++- > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug > index d1893ac..466a37e 100644 > --- a/mm/Kconfig.debug > +++ b/mm/Kconfig.debug > @@ -219,6 +219,7 @@ config DEBUG_KMEMLEAK > select KALLSYMS > select CRC32 > select STACKDEPOT > + select STACKDEPOT_ALWAYS_INIT if !DEBUG_KMEMLEAK_DEFAULT_OFF > help > Say Y here if you want to enable the memory leak > detector. The memory allocation/freeing is traced in a way > diff --git a/mm/kmemleak.c b/mm/kmemleak.c > index 762b91f..ddc1ddf 100644 > --- a/mm/kmemleak.c > +++ b/mm/kmemleak.c > @@ -2070,8 +2070,10 @@ static int __init kmemleak_boot_config(char *str) > return -EINVAL; > if (strcmp(str, "off") == 0) > kmemleak_disable(); > - else if (strcmp(str, "on") == 0) > + else if (strcmp(str, "on") == 0) { > kmemleak_skip_disable = 1; > + stack_depot_want_early_init(); > + } > else > return -EINVAL; > return 0; > -- > 1.9.1 > > -- Sincerely yours, Mike.