public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] drm/v3d: Improve v3d_stats lifetime and locking
@ 2026-03-06 11:30 Maíra Canal
  2026-03-06 11:30 ` [PATCH v3 1/6] drm/v3d: Handle error from drm_sched_entity_init() Maíra Canal
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Maíra Canal @ 2026-03-06 11:30 UTC (permalink / raw)
  To: Melissa Wen, Tvrtko Ursulin, Maxime Ripard
  Cc: kernel-dev, dri-devel, Maíra Canal, Iago Toral Quiroga

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

v2 -> v3:

- [5/6] Remove mutex from DRM_V3D_PARAM_CONTEXT_RESET_COUNTER (Tvrtko Ursulin)
- Link to v2: https://lore.kernel.org/r/20260305-v3d-reset-locking-improv-v2-0-fd53c91f7726@igalia.com

---
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    |  55 ++++++++--------
 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, 147 insertions(+), 142 deletions(-)
---
base-commit: e597a809a2b97e927060ba182f58eb3e6101bc70
change-id: 20260215-v3d-reset-locking-improv-ffe16c35569b


^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH v2 0/6] drm/v3d: Improve v3d_stats lifetime and locking
@ 2026-03-05 23:25 Maíra Canal
  2026-03-05 23:25 ` [PATCH v2 3/6] drm/v3d: Refcount v3d_stats Maíra Canal
  0 siblings, 1 reply; 15+ messages in thread
From: Maíra Canal @ 2026-03-05 23:25 UTC (permalink / raw)
  To: Melissa Wen, Tvrtko Ursulin, Maxime Ripard
  Cc: kernel-dev, dri-devel, Maíra Canal, Iago Toral Quiroga

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


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

end of thread, other threads:[~2026-03-08 23:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06 11:30 [PATCH v3 0/6] drm/v3d: Improve v3d_stats lifetime and locking Maíra Canal
2026-03-06 11:30 ` [PATCH v3 1/6] drm/v3d: Handle error from drm_sched_entity_init() Maíra Canal
2026-03-08 22:56   ` Claude review: " Claude Code Review Bot
2026-03-06 11:30 ` [PATCH v3 2/6] drm/v3d: Use raw seqcount helpers instead of fighting with lockdep Maíra Canal
2026-03-08 22:56   ` Claude review: " Claude Code Review Bot
2026-03-06 11:30 ` [PATCH v3 3/6] drm/v3d: Refcount v3d_stats Maíra Canal
2026-03-08 22:56   ` Claude review: " Claude Code Review Bot
2026-03-06 11:30 ` [PATCH v3 4/6] drm/v3d: Hold v3d_stats references in each job Maíra Canal
2026-03-08 22:56   ` Claude review: " Claude Code Review Bot
2026-03-06 11:30 ` [PATCH v3 5/6] drm/v3d: Attach per-fd reset counters to v3d_stats Maíra Canal
2026-03-08 22:56   ` Claude review: " Claude Code Review Bot
2026-03-06 11:30 ` [PATCH v3 6/6] drm/v3d: Remove dedicated fence_lock Maíra Canal
2026-03-08 22:56   ` Claude review: " Claude Code Review Bot
2026-03-08 22:56 ` Claude review: drm/v3d: Improve v3d_stats lifetime and locking Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-05 23:25 [PATCH v2 0/6] " Maíra Canal
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox