From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: Re: [PATCH v3 1/2] drm/scheduler: Avoid using wait_event_killable for dying process. Date: Mon, 4 Jun 2018 20:20:00 +0200 Message-ID: <78eb77c1-337e-974d-d4dc-40a382ab8b59@amd.com> References: <1528124636-17283-1-git-send-email-andrey.grodzovsky@amd.com> <707e5e63-ba88-0cb7-c8b0-5b4bed550d0c@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0132880508==" Return-path: In-Reply-To: <707e5e63-ba88-0cb7-c8b0-5b4bed550d0c-5C7GfCeVMHo@public.gmane.org> Content-Language: en-US List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: Andrey Grodzovsky , amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org This is a multi-part message in MIME format. --===============0132880508== Content-Type: multipart/alternative; boundary="------------22DD79F7D3465BE3D9839A83" Content-Language: en-US This is a multi-part message in MIME format. --------------22DD79F7D3465BE3D9839A83 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Ok that explains it. I was already wondering what the heck I was missing :) The second patch already looked fine to me as well. Just send it out once more to get an rb, Christian. Am 04.06.2018 um 20:03 schrieb Andrey Grodzovsky: > > I reread the documentation for wait_event_timeout, my bad, all this > time i assumed it returns > > amount of jiffies he spent in waiting while actually it returns "the > remaining jiffies (at least 1) > > if the @condition evaluated >  * to %true before the @timeout elapsed." > > Will fix that, please take a look also at the second patch. > > Andrey > > > On 06/04/2018 01:53 PM, Christian König wrote: >>> +            ret = wait_event_timeout( >>> +                    sched->job_scheduled, >>> +                    drm_sched_entity_is_idle(entity), >>> +                    timeout); >>> + >>> +            ret = ret ? timeout - ret : ret; >> >> Ok we still seem to have a misunderstanding here what >> wait_event_timeout() returns. >> >> As far as I know that line shouldn't be necessary and is actually >> quite harmful. >> >> Apart from that this patch looks fine to me now, >> Christian. > --------------22DD79F7D3465BE3D9839A83 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Ok that explains it. I was already wondering what the heck I was missing :)

The second patch already looked fine to me as well.

Just send it out once more to get an rb,
Christian.

Am 04.06.2018 um 20:03 schrieb Andrey Grodzovsky:

I reread the documentation for wait_event_timeout, my bad, all this time i assumed it returns

amount of jiffies he spent in waiting while actually it returns "the remaining jiffies (at least 1)

if the @condition evaluated
 * to %true before the @timeout elapsed."

Will fix that, please take a look also at the second patch.

Andrey


On 06/04/2018 01:53 PM, Christian König wrote:
+            ret = wait_event_timeout(
+                    sched->job_scheduled,
+                    drm_sched_entity_is_idle(entity),
+                    timeout);
+
+            ret = ret ? timeout - ret : ret;

Ok we still seem to have a misunderstanding here what wait_event_timeout() returns.

As far as I know that line shouldn't be necessary and is actually quite harmful.

Apart from that this patch looks fine to me now,
Christian.


--------------22DD79F7D3465BE3D9839A83-- --===============0132880508== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4Cg== --===============0132880508==--