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 907A2C004D4 for ; Thu, 19 Jan 2023 10:04:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 269506B007B; Thu, 19 Jan 2023 05:04:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2189B6B007E; Thu, 19 Jan 2023 05:04:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0933C6B0080; Thu, 19 Jan 2023 05:04:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E9BD96B007B for ; Thu, 19 Jan 2023 05:04:17 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id AC9B0AB2D6 for ; Thu, 19 Jan 2023 10:04:17 +0000 (UTC) X-FDA: 80371113354.12.61CA45B Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 2C8CC120016 for ; Thu, 19 Jan 2023 10:04:15 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=gxwfTqJ8; spf=pass (imf29.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=1674122656; 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=PmyAYd2kRh9m1FDYAxM4C2UufZsjJhNJoMWOo2Q3+3o=; b=0UM7d6LfJhZwqQFmKRhreUsWmFRFKz2eMeatBpRRU9PKU13WqPb2FnX0HgmWqcocAa0bvF U8GW8sB5qVsUB4rpYKV+/vUJkD3EVxsY7RgtvePsg9yNgP2agKgXVaTcxVc235EPVhW5f9 GtcIosQqsWe20IsclrHVQUGgoT+C9ks= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=gxwfTqJ8; spf=pass (imf29.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=1674122656; a=rsa-sha256; cv=none; b=SvceMSnRLLYBn3BoKTSIKZveR1hTtITT06yOXEQgK4JAoO5FdahwIV9zghQz1utVPgMX4s nPMrcx+W/srL3FrAdaHdcffbdzrCOldwDh/me7E+mXY8RgqP3bDiLM6PQ7DaLBkWUuZuC4 QUvAKGVxaQrgP7FdRVRM4Bi7mJb9R30= 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 3F6AB6136E; Thu, 19 Jan 2023 10:04:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C00A1C433F0; Thu, 19 Jan 2023 10:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674122654; bh=PZzBwOj6lTIQ6U5yiabXUXMVM4plXhXshUd7IAubI6M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gxwfTqJ8nNHq59XloszSNGBBynkA25dIpH2hv5FX1Wj/bpCu9P4G04sMyfir8TUBQ +TN18rQzMjChGCAxLrBxLLwml/EtG8OIluzgWhk8VuwCRFP6sUA8cqlwidfXju/cvM 0FMjxcBB6H/NzgjiJ/Cylzq7Un34tZp0C7NuApqVvXQT8LOJpvWGkXuf4RtKsBQCa8 Eo95LH2XXQsGuMv4f/UNlm2yM3Z/yxafylPx38NsBox/Gh1LGrtQ0Ou581uqSwgeAn ucUHlYn5117sagdN17UCmepAt2li+odYf4c1Fv3NGprZvE61a9jUmrWNd+FRu/jzur PjyUMf5rjQPGQ== Date: Thu, 19 Jan 2023 12:04:01 +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 1/2] mm: move KMEMLEAK's Kconfig items from lib to mm Message-ID: References: <1674091345-14799-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: <1674091345-14799-1-git-send-email-zhaoyang.huang@unisoc.com> X-Stat-Signature: x164mrawqu1m3xej9dkcm11iea5i1tfw X-Rspam-User: X-Rspamd-Queue-Id: 2C8CC120016 X-Rspamd-Server: rspam06 X-HE-Tag: 1674122655-912303 X-HE-Meta: U2FsdGVkX19Ed15cnR9YlRz0BRmnSibX0qG1MdlrJ0jw03fehO3LzMJ66gn6EPyTgDEyC01L0u0ZZDTPXcC5z8t9PM5dq6XBMNrHWKKlyh13Ybkxq/F4ThoN3xmpPcqQohxTpys8fjdggrt8gUbAZUyUfeVJdxqFeEXclulKMD37Xj2x2rqKsLWHo2phc87PAJg/wkGXgitsDIyfnQk5vNyrNLrxL2hg3Vk+FhAybpFwTA7hBHBxwYUNek1bLsE537FMVPSmoDy3HJNENpG0FqkotKKCvUf6kp5RDHQ2xcVaInA0LEwRLc6SJhxlTgaEiB+0pv0ZyFJ+43hoIuKWq4X9FyiSwyQI9/tUZJ8dwu+J3br5KNmMVwc4wLfbHznVTnxJA5FzQqNAuQy0GU94qm2p1IS85M4Od3Cr/8JvOvz0wfIJVjHUK05HFZTFYXidbbggvXW4krzf0ruGvEcC4sI8cSrEV3YVFQWAAP7W88NCaw5BSVdFCbxW2QyhgjLTBB84Crf7mzOn8RZxqYA1x/NM7hn4G7rPLE6lRRnMGpyjAM+w226QF1A8WvEMLZmXpM73Is5Z1fdHRjweIzZodJKLOckNMuhl0KhsUhD4NzzGbShgh/QfYXMroTK2MFGgP4t6289SCl4nuzssFFpH8CmMF3JWoRKZ9fbIDacbiX20CM5HG9OVJ/3pLDmnb64yelHZYkwP2IbwuRvTMw1fGxt2aUZ6zuP6fvtXHl5q4vOwGVtihDjSeiUkVAE+McUAtK39GvA2vehX8hKbhy9YIgpwmXU2YAq5GjpDl5X7l6hJfHHOCMsjtsQnUoy83f2t3D1jiHpe+V4ptUl24jSl/pLHsH/vqv2qmyV3gAnhsDS6ePab7aShDTO27wwuGaYqHEqkW7+IcaXJgDHn5khtplyX467uINNMmQbkKAKEjeWT0br5LOFoDNh531L1IhEXcRtujRsfI9fewdvbaBQ 0OpXSeJh mkT61GpiO8n122A4GQhvtKsHaQCuCpR0otLCw 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:24AM +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.