Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4321065rwb; Mon, 16 Jan 2023 22:17:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXtuiVtgdS5GJhO+xbqXnb+GSCSbdakBajDSYmAGS5PpbIOrufSl5ZQ35pi83HU9EAF6NnvG X-Received: by 2002:a17:907:8c17:b0:871:38cc:7b3a with SMTP id ta23-20020a1709078c1700b0087138cc7b3amr5480252ejc.75.1673936221316; Mon, 16 Jan 2023 22:17:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673936221; cv=none; d=google.com; s=arc-20160816; b=kfoZbYHT4ViP3ZbbfpV2x+bVKSmOTvTJzK959UO708+A8zvBOxWSiklauxABUALnu8 0W3dFUCH4UuyajY+RYIrF6Gb3f0ybFzZxWo6Y0C/CJHe9TywvjAiJ6eRWY/nObN4gPTK oCU6yskiY2RwGEzpd3ZElqypDK3aH+t9H3YdShbI+Zod7Yf2HM0yHHaw+p/iIlGEldZZ /TzAYaoWHAvEu/7HLh5Gm/+sNDpFAGM2y3dCIxS8V+lauXD8sPh3OXXEMceGDFX1Z6PB pAjwOlk4UpSLBa6S2qEXaPFkxKzBFR3TNANlHbV7SVgPfdT9iVrITsIPEQYs4JxZiqYs xbhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from; bh=sisJg9XG2PU7BopEVruC5/ToBIvXI3DVE/yo4Q65jH0=; b=JqFOKx6mXjFmOAU41V9JN8RTxNIiVEeT3zMvMd0unQiEcqXD9N4v3jIxWJWMD+wcRO JBD21H/pgOzwzTfla5gtjW0s457nH1sO82oFpkxOu2DMn1ynpBzItNttmeHgynaewKQO DMFucllp/JSlvtJ6v5ncSRK1Z2zkGvG9m0AiV3QYWA/+9qMxdk6NrflzoeI0HFlknLga R+E4so1BfvCr9FWy0Gr4D7cK3G7YmZWN1Iyt4Ntvs0eB4bHMRy3L5TFNPgUtuFKOl9pw igm3/syIoKdFV0slAMjx+HQvp1dmM+Ih682IGCgy9VjFkJETsqSIHKG/cXwljKZ2s2Wb 6ORQ== ARC-Authentication-Results: i=1; mx.google.com; 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 s5-20020a17090699c500b007c103219025si33691765ejn.825.2023.01.16.22.16.49; Mon, 16 Jan 2023 22:17:01 -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; 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 S235599AbjAQGBM (ORCPT + 50 others); Tue, 17 Jan 2023 01:01:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235591AbjAQGAI (ORCPT ); Tue, 17 Jan 2023 01:00:08 -0500 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9487E2313B for ; Mon, 16 Jan 2023 22:00:04 -0800 (PST) Received: from SHSend.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by SHSQR01.spreadtrum.com with ESMTP id 30H5xluX010533; Tue, 17 Jan 2023 13:59:47 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from bj03382pcu.spreadtrum.com (10.0.74.65) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 17 Jan 2023 13:59:44 +0800 From: "zhaoyang.huang" To: Andrew Morton , Catalin Marinas , Vlastimil Babka , "Nathan Chancellor" , Peter Zijlstra , Zhaoyang Huang , , , , Mirsad Todorovac Subject: [PATCH] mm: use stack_depot_early_init for kmemleak Date: Tue, 17 Jan 2023 13:59:29 +0800 Message-ID: <1673935169-30019-1-git-send-email-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.74.65] X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 30H5xluX010533 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 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 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 -- 1.9.1