From: Maíra Canal <mcanal@igalia.com>
To: Melissa Wen <mwen@igalia.com>,
Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
Maxime Ripard <mripard@kernel.org>
Cc: kernel-dev@igalia.com, dri-devel@lists.freedesktop.org,
Maíra Canal <mcanal@igalia.com>,
Iago Toral Quiroga <itoral@igalia.com>
Subject: [PATCH v2 0/6] drm/v3d: Improve v3d_stats lifetime and locking
Date: Thu, 05 Mar 2026 20:25:49 -0300 [thread overview]
Message-ID: <20260305-v3d-reset-locking-improv-v2-0-fd53c91f7726@igalia.com> (raw)
This series aims to improve the `struct v3d_stats` lifetime management.
The commit fa6a20c87470 ("drm/v3d: Address race-condition between per-fd
GPU stats and fd release") addressed a race-condition between the per-fd
GPU stats and the fd release by clearing `job->file_priv` before the V3D
per-fd structure is freed and assuring that `job->file_priv` exists
during the per-fd GPU stats updates.
However, this approach introduced a tricky file_priv NULL-ing dance with
the `queue_lock` spinlock. This series aims to address this issue in a
simpler way: converting `v3d_stats` from embedded structs to
heap-allocated, refcounted objects. This simplifies the code and leaves
`queue_lock` exclusively for job management.
The series also switches to raw seqcount helpers to resolve a lockdep
annotation issue, fixes missing error handling in drm_sched_entity_init(),
and removes the now-unnecessary dedicated fence_lock.
Best regards,
- Maíra
---
v1 -> v2:
- [All patches] Added Iago's R-b (Iago Toral)
- [3/6] s/kzalloc/kzalloc_obj
- [5/6] Add a comment explaining while the mutex is used in
DRM_V3D_PARAM_CONTEXT_RESET_COUNTER (Iago Toral)
- Link to v1: https://lore.kernel.org/r/20260217-v3d-reset-locking-improv-v1-0-0db848016869@igalia.com
To: Melissa Wen <mwen@igalia.com>
To: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: kernel-dev@igalia.com
Cc: dri-devel@lists.freedesktop.org
---
Maíra Canal (2):
drm/v3d: Handle error from drm_sched_entity_init()
drm/v3d: Remove dedicated fence_lock
Tvrtko Ursulin (4):
drm/v3d: Use raw seqcount helpers instead of fighting with lockdep
drm/v3d: Refcount v3d_stats
drm/v3d: Hold v3d_stats references in each job
drm/v3d: Attach per-fd reset counters to v3d_stats
drivers/gpu/drm/v3d/v3d_drv.c | 57 ++++++++++-------
drivers/gpu/drm/v3d/v3d_drv.h | 46 +++++++++-----
drivers/gpu/drm/v3d/v3d_fence.c | 2 +-
drivers/gpu/drm/v3d/v3d_gem.c | 43 ++++++++-----
drivers/gpu/drm/v3d/v3d_irq.c | 2 +-
drivers/gpu/drm/v3d/v3d_sched.c | 133 +++++++++++++++------------------------
drivers/gpu/drm/v3d/v3d_submit.c | 6 ++
drivers/gpu/drm/v3d/v3d_sysfs.c | 2 +-
8 files changed, 151 insertions(+), 140 deletions(-)
---
base-commit: 21613f67ede11e495281b4a6dde72cd7db3ada4e
change-id: 20260215-v3d-reset-locking-improv-ffe16c35569b
next reply other threads:[~2026-03-05 23:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 23:25 Maíra Canal [this message]
2026-03-05 23:25 ` [PATCH v2 1/6] drm/v3d: Handle error from drm_sched_entity_init() Maíra Canal
2026-03-08 23:20 ` Claude review: " Claude Code Review Bot
2026-03-05 23:25 ` [PATCH v2 2/6] drm/v3d: Use raw seqcount helpers instead of fighting with lockdep Maíra Canal
2026-03-08 23:20 ` Claude review: " Claude Code Review Bot
2026-03-05 23:25 ` [PATCH v2 3/6] drm/v3d: Refcount v3d_stats Maíra Canal
2026-03-08 23:20 ` Claude review: " Claude Code Review Bot
2026-03-05 23:25 ` [PATCH v2 4/6] drm/v3d: Hold v3d_stats references in each job Maíra Canal
2026-03-08 23:20 ` Claude review: " Claude Code Review Bot
2026-03-05 23:25 ` [PATCH v2 5/6] drm/v3d: Attach per-fd reset counters to v3d_stats Maíra Canal
2026-03-08 23:20 ` Claude review: " Claude Code Review Bot
2026-03-05 23:25 ` [PATCH v2 6/6] drm/v3d: Remove dedicated fence_lock Maíra Canal
2026-03-08 23:20 ` Claude review: " Claude Code Review Bot
2026-03-08 23:20 ` Claude review: drm/v3d: Improve v3d_stats lifetime and locking Claude Code Review Bot
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=20260305-v3d-reset-locking-improv-v2-0-fd53c91f7726@igalia.com \
--to=mcanal@igalia.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=itoral@igalia.com \
--cc=kernel-dev@igalia.com \
--cc=mripard@kernel.org \
--cc=mwen@igalia.com \
--cc=tvrtko.ursulin@igalia.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