Message ID | 1550877522-15317-1-git-send-email-Felix.Kuehling@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/1] drm/ttm: Account for kernel allocations in kernel zone only | expand |
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); >
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); > >
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); >>>
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
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);
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(-)