From: Andrew Morton <akpm@linux-foundation.org>
To: Hao Ge <gehao@kylinos.cn>
Cc: alex.williamson@redhat.com, jgg@ziepe.ca, akrowiak@linux.ibm.com,
arnd@arndb.de, mark.rutland@arm.com, ye.xingchen@zte.com.cn,
ojeda@kernel.org, alex.gaynor@gmail.com, me@kloenk.de,
gregkh@linuxfoundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, gehao618@163.com,
Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [RESEND PATCH] kmemleak-test: Optimize kmemleak_test.c build flow
Date: Thu, 30 Mar 2023 13:10:13 -0700 [thread overview]
Message-ID: <20230330131013.2685eeee5f7db76b850512ed@linux-foundation.org> (raw)
In-Reply-To: <20230330060904.292975-1-gehao@kylinos.cn>
On Thu, 30 Mar 2023 14:09:04 +0800 Hao Ge <gehao@kylinos.cn> wrote:
> Now kmemleak-test.c is moved to samples directory,
> if CONFIG_DEBUG_KMEMLEAK_TEST=m,but CONFIG_SAMPLES
> is not set,it will be meaningless.
>
> So we will remove CONFIG_DEBUG_KMEMLEAK_TEST and
> add CONFIG_SAMPLE_KMEMLEAK which in samples directory
> to control kmemleak-test.c build or not
Thanks.
I changed the patch title, reworked the changelog and added the Fixes:
information. Please check all this carefully.
From: Hao Ge <gehao@kylinos.cn>
Subject: kmemleak-test: fix kmemleak_test.c build logic
Date: Thu, 30 Mar 2023 14:09:04 +0800
kmemleak-test.c was moved to the samples directory in 1abbef4f51724
("mm,kmemleak-test.c: move kmemleak-test.c to samples dir").
If CONFIG_DEBUG_KMEMLEAK_TEST=m and CONFIG_SAMPLES is unset,
kmemleak-test.c will be unnecessarily compiled.
So move the entry for CONFIG_DEBUG_KMEMLEAK_TEST from mm/Kconfig and add a
new CONFIG_SAMPLE_KMEMLEAK in samples/ to control whether kmemleak-test.c
is built or not.
Link: https://lkml.kernel.org/r/20230330060904.292975-1-gehao@kylinos.cn
Fixes: 1abbef4f51724 ("mm,kmemleak-test.c: move kmemleak-test.c to samples dir")
Signed-off-by: Hao Ge <gehao@kylinos.cn>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Alex Gaynor <alex.gaynor@gmail.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Finn Behrens <me@kloenk.dev>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Tony Krowiak <akrowiak@linux.ibm.com>
Cc: Ye Xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/Kconfig.debug | 8 --------
samples/Kconfig | 7 +++++++
samples/Makefile | 2 +-
samples/kmemleak/Makefile | 2 +-
4 files changed, 9 insertions(+), 10 deletions(-)
--- a/mm/Kconfig.debug~kmemleak-test-optimize-kmemleak_testc-build-flow
+++ a/mm/Kconfig.debug
@@ -249,14 +249,6 @@ config DEBUG_KMEMLEAK_MEM_POOL_SIZE
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
--- a/samples/Kconfig~kmemleak-test-optimize-kmemleak_testc-build-flow
+++ a/samples/Kconfig
@@ -273,6 +273,13 @@ config SAMPLE_CORESIGHT_SYSCFG
This demonstrates how a user may create their own CoreSight
configurations and easily load them into the system at runtime.
+config SAMPLE_KMEMLEAK
+ tristate "Simple test for the kernel memory leak detector"
+ depends on DEBUG_KMEMLEAK && m
+ help
+ Build a sample program which have explicitly leaks memory to test
+ kmemleak
+
source "samples/rust/Kconfig"
endif # SAMPLES
--- a/samples/kmemleak/Makefile~kmemleak-test-optimize-kmemleak_testc-build-flow
+++ a/samples/kmemleak/Makefile
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak-test.o
+obj-$(CONFIG_SAMPLE_KMEMLEAK) += kmemleak-test.o
--- a/samples/Makefile~kmemleak-test-optimize-kmemleak_testc-build-flow
+++ a/samples/Makefile
@@ -33,7 +33,7 @@ subdir-$(CONFIG_SAMPLE_VFS) += vfs
obj-$(CONFIG_SAMPLE_INTEL_MEI) += mei/
subdir-$(CONFIG_SAMPLE_WATCHDOG) += watchdog
subdir-$(CONFIG_SAMPLE_WATCH_QUEUE) += watch_queue
-obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak/
+obj-$(CONFIG_SAMPLE_KMEMLEAK) += kmemleak/
obj-$(CONFIG_SAMPLE_CORESIGHT_SYSCFG) += coresight/
obj-$(CONFIG_SAMPLE_FPROBE) += fprobe/
obj-$(CONFIG_SAMPLES_RUST) += rust/
_
prev parent reply other threads:[~2023-03-30 20:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 6:09 Hao Ge
2023-03-30 20:10 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230330131013.2685eeee5f7db76b850512ed@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=akrowiak@linux.ibm.com \
--cc=alex.gaynor@gmail.com \
--cc=alex.williamson@redhat.com \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=gehao618@163.com \
--cc=gehao@kylinos.cn \
--cc=gregkh@linuxfoundation.org \
--cc=jgg@ziepe.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mark.rutland@arm.com \
--cc=me@kloenk.de \
--cc=ojeda@kernel.org \
--cc=ye.xingchen@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox