From: Maarten Lankhorst <maarten.lankhorst@canonical.com>
To: "Zhou, Jammy" <Jammy.Zhou@amd.com>
Cc: "Deucher, Alexander" <Alexander.Deucher@amd.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/1] reservation: wait only with non-zero timeout specified (v2)
Date: Tue, 13 Jan 2015 09:05:07 +0100 [thread overview]
Message-ID: <54B4D1B3.1040108@canonical.com> (raw)
In-Reply-To: <FD5696F5CDD4B04D92C97DB96167DECA16010540@SCYBEXDAG04.amd.com>
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@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-01-13 8:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 5:50 [PATCH 1/1] reservation: wait only with non-zero timeout specified (v2) Jammy Zhou
2015-01-13 6:50 ` Maarten Lankhorst
2015-01-13 7:59 ` Zhou, Jammy
2015-01-13 8:05 ` Maarten Lankhorst [this message]
2015-01-13 8:53 ` Zhou, Jammy
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=54B4D1B3.1040108@canonical.com \
--to=maarten.lankhorst@canonical.com \
--cc=Alexander.Deucher@amd.com \
--cc=Jammy.Zhou@amd.com \
--cc=dri-devel@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.