From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/amd/display: Replace use of system_wq with system_percpu_wq
Date: Sat, 14 Mar 2026 06:50:05 +1000 [thread overview]
Message-ID: <review-patch1-20260313144715.252069-1-marco.crivellari@suse.com> (raw)
In-Reply-To: <20260313144715.252069-1-marco.crivellari@suse.com>
Patch Review
**Correctness concern — per-CPU workqueue may not be appropriate here:**
Both work items modified in this patch do not have per-CPU affinity requirements:
1. **`schedule_dc_vmin_vmax`** (line 575): The work handler `dm_handle_vmin_vmax_update` immediately takes `adev->dm.dc_lock` (a mutex) and calls `dc_stream_adjust_vmin_vmax`. There is no reason this work needs to run on the CPU that queued it — it operates on device-global state protected by a mutex.
2. **`handle_hpd_irq_helper`** (line 4145): The delayed work for HDMI HPD debouncing performs connector hotplug detection. Again, there is no CPU-affinity requirement — this is device-level connector handling.
`system_percpu_wq` is a per-CPU workqueue (`WQ_PERCPU`), meaning work items will execute on the same CPU that queued them. For IRQ handler offloading (the vmin/vmax case is called from `dm_vupdate_high_irq`), pinning work to the interrupt-servicing CPU might cause unnecessary load imbalance, especially since the work immediately contends on a global mutex anyway.
**The more appropriate replacement** for these use cases would likely be `system_dfl_wq` (the replacement for `system_unbound_wq`), which allows the scheduler to place the work optimally, or simply staying with the current `system_wq` until the migration plan for non-CPU-affine users is clarified.
**Suggestion:** Confirm with the workqueue maintainers (Tejun Heo) whether `system_percpu_wq` is indeed the correct target for work items that have no per-CPU affinity requirement. The referenced refactoring thread suggests `system_wq -> system_percpu_wq` as a blanket mapping, but for work items that take global mutexes and operate on shared device state, `system_dfl_wq` may be more appropriate.
**Code changes themselves are mechanically correct** — the API signatures for `queue_work()` and `mod_delayed_work()` accept any `struct workqueue_struct *`, so the substitution compiles and functions correctly regardless of which workqueue is chosen.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-03-13 20:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 14:47 [PATCH] drm/amd/display: Replace use of system_wq with system_percpu_wq Marco Crivellari
2026-03-13 20:50 ` Claude review: " Claude Code Review Bot
2026-03-13 20:50 ` Claude Code Review Bot [this message]
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=review-patch1-20260313144715.252069-1-marco.crivellari@suse.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/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