mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] drm: 2 quick fixes
@ 2026-09-26 22:33 Jim Cromie via B4 Relay
  2026-09-26 22:33 ` [PATCH 1/2] drm/print: Mark __drm_debug as __read_mostly Jim Cromie via B4 Relay
  2026-09-26 22:33 ` [PATCH 2/2] drm: Fix incorrect ccflags-y spelling inside Makefile Jim Cromie via B4 Relay
  0 siblings, 2 replies; 3+ messages in thread
From: Jim Cromie via B4 Relay @ 2026-09-26 22:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: dri-devel, linux-kernel, Jim Cromie

1. make __drm_debug __read_mostly
   it is rarely written, and read at up to 80khz
   
2. fix CFLAGS -> ccflags mis-spelling
   this fails to add -DDYNAMIC_DEBUG_MODULE to ccflags
   currently masked by DRM_USE_DYNAMIC_DEBUG=n

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
Jim Cromie (2):
      drm/print: Mark __drm_debug as __read_mostly
      drm: Fix incorrect ccflags-y spelling inside Makefile

 drivers/gpu/drm/Makefile    | 3 ++-
 drivers/gpu/drm/drm_print.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
base-commit: 93f51579e7df248780214094418f205253383cc5
change-id: 20260925-rd-mostly-6a2fc0cd6fd6

Best regards,
-- 
Jim Cromie <jim.cromie@gmail.com>



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

* [PATCH 1/2] drm/print: Mark __drm_debug as __read_mostly
  2026-09-26 22:33 [PATCH 0/2] drm: 2 quick fixes Jim Cromie via B4 Relay
@ 2026-09-26 22:33 ` Jim Cromie via B4 Relay
  2026-09-26 22:33 ` [PATCH 2/2] drm: Fix incorrect ccflags-y spelling inside Makefile Jim Cromie via B4 Relay
  1 sibling, 0 replies; 3+ messages in thread
From: Jim Cromie via B4 Relay @ 2026-09-26 22:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: dri-devel, linux-kernel, Jim Cromie

From: Jim Cromie <jim.cromie@gmail.com>

Under a multi-client workload of 12 concurrent vkcubes on AMD iGPU,
__drm_debug is read at ~83.3 kHz across multiple cores during atomic
and vblank checks.

__drm_debug is written only when userspace does:
  echo 0xff > /sys/module/drm/parameters/debug

Currently the linker packs __drm_debug into .bss adjacent to hot
structures: drm_lease_idr_object, drm_class, and drm_global_mutex,
causing unnecessary cacheline invalidations.

Mark __drm_debug as __read_mostly to relocate it to .data..read_mostly.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 drivers/gpu/drm/drm_print.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
index 86cef1a37678..50cdeb1b15e2 100644
--- a/drivers/gpu/drm/drm_print.c
+++ b/drivers/gpu/drm/drm_print.c
@@ -40,7 +40,7 @@
  * __drm_debug: Enable debug output.
  * Bitmask of DRM_UT_x. See include/drm/drm_print.h for details.
  */
-unsigned long __drm_debug;
+unsigned long __drm_debug __read_mostly;
 EXPORT_SYMBOL(__drm_debug);
 
 MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n"

-- 
2.55.0



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

* [PATCH 2/2] drm: Fix incorrect ccflags-y spelling inside Makefile
  2026-09-26 22:33 [PATCH 0/2] drm: 2 quick fixes Jim Cromie via B4 Relay
  2026-09-26 22:33 ` [PATCH 1/2] drm/print: Mark __drm_debug as __read_mostly Jim Cromie via B4 Relay
@ 2026-09-26 22:33 ` Jim Cromie via B4 Relay
  1 sibling, 0 replies; 3+ messages in thread
From: Jim Cromie via B4 Relay @ 2026-09-26 22:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: dri-devel, linux-kernel, Jim Cromie

From: Jim Cromie <jim.cromie@gmail.com>

Fix a longstanding spelling error in the DRM Makefile by changing
'CFLAGS-y' to 'ccflags-y'. This fixes CONFIG_DRM_USE_DYNAMIC_DEBUG=y
dependent addition of -DDYNAMIC_DEBUG_MODULE, which is needed to
enable dyndbg-under-drm-debug when only CONFIG_DYNAMIC_DEBUG_CORE is
enabled (and not CONFIG_DYNAMIC_DEBUG itself).

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 drivers/gpu/drm/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index e635fcffd379..c42884d84ad1 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -3,7 +3,8 @@
 # Makefile for the drm device driver.  This driver provides support for the
 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
 
-CFLAGS-$(CONFIG_DRM_USE_DYNAMIC_DEBUG)	+= -DDYNAMIC_DEBUG_MODULE
+ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG)		+= -DDYNAMIC_DEBUG_MODULE
+subdir-ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG)	+= -DDYNAMIC_DEBUG_MODULE
 
 # Unconditionally enable W=1 warnings locally
 # --- begin copy-paste W=1 warnings from scripts/Makefile.warn

-- 
2.55.0



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

end of thread, other threads:[~2026-09-26 22:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-26 22:33 [PATCH 0/2] drm: 2 quick fixes Jim Cromie via B4 Relay
2026-09-26 22:33 ` [PATCH 1/2] drm/print: Mark __drm_debug as __read_mostly Jim Cromie via B4 Relay
2026-09-26 22:33 ` [PATCH 2/2] drm: Fix incorrect ccflags-y spelling inside Makefile Jim Cromie via B4 Relay

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®