All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Grodzovsky, Andrey" <Andrey.Grodzovsky@amd.com>
To: "Zhou, David(ChunMing)" <David1.Zhou@amd.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"eric@anholt.net" <eric@anholt.net>,
	"etnaviv@lists.freedesktop.org" <etnaviv@lists.freedesktop.org>,
	"ckoenig.leichtzumerken@gmail.com"
	<ckoenig.leichtzumerken@gmail.com>
Cc: "Kazlauskas, Nicholas" <Nicholas.Kazlauskas@amd.com>,
	"Liu, Monk" <Monk.Liu@amd.com>
Subject: Re: [PATCH v5 4/6] drm/sched: Keep s_fence->parent pointer
Date: Tue, 23 Apr 2019 15:14:57 +0000	[thread overview]
Message-ID: <6576a042-e812-dd7f-4d90-843102e5fbc9@amd.com> (raw)
In-Reply-To: <55dd15d0-9b42-f5da-693e-c35532206cdc@amd.com>


On 4/22/19 8:59 AM, Zhou, David(ChunMing) wrote:
> +Monk to response this patch.
>
>
> 在 2019/4/18 23:00, Andrey Grodzovsky 写道:
>> For later driver's reference to see if the fence is signaled.
>>
>> v2: Move parent fence put to resubmit jobs.
>>
>> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
>> Reviewed-by: Christian König <christian.koenig@amd.com>
>> ---
>>    drivers/gpu/drm/scheduler/sched_main.c | 11 +++++++++--
>>    1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
>> index 7816de7..03e6bd8 100644
>> --- a/drivers/gpu/drm/scheduler/sched_main.c
>> +++ b/drivers/gpu/drm/scheduler/sched_main.c
>> @@ -375,8 +375,6 @@ void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad)
>>    		if (s_job->s_fence->parent &&
>>    		    dma_fence_remove_callback(s_job->s_fence->parent,
>>    					      &s_job->cb)) {
>> -			dma_fence_put(s_job->s_fence->parent);
>> -			s_job->s_fence->parent = NULL;
> I vaguely remember Monk set parent to be NULL to avoiod potiential free
> problem after callback removal.
>
>
> -David

I see, we have to avoid setting it to NULL here as in case the guilty 
job does signal and we avoid HW reset we are not going to resubmit the 
jobs and hence stay with the same parent on reattachment of the cb. So I 
need to know exactly what scenario this set to NULL fixes.

Andrey


>
>
>>    			atomic_dec(&sched->hw_rq_count);
>>    		} else {
>>    			/*
>> @@ -403,6 +401,14 @@ void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad)
>>    				sched->ops->free_job(s_job);
>>    		}
>>    	}
>> +
>> +	/*
>> +	 * Stop pending timer in flight as we rearm it in  drm_sched_start. This
>> +	 * avoids the pending timeout work in progress to fire right away after
>> +	 * this TDR finished and before the newly restarted jobs had a
>> +	 * chance to complete.
>> +	 */
>> +	cancel_delayed_work(&sched->work_tdr);
>>    }
>>    
>>    EXPORT_SYMBOL(drm_sched_stop);
>> @@ -477,6 +483,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
>>    		if (found_guilty && s_job->s_fence->scheduled.context == guilty_context)
>>    			dma_fence_set_error(&s_fence->finished, -ECANCELED);
>>    
>> +		dma_fence_put(s_job->s_fence->parent);
>>    		s_job->s_fence->parent = sched->ops->run_job(s_job);
>>    	}
>>    }
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-04-23 15:14 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 15:00 [PATCH v5 1/6] drm/amd/display: wait for fence without holding reservation lock Andrey Grodzovsky
     [not found] ` <1555599624-12285-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2019-04-18 15:00   ` [PATCH v5 2/6] drm/amd/display: Use a reasonable timeout for framebuffer fence waits Andrey Grodzovsky
2019-04-18 15:00   ` [PATCH v5 3/6] drm/scheduler: rework job destruction Andrey Grodzovsky
2019-04-22 12:48     ` Chunming Zhou
     [not found]       ` <9f7112b1-0348-b4f6-374d-e44c0d448112-5C7GfCeVMHo@public.gmane.org>
2019-04-23 14:26         ` Grodzovsky, Andrey
2019-04-23 14:44           ` Zhou, David(ChunMing)
2019-04-23 15:01             ` [PATCH " Grodzovsky, Andrey
2019-05-29 10:02     ` Daniel Vetter
2019-04-18 15:00   ` [PATCH v5 4/6] drm/sched: Keep s_fence->parent pointer Andrey Grodzovsky
     [not found]     ` <1555599624-12285-4-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2019-04-22 12:59       ` Chunming Zhou
2019-04-23 15:14         ` Grodzovsky, Andrey [this message]
2019-04-18 15:00   ` [PATCH v5 5/6] drm/scheduler: Add flag to hint the release of guilty job Andrey Grodzovsky
2019-04-18 15:00   ` [PATCH v5 6/6] drm/amdgpu: Avoid HW reset if guilty job already signaled Andrey Grodzovsky
     [not found]     ` <1555599624-12285-6-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2019-04-22 11:54       ` Grodzovsky, Andrey
2019-04-23 12:32         ` Koenig, Christian
     [not found]           ` <9774408b-cc4c-90dd-cbc7-6ef5c6fd8c46-5C7GfCeVMHo@public.gmane.org>
2019-04-23 13:14             ` Kazlauskas, Nicholas
2019-04-23 14:03               ` Grodzovsky, Andrey
2019-04-23 14:12           ` Grodzovsky, Andrey
     [not found]             ` <a5c97356-66d8-b79e-32ab-a03e4c4d3e39-5C7GfCeVMHo@public.gmane.org>
2019-04-23 14:49               ` Christian König
2019-04-22 13:09       ` Chunming Zhou
2019-04-23 14:51         ` Grodzovsky, Andrey
     [not found]           ` <1b41c4f1-b406-8710-2a7a-e5c54a116fe9-5C7GfCeVMHo@public.gmane.org>
2019-04-23 15:19             ` Zhou, David(ChunMing)
     [not found]               ` <-hyv5g0n8ru25qelb0v-8u6jdi1vp2c7z1m3f5-uygwc1o5ji6s-9zli9v-srreuk-3pvse1en6kx0-6se95l-6jsafd-a6sboi-j814xf-ijgwfc-qewgmm-vnafjgrn2fq0-jgir949hx4yo-i772hz-tn7ial.1556032736536-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2019-04-23 15:59                 ` [PATCH " Grodzovsky, Andrey
2019-04-24  3:02                   ` Zhou, David(ChunMing)
2019-04-24  7:09                     ` Christian König
     [not found]                       ` <e20d013e-df21-1300-27d1-7f9b829cc067-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-04-26 14:08                         ` Grodzovsky, Andrey
2019-04-28  2:56                           ` Zhou, David(ChunMing)
2019-04-29 14:14                             ` Grodzovsky, Andrey
2019-04-29 19:03                               ` Christian König
2019-04-23  2:35   ` [PATCH v5 1/6] drm/amd/display: wait for fence without holding reservation lock Dieter Nützel
     [not found]     ` <2ddcff29bfaab2408b6e2cbc416322cd-0hun7QTegEsDD4udEopG9Q@public.gmane.org>
2019-04-23 14:02       ` Grodzovsky, Andrey

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=6576a042-e812-dd7f-4d90-843102e5fbc9@amd.com \
    --to=andrey.grodzovsky@amd.com \
    --cc=David1.Zhou@amd.com \
    --cc=Monk.Liu@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=etnaviv@lists.freedesktop.org \
    /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.