From: sashiko-bot@kernel.org
To: "Maíra Canal" <mcanal@igalia.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/v3d: Skip perfmon serialization while a global perfmon is set
Date: Mon, 21 Sep 2026 21:35:45 +0000 [thread overview]
Message-ID: <20260921213546.3F6F51F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260921-v3d-quick-exit-perfmon-serialize-v1-2-e58aea1075e2@igalia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/v3d: counter pollution due to skipped job tracking with global perfmon
--
commit 16d01b295e0df230e5bdde84096f44906f1411fe
Author: Maíra Canal <mcanal@igalia.com>
drm/v3d: Skip perfmon serialization while a global perfmon is set
A global perfmon counts concurrent activity from every job, so no dependency
is added while one is set. This patch skips the accumulator for the jobs
carrying no perfmon while a global perfmon is enabled.
> diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm/v3d/v3d_submit.c
> index bc3c43fd4fd9e..7548faab67baa 100644
> --- a/drivers/gpu/drm/v3d/v3d_submit.c
> +++ b/drivers/gpu/drm/v3d/v3d_submit.c
[ ... ]
> @@ -375,11 +375,10 @@ v3d_serialize_for_perfmon(struct v3d_job *job)
> if (!atomic_read(&v3d->perfmon_state.nperfmons))
> return 0;
>
> - scoped_guard(spinlock_irqsave, &v3d->perfmon_state.lock)
> - is_global_perfmon = !!v3d->global_perfmon;
> -
> - if (is_global_perfmon)
> - goto publish;
> + scoped_guard(spinlock_irqsave, &v3d->perfmon_state.lock) {
> + if (!job->perfmon && v3d->global_perfmon)
> + return 0;
[Severity: Medium]
Does this early return cause subsequent local perfmon jobs to overlap with
untracked ones?
If a user sets a global perfmon and a job without a local perfmon is
submitted, v3d_serialize_for_perfmon() returns early here. By skipping the
publish step, the job is never added to last_hw_fence.
If the global perfmon is subsequently cleared and a job with a local perfmon
is submitted, it will check last_hw_fence but won't find a dependency for
the previously untracked job.
Could this result in both jobs executing concurrently and polluting the
performance counters for the local perfmon?
> + }
>
> if (job->perfmon) {
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921-v3d-quick-exit-perfmon-serialize-v1-0-e58aea1075e2@igalia.com?part=2
next prev parent reply other threads:[~2026-09-21 21:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 21:24 [PATCH 0/2] drm/v3d: Skip perfmon serialization when it cannot be observed Maíra Canal
2026-09-21 21:24 ` [PATCH 1/2] drm/v3d: Skip perfmon serialization while the device has no perfmon Maíra Canal
2026-09-22 6:35 ` Iago Toral
2026-09-21 21:24 ` [PATCH 2/2] drm/v3d: Skip perfmon serialization while a global perfmon is set Maíra Canal
2026-09-21 21:35 ` sashiko-bot [this message]
2026-09-22 7:11 ` Iago Toral
2026-09-22 7:11 ` [PATCH 0/2] drm/v3d: Skip perfmon serialization when it cannot be observed Iago Toral
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=20260921213546.3F6F51F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mcanal@igalia.com \
--cc=sashiko-reviews@lists.linux.dev \
/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