linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mm/numa_memblks: Use pr_debug instead of printk(KERN_DEBUG)
@ 2025-08-11  6:43 pratyush.brahma
  2025-08-11  8:01 ` Mike Rapoport
  0 siblings, 1 reply; 6+ messages in thread
From: pratyush.brahma @ 2025-08-11  6:43 UTC (permalink / raw)
  To: Andrew Morton, Mike Rapoport
  Cc: linux-mm, linux-kernel, Pratyush Brahma, Joshua Hahn

From: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>

Replace the direct usage of printk(KERN_DEBUG ...) with pr_debug(...) to
align with the consistent `pr_*` API usage within the file.

Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
Signed-off-by: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
---
Changes in v2:
- Removed printk header as suggested by Joshua.
- Link to v1: https://lore.kernel.org/r/20250808-numa-dbg-v1-1-2ddd1ec634aa@oss.qualcomm.com
---
 mm/numa_memblks.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c
index 541a99c4071a67e5b0ef66f4136dee268a880003..ed6fcfca057ab4c9a8aa26cd1929551b4ded4a5b 100644
--- a/mm/numa_memblks.c
+++ b/mm/numa_memblks.c
@@ -2,7 +2,6 @@
 
 #include <linux/array_size.h>
 #include <linux/sort.h>
-#include <linux/printk.h>
 #include <linux/memblock.h>
 #include <linux/numa.h>
 #include <linux/numa_memblks.h>
@@ -76,7 +75,7 @@ static int __init numa_alloc_distance(void)
 		for (j = 0; j < cnt; j++)
 			numa_distance[i * cnt + j] = i == j ?
 				LOCAL_DISTANCE : REMOTE_DISTANCE;
-	printk(KERN_DEBUG "NUMA: Initialized distance table, cnt=%d\n", cnt);
+	pr_debug("NUMA: Initialized distance table, cnt=%d\n", cnt);
 
 	return 0;
 }

---
base-commit: 479058002c32b77acac43e883b92174e22c4be2d
change-id: 20250808-numa-dbg-62a8b2092c56

Best regards,
-- 
Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] mm/numa_memblks: Use pr_debug instead of printk(KERN_DEBUG)
  2025-08-11  6:43 [PATCH v2] mm/numa_memblks: Use pr_debug instead of printk(KERN_DEBUG) pratyush.brahma
@ 2025-08-11  8:01 ` Mike Rapoport
  2025-08-11 12:46   ` Pratyush Brahma
  2025-08-11 14:02   ` Joshua Hahn
  0 siblings, 2 replies; 6+ messages in thread
From: Mike Rapoport @ 2025-08-11  8:01 UTC (permalink / raw)
  To: pratyush.brahma; +Cc: Andrew Morton, linux-mm, linux-kernel, Joshua Hahn

On Mon, Aug 11, 2025 at 12:13:54PM +0530, pratyush.brahma@oss.qualcomm.com wrote:
> From: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> 
> Replace the direct usage of printk(KERN_DEBUG ...) with pr_debug(...) to
> align with the consistent `pr_*` API usage within the file.
> 
> Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
> Signed-off-by: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> ---
> Changes in v2:
> - Removed printk header as suggested by Joshua.
> - Link to v1: https://lore.kernel.org/r/20250808-numa-dbg-v1-1-2ddd1ec634aa@oss.qualcomm.com
> ---
>  mm/numa_memblks.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c
> index 541a99c4071a67e5b0ef66f4136dee268a880003..ed6fcfca057ab4c9a8aa26cd1929551b4ded4a5b 100644
> --- a/mm/numa_memblks.c
> +++ b/mm/numa_memblks.c
> @@ -2,7 +2,6 @@
>  
>  #include <linux/array_size.h>
>  #include <linux/sort.h>
> -#include <linux/printk.h>

Please don't, pr_debug is defined there.

>  #include <linux/memblock.h>
>  #include <linux/numa.h>
>  #include <linux/numa_memblks.h>
> @@ -76,7 +75,7 @@ static int __init numa_alloc_distance(void)
>  		for (j = 0; j < cnt; j++)
>  			numa_distance[i * cnt + j] = i == j ?
>  				LOCAL_DISTANCE : REMOTE_DISTANCE;
> -	printk(KERN_DEBUG "NUMA: Initialized distance table, cnt=%d\n", cnt);
> +	pr_debug("NUMA: Initialized distance table, cnt=%d\n", cnt);
>  
>  	return 0;
>  }
> 
> ---
> base-commit: 479058002c32b77acac43e883b92174e22c4be2d
> change-id: 20250808-numa-dbg-62a8b2092c56
> 
> Best regards,
> -- 
> Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> 

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] mm/numa_memblks: Use pr_debug instead of printk(KERN_DEBUG)
  2025-08-11  8:01 ` Mike Rapoport
@ 2025-08-11 12:46   ` Pratyush Brahma
  2025-08-11 14:02   ` Joshua Hahn
  1 sibling, 0 replies; 6+ messages in thread
From: Pratyush Brahma @ 2025-08-11 12:46 UTC (permalink / raw)
  To: Mike Rapoport; +Cc: Andrew Morton, linux-mm, linux-kernel, Joshua Hahn

[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]

On Mon, Aug 11, 2025 at 1:31 PM Mike Rapoport <rppt@kernel.org> wrote:

> On Mon, Aug 11, 2025 at 12:13:54PM +0530, pratyush.brahma@oss.qualcomm.com
> wrote:
> > From: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> >
> > Replace the direct usage of printk(KERN_DEBUG ...) with pr_debug(...) to
> > align with the consistent `pr_*` API usage within the file.
> >
> > Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
> > Signed-off-by: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> > ---
> > Changes in v2:
> > - Removed printk header as suggested by Joshua.
> > - Link to v1:
> https://lore.kernel.org/r/20250808-numa-dbg-v1-1-2ddd1ec634aa@oss.qualcomm.com
> > ---
> >  mm/numa_memblks.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c
> > index
> 541a99c4071a67e5b0ef66f4136dee268a880003..ed6fcfca057ab4c9a8aa26cd1929551b4ded4a5b
> 100644
> > --- a/mm/numa_memblks.c
> > +++ b/mm/numa_memblks.c
> > @@ -2,7 +2,6 @@
> >
> >  #include <linux/array_size.h>
> >  #include <linux/sort.h>
> > -#include <linux/printk.h>
>
> Please don't, pr_debug is defined there.
>
But I had compile tested this code. I wonder why it didn't throw any error.

>
> >  #include <linux/memblock.h>
> >  #include <linux/numa.h>
> >  #include <linux/numa_memblks.h>
> > @@ -76,7 +75,7 @@ static int __init numa_alloc_distance(void)
> >               for (j = 0; j < cnt; j++)
> >                       numa_distance[i * cnt + j] = i == j ?
> >                               LOCAL_DISTANCE : REMOTE_DISTANCE;
> > -     printk(KERN_DEBUG "NUMA: Initialized distance table, cnt=%d\n",
> cnt);
> > +     pr_debug("NUMA: Initialized distance table, cnt=%d\n", cnt);
> >
> >       return 0;
> >  }
> >
> > ---
> > base-commit: 479058002c32b77acac43e883b92174e22c4be2d
> > change-id: 20250808-numa-dbg-62a8b2092c56
> >
> > Best regards,
> > --
> > Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> >
>
> --
> Sincerely yours,
> Mike.
>

[-- Attachment #2: Type: text/html, Size: 3369 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] mm/numa_memblks: Use pr_debug instead of printk(KERN_DEBUG)
  2025-08-11  8:01 ` Mike Rapoport
  2025-08-11 12:46   ` Pratyush Brahma
@ 2025-08-11 14:02   ` Joshua Hahn
  2025-08-12  3:13     ` Pratyush Brahma
  1 sibling, 1 reply; 6+ messages in thread
From: Joshua Hahn @ 2025-08-11 14:02 UTC (permalink / raw)
  To: Mike Rapoport; +Cc: pratyush.brahma, Andrew Morton, linux-mm, linux-kernel

On Mon, 11 Aug 2025 11:01:32 +0300 Mike Rapoport <rppt@kernel.org> wrote:

> On Mon, Aug 11, 2025 at 12:13:54PM +0530, pratyush.brahma@oss.qualcomm.com wrote:
> > From: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> > 
> > Replace the direct usage of printk(KERN_DEBUG ...) with pr_debug(...) to
> > align with the consistent `pr_*` API usage within the file.
> > 
> > Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
> > Signed-off-by: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> > ---
> > Changes in v2:
> > - Removed printk header as suggested by Joshua.
> > - Link to v1: https://lore.kernel.org/r/20250808-numa-dbg-v1-1-2ddd1ec634aa@oss.qualcomm.com
> > ---
> >  mm/numa_memblks.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c
> > index 541a99c4071a67e5b0ef66f4136dee268a880003..ed6fcfca057ab4c9a8aa26cd1929551b4ded4a5b 100644
> > --- a/mm/numa_memblks.c
> > +++ b/mm/numa_memblks.c
> > @@ -2,7 +2,6 @@
> >  
> >  #include <linux/array_size.h>
> >  #include <linux/sort.h>
> > -#include <linux/printk.h>
> 
> Please don't, pr_debug is defined there.

Hello Mike, you're totally right, sorry about the incorrect feedback.
For some reason I completely missed this dependency when reviewing.
Joshua

Sent using hkml (https://github.com/sjp38/hackermail)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] mm/numa_memblks: Use pr_debug instead of printk(KERN_DEBUG)
  2025-08-11 14:02   ` Joshua Hahn
@ 2025-08-12  3:13     ` Pratyush Brahma
  2025-08-12 12:50       ` Joshua Hahn
  0 siblings, 1 reply; 6+ messages in thread
From: Pratyush Brahma @ 2025-08-12  3:13 UTC (permalink / raw)
  To: Joshua Hahn; +Cc: Mike Rapoport, Andrew Morton, linux-mm, linux-kernel

On Mon, Aug 11, 2025 at 7:33 PM Joshua Hahn <joshua.hahnjy@gmail.com> wrote:
>
> On Mon, 11 Aug 2025 11:01:32 +0300 Mike Rapoport <rppt@kernel.org> wrote:
>
> > On Mon, Aug 11, 2025 at 12:13:54PM +0530, pratyush.brahma@oss.qualcomm.com wrote:
> > > From: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> > >
> > > Replace the direct usage of printk(KERN_DEBUG ...) with pr_debug(...) to
> > > align with the consistent `pr_*` API usage within the file.
> > >
> > > Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
> > > Signed-off-by: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> > > ---
> > > Changes in v2:
> > > - Removed printk header as suggested by Joshua.
> > > - Link to v1: https://lore.kernel.org/r/20250808-numa-dbg-v1-1-2ddd1ec634aa@oss.qualcomm.com
> > > ---
> > >  mm/numa_memblks.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c
> > > index 541a99c4071a67e5b0ef66f4136dee268a880003..ed6fcfca057ab4c9a8aa26cd1929551b4ded4a5b 100644
> > > --- a/mm/numa_memblks.c
> > > +++ b/mm/numa_memblks.c
> > > @@ -2,7 +2,6 @@
> > >
> > >  #include <linux/array_size.h>
> > >  #include <linux/sort.h>
> > > -#include <linux/printk.h>
> >
> > Please don't, pr_debug is defined there.
>
> Hello Mike, you're totally right, sorry about the incorrect feedback.
> For some reason I completely missed this dependency when reviewing.
> Joshua

While the current patch compiles fine as some other header includes printk,
I see sense in Mike's suggestion to keep the printk header. I'll
revert to my original patch
in the next iteration. Joshua, would you be okay with me keeping your R-by tag
in the original implementation?
>
> Sent using hkml (https://github.com/sjp38/hackermail)

Thanks and Regards
Pratyush


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] mm/numa_memblks: Use pr_debug instead of printk(KERN_DEBUG)
  2025-08-12  3:13     ` Pratyush Brahma
@ 2025-08-12 12:50       ` Joshua Hahn
  0 siblings, 0 replies; 6+ messages in thread
From: Joshua Hahn @ 2025-08-12 12:50 UTC (permalink / raw)
  To: Pratyush Brahma; +Cc: Mike Rapoport, Andrew Morton, linux-mm, linux-kernel

On Tue, 12 Aug 2025 08:43:48 +0530 Pratyush Brahma <pratyush.brahma@oss.qualcomm.com> wrote:

> On Mon, Aug 11, 2025 at 7:33 PM Joshua Hahn <joshua.hahnjy@gmail.com> wrote:
> >
> > On Mon, 11 Aug 2025 11:01:32 +0300 Mike Rapoport <rppt@kernel.org> wrote:
> >
> > > On Mon, Aug 11, 2025 at 12:13:54PM +0530, pratyush.brahma@oss.qualcomm.com wrote:
> > > > From: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> > > >
> > > > Replace the direct usage of printk(KERN_DEBUG ...) with pr_debug(...) to
> > > > align with the consistent `pr_*` API usage within the file.
> > > >
> > > > Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
> > > > Signed-off-by: Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>
> > > > ---
> > > > Changes in v2:
> > > > - Removed printk header as suggested by Joshua.
> > > > - Link to v1: https://lore.kernel.org/r/20250808-numa-dbg-v1-1-2ddd1ec634aa@oss.qualcomm.com
> > > > ---
> > > >  mm/numa_memblks.c | 3 +--
> > > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > >
> > > > diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c
> > > > index 541a99c4071a67e5b0ef66f4136dee268a880003..ed6fcfca057ab4c9a8aa26cd1929551b4ded4a5b 100644
> > > > --- a/mm/numa_memblks.c
> > > > +++ b/mm/numa_memblks.c
> > > > @@ -2,7 +2,6 @@
> > > >
> > > >  #include <linux/array_size.h>
> > > >  #include <linux/sort.h>
> > > > -#include <linux/printk.h>
> > >
> > > Please don't, pr_debug is defined there.
> >
> > Hello Mike, you're totally right, sorry about the incorrect feedback.
> > For some reason I completely missed this dependency when reviewing.
> > Joshua
> 
> While the current patch compiles fine as some other header includes printk,
> I see sense in Mike's suggestion to keep the printk header. I'll
> revert to my original patch
> in the next iteration. Joshua, would you be okay with me keeping your R-by tag
> in the original implementation?

Hi Pratyush, 

Yes, for sure. I think in general include-what-you-use is a good rule of thumb,
it was just my mistake that I overlooked pr_debug being defined in
linux/printk as well.

Have a great day, sorry again for the noise.
Joshua


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-12 12:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11  6:43 [PATCH v2] mm/numa_memblks: Use pr_debug instead of printk(KERN_DEBUG) pratyush.brahma
2025-08-11  8:01 ` Mike Rapoport
2025-08-11 12:46   ` Pratyush Brahma
2025-08-11 14:02   ` Joshua Hahn
2025-08-12  3:13     ` Pratyush Brahma
2025-08-12 12:50       ` Joshua Hahn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).