All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhou, David(ChunMing)" <David1.Zhou@amd.com>
To: "Koenig, Christian" <Christian.Koenig@amd.com>,
	"Liang, Prike" <Prike.Liang@amd.com>,
	"Zhou, David(ChunMing)" <David1.Zhou@amd.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re:[PATCH] ttm: wait mem space if user allow while gpu busy
Date: Tue, 23 Apr 2019 13:19:39 +0000	[thread overview]
Message-ID: <ven3p5-dcjsua-aovhkzqonovm1ermvl-iasad2-grfh83xntt6k-qnptbs-6ko55nfhu2ac-rew2lw-zbd8fsix6bv3-dlzat2-8w1c4brcif8r7131wn-p5wdqd-fvtllbv000vq-jszyw5-f3mv7ivocjk.1556025578377@email.android.com> (raw)
In-Reply-To: <1c98b839-362d-c279-1abb-c022aed3abf1@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2290 bytes --]

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.

Otherwise, any other idea?

-------- Original Message --------
Subject: Re: [PATCH] ttm: wait mem space if user allow while gpu busy
From: Christian König
To: "Liang, Prike" ,"Zhou, David(ChunMing)" ,dri-devel@lists.freedesktop.org
CC:

Well that is certainly a NAK because it can lead to deadlock in the
memory management.

You can't just busy wait with all those locks held.

Regards,
Christian.

Am 23.04.19 um 03:45 schrieb Liang, Prike:
> Acked-by: Prike Liang <Prike.Liang@amd.com>
>
> Thanks,
> Prike
> -----Original Message-----
> From: Chunming Zhou <david1.zhou@amd.com>
> Sent: Monday, April 22, 2019 6:39 PM
> To: dri-devel@lists.freedesktop.org
> Cc: Liang, Prike <Prike.Liang@amd.com>; Zhou, David(ChunMing) <David1.Zhou@amd.com>
> Subject: [PATCH] ttm: wait mem space if user allow while gpu busy
>
> heavy gpu job could occupy memory long time, which could lead to other user fail to get memory.
>
> Change-Id: I0b322d98cd76e5ac32b00462bbae8008d76c5e11
> Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 7c484729f9b2..6c596cc24bec 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -830,8 +830,10 @@ static int ttm_bo_mem_force_space(struct ttm_buffer_object *bo,
>                if (mem->mm_node)
>                        break;
>                ret = ttm_mem_evict_first(bdev, mem_type, place, ctx);
> -             if (unlikely(ret != 0))
> -                     return ret;
> +             if (unlikely(ret != 0)) {
> +                     if (!ctx || ctx->no_wait_gpu || ret != -EBUSY)
> +                             return ret;
> +             }
>        } while (1);
>        mem->mem_type = mem_type;
>        return ttm_bo_add_move_fence(bo, man, mem);
> --
> 2.17.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


[-- Attachment #1.2: Type: text/html, Size: 4194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-04-23 13:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-22 10:38 [PATCH] ttm: wait mem space if user allow while gpu busy Chunming Zhou
2019-04-23  1:45 ` Liang, Prike
2019-04-23 13:05   ` Christian König
2019-04-23 13:19     ` Zhou, David(ChunMing) [this message]
2019-04-23 14:42       ` Christian König
2019-04-23 15:09         ` Zhou, David(ChunMing)
2019-04-24  7:12           ` [PATCH] " Christian König
2019-04-24  7:17             ` zhoucm1
2019-04-24  7:30               ` Christian König
2019-04-24  7:59                 ` zhoucm1
2019-04-24  8:07                   ` Christian König
2019-04-24  8:11                     ` zhoucm1
2019-04-24  8:59                       ` Koenig, Christian
2019-04-24  9:03                         ` zhoucm1
2019-04-24 10:03                           ` Christian König
2019-04-24  8:01         ` Daniel Vetter
2019-04-24  8:06           ` Koenig, Christian

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=ven3p5-dcjsua-aovhkzqonovm1ermvl-iasad2-grfh83xntt6k-qnptbs-6ko55nfhu2ac-rew2lw-zbd8fsix6bv3-dlzat2-8w1c4brcif8r7131wn-p5wdqd-fvtllbv000vq-jszyw5-f3mv7ivocjk.1556025578377@email.android.com \
    --to=david1.zhou@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=Prike.Liang@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.