Re: [PATCH 1/1] reservation: wait only with non-zero timeout specified (v2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Op 13-01-15 om 08:59 schreef Zhou, Jammy:
> Hi Maarten,
>
>> Can't you simply add if (!timeout) return !reservation_object_test_signaled_rcu(obj, wait_all); to the beginning instead?
> Hmm, after looking into it, I think that can achieve the same purpose. I will update the patch with this.
>
>> Also why do you need this? Why not simply return 0 with timeout = 0.
> The major purpose here is to use reservation_object_wait_timeout_rcu to handle all possible timeout values (and just to check status with timeout==0). If we simply return 0, we cannot determine the fence is signaled or not with the return value.
You can't anyway when calling with timeout = 0.

 * fence_wait_timeout - sleep until the fence gets signaled
 *
 * Returns -ERESTARTSYS if interrupted, 0 if the wait timed out, or the
 * remaining timeout in jiffies on success. Other error values may be
 * returned on custom implementations.

Since you have 0 returning jiffies, you would get 0 regardless of fence_wait being succesful or not.

I think the only right way to handle this is by returning 0 immediately if timeout is 0.

Why do you need it to return 1? Why not use reservation_object_test_signaled_rcu directly?

~Maarten
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux