From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: Re: [PATCH] dma-buf/fence-array: get signaled state when signaling is disabled Date: Thu, 22 Sep 2016 13:00:27 +0200 Message-ID: <3eec9eb7-cd10-48fe-60c3-c2e282fd982e@amd.com> References: <1474457767-26195-1-git-send-email-gustavo@padovan.org> <20160922074413.GB3473@joana> <45c32a0d-ffd5-612c-cddd-ac7dfb9226bc@amd.com> <20160922104001.GC3473@joana> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0480790847==" Return-path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0059.outbound.protection.outlook.com [104.47.38.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id C8AA06E01B for ; Thu, 22 Sep 2016 13:32:55 +0000 (UTC) In-Reply-To: <20160922104001.GC3473@joana> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Gustavo Padovan , dri-devel@lists.freedesktop.org, Gustavo Padovan List-Id: dri-devel@lists.freedesktop.org --===============0480790847== Content-Type: multipart/alternative; boundary="------------C44E56A03B1CC1A1288EADA4" --------------C44E56A03B1CC1A1288EADA4 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Dropping the rest of the patch, cause that really doesn't make sense any more. Am 22.09.2016 um 12:40 schrieb Gustavo Padovan: >> E.g. for example it is illegal to do something like >> >"while(!fence_is_signaled(f)) sleep();" without enabling signaling before >> >doing this. >> > >> >Could just be a misunderstanding, but the comments on your patch actually >> >sounds a bit like somebody is trying to do exactly that. > I think the usecase in mind here is poll(fd, timeout=0) Exactly as I feared. Even if userspace polls with timeout=0 you still need to call enable_signaling(). Otherwise you can run into a situation where userspace only uses timeout=0 and so never activates the signaling check in the driver. This would in turn result in an endless loop on implementations where the driver never signals fences on their own. Regards, Christian. --------------C44E56A03B1CC1A1288EADA4 Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: 7bit
Dropping the rest of the patch, cause that really doesn't make sense any more.

Am 22.09.2016 um 12:40 schrieb Gustavo Padovan:
E.g. for example it is illegal to do something like
> "while(!fence_is_signaled(f)) sleep();" without enabling signaling before
> doing this.
> 
> Could just be a misunderstanding, but the comments on your patch actually
> sounds a bit like somebody is trying to do exactly that.
I think the usecase in mind here is poll(fd, timeout=0)

Exactly as I feared. Even if userspace polls with timeout=0 you still need to call enable_signaling().

Otherwise you can run into a situation where userspace only uses timeout=0 and so never activates the signaling check in the driver.

This would in turn result in an endless loop on implementations where the driver never signals fences on their own.

Regards,
Christian.
--------------C44E56A03B1CC1A1288EADA4-- --===============0480790847== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0480790847==--