public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] treewide: fixup gfp_t printks
@ 2026-03-26 12:31 Brendan Jackman
  2026-03-26 12:31 ` [PATCH v2 1/4] drm/managed: Use special gfp_t format specifier Brendan Jackman
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Brendan Jackman @ 2026-03-26 12:31 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Stanislaw Gruszka, Alexander Potapenko,
	Marco Elver, Dmitry Vyukov, Andrew Morton, Allison Henderson,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: dri-devel, linux-kernel, linux-wireless, kasan-dev, linux-mm,
	netdev, linux-rdma, rds-devel, Brendan Jackman

This patchset used to be about switching gfp_t to unsigned long. That is
probably not gonna happen any more but while writing it I found these
cleanups that seem worthwhile regardless.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
Changes in v2:
- Drop gfp_t changes
- Add correct CCs
- Add minor fixups to preexisting code spotted by AI review
- Link to v1: https://lore.kernel.org/r/20260319-gfp64-v1-0-2c73b8d42b7f@google.com

---
Brendan Jackman (4):
      drm/managed: Use special gfp_t format specifier
      iwlegacy: 3945-mac: Fixup allocation failure log
      mm/kfence: Use special gfp_t format specifier
      net/rds: Use special gfp_t format specifier

 drivers/gpu/drm/drm_managed.c                  | 4 ++--
 drivers/net/wireless/intel/iwlegacy/3945-mac.c | 4 ++--
 mm/kfence/kfence_test.c                        | 2 +-
 net/rds/tcp_recv.c                             | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
---
base-commit: c369299895a591d96745d6492d4888259b004a9e
change-id: 20260319-gfp64-7a970a80ba4e

Best regards,
-- 
Brendan Jackman <jackmanb@google.com>


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

* [PATCH v2 1/4] drm/managed: Use special gfp_t format specifier
  2026-03-26 12:31 [PATCH v2 0/4] treewide: fixup gfp_t printks Brendan Jackman
@ 2026-03-26 12:31 ` Brendan Jackman
  2026-03-26 12:31 ` [PATCH v2 2/4] iwlegacy: 3945-mac: Fixup allocation failure log Brendan Jackman
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Brendan Jackman @ 2026-03-26 12:31 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Stanislaw Gruszka, Alexander Potapenko,
	Marco Elver, Dmitry Vyukov, Andrew Morton, Allison Henderson,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: dri-devel, linux-kernel, linux-wireless, kasan-dev, linux-mm,
	netdev, linux-rdma, rds-devel, Brendan Jackman

%pGg produces nice readable output and decouples the format string from
the size of gfp_t.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 drivers/gpu/drm/drm_managed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_managed.c b/drivers/gpu/drm/drm_managed.c
index 247f468731de0..a9da94319b052 100644
--- a/drivers/gpu/drm/drm_managed.c
+++ b/drivers/gpu/drm/drm_managed.c
@@ -232,8 +232,8 @@ void *drmm_kmalloc(struct drm_device *dev, size_t size, gfp_t gfp)
 
 	dr = alloc_dr(NULL, size, gfp, dev_to_node(dev->dev));
 	if (!dr) {
-		drm_dbg_drmres(dev, "failed to allocate %zu bytes, %u flags\n",
-			       size, gfp);
+		drm_dbg_drmres(dev, "failed to allocate %zu bytes, %pGg\n",
+			       size, &gfp);
 		return NULL;
 	}
 	dr->node.name = kstrdup_const("kmalloc", gfp);

-- 
2.51.2


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

* [PATCH v2 2/4] iwlegacy: 3945-mac: Fixup allocation failure log
  2026-03-26 12:31 [PATCH v2 0/4] treewide: fixup gfp_t printks Brendan Jackman
  2026-03-26 12:31 ` [PATCH v2 1/4] drm/managed: Use special gfp_t format specifier Brendan Jackman
@ 2026-03-26 12:31 ` Brendan Jackman
  2026-03-27 11:45   ` Stanislaw Gruszka
  2026-03-26 12:31 ` [PATCH v2 3/4] mm/kfence: Use special gfp_t format specifier Brendan Jackman
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Brendan Jackman @ 2026-03-26 12:31 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Stanislaw Gruszka, Alexander Potapenko,
	Marco Elver, Dmitry Vyukov, Andrew Morton, Allison Henderson,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: dri-devel, linux-kernel, linux-wireless, kasan-dev, linux-mm,
	netdev, linux-rdma, rds-devel, Brendan Jackman

Fix 2 issues spotted by AI[0]:

1. Missing space after the full stop.

2. Wrong GFP flags are printed.

And also switch to %pGg for the GFP flags. This produces nice readable
output and decouples the format string from the size of gfp_t.

[0] https://sashiko.dev/#/patchset/20260319-gfp64-v1-0-2c73b8d42b7f%40google.com

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 drivers/net/wireless/intel/iwlegacy/3945-mac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
index c148654aa9533..88b31e0b9568c 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
@@ -1002,9 +1002,9 @@ il3945_rx_allocate(struct il_priv *il, gfp_t priority)
 				D_INFO("Failed to allocate SKB buffer.\n");
 			if (rxq->free_count <= RX_LOW_WATERMARK &&
 			    net_ratelimit())
-				IL_ERR("Failed to allocate SKB buffer with %0x."
+				IL_ERR("Failed to allocate SKB buffer with %pGg. "
 				       "Only %u free buffers remaining.\n",
-				       priority, rxq->free_count);
+				       &gfp_mask, rxq->free_count);
 			/* We don't reschedule replenish work here -- we will
 			 * call the restock method and if it still needs
 			 * more buffers it will schedule replenish */

-- 
2.51.2


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

* [PATCH v2 3/4] mm/kfence: Use special gfp_t format specifier
  2026-03-26 12:31 [PATCH v2 0/4] treewide: fixup gfp_t printks Brendan Jackman
  2026-03-26 12:31 ` [PATCH v2 1/4] drm/managed: Use special gfp_t format specifier Brendan Jackman
  2026-03-26 12:31 ` [PATCH v2 2/4] iwlegacy: 3945-mac: Fixup allocation failure log Brendan Jackman
@ 2026-03-26 12:31 ` Brendan Jackman
  2026-03-26 12:32 ` [PATCH v2 4/4] net/rds: " Brendan Jackman
  2026-03-27 11:57 ` [PATCH v2 0/4] treewide: fixup gfp_t printks Stanislaw Gruszka
  4 siblings, 0 replies; 7+ messages in thread
From: Brendan Jackman @ 2026-03-26 12:31 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Stanislaw Gruszka, Alexander Potapenko,
	Marco Elver, Dmitry Vyukov, Andrew Morton, Allison Henderson,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: dri-devel, linux-kernel, linux-wireless, kasan-dev, linux-mm,
	netdev, linux-rdma, rds-devel, Brendan Jackman

%pGg produces nice readable output and decouples the format string from
the size of gfp_t.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 mm/kfence/kfence_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c
index 5725a367246d9..10424cd25e5a6 100644
--- a/mm/kfence/kfence_test.c
+++ b/mm/kfence/kfence_test.c
@@ -263,7 +263,7 @@ static void *test_alloc(struct kunit *test, size_t size, gfp_t gfp, enum allocat
 		break;
 	}
 
-	kunit_info(test, "%s: size=%zu, gfp=%x, policy=%s, cache=%i\n", __func__, size, gfp,
+	kunit_info(test, "%s: size=%zu, gfp=%pGg, policy=%s, cache=%i\n", __func__, size, &gfp,
 		   policy_name, !!test_cache);
 
 	/*

-- 
2.51.2


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

* [PATCH v2 4/4] net/rds: Use special gfp_t format specifier
  2026-03-26 12:31 [PATCH v2 0/4] treewide: fixup gfp_t printks Brendan Jackman
                   ` (2 preceding siblings ...)
  2026-03-26 12:31 ` [PATCH v2 3/4] mm/kfence: Use special gfp_t format specifier Brendan Jackman
@ 2026-03-26 12:32 ` Brendan Jackman
  2026-03-27 11:57 ` [PATCH v2 0/4] treewide: fixup gfp_t printks Stanislaw Gruszka
  4 siblings, 0 replies; 7+ messages in thread
From: Brendan Jackman @ 2026-03-26 12:32 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Stanislaw Gruszka, Alexander Potapenko,
	Marco Elver, Dmitry Vyukov, Andrew Morton, Allison Henderson,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: dri-devel, linux-kernel, linux-wireless, kasan-dev, linux-mm,
	netdev, linux-rdma, rds-devel, Brendan Jackman

%pGg produces nice readable output and decouples the format string from
the size of gfp_t.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 net/rds/tcp_recv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rds/tcp_recv.c b/net/rds/tcp_recv.c
index 49f96ee0c40f6..ffe843ca219c7 100644
--- a/net/rds/tcp_recv.c
+++ b/net/rds/tcp_recv.c
@@ -275,7 +275,7 @@ static int rds_tcp_read_sock(struct rds_conn_path *cp, gfp_t gfp)
 	desc.count = 1; /* give more than one skb per call */
 
 	tcp_read_sock(sock->sk, &desc, rds_tcp_data_recv);
-	rdsdebug("tcp_read_sock for tc %p gfp 0x%x returned %d\n", tc, gfp,
+	rdsdebug("tcp_read_sock for tc %p gfp %pGg returned %d\n", tc, &gfp,
 		 desc.error);
 
 	if (skb_queue_empty_lockless(&sock->sk->sk_receive_queue) &&

-- 
2.51.2


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

* Re: [PATCH v2 2/4] iwlegacy: 3945-mac: Fixup allocation failure log
  2026-03-26 12:31 ` [PATCH v2 2/4] iwlegacy: 3945-mac: Fixup allocation failure log Brendan Jackman
@ 2026-03-27 11:45   ` Stanislaw Gruszka
  0 siblings, 0 replies; 7+ messages in thread
From: Stanislaw Gruszka @ 2026-03-27 11:45 UTC (permalink / raw)
  To: Brendan Jackman
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Alexander Potapenko, Marco Elver, Dmitry Vyukov,
	Andrew Morton, Allison Henderson, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, dri-devel,
	linux-kernel, linux-wireless, kasan-dev, linux-mm, netdev,
	linux-rdma, rds-devel

Hi,

On Thu, Mar 26, 2026 at 12:31:58PM +0000, Brendan Jackman wrote:
> Fix 2 issues spotted by AI[0]:
> 
> 1. Missing space after the full stop.
> 
> 2. Wrong GFP flags are printed.

We should also initialize gfp_mask = priority inside the loop.
But this can be done as separate patch.

> And also switch to %pGg for the GFP flags. This produces nice readable
> output and decouples the format string from the size of gfp_t.
> 
> [0] https://sashiko.dev/#/patchset/20260319-gfp64-v1-0-2c73b8d42b7f%40google.com
> 
> Signed-off-by: Brendan Jackman <jackmanb@google.com>

Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>

> ---
>  drivers/net/wireless/intel/iwlegacy/3945-mac.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> index c148654aa9533..88b31e0b9568c 100644
> --- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> +++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> @@ -1002,9 +1002,9 @@ il3945_rx_allocate(struct il_priv *il, gfp_t priority)
>  				D_INFO("Failed to allocate SKB buffer.\n");
>  			if (rxq->free_count <= RX_LOW_WATERMARK &&
>  			    net_ratelimit())
> -				IL_ERR("Failed to allocate SKB buffer with %0x."
> +				IL_ERR("Failed to allocate SKB buffer with %pGg. "
>  				       "Only %u free buffers remaining.\n",
> -				       priority, rxq->free_count);
> +				       &gfp_mask, rxq->free_count);
>  			/* We don't reschedule replenish work here -- we will
>  			 * call the restock method and if it still needs
>  			 * more buffers it will schedule replenish */
> 
> -- 
> 2.51.2
> 

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

* Re: [PATCH v2 0/4] treewide: fixup gfp_t printks
  2026-03-26 12:31 [PATCH v2 0/4] treewide: fixup gfp_t printks Brendan Jackman
                   ` (3 preceding siblings ...)
  2026-03-26 12:32 ` [PATCH v2 4/4] net/rds: " Brendan Jackman
@ 2026-03-27 11:57 ` Stanislaw Gruszka
  4 siblings, 0 replies; 7+ messages in thread
From: Stanislaw Gruszka @ 2026-03-27 11:57 UTC (permalink / raw)
  To: Brendan Jackman
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Alexander Potapenko, Marco Elver, Dmitry Vyukov,
	Andrew Morton, Allison Henderson, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, dri-devel,
	linux-kernel, linux-wireless, kasan-dev, linux-mm, netdev,
	linux-rdma, rds-devel

On Thu, Mar 26, 2026 at 12:31:56PM +0000, Brendan Jackman wrote:
> This patchset used to be about switching gfp_t to unsigned long. That is
> probably not gonna happen any more but while writing it I found these
> cleanups that seem worthwhile regardless.

For the record, these patches are independent and could be sent separately
to the appropriate maintainers. Doing so would avoid unnecessarily large CC 
lists for people not interested about the changes in other subsystems.

Regards
Stanislaw

> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---

> Changes in v2:
> - Drop gfp_t changes
> - Add correct CCs
> - Add minor fixups to preexisting code spotted by AI review
> - Link to v1: https://lore.kernel.org/r/20260319-gfp64-v1-0-2c73b8d42b7f@google.com
> 
> ---
> Brendan Jackman (4):
>       drm/managed: Use special gfp_t format specifier
>       iwlegacy: 3945-mac: Fixup allocation failure log
>       mm/kfence: Use special gfp_t format specifier
>       net/rds: Use special gfp_t format specifier
> 
>  drivers/gpu/drm/drm_managed.c                  | 4 ++--
>  drivers/net/wireless/intel/iwlegacy/3945-mac.c | 4 ++--
>  mm/kfence/kfence_test.c                        | 2 +-
>  net/rds/tcp_recv.c                             | 2 +-
>  4 files changed, 6 insertions(+), 6 deletions(-)
> ---
> base-commit: c369299895a591d96745d6492d4888259b004a9e
> change-id: 20260319-gfp64-7a970a80ba4e
> 
> Best regards,
> -- 
> Brendan Jackman <jackmanb@google.com>
> 

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

end of thread, other threads:[~2026-03-27 11:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26 12:31 [PATCH v2 0/4] treewide: fixup gfp_t printks Brendan Jackman
2026-03-26 12:31 ` [PATCH v2 1/4] drm/managed: Use special gfp_t format specifier Brendan Jackman
2026-03-26 12:31 ` [PATCH v2 2/4] iwlegacy: 3945-mac: Fixup allocation failure log Brendan Jackman
2026-03-27 11:45   ` Stanislaw Gruszka
2026-03-26 12:31 ` [PATCH v2 3/4] mm/kfence: Use special gfp_t format specifier Brendan Jackman
2026-03-26 12:32 ` [PATCH v2 4/4] net/rds: " Brendan Jackman
2026-03-27 11:57 ` [PATCH v2 0/4] treewide: fixup gfp_t printks Stanislaw Gruszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox