Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: "Souza, Jose" <jose.souza@intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [Intel-xe] [PATCH 1/3] drm/xe: Disable interruptable wait on xe_bo_move()
Date: Mon, 29 May 2023 16:46:22 +0200	[thread overview]
Message-ID: <29af556c-008c-4c4c-421b-a08bb59ef3a7@linux.intel.com> (raw)
In-Reply-To: <376886023a6aed008f3e9e438722403a6278d348.camel@intel.com>


On 5/29/23 16:40, Souza, Jose wrote:
> On Mon, 2023-05-29 at 12:31 +0200, Thomas Hellström wrote:
>> On Mon, 2023-05-29 at 10:59 +0200, Thomas Hellström wrote:
>>> On Fri, 2023-05-26 at 12:06 -0700, José Roberto de Souza wrote:
>>>> All the Xe users of dma_resv_wait_timeout() also disable the
>>>> interruptable wait.
>>>> And doing so this avoids DRM_IOCTL_XE_EXEC fails when under memory
>>>> pressure.
>>> Interruptible waits are crucial for signal delivery latency and for
>>> user experience (being able to ctrl-c away from somtething that is
>>> stuck).
>>>
>>> Uninterruptible waits should only ever be used in situations where
>>> it's
>>> impossible to recover from an error, like in error or possibly
>>> destruction paths.
>>>
>>> In this case execbuf should be able to handle the -EINTR returned
>>> from
>>> the ioctl and restart. If it doesn't there's an error elsewhere.
>>>
>>> But Maarten had a patch to return the real error code rather than
>>> rewriting it to -ETIME.
> This patch? https://patchwork.freedesktop.org/patch/539633/?series=118428&rev=1
>
> This would cause it to return ERESTARTSYS to user-space.

ERESTARTSYS is a special error code that is never forwarded to 
user-space, the kernel's signal handling functionality converts it to 
EINTR iff there is a signal pending, and if not, just restarts the 
system call internally without returning to user-space. So user-space 
should just see the EINTR.

/Thomas


>
>>> /Thomas
>> Upon closer inspection of the code, that bool now set to true should
>> really be ctx->interruptible. Still Maarten's patch would be needed to
>> avoid the -ETIME rewrite, though.
>>
>> /Thomas
>>
>>
>>>
>>>
>>>> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/239
>>>> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>>> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
>>>> ---
>>>>   drivers/gpu/drm/xe/xe_bo.c | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/xe/xe_bo.c
>>>> b/drivers/gpu/drm/xe/xe_bo.c
>>>> index 0db9c05097d07..6ed7e08269e82 100644
>>>> --- a/drivers/gpu/drm/xe/xe_bo.c
>>>> +++ b/drivers/gpu/drm/xe/xe_bo.c
>>>> @@ -609,7 +609,7 @@ static int xe_bo_move(struct ttm_buffer_object
>>>> *ttm_bo, bool evict,
>>>>              new_mem->mem_type == XE_PL_SYSTEM) {
>>>>                  long timeout = dma_resv_wait_timeout(ttm_bo-
>>>>> base.resv,
>>>>                                                      
>>>> DMA_RESV_USAGE_BOOKKEEP,
>>>> -                                                    true,
>>>> +                                                    false,
>>>>                                                      
>>>> MAX_SCHEDULE_TIMEOUT);
>>>>                  if (timeout <= 0) {
>>>>                          ret = -ETIME;

  reply	other threads:[~2023-05-29 14:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26 19:06 [Intel-xe] [PATCH 1/3] drm/xe: Disable interruptable wait on xe_bo_move() José Roberto de Souza
2023-05-26 19:06 ` [Intel-xe] [PATCH 2/3] drm/xe: Add missing TLB invalidation to emit_pipe_invalidate() José Roberto de Souza
2023-05-29  9:08   ` Thomas Hellström
2023-05-29 14:48     ` Souza, Jose
2023-05-29 14:56       ` Thomas Hellström
2023-05-29 15:07         ` Thomas Hellström
2023-05-30 18:40           ` Souza, Jose
2023-05-31  8:46             ` Thomas Hellström
2023-06-01 19:26               ` Matt Roper
2023-06-01 21:09                 ` Souza, Jose
2023-06-02  8:20                   ` Lionel Landwerlin
     [not found]               ` <1ac84b94994b26ee20881de276d6349f16907716.camel@intel.com>
2023-06-02  8:36                 ` [Intel-xe] Render cache flushes WAS " Thomas Hellström
2023-05-26 19:06 ` [Intel-xe] [PATCH 3/3] drm/xe: Replace PVC check by engine type check José Roberto de Souza
2023-05-29  9:10   ` Thomas Hellström
2023-05-26 19:08 ` [Intel-xe] ✓ CI.Patch_applied: success for series starting with [1/3] drm/xe: Disable interruptable wait on xe_bo_move() Patchwork
2023-05-26 19:10 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-05-26 19:14 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-05-26 19:42 ` [Intel-xe] ○ CI.BAT: info " Patchwork
2023-05-29  8:59 ` [Intel-xe] [PATCH 1/3] " Thomas Hellström
2023-05-29 10:31   ` Thomas Hellström
2023-05-29 14:40     ` Souza, Jose
2023-05-29 14:46       ` Thomas Hellström [this message]
2023-05-29 16:48         ` Souza, Jose

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=29af556c-008c-4c4c-421b-a08bb59ef3a7@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jose.souza@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox