From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: lirongqing <lirongqing@baidu.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R . Howlett" <liam@infradead.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Harry Yoo <harry.yoo@oracle.com>, Hao Li <hao.li@linux.dev>
Subject: Re: [PATCH] mm/dmapool: remove redundant DMAPOOL_DEBUG macro
Date: Fri, 22 May 2026 13:19:50 +0200 [thread overview]
Message-ID: <6ba62058-e5f8-4212-b1a8-56047b4977db@kernel.org> (raw)
In-Reply-To: <20260522105346.2215-1-lirongqing@baidu.com>
On 5/22/26 12:53, lirongqing wrote:
> From: Li RongQing <lirongqing@baidu.com>
>
> The DMAPOOL_DEBUG macro is only defined when CONFIG_SLUB_DEBUG_ON is
> enabled, and it is used exclusively to guard the pool_check_block()
> function. Wrapping CONFIG_SLUB_DEBUG_ON in another local macro adds
> unnecessary indirection.
>
> Simplify the code by removing DMAPOOL_DEBUG entirely and using the
> standard CONFIG_SLUB_DEBUG_ON config option directly.
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
I think a more useful change would be to remove the usage of
CONFIG_SLUB_DEBUG_ON completely and rather (re)use a boot option that uses a
static key. CONFIG_SLUB_DEBUG_ON is only useful for bots running
randconfigs, otherwise normally for debugging a specific problem one doesn't
want to rebuild a kernel with CONFIG_SLUB_DEBUG_ON, but just reboot with a
boot option slab_debug[=...] (for slab itself) or debug_pagealloc=on etc.
(same thing should be done for the usage in mm/mempool.c btw)
> ---
> mm/dmapool.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/mm/dmapool.c b/mm/dmapool.c
> index 5d8af6e..af43f1a 100644
> --- a/mm/dmapool.c
> +++ b/mm/dmapool.c
> @@ -36,10 +36,6 @@
> #include <linux/types.h>
> #include <linux/wait.h>
>
> -#ifdef CONFIG_SLUB_DEBUG_ON
> -#define DMAPOOL_DEBUG 1
> -#endif
> -
> struct dma_block {
> struct dma_block *next_block;
> dma_addr_t dma;
> @@ -92,7 +88,7 @@ static ssize_t pools_show(struct device *dev, struct device_attribute *attr, cha
>
> static DEVICE_ATTR_RO(pools);
>
> -#ifdef DMAPOOL_DEBUG
> +#ifdef CONFIG_SLUB_DEBUG_ON
> static void pool_check_block(struct dma_pool *pool, struct dma_block *block,
> gfp_t mem_flags)
> {
next prev parent reply other threads:[~2026-05-22 11:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 10:53 lirongqing
2026-05-22 11:19 ` Vlastimil Babka (SUSE) [this message]
2026-05-23 0:10 ` 答复: [外部邮件] " Li,Rongqing(ACG CCN)
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=6ba62058-e5f8-4212-b1a8-56047b4977db@kernel.org \
--to=vbabka@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=hao.li@linux.dev \
--cc=harry.yoo@oracle.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lirongqing@baidu.com \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
/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
all inboxes | Powered by JetHome®