From: "Christian König" <christian.koenig@amd.com> To: Mike Galbraith <efault@gmx.de>, lkml <linux-kernel@vger.kernel.org> Cc: nouveau@lists.freedesktop.org, Ben Skeggs <bskeggs@redhat.com>, Dave Airlie <airlied@redhat.com> Subject: Re: drm/nouneau: 5.11 cycle regression bisected to 461619f5c324 "drm/nouveau: switch to new allocator" Date: Wed, 10 Feb 2021 14:26:18 +0100 [thread overview] Message-ID: <468ec16b-d716-5bd4-db2b-fb79e6c72a4f@amd.com> (raw) In-Reply-To: <eeea2d002142ec7f8737b9d0fb5128b0cdb2ae58.camel@gmx.de> [-- Attachment #1: Type: text/plain, Size: 667 bytes --] Am 10.02.21 um 13:22 schrieb Mike Galbraith: > On Wed, 2021-02-10 at 12:44 +0100, Christian König wrote: >> Please try to add a "return NULL" at the beginning of ttm_pool_type_take(). >> >> That should effectively disable using the pool. > That did away with the yield looping, but it doesn't take long for the > display to freeze. I ssh'd in from lappy, but there was nada in dmesg. Yeah, that is expected. Without taking pages from the pool we leak memory like sieve. At least we could narrow down the problem quite a bit with that. Can you test the attached patch and see if it helps? Thanks, Christian. > >> Thanks for testing, > Happy to. > > -Mike > [-- Attachment #2: 0001-drm-ttm-make-sure-pool-pages-are-cleared.patch --] [-- Type: text/x-patch, Size: 1365 bytes --] From 1e623dc5c535de2d0af3c5c6107c08ffffa4fe07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com> Date: Wed, 10 Feb 2021 14:24:27 +0100 Subject: [PATCH] drm/ttm: make sure pool pages are cleared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old implementation wasn't consistend on this. Signed-off-by: Christian König <christian.koenig@amd.com> --- drivers/gpu/drm/ttm/ttm_pool.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 74bf1c84b637..6e27cb1bf48b 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -33,6 +33,7 @@ #include <linux/module.h> #include <linux/dma-mapping.h> +#include <linux/highmem.h> #ifdef CONFIG_X86 #include <asm/set_memory.h> @@ -218,6 +219,15 @@ static void ttm_pool_unmap(struct ttm_pool *pool, dma_addr_t dma_addr, /* Give pages into a specific pool_type */ static void ttm_pool_type_give(struct ttm_pool_type *pt, struct page *p) { + unsigned int i, num_pages = 1 << pt->order; + + for (i = 0; i < num_pages; ++i) { + if (PageHighMem(p)) + clear_highpage(p + i); + else + clear_page(page_address(p + i)); + } + spin_lock(&pt->lock); list_add(&p->lru, &pt->pages); spin_unlock(&pt->lock); -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <christian.koenig@amd.com> To: Mike Galbraith <efault@gmx.de>, lkml <linux-kernel@vger.kernel.org> Cc: nouveau@lists.freedesktop.org, Ben Skeggs <bskeggs@redhat.com>, Dave Airlie <airlied@redhat.com> Subject: Re: [Nouveau] drm/nouneau: 5.11 cycle regression bisected to 461619f5c324 "drm/nouveau: switch to new allocator" Date: Wed, 10 Feb 2021 14:26:18 +0100 [thread overview] Message-ID: <468ec16b-d716-5bd4-db2b-fb79e6c72a4f@amd.com> (raw) In-Reply-To: <eeea2d002142ec7f8737b9d0fb5128b0cdb2ae58.camel@gmx.de> [-- Attachment #1: Type: text/plain, Size: 667 bytes --] Am 10.02.21 um 13:22 schrieb Mike Galbraith: > On Wed, 2021-02-10 at 12:44 +0100, Christian König wrote: >> Please try to add a "return NULL" at the beginning of ttm_pool_type_take(). >> >> That should effectively disable using the pool. > That did away with the yield looping, but it doesn't take long for the > display to freeze. I ssh'd in from lappy, but there was nada in dmesg. Yeah, that is expected. Without taking pages from the pool we leak memory like sieve. At least we could narrow down the problem quite a bit with that. Can you test the attached patch and see if it helps? Thanks, Christian. > >> Thanks for testing, > Happy to. > > -Mike > [-- Attachment #2: 0001-drm-ttm-make-sure-pool-pages-are-cleared.patch --] [-- Type: text/x-patch, Size: 1365 bytes --] From 1e623dc5c535de2d0af3c5c6107c08ffffa4fe07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com> Date: Wed, 10 Feb 2021 14:24:27 +0100 Subject: [PATCH] drm/ttm: make sure pool pages are cleared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old implementation wasn't consistend on this. Signed-off-by: Christian König <christian.koenig@amd.com> --- drivers/gpu/drm/ttm/ttm_pool.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 74bf1c84b637..6e27cb1bf48b 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -33,6 +33,7 @@ #include <linux/module.h> #include <linux/dma-mapping.h> +#include <linux/highmem.h> #ifdef CONFIG_X86 #include <asm/set_memory.h> @@ -218,6 +219,15 @@ static void ttm_pool_unmap(struct ttm_pool *pool, dma_addr_t dma_addr, /* Give pages into a specific pool_type */ static void ttm_pool_type_give(struct ttm_pool_type *pt, struct page *p) { + unsigned int i, num_pages = 1 << pt->order; + + for (i = 0; i < num_pages; ++i) { + if (PageHighMem(p)) + clear_highpage(p + i); + else + clear_page(page_address(p + i)); + } + spin_lock(&pt->lock); list_add(&p->lru, &pt->pages); spin_unlock(&pt->lock); -- 2.25.1 [-- Attachment #3: Type: text/plain, Size: 154 bytes --] _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau
next prev parent reply other threads:[~2021-02-10 13:27 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-02-10 10:13 drm/nouneau: 5.11 cycle regression bisected to 461619f5c324 "drm/nouveau: switch to new allocator" Mike Galbraith 2021-02-10 10:13 ` [Nouveau] " Mike Galbraith 2021-02-10 10:34 ` Christian König 2021-02-10 10:34 ` [Nouveau] " Christian König 2021-02-10 10:40 ` Mike Galbraith 2021-02-10 10:40 ` [Nouveau] " Mike Galbraith 2021-02-10 10:42 ` Christian König 2021-02-10 10:42 ` [Nouveau] " Christian König 2021-02-10 11:06 ` Mike Galbraith 2021-02-10 11:06 ` [Nouveau] " Mike Galbraith 2021-02-10 10:46 ` Mike Galbraith 2021-02-10 10:46 ` [Nouveau] " Mike Galbraith 2021-02-10 10:52 ` Christian König 2021-02-10 10:52 ` [Nouveau] " Christian König 2021-02-10 11:22 ` Mike Galbraith 2021-02-10 11:22 ` [Nouveau] " Mike Galbraith 2021-02-10 11:44 ` Christian König 2021-02-10 11:44 ` [Nouveau] " Christian König 2021-02-10 12:22 ` Mike Galbraith 2021-02-10 12:22 ` [Nouveau] " Mike Galbraith 2021-02-10 13:26 ` Christian König [this message] 2021-02-10 13:26 ` Christian König 2021-02-10 15:30 ` Mike Galbraith 2021-02-10 15:30 ` [Nouveau] " Mike Galbraith 2021-02-10 15:34 ` Christian König 2021-02-10 15:34 ` [Nouveau] " Christian König 2021-02-10 15:37 ` Mike Galbraith 2021-02-10 15:37 ` [Nouveau] " Mike Galbraith
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=468ec16b-d716-5bd4-db2b-fb79e6c72a4f@amd.com \ --to=christian.koenig@amd.com \ --cc=airlied@redhat.com \ --cc=bskeggs@redhat.com \ --cc=efault@gmx.de \ --cc=linux-kernel@vger.kernel.org \ --cc=nouveau@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: linkBe 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.