All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström (VMware)" <thomas_os@shipmail.org>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
	kraxel@redhat.com, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/ttm: fix busy reference in ttm_mem_evict_first
Date: Wed, 25 Sep 2019 13:55:47 +0200	[thread overview]
Message-ID: <744cbbcd-f0e8-e6ba-b744-856f3b9b0d86@shipmail.org> (raw)
In-Reply-To: <20190925105530.2261-1-christian.koenig@amd.com>

On 9/25/19 12:55 PM, Christian König wrote:
> The busy BO might actually be already deleted,
> so grab only a list reference.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 881cf26d698e..02f301e1ff29 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -875,11 +875,11 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
>   
>   	if (!bo) {
>   		if (busy_bo)
> -			ttm_bo_get(busy_bo);
> +			kref_get(&busy_bo->list_kref);
>   		spin_unlock(&glob->lru_lock);
>   		ret = ttm_mem_evict_wait_busy(busy_bo, ctx, ticket);
>   		if (busy_bo)
> -			ttm_bo_put(busy_bo);
> +			kref_put(&busy_bo->list_kref, ttm_bo_release_list);
>   		return ret;
>   	}
>   

lgtm.

Reviewed-by: Thomas Hellström <thellstrom@vmware.com>


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

      parent reply	other threads:[~2019-09-25 11:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 10:55 [PATCH 1/3] drm/ttm: fix busy reference in ttm_mem_evict_first Christian König
2019-09-25 10:55 ` [PATCH 2/3] drm/ttm: always keep BOs on the LRU Christian König
2019-09-25 12:06   ` Thomas Hellström (VMware)
2019-09-25 12:10     ` Christian König
2019-10-16  9:30       ` Christian König
2019-10-18 13:49         ` Thomas Hellström (VMware)
2019-10-21 12:27           ` Thomas Hellström (VMware)
2019-09-25 10:55 ` [PATCH 3/3] drm/ttm: remove pointers to globals Christian König
2019-09-25 11:56   ` Thomas Hellström (VMware)
2019-09-25 11:55 ` Thomas Hellström (VMware) [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=744cbbcd-f0e8-e6ba-b744-856f3b9b0d86@shipmail.org \
    --to=thomas_os@shipmail.org \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.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 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.