AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: Thomas Hellstrom <thomas@shipmail.org>,
	"Zhou, David(ChunMing)" <David1.Zhou@amd.com>,
	"Liang, Prike" <Prike.Liang@amd.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm/ttm: fix busy memory to fail other user v6
Date: Wed, 8 May 2019 09:03:34 +0000	[thread overview]
Message-ID: <c100cb61-311f-aa07-7b6b-335b9049b0fc@amd.com> (raw)
In-Reply-To: <27bbe674-1095-1015-e4f3-1c336f71879f@shipmail.org>

Am 08.05.19 um 10:34 schrieb Thomas Hellstrom:
> [SNIP]
>>>> No, what I mean is to add the acquire_ctx as separate parameter to
>>>> ttm_mem_evict_first().
>>>>
>>>> E.g. we only need it in this function and it is actually not related
>>>> to the ttm operation context filled in by the driver.
>>>
>>> FWIW, I think it would be nice at some point to have a reservation
>>> context being part of the ttm operation context, so that validate and
>>> evict could do sleeping reservations, and have bos remain on the lru
>>> even when reserved...
>> Yeah, well that's exactly what the ctx->resv parameter is good for :)
>
> Hmm. I don't quite follow? It looks to me like ctx->resv is there to
> work around recursive reservations?

Well yes and no, this is to allow eviction of BOs which share the same 
reservation object.

>
>
> What I'm after is being able to do sleeping reservations within validate
> and evict and open up for returning -EDEADLK. One benefit would be to
> scan over the LRU lists, reserving exactly those bos we want to evict,
> and when all are reserved, we evict them. If we hit an -EDEADLK while
> evicting we need to restart. Then we need an acquire_ctx in the
> ttm_operation_ctx.

The acquire_ctx is available from the BO you try to find space for.

But we already tried this approach and it doesn't work. We have a lot of 
BOs which now share the same reservation object and so would cause an 
-EDEADLK.

>> And yes, we do keep the BOs on the LRU even when they are reserved.
>
> static inline int ttm_bo_reserve(struct ttm_buffer_object *bo,
>                  bool interruptible, bool no_wait,
>                  struct ww_acquire_ctx *ticket)

ttm_bo_reserve() is not always used any more outside of TTM. The for 
DMA-buf as well as amdgpu VMs code the reservation object is locked 
without calling ttm_bo_reserve now.

Regards,
Christian.

>
> /Thomas

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

      reply	other threads:[~2019-05-08  9:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  9:36 [PATCH 1/2] drm/ttm: fix busy memory to fail other user v6 Chunming Zhou
     [not found] ` <20190507093642.7859-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2019-05-07  9:36   ` [PATCH 2/2] drm/amd/display: use ttm_eu_reserve_buffers instead of amdgpu_bo_reserve Chunming Zhou
     [not found]     ` <20190507093642.7859-2-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2019-05-07 10:46       ` Koenig, Christian
2019-05-07 10:53 ` [PATCH 1/2] drm/ttm: fix busy memory to fail other user v6 Koenig, Christian
     [not found]   ` <f4b1ddf2-b80b-260e-54c9-b0e62ecbe90b-5C7GfCeVMHo@public.gmane.org>
2019-05-07 11:08     ` zhoucm1
2019-05-07 11:13       ` Koenig, Christian
2019-05-07 11:22         ` zhoucm1
2019-05-07 11:24           ` Christian König
     [not found]             ` <968487eb-f78e-9922-a073-8ed08111e307-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-05-07 11:37               ` Thomas Hellstrom
     [not found]                 ` <93fbb994-d305-dfc4-f8e5-502647d7386f-4+hqylr40dJg9hUCZPvPmw@public.gmane.org>
2019-05-07 11:42                   ` Koenig, Christian
     [not found]                     ` <fe4a6a5e-b075-b1cc-a24c-af6c3126145b-5C7GfCeVMHo@public.gmane.org>
2019-05-08  8:34                       ` Thomas Hellstrom
2019-05-08  9:03                         ` Koenig, Christian [this message]

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=c100cb61-311f-aa07-7b6b-335b9049b0fc@amd.com \
    --to=christian.koenig@amd.com \
    --cc=David1.Zhou@amd.com \
    --cc=Prike.Liang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=thomas@shipmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox