Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Christian König" <christian.koenig@amd.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Dave Airlie" <airlied@gmail.com>
Cc: Matthew Brost <matthew.brost@intel.com>,
	<intel-xe@lists.freedesktop.org>,
	 <dri-devel@lists.freedesktop.org>, <airlied@gmail.com>,
	<ltuikov89@gmail.com>
Subject: Re: [PATCH] drm/sched: Re-queue run job worker when drm_sched_entity_pop_job() returns NULL
Date: Mon, 5 Feb 2024 08:33:21 -0500	[thread overview]
Message-ID: <ZcDjoek_l_cqE4Rr@intel.com> (raw)
In-Reply-To: <c5a7ae52-98e2-4edf-a539-71e4166fe3a4@amd.com>

On Mon, Feb 05, 2024 at 09:44:56AM +0100, Christian König wrote:
> Am 02.02.24 um 22:58 schrieb Rodrigo Vivi:
> > On Tue, Jan 30, 2024 at 08:05:29AM +0100, Christian König wrote:
> > > Am 30.01.24 um 04:04 schrieb Matthew Brost:
> > > > Rather then loop over entities until one with a ready job is found,
> > > > re-queue the run job worker when drm_sched_entity_pop_job() returns NULL.
> > > > 
> > > > Fixes: 6dbd9004a55 ("drm/sched: Drain all entities in DRM sched run job worker")
> > First of all there's a small typo in this Fixes tag that needs to be fixed.
> > The correct one is:
> > 
> > Fixes: 66dbd9004a55 ("drm/sched: Drain all entities in DRM sched run job worker")

Cc: Dave Airlie <airlied@redhat.com>

> > 
> > But I couldn't apply this right now in any of our drm-tip trees because it
> > is not clear where this is coming from originally.
> > 
> > likely amd tree?!
> 
> No, this comes from Matthews work on the DRM scheduler.
> 
> Matthews patches were most likely merged through drm-misc.

the original is not there in drm-misc-next.
it looks like Dave had taken that one directly to drm-next.
So we either need the drm-misc maintainers to have a backmerge or
Dave to take this through the drm-fixes directly.

> 
> Regards,
> Christian.
> 
> > 
> > > > Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> > > Reviewed-by: Christian König <christian.koenig@amd.com>
> > Christian, if this came from the amd, could you please apply it there and
> > propagate through your fixes flow?
> > 
> > Thanks,
> > Rodrigo.
> > 
> > > > ---
> > > >    drivers/gpu/drm/scheduler/sched_main.c | 15 +++++++++------
> > > >    1 file changed, 9 insertions(+), 6 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> > > > index 8acbef7ae53d..7e90c9f95611 100644
> > > > --- a/drivers/gpu/drm/scheduler/sched_main.c
> > > > +++ b/drivers/gpu/drm/scheduler/sched_main.c
> > > > @@ -1178,21 +1178,24 @@ static void drm_sched_run_job_work(struct work_struct *w)
> > > >    	struct drm_sched_entity *entity;
> > > >    	struct dma_fence *fence;
> > > >    	struct drm_sched_fence *s_fence;
> > > > -	struct drm_sched_job *sched_job = NULL;
> > > > +	struct drm_sched_job *sched_job;
> > > >    	int r;
> > > >    	if (READ_ONCE(sched->pause_submit))
> > > >    		return;
> > > >    	/* Find entity with a ready job */
> > > > -	while (!sched_job && (entity = drm_sched_select_entity(sched))) {
> > > > -		sched_job = drm_sched_entity_pop_job(entity);
> > > > -		if (!sched_job)
> > > > -			complete_all(&entity->entity_idle);
> > > > -	}
> > > > +	entity = drm_sched_select_entity(sched);
> > > >    	if (!entity)
> > > >    		return;	/* No more work */
> > > > +	sched_job = drm_sched_entity_pop_job(entity);
> > > > +	if (!sched_job) {
> > > > +		complete_all(&entity->entity_idle);
> > > > +		drm_sched_run_job_queue(sched);
> > > > +		return;
> > > > +	}
> > > > +
> > > >    	s_fence = sched_job->s_fence;
> > > >    	atomic_add(sched_job->credits, &sched->credit_count);
> 

  reply	other threads:[~2024-02-05 13:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30  3:04 [PATCH] drm/sched: Re-queue run job worker when drm_sched_entity_pop_job() returns NULL Matthew Brost
2024-01-30  3:07 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-30  3:07 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-30  3:08 ` ✓ CI.KUnit: success " Patchwork
2024-01-30  3:15 ` ✓ CI.Build: " Patchwork
2024-01-30  3:15 ` ✓ CI.Hooks: " Patchwork
2024-01-30  3:17 ` ✓ CI.checksparse: " Patchwork
2024-01-30  3:39 ` ✓ CI.BAT: " Patchwork
2024-01-30  7:05 ` [PATCH] " Christian König
2024-02-02 21:58   ` Rodrigo Vivi
2024-02-05  8:44     ` Christian König
2024-02-05 13:33       ` Rodrigo Vivi [this message]
2024-02-06  0:56         ` Luben Tuikov
2024-02-06  2:05           ` Dave Airlie
2024-02-06  0:45 ` Luben Tuikov

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=ZcDjoek_l_cqE4Rr@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=airlied@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=ltuikov89@gmail.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.brost@intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /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