All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Felix Kuehling <Felix.Kuehling@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: christian.koenig@amd.com
Subject: Re: [PATCH 8/9] drm/ttm: Don't count pages in SG BOs against pages_limit
Date: Wed, 14 Apr 2021 08:51:51 +0200	[thread overview]
Message-ID: <60d08770-e4f5-4e8f-0a93-2270ae02aa26@gmail.com> (raw)
In-Reply-To: <20210414064804.29356-9-Felix.Kuehling@amd.com>

Am 14.04.21 um 08:48 schrieb Felix Kuehling:
> Pages in SG BOs were not allocated by TTM. So don't count them against
> TTM's pages limit.
>
> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

Going to pick that one up for inclusion in drm-misc-next.

Regards,
Christian.

> ---
>   drivers/gpu/drm/ttm/ttm_tt.c | 27 ++++++++++++++++++---------
>   1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
> index 5d8820725b75..e8b8c3257392 100644
> --- a/drivers/gpu/drm/ttm/ttm_tt.c
> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
> @@ -317,9 +317,12 @@ int ttm_tt_populate(struct ttm_device *bdev,
>   	if (ttm_tt_is_populated(ttm))
>   		return 0;
>   
> -	atomic_long_add(ttm->num_pages, &ttm_pages_allocated);
> -	if (bdev->pool.use_dma32)
> -		atomic_long_add(ttm->num_pages, &ttm_dma32_pages_allocated);
> +	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
> +		atomic_long_add(ttm->num_pages, &ttm_pages_allocated);
> +		if (bdev->pool.use_dma32)
> +			atomic_long_add(ttm->num_pages,
> +					&ttm_dma32_pages_allocated);
> +	}
>   
>   	while (atomic_long_read(&ttm_pages_allocated) > ttm_pages_limit ||
>   	       atomic_long_read(&ttm_dma32_pages_allocated) >
> @@ -350,9 +353,12 @@ int ttm_tt_populate(struct ttm_device *bdev,
>   	return 0;
>   
>   error:
> -	atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
> -	if (bdev->pool.use_dma32)
> -		atomic_long_sub(ttm->num_pages, &ttm_dma32_pages_allocated);
> +	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
> +		atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
> +		if (bdev->pool.use_dma32)
> +			atomic_long_sub(ttm->num_pages,
> +					&ttm_dma32_pages_allocated);
> +	}
>   	return ret;
>   }
>   EXPORT_SYMBOL(ttm_tt_populate);
> @@ -382,9 +388,12 @@ void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)
>   	else
>   		ttm_pool_free(&bdev->pool, ttm);
>   
> -	atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
> -	if (bdev->pool.use_dma32)
> -		atomic_long_sub(ttm->num_pages, &ttm_dma32_pages_allocated);
> +	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
> +		atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
> +		if (bdev->pool.use_dma32)
> +			atomic_long_sub(ttm->num_pages,
> +					&ttm_dma32_pages_allocated);
> +	}
>   
>   	ttm->page_flags &= ~TTM_PAGE_FLAG_PRIV_POPULATED;
>   }

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

WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Felix Kuehling <Felix.Kuehling@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: christian.koenig@amd.com
Subject: Re: [PATCH 8/9] drm/ttm: Don't count pages in SG BOs against pages_limit
Date: Wed, 14 Apr 2021 08:51:51 +0200	[thread overview]
Message-ID: <60d08770-e4f5-4e8f-0a93-2270ae02aa26@gmail.com> (raw)
In-Reply-To: <20210414064804.29356-9-Felix.Kuehling@amd.com>

Am 14.04.21 um 08:48 schrieb Felix Kuehling:
> Pages in SG BOs were not allocated by TTM. So don't count them against
> TTM's pages limit.
>
> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

Going to pick that one up for inclusion in drm-misc-next.

Regards,
Christian.

> ---
>   drivers/gpu/drm/ttm/ttm_tt.c | 27 ++++++++++++++++++---------
>   1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
> index 5d8820725b75..e8b8c3257392 100644
> --- a/drivers/gpu/drm/ttm/ttm_tt.c
> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
> @@ -317,9 +317,12 @@ int ttm_tt_populate(struct ttm_device *bdev,
>   	if (ttm_tt_is_populated(ttm))
>   		return 0;
>   
> -	atomic_long_add(ttm->num_pages, &ttm_pages_allocated);
> -	if (bdev->pool.use_dma32)
> -		atomic_long_add(ttm->num_pages, &ttm_dma32_pages_allocated);
> +	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
> +		atomic_long_add(ttm->num_pages, &ttm_pages_allocated);
> +		if (bdev->pool.use_dma32)
> +			atomic_long_add(ttm->num_pages,
> +					&ttm_dma32_pages_allocated);
> +	}
>   
>   	while (atomic_long_read(&ttm_pages_allocated) > ttm_pages_limit ||
>   	       atomic_long_read(&ttm_dma32_pages_allocated) >
> @@ -350,9 +353,12 @@ int ttm_tt_populate(struct ttm_device *bdev,
>   	return 0;
>   
>   error:
> -	atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
> -	if (bdev->pool.use_dma32)
> -		atomic_long_sub(ttm->num_pages, &ttm_dma32_pages_allocated);
> +	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
> +		atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
> +		if (bdev->pool.use_dma32)
> +			atomic_long_sub(ttm->num_pages,
> +					&ttm_dma32_pages_allocated);
> +	}
>   	return ret;
>   }
>   EXPORT_SYMBOL(ttm_tt_populate);
> @@ -382,9 +388,12 @@ void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)
>   	else
>   		ttm_pool_free(&bdev->pool, ttm);
>   
> -	atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
> -	if (bdev->pool.use_dma32)
> -		atomic_long_sub(ttm->num_pages, &ttm_dma32_pages_allocated);
> +	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
> +		atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
> +		if (bdev->pool.use_dma32)
> +			atomic_long_sub(ttm->num_pages,
> +					&ttm_dma32_pages_allocated);
> +	}
>   
>   	ttm->page_flags &= ~TTM_PAGE_FLAG_PRIV_POPULATED;
>   }

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2021-04-14  6:51 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  6:47 [PATCH 0/9] Implement multi-GPU DMA mappings for KFD Felix Kuehling
2021-04-14  6:47 ` Felix Kuehling
2021-04-14  6:47 ` [PATCH 1/9] drm/amdgpu: Rename kfd_bo_va_list to kfd_mem_attachment Felix Kuehling
2021-04-14  6:47   ` Felix Kuehling
2021-04-14  6:47 ` [PATCH 2/9] drm/amdgpu: Keep a bo-reference per-attachment Felix Kuehling
2021-04-14  6:47   ` Felix Kuehling
2021-04-14  6:47 ` [PATCH 3/9] drm/amdgpu: Simplify AQL queue mapping Felix Kuehling
2021-04-14  6:47   ` Felix Kuehling
2021-04-14  6:47 ` [PATCH 4/9] drm/amdgpu: Add multi-GPU DMA mapping helpers Felix Kuehling
2021-04-14  6:47   ` Felix Kuehling
2021-04-14  6:48 ` [PATCH 5/9] drm/amdgpu: DMA map/unmap when updating GPU mappings Felix Kuehling
2021-04-14  6:48   ` Felix Kuehling
2021-04-14  6:48 ` [PATCH 6/9] drm/amdgpu: Move kfd_mem_attach outside reservation Felix Kuehling
2021-04-14  6:48   ` Felix Kuehling
2021-04-14  6:48 ` [PATCH 7/9] drm/amdgpu: Add DMA mapping of GTT BOs Felix Kuehling
2021-04-14  6:48   ` Felix Kuehling
2021-04-14  6:48 ` [PATCH 8/9] drm/ttm: Don't count pages in SG BOs against pages_limit Felix Kuehling
2021-04-14  6:48   ` Felix Kuehling
2021-04-14  6:51   ` Christian König [this message]
2021-04-14  6:51     ` Christian König
2021-04-14  9:15     ` Daniel Vetter
2021-04-14  9:15       ` Daniel Vetter
2021-04-14  9:19       ` Christian König
2021-04-14  9:19         ` Christian König
2021-04-14 10:26         ` Daniel Vetter
2021-04-14 10:26           ` Daniel Vetter
2021-04-14 10:49           ` Christian König
2021-04-14 10:49             ` Christian König
2021-04-14 12:25             ` Daniel Vetter
2021-04-14 12:25               ` Daniel Vetter
2021-04-14 12:43               ` Christian König
2021-04-14 12:43                 ` Christian König
2021-04-14 12:47                 ` Daniel Vetter
2021-04-14 12:47                   ` Daniel Vetter
2021-04-14 12:49                   ` Christian König
2021-04-14 12:49                     ` Christian König
2021-04-14 14:41               ` Felix Kuehling
2021-04-14 14:41                 ` Felix Kuehling
2021-04-14  6:48 ` [PATCH 9/9] drm/amdgpu: Lock the attached dmabuf in unpopulate Felix Kuehling
2021-04-14  6:48   ` Felix Kuehling
  -- strict thread matches above, loose matches on Subject: below --
2021-04-14  6:46 [PATCH 0/9] Implement multi-GPU DMA mappings for KFD Felix Kuehling
2021-04-14  6:46 ` [PATCH 8/9] drm/ttm: Don't count pages in SG BOs against pages_limit Felix Kuehling
2021-04-14  9:13   ` Daniel Vetter

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=60d08770-e4f5-4e8f-0a93-2270ae02aa26@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@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.