All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thomas@shipmail.org>
To: Ben Skeggs <skeggsb@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/ttm: ensure ttm_mem_io_free is called on bo	destruction
Date: Thu, 04 Nov 2010 12:24:29 +0100	[thread overview]
Message-ID: <4CD297ED.8050907@shipmail.org> (raw)
In-Reply-To: <1288829027-23239-1-git-send-email-skeggsb@gmail.com>

On 11/04/2010 01:03 AM, Ben Skeggs wrote:
> From: Ben Skeggs<bskeggs@redhat.com>
>
> Nouveau will start to use ttm_mem_io_reserve to allocate BAR VM space
> for VRAM mappings, and without this call GPU address space gets leaked.
>
> Signed-off-by: Ben Skeggs<bskeggs@redhat.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index dfa163b..c373cf9 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -472,6 +472,7 @@ static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo)
>   	wake_up_all(&bo->event_queue);
>   	spin_unlock(&glob->lru_lock);
>
> +	ttm_mem_io_free(bo->bdev,&tmp_mem);
>   	ttm_bo_mem_put(bo,&tmp_mem);
>   }
>
>    
Ideally this should be done after the last VMA is closed, but since we 
don't count VMAs currently. This place is just as good.

However, the mem members are strictly protected by bo::reserve, so we 
should place this before we unreserve in the same function, Please use 
drm-next where ttm_bo_mem_put() is placed just before the unreserve as well.


/Thomas

      parent reply	other threads:[~2010-11-04 11:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04  0:03 [PATCH 1/2] drm/ttm: ensure ttm_mem_io_free is called on bo destruction Ben Skeggs
2010-11-04  0:03 ` [PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed Ben Skeggs
2010-11-04 13:08   ` Thomas Hellstrom
2010-11-04 18:34     ` Thomas Hellstrom
2010-11-09  3:03       ` Ben Skeggs
2010-11-09  7:18         ` Thomas Hellstrom
2010-11-09 14:33           ` Jerome Glisse
2010-11-04 11:24 ` Thomas Hellstrom [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=4CD297ED.8050907@shipmail.org \
    --to=thomas@shipmail.org \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=skeggsb@gmail.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.