From: Melissa Wen <mwen@igalia.com>
To: "Maíra Canal" <mcanal@igalia.com>,
"Iago Toral Quiroga" <itoral@igalia.com>,
"Jose Maria Casanova Crespo" <jmcasanova@igalia.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>
Cc: kernel-dev@igalia.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 1/6] drm/v3d: Store a pointer to `struct v3d_file_priv` inside each job
Date: Mon, 25 Aug 2025 16:56:50 -0300 [thread overview]
Message-ID: <230174f5-4dd3-4974-a308-24262d5a6b02@igalia.com> (raw)
In-Reply-To: <20250815-v3d-queue-lock-v2-1-ce37258ffb53@igalia.com>
On 15/08/2025 16:58, Maíra Canal wrote:
> Instead of storing a pointer to the DRM file data, store a pointer
> directly to the private V3D file struct.
Why? "to collect per-process information about the GPU"?
>
> Signed-off-by: Maíra Canal <mcanal@igalia.com>
> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
> ---
> drivers/gpu/drm/v3d/v3d_drv.h | 4 ++--
> drivers/gpu/drm/v3d/v3d_sched.c | 10 +++++-----
> drivers/gpu/drm/v3d/v3d_submit.c | 2 +-
> 3 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h
> index 82d84a96235f0c5396ff634c2f6a0a7bb809b332..951a302336ce55f0a70f6a7adc0ec7ca30033198 100644
> --- a/drivers/gpu/drm/v3d/v3d_drv.h
> +++ b/drivers/gpu/drm/v3d/v3d_drv.h
> @@ -327,9 +327,9 @@ struct v3d_job {
> struct v3d_perfmon *perfmon;
>
> /* File descriptor of the process that submitted the job that could be used
> - * for collecting stats by process of GPU usage.
> + * to collect per-process information about the GPU.
> */
> - struct drm_file *file;
> + struct v3d_file_priv *file_priv;
>
> /* Callback for the freeing of the job on refcount going to 0. */
> void (*free)(struct kref *ref);
> diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/v3d_sched.c
> index f9d9a198d71866e662376a2367d7d5bcb4a363b6..1846030c5f3a508455087947872dacbfd6fb52ad 100644
> --- a/drivers/gpu/drm/v3d/v3d_sched.c
> +++ b/drivers/gpu/drm/v3d/v3d_sched.c
> @@ -139,7 +139,7 @@ static void
> v3d_job_start_stats(struct v3d_job *job, enum v3d_queue queue)
> {
> struct v3d_dev *v3d = job->v3d;
> - struct v3d_file_priv *file = job->file->driver_priv;
> + struct v3d_file_priv *file = job->file_priv;
> struct v3d_stats *global_stats = &v3d->queue[queue].stats;
> struct v3d_stats *local_stats = &file->stats[queue];
> u64 now = local_clock();
> @@ -197,7 +197,7 @@ void
> v3d_job_update_stats(struct v3d_job *job, enum v3d_queue queue)
> {
> struct v3d_dev *v3d = job->v3d;
> - struct v3d_file_priv *file = job->file->driver_priv;
> + struct v3d_file_priv *file = job->file_priv;
> struct v3d_stats *global_stats = &v3d->queue[queue].stats;
> u64 now = local_clock();
> unsigned long flags;
> @@ -574,7 +574,7 @@ static void
> v3d_reset_performance_queries(struct v3d_cpu_job *job)
> {
> struct v3d_performance_query_info *performance_query = &job->performance_query;
> - struct v3d_file_priv *v3d_priv = job->base.file->driver_priv;
> + struct v3d_file_priv *v3d_priv = job->base.file_priv;
> struct v3d_dev *v3d = job->base.v3d;
> struct v3d_perfmon *perfmon;
>
> @@ -604,7 +604,7 @@ v3d_write_performance_query_result(struct v3d_cpu_job *job, void *data,
> {
> struct v3d_performance_query_info *performance_query =
> &job->performance_query;
> - struct v3d_file_priv *v3d_priv = job->base.file->driver_priv;
> + struct v3d_file_priv *v3d_priv = job->base.file_priv;
> struct v3d_performance_query *perf_query =
> &performance_query->queries[query];
> struct v3d_dev *v3d = job->base.v3d;
> @@ -722,7 +722,7 @@ static enum drm_gpu_sched_stat
> v3d_gpu_reset_for_timeout(struct v3d_dev *v3d, struct drm_sched_job *sched_job)
> {
> struct v3d_job *job = to_v3d_job(sched_job);
> - struct v3d_file_priv *v3d_priv = job->file->driver_priv;
> + struct v3d_file_priv *v3d_priv = job->file_priv;
> enum v3d_queue q;
>
> mutex_lock(&v3d->reset_lock);
> diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm/v3d/v3d_submit.c
> index 5171ffe9012d4d0140d82d40af71ecbaf029a24a..f3652e90683c398f25d2ce306be1c0fdfe4d286f 100644
> --- a/drivers/gpu/drm/v3d/v3d_submit.c
> +++ b/drivers/gpu/drm/v3d/v3d_submit.c
> @@ -166,7 +166,7 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv,
>
> job->v3d = v3d;
> job->free = free;
> - job->file = file_priv;
> + job->file_priv = v3d_priv;
>
> ret = drm_sched_job_init(&job->base, &v3d_priv->sched_entity[queue],
> 1, v3d_priv, file_priv->client_id);
>
next prev parent reply other threads:[~2025-08-25 19:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 19:58 [PATCH v2 0/6] drm/v3d: General job locking improvements + race-condition fixes Maíra Canal
2025-08-15 19:58 ` [PATCH v2 1/6] drm/v3d: Store a pointer to `struct v3d_file_priv` inside each job Maíra Canal
2025-08-25 19:56 ` Melissa Wen [this message]
2025-08-25 20:30 ` Maíra Canal
2025-08-25 20:33 ` Melissa Wen
2025-08-15 19:58 ` [PATCH v2 2/6] drm/v3d: Store the active job inside the queue's state Maíra Canal
2025-08-25 20:23 ` Melissa Wen
2025-08-15 19:58 ` [PATCH v2 3/6] drm/v3d: Replace a global spinlock with a per-queue spinlock Maíra Canal
2025-08-25 19:57 ` Melissa Wen
2025-08-25 20:35 ` Maíra Canal
2025-08-15 19:58 ` [PATCH v2 4/6] drm/v3d: Address race-condition between per-fd GPU stats and fd release Maíra Canal
2025-08-25 20:03 ` Melissa Wen
2025-08-25 20:53 ` Maíra Canal
2025-08-25 23:09 ` Melissa Wen
2025-08-26 12:03 ` Maíra Canal
2025-08-15 19:58 ` [PATCH v2 5/6] drm/v3d: Synchronous operations can't timeout Maíra Canal
2025-08-25 20:31 ` Melissa Wen
2025-08-15 19:58 ` [PATCH v2 6/6] drm/v3d: Protect per-fd reset counter against fd release Maíra Canal
2025-08-25 20:15 ` Melissa Wen
2025-08-25 20:50 ` Maíra Canal
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=230174f5-4dd3-4974-a308-24262d5a6b02@igalia.com \
--to=mwen@igalia.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=itoral@igalia.com \
--cc=jmcasanova@igalia.com \
--cc=kernel-dev@igalia.com \
--cc=mcanal@igalia.com \
--cc=simona@ffwll.ch \
/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;
as well as URLs for NNTP newsgroup(s).