From: Alex Xie <AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>,
"Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 2/2] drm/amdgpu: Fix use of interruptible waiting
Date: Wed, 26 Apr 2017 15:19:20 -0400 [thread overview]
Message-ID: <5900F2B8.4010304@amd.com> (raw)
In-Reply-To: <226c0397-5820-76de-2299-997922f32c87-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
Hi,
I knew this is part of ioctl. And I intended to fix this interruptible
waiting in an ioctl.
ioctl is one of driver interfaces, where interruptible waiting is good
in some scenarios. For example, if ioctl performs IO operations in
atomic way, we don't want ioctl to be interrupted by a signal.
Interruptible waiting is good when we need to wait for longer time, for
example, waiting for an input data for indefinite time. We don't want
the process not responding to signals. Interruptible waitings can be
good in read/write/ioctl interfaces.
For this patch,
1. The wait is short. There is not much benefit by interruptible
waiting. The BO is a frame buffer BO. Are there many competitors to
lock this BO? If not, the wait is very short. This is my main reason to
change.
2. In this function and caller functions, the error handling for such
interrupt is complicated and risky. When the waiting is interrupted by a
signal, the callers of this function need to handle this interrupt
error. I traced the calling stack all the way back to function
drm_mode_page_flip_ioctl. I could not find an issue. But I am not sure
about even upper layer. Is this IOCTL restartable? How about further
higher layer? Since I didn't see benefit in point 1. So I thought it was
a good idea to change.
Anyway, it is up to you. A change might bring other unseen risk. If you
still have concern, I will drop this patch. This IOCTL is used by
graphic operation. There may not be a lot of signals to a GUI process
which uses this IOCTL.
Thanks,
Alex Bin
On 17-04-26 04:34 AM, Christian König wrote:
> Am 26.04.2017 um 03:17 schrieb Michel Dänzer:
>> On 26/04/17 06:25 AM, Alex Xie wrote:
>>> 1. The wait is short. There is not much benefit by
>>> interruptible waiting.
>>> 2. In this function and caller functions, the error
>>> handling for such interrupt is complicated and risky.
>>>
>>> Change-Id: I289674ecd3f5ef20c93fe63e33df6d668b3c2edc
>>> Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>>> index 43082bf..c006cc4 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>>> @@ -227,7 +227,7 @@ int amdgpu_crtc_prepare_flip(
>>> new_abo = gem_to_amdgpu_bo(obj);
>>> /* pin the new buffer */
>>> - r = amdgpu_bo_reserve(new_abo, false);
>>> + r = amdgpu_bo_reserve(new_abo, true);
>>> if (unlikely(r != 0)) {
>>> DRM_ERROR("failed to reserve new abo buffer before flip\n");
>>> goto cleanup;
>>>
>> I'm afraid we have no choice but to use interruptible here, because this
>> code runs as part of an ioctl (DRM_IOCTL_MODE_PAGE_FLIP).
>
> Yes, agree. But the error message is incorrect here and should be
> removed.
>
> Christian.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2017-04-26 19:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-25 21:25 [PATCH 1/2] drm/amdgpu: Fix use of interruptible waiting Alex Xie
[not found] ` <1493155526-28910-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
2017-04-25 21:25 ` [PATCH 2/2] " Alex Xie
[not found] ` <1493155526-28910-2-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
2017-04-26 1:17 ` Michel Dänzer
[not found] ` <13a02c0e-0db4-043a-0e2f-353c540e2125-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-04-26 8:34 ` Christian König
[not found] ` <226c0397-5820-76de-2299-997922f32c87-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-26 19:19 ` Alex Xie [this message]
[not found] ` <5900F2B8.4010304-5C7GfCeVMHo@public.gmane.org>
2017-04-27 7:39 ` Michel Dänzer
[not found] ` <a54247e2-09dd-4157-7063-1f9dd025b845-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-04-27 9:31 ` Michel Dänzer
2017-04-27 9:05 ` Christian König
[not found] ` <2789f1cb-f2b5-b482-ad36-ee20329b69f2-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-27 9:27 ` Michel Dänzer
2017-04-26 8:34 ` [PATCH 1/2] " Christian König
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=5900F2B8.4010304@amd.com \
--to=alexbin.xie-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org \
--cc=michel-otUistvHUpPR7s880joybQ@public.gmane.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.