All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Matthew Brost <matthew.brost@intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe: Take job list lock in xe_sched_first_pending_job
Date: Tue, 5 Nov 2024 22:56:19 +0100	[thread overview]
Message-ID: <ddc74c9d-97a0-4700-8b0b-4bfa8eb64b49@linux.intel.com> (raw)
In-Reply-To: <Zypa9M+p2+4RZ3Oa@lstrano-desk.jf.intel.com>


On 11/5/2024 6:50 PM, Matthew Brost wrote:
> On Tue, Nov 05, 2024 at 05:03:27PM +0100, Nirmoy Das wrote:
>> Access to the pending_list should always happens under job_list_lock.
>>
>> Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
> Is this showing up in any bug reports? The only user of this function is
> guc_exec_queue_stop which as stopped the scheduler worker so I think
> accessing to the pending_list is in fact safe without this lock. This is
> however a micro-optimization in a non-hot path which I think is frowned
> upon.

This showed up in coverity report so no real bug report. Also agree that with current usage this won't

cause any issue so avoided adding Cc to stable.

>
> So I think with above the fixes tag is not strickly required.

I will remove the Fixes tag before merging.

>
> For the patch though:
> Reviewed-by: Matthew Brost <matthew.brost@intel.com>


Thanks,

Nirmoy

>> Cc: Matthew Brost <matthew.brost@intel.com>
>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
>> ---
>>  drivers/gpu/drm/xe/xe_gpu_scheduler.h | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_gpu_scheduler.h b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
>> index 64b2ae6839db..c250ea773491 100644
>> --- a/drivers/gpu/drm/xe/xe_gpu_scheduler.h
>> +++ b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
>> @@ -71,8 +71,14 @@ static inline void xe_sched_add_pending_job(struct xe_gpu_scheduler *sched,
>>  static inline
>>  struct xe_sched_job *xe_sched_first_pending_job(struct xe_gpu_scheduler *sched)
>>  {
>> -	return list_first_entry_or_null(&sched->base.pending_list,
>> -					struct xe_sched_job, drm.list);
>> +	struct xe_sched_job *job;
>> +
>> +	spin_lock(&sched->base.job_list_lock);
>> +	job = list_first_entry_or_null(&sched->base.pending_list,
>> +				       struct xe_sched_job, drm.list);
>> +	spin_unlock(&sched->base.job_list_lock);
>> +
>> +	return job;
>>  }
>>  
>>  static inline int
>> -- 
>> 2.46.0
>>

  reply	other threads:[~2024-11-05 21:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05 16:03 [PATCH] drm/xe: Take job list lock in xe_sched_first_pending_job Nirmoy Das
2024-11-05 16:50 ` ✓ CI.Patch_applied: success for " Patchwork
2024-11-05 16:50 ` ✓ CI.checkpatch: " Patchwork
2024-11-05 16:52 ` ✓ CI.KUnit: " Patchwork
2024-11-05 17:03 ` ✓ CI.Build: " Patchwork
2024-11-05 17:05 ` ✓ CI.Hooks: " Patchwork
2024-11-05 17:07 ` ✓ CI.checksparse: " Patchwork
2024-11-05 17:33 ` ✓ CI.BAT: " Patchwork
2024-11-05 17:50 ` [PATCH] " Matthew Brost
2024-11-05 21:56   ` Nirmoy Das [this message]
2024-11-06 21:36 ` ✗ CI.FULL: failure for " Patchwork
2024-11-07  0:38 ` ✓ CI.Patch_applied: success for drm/xe: Take job list lock in xe_sched_first_pending_job (rev2) Patchwork
2024-11-07  0:38 ` ✓ CI.checkpatch: " Patchwork
2024-11-07  0:39 ` ✓ CI.KUnit: " Patchwork
2024-11-07  0:51 ` ✓ CI.Build: " Patchwork
2024-11-07  0:53 ` ✓ CI.Hooks: " Patchwork
2024-11-07  0:55 ` ✓ CI.checksparse: " Patchwork
2024-11-07  1:19 ` ✓ CI.BAT: " Patchwork
2024-11-08  6:22 ` ✗ CI.FULL: failure " Patchwork
2024-11-12 10:04   ` Nirmoy Das

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=ddc74c9d-97a0-4700-8b0b-4bfa8eb64b49@linux.intel.com \
    --to=nirmoy.das@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=nirmoy.das@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.