From: Jim Cromie via B4 Relay <devnull+jim.cromie.gmail.com@kernel.org>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>, Jason Baron <jbaron@akamai.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Luca Coelho <luciano.coelho@intel.com>,
Jani Nikula <jani.nikula@intel.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Jim Cromie <jim.cromie@gmail.com>
Subject: [PATCH v4 0/3] drm/print,dyndbg: __drm_debug __read_mostly, restore it to uint, printer fix
Date: Tue, 24 Nov 2026 16:38:32 -0700 [thread overview]
Message-ID: <20261124-rd-mostly-v4-0-26d60beb6666@gmail.com> (raw)
This series improves __drm_debug placement/sizing and fixes a
drm_dbg_printer() bypass exposed when CONFIG_DRM_USE_DYNAMIC_DEBUG=y:
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. Shrink __drm_debug and struct ddebug_class_param.bits from unsigned
long back to (original) unsigned int, updating lib/dynamic_debug.c
and lib/test_dynamic_debug.c callers accordingly.
3. Fix __drm_printfn_dbg() use of __drm_debug_enabled(), which always
prints when CONFIG_DRM_USE_DYNAMIC_DEBUG=y, disregarding p->category.
NOTES:
drm and dyndbg are coupled on __drm_debug's size and type, so changing
the size requires coordination between DRM and dyndbg. The coupling
allows dyndbg to keep state in __drm_debug while letting drm use it in
cases where static-key drm_*dbg() macros do not fit.
Build-tested with BROKEN locally removed from DRM_USE_DYNAMIC_DEBUG to
cover both Y/N cases. That un-BROKEN patch is intentionally excluded
here as drm.debug still needs classmap fixes patchset.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
Changes in v4:
- Replace unused-variable workaround with proper __drm_printfn_dbg()
fix (per Sashiko review).
- Drop drivers/gpu/drm/Makefile and DONT_APPLY un-BROKEN patches from
this series (deferred to classmap-inheritance series).
- Link to v3: https://lore.kernel.org/r/20261121-rd-mostly-v3-0-89e74b23b491@gmail.com
Changes in v3:
- dont need both ccflags-y and subdir-ccflags-y, latter covers former.
- Link to v2: https://lore.kernel.org/r/20261120-rd-mostly-v2-0-88056ede02a8@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 (3):
drm/print: Mark __drm_debug as __read_mostly
drm/print,dyndbg: restore __drm_debug to uint from ulong
drm/print: fix drm_printer dynamic debug bit-test bypass
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 +-
5 files changed, 11 insertions(+), 10 deletions(-)
---
base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
change-id: 20260925-rd-mostly-6a2fc0cd6fd6
Best regards,
--
Jim Cromie <jim.cromie@gmail.com>
next reply other threads:[~2026-11-24 23:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 23:38 Jim Cromie via B4 Relay [this message]
2026-11-24 23:38 ` [PATCH v4 1/3] drm/print: Mark __drm_debug as __read_mostly Jim Cromie via B4 Relay
2026-11-24 23:38 ` [PATCH v4 2/3] drm/print,dyndbg: restore __drm_debug to uint from ulong Jim Cromie via B4 Relay
2026-11-24 23:38 ` [PATCH v4 3/3] drm/print: fix drm_printer dynamic debug bit-test bypass Jim Cromie via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261124-rd-mostly-v4-0-26d60beb6666@gmail.com \
--to=devnull+jim.cromie.gmail.com@kernel.org \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=jani.nikula@intel.com \
--cc=jbaron@akamai.com \
--cc=jim.cromie@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luciano.coelho@intel.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®