<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>How about adding more condition ctx->resv inline to address your concern? As well as don't wait from same user, shouldn't lead to deadlock.<br>
<br>
Otherwise, any other idea?<br>
<br>
-------- Original Message --------<br>
Subject: Re: [PATCH] ttm: wait mem space if user allow while gpu busy<br>
From: Christian König <br>
To: "Liang, Prike" ,"Zhou, David(ChunMing)" ,dri-devel@lists.freedesktop.org<br>
CC: <br>
<br>
</div>
<font size="2"><span style="font-size:11pt;">
<div class="PlainText">Well that is certainly a NAK because it can lead to deadlock in the
<br>
memory management.<br>
<br>
You can't just busy wait with all those locks held.<br>
<br>
Regards,<br>
Christian.<br>
<br>
Am 23.04.19 um 03:45 schrieb Liang, Prike:<br>
> Acked-by: Prike Liang <Prike.Liang@amd.com><br>
><br>
> Thanks,<br>
> Prike<br>
> -----Original Message-----<br>
> From: Chunming Zhou <david1.zhou@amd.com><br>
> Sent: Monday, April 22, 2019 6:39 PM<br>
> To: dri-devel@lists.freedesktop.org<br>
> Cc: Liang, Prike <Prike.Liang@amd.com>; Zhou, David(ChunMing) <David1.Zhou@amd.com><br>
> Subject: [PATCH] ttm: wait mem space if user allow while gpu busy<br>
><br>
> heavy gpu job could occupy memory long time, which could lead to other user fail to get memory.<br>
><br>
> Change-Id: I0b322d98cd76e5ac32b00462bbae8008d76c5e11<br>
> Signed-off-by: Chunming Zhou <david1.zhou@amd.com><br>
> ---<br>
>   drivers/gpu/drm/ttm/ttm_bo.c | 6 ++++--<br>
>   1 file changed, 4 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 7c484729f9b2..6c596cc24bec 100644<br>
> --- a/drivers/gpu/drm/ttm/ttm_bo.c<br>
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c<br>
> @@ -830,8 +830,10 @@ static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo,<br>
>                if (mem->mm_node)<br>
>                        break;<br>
>                ret = ttm_mem_evict_first(bdev, mem_type, place, ctx);<br>
> -             if (unlikely(ret != 0))<br>
> -                     return ret;<br>
> +             if (unlikely(ret != 0)) {<br>
> +                     if (!ctx || ctx->no_wait_gpu || ret != -EBUSY)<br>
> +                             return ret;<br>
> +             }<br>
>        } while (1);<br>
>        mem->mem_type = mem_type;<br>
>        return ttm_bo_add_move_fence(bo, man, mem);<br>
> --<br>
> 2.17.1<br>
><br>
> _______________________________________________<br>
> dri-devel mailing list<br>
> dri-devel@lists.freedesktop.org<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
<br>
</div>
</span></font>
</body>
</html>