All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
To: christian.koenig-5C7GfCeVMHo@public.gmane.org, "Zeng,
	Oak" <Oak.Zeng-5C7GfCeVMHo@public.gmane.org>,
	"Kuehling, Felix" <Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>,
	"dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH] drm/ttm: fix ttm_bo_unreserve
Date: Wed, 5 Jun 2019 15:56:28 +0200	[thread overview]
Message-ID: <1a0e5fdc-5b9d-844c-10cb-2cc880863142@daenzer.net> (raw)
In-Reply-To: <5a0f4e09-2614-5bbc-b8a2-53746bbb0b15-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On 2019-06-05 1:24 p.m., Christian König wrote:
> Am 04.06.19 um 21:03 schrieb Zeng, Oak:
>> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
>> Kuehling, Felix
>> On 2019-06-04 11:23, Christian König wrote:
>>
>>> Since we now keep BOs on the LRU we need to make sure that they are
>>> removed when they are pinned.
>>>
>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>> ---
>>>    include/drm/ttm/ttm_bo_driver.h | 14 ++++++--------
>>>    1 file changed, 6 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/include/drm/ttm/ttm_bo_driver.h
>>> b/include/drm/ttm/ttm_bo_driver.h index 9f54cf9c60df..c9b8ba492f24
>>> 100644
>>> --- a/include/drm/ttm/ttm_bo_driver.h
>>> +++ b/include/drm/ttm/ttm_bo_driver.h
>>> @@ -767,14 +767,12 @@ static inline int
>>> ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo,
>>>     */
>>>    static inline void ttm_bo_unreserve(struct ttm_buffer_object *bo)
>>>    {
>>> -    if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
>>> -        spin_lock(&bo->bdev->glob->lru_lock);
>>> -        if (list_empty(&bo->lru))
>>> -            ttm_bo_add_to_lru(bo);
>>> -        else
>>> -            ttm_bo_move_to_lru_tail(bo, NULL);
>>> -        spin_unlock(&bo->bdev->glob->lru_lock);
>>> -    }
>>> +    spin_lock(&bo->bdev->glob->lru_lock);
>>> +    if (list_empty(&bo->lru))
>>> +        ttm_bo_add_to_lru(bo);
>>> +    else
>>> +        ttm_bo_move_to_lru_tail(bo, NULL);
>> Going just by the function names, this seems to do the exact opposite
>> of what the change description says.
>>
>> [Oak] +1, when I read the description, I also get lost...So please do
>> add a more accurate description.
> 
> I'm puzzled why you are confused. We now keep the BOs on the LRU while
> they are reserved, so on unreserve we now need to explicitly remove them
> from the LRU when they are pinned.

I don't know about Felix and Oak, but for me "remove from the LRU" is
confusing, as I don't see that in the code, only adding to the LRU or
moving to its tail.


-- 
Earthling Michel Dänzer               |              https://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2019-06-05 13:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04 15:23 [PATCH] drm/ttm: fix ttm_bo_unreserve Christian König
     [not found] ` <20190604152306.1804-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-06-04 18:46   ` Kuehling, Felix
2019-06-04 19:03     ` Zeng, Oak
     [not found]       ` <BL0PR12MB2580B3E88C17043DE402CF3280150-b4cIHhjg/p/XzH18dTCKOgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-06-05 11:24         ` Christian König
     [not found]           ` <5a0f4e09-2614-5bbc-b8a2-53746bbb0b15-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-05 13:56             ` Michel Dänzer [this message]
2019-06-05 14:33               ` Kuehling, Felix
2019-06-05 17:59                 ` Koenig, Christian
2019-06-05 14:39           ` Zeng, Oak

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=1a0e5fdc-5b9d-844c-10cb-2cc880863142@daenzer.net \
    --to=michel-otuistvhuppr7s880joybq@public.gmane.org \
    --cc=Felix.Kuehling-5C7GfCeVMHo@public.gmane.org \
    --cc=Oak.Zeng-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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.