* [PATCH] mm/dmapool: remove redundant DMAPOOL_DEBUG macro
@ 2026-05-22 10:53 lirongqing
2026-05-22 11:19 ` Vlastimil Babka (SUSE)
0 siblings, 1 reply; 3+ messages in thread
From: lirongqing @ 2026-05-22 10:53 UTC (permalink / raw)
To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R . Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, linux-mm, linux-kernel
Cc: Li RongQing
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>
---
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)
{
--
2.9.4
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mm/dmapool: remove redundant DMAPOOL_DEBUG macro
2026-05-22 10:53 [PATCH] mm/dmapool: remove redundant DMAPOOL_DEBUG macro lirongqing
@ 2026-05-22 11:19 ` Vlastimil Babka (SUSE)
2026-05-23 0:10 ` 答复: [外部邮件] " Li,Rongqing(ACG CCN)
0 siblings, 1 reply; 3+ messages in thread
From: Vlastimil Babka (SUSE) @ 2026-05-22 11:19 UTC (permalink / raw)
To: lirongqing, Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R . Howlett, Mike Rapoport, Suren Baghdasaryan,
Michal Hocko, linux-mm, linux-kernel, Harry Yoo, Hao Li
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)
> {
^ permalink raw reply [flat|nested] 3+ messages in thread* 答复: [外部邮件] Re: [PATCH] mm/dmapool: remove redundant DMAPOOL_DEBUG macro
2026-05-22 11:19 ` Vlastimil Babka (SUSE)
@ 2026-05-23 0:10 ` Li,Rongqing(ACG CCN)
0 siblings, 0 replies; 3+ messages in thread
From: Li,Rongqing(ACG CCN) @ 2026-05-23 0:10 UTC (permalink / raw)
To: Vlastimil Babka (SUSE),
Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R . Howlett, Mike Rapoport, Suren Baghdasaryan,
Michal Hocko, linux-mm, linux-kernel, Harry Yoo, Hao Li
>
> 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)
Good idea, I will send v2
Thanks
[Li,Rongqing]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-23 0:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-22 10:53 [PATCH] mm/dmapool: remove redundant DMAPOOL_DEBUG macro lirongqing
2026-05-22 11:19 ` Vlastimil Babka (SUSE)
2026-05-23 0:10 ` 答复: [外部邮件] " Li,Rongqing(ACG CCN)
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®