Skip to contentSkip to conversation

drm/print: Mark __drm_debug as __read_mostly

PATCH New Jim Cromie 1 participant 1 message Sep 25

Subsystems (2)
lore
Share & tools
lore

Jim Cromie

author
#0 lore raw

PATCH 1/1 drm/print: Mark __drm_debug as __read_mostly

Under multi-client workloads (e.g. 12 concurrent vkcubes on AMD iGPU), __drm_debug is read at ~83.3 kHz across multiple cores during atomic and vblank checks, but is otherwise write-rare.

Without section placement attributes, the linker packs __drm_debug into .bss adjacent to hot structures like 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.

---
 drivers/gpu/drm/drm_print.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_print.c +1 -1
index 86cef1a37678..50cdeb1b15e2 100644
@@ -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"
Signature · 1 line
2.55.0