The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/5] drm/print,dyndbg: __drm_debug __read_mostly, uint shrink, build fixes
@ 2026-11-20 17:18 Jim Cromie via B4 Relay
  2026-11-20 17:18 ` [PATCH v2 1/5] drm/print: Mark __drm_debug as __read_mostly Jim Cromie via B4 Relay
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jim Cromie via B4 Relay @ 2026-11-20 17:18 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Jason Baron, Greg Kroah-Hartman, Andrew Morton
  Cc: dri-devel, linux-kernel, Jim Cromie

This series improves __drm_debug placement/sizing and fixes two build
issues exposed when CONFIG_DRM_USE_DYNAMIC_DEBUG=y is enabled:        

1. Mark __drm_debug as __read_mostly to move it out of the cacheline
it currently shares with frequently written locks and structures.  In
a 12-vkcube test, its read rate is ~83 kHz.
    
2. Fix CFLAGS- -> ccflags- spelling error in drivers/gpu/drm/Makefile
to add -DDYNAMIC_DEBUG_MODULE when CONFIG_DYNAMIC_DEBUG_CORE=y without
CONFIG_DYNAMIC_DEBUG=y.  Also add subdir-ccflags- so DRM subdirs
(drivers and helpers) get the -Dflag too.

3. Drop the unused `category` local in __drm_printfn_dbg() when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y expands __drm_debug_enabled() to true.

4. Shrink __drm_debug and struct ddebug_class_param.bits from unsigned
long back to unsigned int, updating lib/dynamic_debug.c and        
lib/test_dynamic_debug.c callers accordingly.               

NOTES:

drm and dyndbg are coupled on __drm_debug's size and type, so changing
the size requires coordination between DRM and core.  The coupling
allows dyndbg to use the var to keep 'state', and allows drm to
continue using it in a few cases where drm_*dbg doesnt quite fit.

Because DRM_USE_DYNAMIC_DEBUG still depends on BROKEN, patches 2-4
were build-tested with that dependency locally removed. That un-BROKEN
patch is intentionally excluded here, as modular DRM probe-time
drm.debug support (and external users like drivers/accel/) still
need the separate/pending classmap fixup series.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
Changes in v2:
- Add subdir-ccflags- propagation in drivers/gpu/drm/Makefile (patch 2).
- Add unused `category` warning fix under CONFIG_DRM_USE_DYNAMIC_DEBUG=y
(patch 3). 
- Add __drm_debug and ddebug_class_param.bits shrink to unsigned int
(patch 4).
- Link to v1: https://lore.kernel.org/r/20260926-rd-mostly-v1-0-28b7d714ed2c@gmail.com

---
Jim Cromie (5):
      drm/print: Mark __drm_debug as __read_mostly
      drm: Fix incorrect CFLAGS-y spelling inside Makefile
      drm: fix config dependent unused variable warning.
      drm/print,dyndbg: restore __drm_debug to uint from ulong
      drm-dyndbg: drop BROKEN on DRM_USE_DYNAMIC_DEBUG for testing (DONT_APPLY)

 drivers/gpu/drm/Kconfig.debug | 1 -
 drivers/gpu/drm/Makefile      | 3 ++-
 drivers/gpu/drm/drm_print.c   | 7 +++----
 include/drm/drm_print.h       | 2 +-
 include/linux/dynamic_debug.h | 2 +-
 lib/dynamic_debug.c           | 8 +++++---
 lib/test_dynamic_debug.c      | 2 +-
 7 files changed, 13 insertions(+), 12 deletions(-)
---
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
change-id: 20260925-rd-mostly-6a2fc0cd6fd6

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



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

end of thread, other threads:[~2026-11-20 17:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 17:18 [PATCH v2 0/5] drm/print,dyndbg: __drm_debug __read_mostly, uint shrink, build fixes Jim Cromie via B4 Relay
2026-11-20 17:18 ` [PATCH v2 1/5] drm/print: Mark __drm_debug as __read_mostly Jim Cromie via B4 Relay
2026-11-20 17:18 ` [PATCH v2 2/5] drm: Fix incorrect CFLAGS-y spelling inside Makefile Jim Cromie via B4 Relay
2026-11-20 17:18 ` [PATCH v2 3/5] drm: fix config dependent unused variable warning Jim Cromie via B4 Relay
2026-11-20 17:18 ` [PATCH v2 4/5] drm/print,dyndbg: restore __drm_debug to uint from ulong Jim Cromie via B4 Relay
2026-11-20 17:18 ` [PATCH v2 5/5] drm-dyndbg: drop BROKEN on DRM_USE_DYNAMIC_DEBUG for testing (DONT_APPLY) 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