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 92FFBC00A5A for ; Thu, 19 Jan 2023 10:02:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21C2A6B0074; Thu, 19 Jan 2023 05:02:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CBC66B0075; Thu, 19 Jan 2023 05:02:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 094A36B0078; Thu, 19 Jan 2023 05:02:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id ED53A6B0074 for ; Thu, 19 Jan 2023 05:02:20 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id BAE14C0CF1 for ; Thu, 19 Jan 2023 10:02:20 +0000 (UTC) X-FDA: 80371108440.13.268EF70 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf13.hostedemail.com (Postfix) with ESMTP id F366420020 for ; Thu, 19 Jan 2023 10:02:18 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XSt3Zory; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf13.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674122539; 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=u0XUKCV7GKgvnCyfXHy04dkmww+tjlv4dkqnbF09UuQ=; b=lnRj0KTOOJfMPXjiChLEnQSusyL7nOiIIHSvfmhOdh25mCC4kYIdjorL8tuK4Bv7R4duug FhztJvGdf4IFtdMGtrGTETnlmh8z3/LURRVH6Uet0s003gG3yG86MLFFI/T8M5qLBOHKGT ew2r1J2SEBQjwXqFMws0IgZDBxHzpqM= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XSt3Zory; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf13.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674122539; a=rsa-sha256; cv=none; b=LDfAZDHOZucas0V85fbXBBB/mCQbCSyyyOt6+g+Bxidc05G8znm3ppXaHgr97rMTeTummd xWB9VzuWoHgbP+Mr7++slwjSumJeheXjWGLFkNeiT32thLl0JLnfoCLP0u4fZAofEGkU6Y PAPoPtJSpkgYOT01w11VgJgl25eu7KA= 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 ams.source.kernel.org (Postfix) with ESMTPS id 5DC4BB82161; Thu, 19 Jan 2023 10:02:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23302C433EF; Thu, 19 Jan 2023 10:02:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674122536; bh=usy+6yBsUaQa6PTMk5+DPXTRseaIjzgQf55WPxrdQxU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XSt3Zory7mayxPL8D39JFMIiwiZtTKen6LihiMEwSxgmpB2O8+NPZ2fQNNfTzS1ob YXDc1oaphF+Z1THCRtqYiFs6icurhty3SQwh2TSxiRy/2lDnJZV2ulWE6dh3o7wtBS IotIicKtfTP4RDhCTNYBZF1CZrkInlV6TS4bb74y1lsME6yZ0cF5j1UgBRJMnOnoRJ CUhm6njCvBgr3wXJ2NldXciqGA2QKTQAW2VMbSbJwJCxQRzeVpEgAriSNKqt4ty7cb UnJX4izoBrB3KbzHJBN/xZER6BQE7sC1TS/uerwG9YFpbmfnBRiEE2hFjYGJ0S4Zan QhgTEJrfthcEg== Date: Thu, 19 Jan 2023 12:02:03 +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: [PATCH] mm: move KMEMLEAK's Kconfig items from lib to mm Message-ID: References: <1674009327-23493-1-git-send-email-zhaoyang.huang@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1674009327-23493-1-git-send-email-zhaoyang.huang@unisoc.com> X-Rspamd-Queue-Id: F366420020 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: gzrypx4on6rg8ki7d31c9xm8atoeuz4c X-HE-Tag: 1674122538-10277 X-HE-Meta: U2FsdGVkX1/6vpg530R7idshjEBSY26lPb0vlZ2/sum9l/b96PdXCf/07XlUZhzOMCXmuzP1VhCTx9gLydPl1ztVRO/nx/ADpjMXuotxSMSyu0FGoGEOAp52dkPCpaPlSqIxnvGfNaPR4t/LtKP0DIfsRWg6d9wfNHzFZbwIInT4K+wb8y8q+4vVE3wU/qeTt4VFYne8JxVEKCskp4ZusPQV2+8WMCaxrwvo9efysxL1G7crMffpTAdgow2NLyj1gc9mBpl3LHB3yMvDTFPga5nE4z9JH8ytze86/6AyH40N/n/lZ7JsID/ltX7gtwaJZtxrvx2pTjyANOZrYx1Zqa3TdghBoVQHl5299aPAGIf327Q1IgwTa1DDB4mrcgU1QL1NLr5Xw9RVVsiHYi8AMuxZ5rwUdOOsQs7AG6vKap8SDb2SX4PRJcUDCaQncRBnDluRNFT/emBu/v2BRNtN+9VfYpnvuUOr+YucXFZi6YUE+3pZbwd0B+eI25Adql5u8VMSAutvuCz7yyW9iDinP9kx9nbEnFN2qboYpIxipNxeJqQ3VQMhHpe63bVW4V/mrg7TxFOUNY9s0/rM9E4DuP2Dulw5DYLWW9n5fypea594rpE6MBFuNby8T0dXpjGEqOs76+OAD2ERD28yNPOF2xKq4FmmGjbouWPZuaPV8FgBiBAObePCessqMPK37XAom95ql2pFevb05eaAD4KuqSBDKewDF1eyo0sIeNNDVX/h5Z3hmxbCpmo2zJqtdNl7IAIDyLNzTolb9iISi71ZxzuMg8o0PKb57PfnU6jWB8WB5ak6aB8RIq0zG22mqfZsqn7Z+oGkxCCtJL3nRhn1pxvvAkGu4oarijBrlD2a7h24HdIXV8R0YSBqTsghg7z57B8yMM3pWdSuhwPee9zwnJNB3iGoMglNEOmTQMNIx87kT7bKRDGN0A+CjJTQ+wE96yZsGVRX7VS+YcLR0Rr gyKhjnk7 s8tDutzShYnfvf0gw3MuXJymKA3CMq6fhANpL 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 Wed, Jan 18, 2023 at 10:35:27AM +0800, zhaoyang.huang wrote: > From: Zhaoyang Huang > > Have the kmemleak's source code and Kconfig items be in the same directory. > > Signed-off-by: Zhaoyang Huang Acked-by: Mike Rapoport (IBM) > --- > lib/Kconfig.debug | 70 ------------------------------------------------------- > mm/Kconfig.debug | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 70 insertions(+), 70 deletions(-) > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > index 401ad4b..62884ac 100644 > --- a/lib/Kconfig.debug > +++ b/lib/Kconfig.debug > @@ -716,76 +716,6 @@ config SHRINKER_DEBUG > visibility into the kernel memory shrinkers subsystem. > Disable it to avoid an extra memory footprint. > > -config HAVE_DEBUG_KMEMLEAK > - bool > - > -config DEBUG_KMEMLEAK > - bool "Kernel memory leak detector" > - depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK > - select DEBUG_FS > - select STACKTRACE if STACKTRACE_SUPPORT > - select KALLSYMS > - select CRC32 > - select STACKDEPOT > - help > - Say Y here if you want to enable the memory leak > - detector. The memory allocation/freeing is traced in a way > - similar to the Boehm's conservative garbage collector, the > - difference being that the orphan objects are not freed but > - only shown in /sys/kernel/debug/kmemleak. Enabling this > - feature will introduce an overhead to memory > - allocations. See Documentation/dev-tools/kmemleak.rst for more > - details. > - > - Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances > - of finding leaks due to the slab objects poisoning. > - > - In order to access the kmemleak file, debugfs needs to be > - mounted (usually at /sys/kernel/debug). > - > -config DEBUG_KMEMLEAK_MEM_POOL_SIZE > - int "Kmemleak memory pool size" > - depends on DEBUG_KMEMLEAK > - range 200 1000000 > - default 16000 > - help > - Kmemleak must track all the memory allocations to avoid > - reporting false positives. Since memory may be allocated or > - freed before kmemleak is fully initialised, use a static pool > - of metadata objects to track such callbacks. After kmemleak is > - fully initialised, this memory pool acts as an emergency one > - if slab allocations fail. > - > -config DEBUG_KMEMLEAK_TEST > - tristate "Simple test for the kernel memory leak detector" > - depends on DEBUG_KMEMLEAK && m > - help > - This option enables a module that explicitly leaks memory. > - > - If unsure, say N. > - > -config DEBUG_KMEMLEAK_DEFAULT_OFF > - bool "Default kmemleak to off" > - depends on DEBUG_KMEMLEAK > - help > - Say Y here to disable kmemleak by default. It can then be enabled > - on the command line via kmemleak=on. > - > -config DEBUG_KMEMLEAK_AUTO_SCAN > - bool "Enable kmemleak auto scan thread on boot up" > - default y > - depends on DEBUG_KMEMLEAK > - help > - Depending on the cpu, kmemleak scan may be cpu intensive and can > - stall user tasks at times. This option enables/disables automatic > - kmemleak scan at boot up. > - > - Say N here to disable kmemleak auto scan thread to stop automatic > - scanning. Disabling this option disables automatic reporting of > - memory leaks. > - > - If unsure, say Y. > - > config DEBUG_STACK_USAGE > bool "Stack utilization instrumentation" > depends on DEBUG_KERNEL && !IA64 > diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug > index ce8dded..d1893ac 100644 > --- a/mm/Kconfig.debug > +++ b/mm/Kconfig.debug > @@ -207,3 +207,73 @@ config PTDUMP_DEBUGFS > kernel. > > If in doubt, say N. > + > +config HAVE_DEBUG_KMEMLEAK > + bool > + > +config DEBUG_KMEMLEAK > + bool "Kernel memory leak detector" > + depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK > + select DEBUG_FS > + select STACKTRACE if STACKTRACE_SUPPORT > + select KALLSYMS > + select CRC32 > + select STACKDEPOT > + help > + Say Y here if you want to enable the memory leak > + detector. The memory allocation/freeing is traced in a way > + similar to the Boehm's conservative garbage collector, the > + difference being that the orphan objects are not freed but > + only shown in /sys/kernel/debug/kmemleak. Enabling this > + feature will introduce an overhead to memory > + allocations. See Documentation/dev-tools/kmemleak.rst for more > + details. > + > + Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances > + of finding leaks due to the slab objects poisoning. > + > + In order to access the kmemleak file, debugfs needs to be > + mounted (usually at /sys/kernel/debug). > + > +config DEBUG_KMEMLEAK_MEM_POOL_SIZE > + int "Kmemleak memory pool size" > + depends on DEBUG_KMEMLEAK > + range 200 1000000 > + default 16000 > + help > + Kmemleak must track all the memory allocations to avoid > + reporting false positives. Since memory may be allocated or > + freed before kmemleak is fully initialised, use a static pool > + of metadata objects to track such callbacks. After kmemleak is > + fully initialised, this memory pool acts as an emergency one > + if slab allocations fail. > + > +config DEBUG_KMEMLEAK_TEST > + tristate "Simple test for the kernel memory leak detector" > + depends on DEBUG_KMEMLEAK && m > + help > + This option enables a module that explicitly leaks memory. > + > + If unsure, say N. > + > +config DEBUG_KMEMLEAK_DEFAULT_OFF > + bool "Default kmemleak to off" > + depends on DEBUG_KMEMLEAK > + help > + Say Y here to disable kmemleak by default. It can then be enabled > + on the command line via kmemleak=on. > + > +config DEBUG_KMEMLEAK_AUTO_SCAN > + bool "Enable kmemleak auto scan thread on boot up" > + default y > + depends on DEBUG_KMEMLEAK > + help > + Depending on the cpu, kmemleak scan may be cpu intensive and can > + stall user tasks at times. This option enables/disables automatic > + kmemleak scan at boot up. > + > + Say N here to disable kmemleak auto scan thread to stop automatic > + scanning. Disabling this option disables automatic reporting of > + memory leaks. > + > + If unsure, say Y. > -- > 1.9.1 > > -- Sincerely yours, Mike.