All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drm/ttm: Account for kernel allocations in kernel zone only
@ 2019-02-22 23:19 Kuehling, Felix
       [not found] ` <1550877522-15317-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Kuehling, Felix @ 2019-02-22 23:19 UTC (permalink / raw)
  To: dri-devel, amd-gfx; +Cc: Kuehling, Felix, thellstrom, Koenig, Christian

Don't account for them in other zones such as dma32. The kernel page
allocator has its own heuristics to avoid exhausting special zones
for regular kernel allocations.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
CC: thellstrom@vmware.com
CC: christian.koenig@amd.com
---
 drivers/gpu/drm/ttm/ttm_memory.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c
index f1567c3..90d1e24 100644
--- a/drivers/gpu/drm/ttm/ttm_memory.c
+++ b/drivers/gpu/drm/ttm/ttm_memory.c
@@ -522,7 +522,7 @@ static void ttm_mem_global_free_zone(struct ttm_mem_global *glob,
 void ttm_mem_global_free(struct ttm_mem_global *glob,
 			 uint64_t amount)
 {
-	return ttm_mem_global_free_zone(glob, NULL, amount);
+	return ttm_mem_global_free_zone(glob, glob->zone_kernel, amount);
 }
 EXPORT_SYMBOL(ttm_mem_global_free);
 
@@ -621,10 +621,10 @@ int ttm_mem_global_alloc(struct ttm_mem_global *glob, uint64_t memory,
 {
 	/**
 	 * Normal allocations of kernel memory are registered in
-	 * all zones.
+	 * the kernel zone.
 	 */
 
-	return ttm_mem_global_alloc_zone(glob, NULL, memory, ctx);
+	return ttm_mem_global_alloc_zone(glob, glob->zone_kernel, memory, ctx);
 }
 EXPORT_SYMBOL(ttm_mem_global_alloc);
 
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] drm/ttm: Account for kernel allocations in kernel zone only
       [not found] ` <1550877522-15317-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
@ 2019-02-25 14:20   ` Koenig, Christian
       [not found]     ` <a0f6aa85-ab0e-e809-5e05-98056b9c7185-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Koenig, Christian @ 2019-02-25 14:20 UTC (permalink / raw)
  To: Kuehling, Felix, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: thellstrom-pghWNbHTmq7QT0dZR+AlfA

Am 23.02.19 um 00:19 schrieb Kuehling, Felix:
> Don't account for them in other zones such as dma32. The kernel page
> allocator has its own heuristics to avoid exhausting special zones
> for regular kernel allocations.
>
> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
> CC: thellstrom@vmware.com
> CC: christian.koenig@amd.com

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

> ---
>   drivers/gpu/drm/ttm/ttm_memory.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c
> index f1567c3..90d1e24 100644
> --- a/drivers/gpu/drm/ttm/ttm_memory.c
> +++ b/drivers/gpu/drm/ttm/ttm_memory.c
> @@ -522,7 +522,7 @@ static void ttm_mem_global_free_zone(struct ttm_mem_global *glob,
>   void ttm_mem_global_free(struct ttm_mem_global *glob,
>   			 uint64_t amount)
>   {
> -	return ttm_mem_global_free_zone(glob, NULL, amount);
> +	return ttm_mem_global_free_zone(glob, glob->zone_kernel, amount);
>   }
>   EXPORT_SYMBOL(ttm_mem_global_free);
>   
> @@ -621,10 +621,10 @@ int ttm_mem_global_alloc(struct ttm_mem_global *glob, uint64_t memory,
>   {
>   	/**
>   	 * Normal allocations of kernel memory are registered in
> -	 * all zones.
> +	 * the kernel zone.
>   	 */
>   
> -	return ttm_mem_global_alloc_zone(glob, NULL, memory, ctx);
> +	return ttm_mem_global_alloc_zone(glob, glob->zone_kernel, memory, ctx);
>   }
>   EXPORT_SYMBOL(ttm_mem_global_alloc);
>   

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] drm/ttm: Account for kernel allocations in kernel zone only
       [not found]     ` <a0f6aa85-ab0e-e809-5e05-98056b9c7185-5C7GfCeVMHo@public.gmane.org>
@ 2019-02-25 19:58       ` Thomas Hellstrom
       [not found]         ` <a2fcbc0155a7f1eea9a6df9669dc2de75315e937.camel-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Hellstrom @ 2019-02-25 19:58 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Felix.Kuehling-5C7GfCeVMHo, Christian.Koenig-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, 2019-02-25 at 14:20 +0000, Koenig, Christian wrote:
> Am 23.02.19 um 00:19 schrieb Kuehling, Felix:
> > Don't account for them in other zones such as dma32. The kernel
> > page
> > allocator has its own heuristics to avoid exhausting special zones
> > for regular kernel allocations.
> > 
> > Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
> > CC: thellstrom@vmware.com
> > CC: christian.koenig@amd.com
> 
> Reviewed-by: Christian König <christian.koenig@amd.com>

Hmm,

So actually with this patch we theoretically still can exhaust the
DMA32 zone by first performing kernel allocations that DO spare a
number of DMA32 pages  according to the kernel allocator heuristics,
and then populate TTM buffers with DMA32 pages only.

However, since vmwgfx bo's don't request DMA32 pages, we're OK with
this, and it's really up to Christian to decide. So:

Acked-by: Thomas Hellstrom <thellstrom@vmware.com>

Thanks,
Thomas








> 
> > ---
> >   drivers/gpu/drm/ttm/ttm_memory.c | 6 +++---
> >   1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/ttm/ttm_memory.c
> > b/drivers/gpu/drm/ttm/ttm_memory.c
> > index f1567c3..90d1e24 100644
> > --- a/drivers/gpu/drm/ttm/ttm_memory.c
> > +++ b/drivers/gpu/drm/ttm/ttm_memory.c
> > @@ -522,7 +522,7 @@ static void ttm_mem_global_free_zone(struct
> > ttm_mem_global *glob,
> >   void ttm_mem_global_free(struct ttm_mem_global *glob,
> >   			 uint64_t amount)
> >   {
> > -	return ttm_mem_global_free_zone(glob, NULL, amount);
> > +	return ttm_mem_global_free_zone(glob, glob->zone_kernel,
> > amount);
> >   }
> >   EXPORT_SYMBOL(ttm_mem_global_free);
> >   
> > @@ -621,10 +621,10 @@ int ttm_mem_global_alloc(struct
> > ttm_mem_global *glob, uint64_t memory,
> >   {
> >   	/**
> >   	 * Normal allocations of kernel memory are registered in
> > -	 * all zones.
> > +	 * the kernel zone.
> >   	 */
> >   
> > -	return ttm_mem_global_alloc_zone(glob, NULL, memory, ctx);
> > +	return ttm_mem_global_alloc_zone(glob, glob->zone_kernel,
> > memory, ctx);
> >   }
> >   EXPORT_SYMBOL(ttm_mem_global_alloc);
> >   
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] drm/ttm: Account for kernel allocations in kernel zone only
       [not found]         ` <a2fcbc0155a7f1eea9a6df9669dc2de75315e937.camel-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
@ 2019-02-26  4:25           ` Kuehling, Felix
  2019-02-26  5:37             ` Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: Kuehling, Felix @ 2019-02-26  4:25 UTC (permalink / raw)
  To: Thomas Hellstrom, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Koenig, Christian, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2/25/2019 2:58 PM, Thomas Hellstrom wrote:
> On Mon, 2019-02-25 at 14:20 +0000, Koenig, Christian wrote:
>> Am 23.02.19 um 00:19 schrieb Kuehling, Felix:
>>> Don't account for them in other zones such as dma32. The kernel
>>> page
>>> allocator has its own heuristics to avoid exhausting special zones
>>> for regular kernel allocations.
>>>
>>> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
>>> CC: thellstrom@vmware.com
>>> CC: christian.koenig@amd.com
>> Reviewed-by: Christian König <christian.koenig@amd.com>
> Hmm,
>
> So actually with this patch we theoretically still can exhaust the
> DMA32 zone by first performing kernel allocations that DO spare a
> number of DMA32 pages  according to the kernel allocator heuristics,
> and then populate TTM buffers with DMA32 pages only.
>
> However, since vmwgfx bo's don't request DMA32 pages, we're OK with
> this, and it's really up to Christian to decide. So:
>
> Acked-by: Thomas Hellstrom <thellstrom@vmware.com>

Thanks. What's the best branch to submit this to? My patches were based 
on amd-staging-drm-next.

Regards,
   Felix

>
> Thanks,
> Thomas
>
>
>
>
>
>
>
>
>>> ---
>>>    drivers/gpu/drm/ttm/ttm_memory.c | 6 +++---
>>>    1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/ttm/ttm_memory.c
>>> b/drivers/gpu/drm/ttm/ttm_memory.c
>>> index f1567c3..90d1e24 100644
>>> --- a/drivers/gpu/drm/ttm/ttm_memory.c
>>> +++ b/drivers/gpu/drm/ttm/ttm_memory.c
>>> @@ -522,7 +522,7 @@ static void ttm_mem_global_free_zone(struct
>>> ttm_mem_global *glob,
>>>    void ttm_mem_global_free(struct ttm_mem_global *glob,
>>>    			 uint64_t amount)
>>>    {
>>> -	return ttm_mem_global_free_zone(glob, NULL, amount);
>>> +	return ttm_mem_global_free_zone(glob, glob->zone_kernel,
>>> amount);
>>>    }
>>>    EXPORT_SYMBOL(ttm_mem_global_free);
>>>    
>>> @@ -621,10 +621,10 @@ int ttm_mem_global_alloc(struct
>>> ttm_mem_global *glob, uint64_t memory,
>>>    {
>>>    	/**
>>>    	 * Normal allocations of kernel memory are registered in
>>> -	 * all zones.
>>> +	 * the kernel zone.
>>>    	 */
>>>    
>>> -	return ttm_mem_global_alloc_zone(glob, NULL, memory, ctx);
>>> +	return ttm_mem_global_alloc_zone(glob, glob->zone_kernel,
>>> memory, ctx);
>>>    }
>>>    EXPORT_SYMBOL(ttm_mem_global_alloc);
>>>    
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] drm/ttm: Account for kernel allocations in kernel zone only
  2019-02-26  4:25           ` Kuehling, Felix
@ 2019-02-26  5:37             ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2019-02-26  5:37 UTC (permalink / raw)
  To: Kuehling, Felix; +Cc: Thomas Hellstrom, amd-gfx, Koenig, Christian, dri-devel

On Mon, Feb 25, 2019 at 11:25 PM Kuehling, Felix <Felix.Kuehling@amd.com> wrote:
>
> On 2/25/2019 2:58 PM, Thomas Hellstrom wrote:
> > On Mon, 2019-02-25 at 14:20 +0000, Koenig, Christian wrote:
> >> Am 23.02.19 um 00:19 schrieb Kuehling, Felix:
> >>> Don't account for them in other zones such as dma32. The kernel
> >>> page
> >>> allocator has its own heuristics to avoid exhausting special zones
> >>> for regular kernel allocations.
> >>>
> >>> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
> >>> CC: thellstrom@vmware.com
> >>> CC: christian.koenig@amd.com
> >> Reviewed-by: Christian König <christian.koenig@amd.com>
> > Hmm,
> >
> > So actually with this patch we theoretically still can exhaust the
> > DMA32 zone by first performing kernel allocations that DO spare a
> > number of DMA32 pages  according to the kernel allocator heuristics,
> > and then populate TTM buffers with DMA32 pages only.
> >
> > However, since vmwgfx bo's don't request DMA32 pages, we're OK with
> > this, and it's really up to Christian to decide. So:
> >
> > Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
>
> Thanks. What's the best branch to submit this to? My patches were based
> on amd-staging-drm-next.

amd-staging-drm-next is fine.  It will flow into drm-next naturally from there.

Alex

>
> Regards,
>    Felix
>
> >
> > Thanks,
> > Thomas
> >
> >
> >
> >
> >
> >
> >
> >
> >>> ---
> >>>    drivers/gpu/drm/ttm/ttm_memory.c | 6 +++---
> >>>    1 file changed, 3 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/drivers/gpu/drm/ttm/ttm_memory.c
> >>> b/drivers/gpu/drm/ttm/ttm_memory.c
> >>> index f1567c3..90d1e24 100644
> >>> --- a/drivers/gpu/drm/ttm/ttm_memory.c
> >>> +++ b/drivers/gpu/drm/ttm/ttm_memory.c
> >>> @@ -522,7 +522,7 @@ static void ttm_mem_global_free_zone(struct
> >>> ttm_mem_global *glob,
> >>>    void ttm_mem_global_free(struct ttm_mem_global *glob,
> >>>                      uint64_t amount)
> >>>    {
> >>> -   return ttm_mem_global_free_zone(glob, NULL, amount);
> >>> +   return ttm_mem_global_free_zone(glob, glob->zone_kernel,
> >>> amount);
> >>>    }
> >>>    EXPORT_SYMBOL(ttm_mem_global_free);
> >>>
> >>> @@ -621,10 +621,10 @@ int ttm_mem_global_alloc(struct
> >>> ttm_mem_global *glob, uint64_t memory,
> >>>    {
> >>>     /**
> >>>      * Normal allocations of kernel memory are registered in
> >>> -    * all zones.
> >>> +    * the kernel zone.
> >>>      */
> >>>
> >>> -   return ttm_mem_global_alloc_zone(glob, NULL, memory, ctx);
> >>> +   return ttm_mem_global_alloc_zone(glob, glob->zone_kernel,
> >>> memory, ctx);
> >>>    }
> >>>    EXPORT_SYMBOL(ttm_mem_global_alloc);
> >>>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-26  5:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22 23:19 [PATCH 1/1] drm/ttm: Account for kernel allocations in kernel zone only Kuehling, Felix
     [not found] ` <1550877522-15317-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2019-02-25 14:20   ` Koenig, Christian
     [not found]     ` <a0f6aa85-ab0e-e809-5e05-98056b9c7185-5C7GfCeVMHo@public.gmane.org>
2019-02-25 19:58       ` Thomas Hellstrom
     [not found]         ` <a2fcbc0155a7f1eea9a6df9669dc2de75315e937.camel-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2019-02-26  4:25           ` Kuehling, Felix
2019-02-26  5:37             ` Alex Deucher

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.