From: "Christian König" <christian.koenig@amd.com>
To: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>,
amd-gfx list <amd-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
Harry Wentland <harry.wentland@amd.com>,
"Deucher, Alexander" <alexander.deucher@amd.com>
Subject: Re: [drm:dm_plane_helper_prepare_fb [amdgpu]] *ERROR* Failed to pin framebuffer with error -12
Date: Mon, 11 Jan 2021 15:01:31 +0100 [thread overview]
Message-ID: <6e55d84c-7b9a-167c-34cf-9e980f8e2354@amd.com> (raw)
In-Reply-To: <816e944c-72bc-d94d-449f-bfb915382290@amd.com>
Am 11.01.21 um 10:03 schrieb Christian König:
> Hi Mikhail
>
> Am 10.01.21 um 23:26 schrieb Mikhail Gavrilov:
>> Hi folks,
>> today I joined to testing Kernel 5.11 and saw that the kernel log was
>> flooded with BUG messages:
>> BUG: sleeping function called from invalid context at mm/vmalloc.c:1756
>> in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 266, name:
>> kswapd0
>> INFO: lockdep is turned off.
>> CPU: 15 PID: 266 Comm: kswapd0 Tainted: G W ---------
>> --- 5.11.0-0.rc2.20210108gitf5e6c330254a.119.fc34.x86_64 #1
>> Hardware name: System manufacturer System Product Name/ROG STRIX
>> X570-I GAMING, BIOS 2802 10/21/2020
>> Call Trace:
>> dump_stack+0x8b/0xb0
>> ___might_sleep.cold+0xb6/0xc6
>> vm_unmap_aliases+0x21/0x40
>> change_page_attr_set_clr+0x9e/0x190
>> set_memory_wb+0x2f/0x80
>> ttm_pool_free_page+0x28/0x90 [ttm]
>> ttm_pool_shrink+0x45/0xb0 [ttm]
>> ttm_pool_shrinker_scan+0xa/0x20 [ttm]
>> do_shrink_slab+0x177/0x3a0
>> shrink_slab+0x9c/0x290
>> shrink_node+0x2e6/0x700
>> balance_pgdat+0x2f5/0x650
>> kswapd+0x21d/0x4d0
>> ? do_wait_intr_irq+0xd0/0xd0
>> ? balance_pgdat+0x650/0x650
>> kthread+0x13a/0x150
>> ? __kthread_bind_mask+0x60/0x60
>> ret_from_fork+0x22/0x30
>
> I'm probably responsible for this. Need to double check why we try to
> allocate memory while freeing some.
Changing the page table attributes while releasing memory might sleep.
So we can't use a spinlock here.
Thanks for the report, a patch to fix this is on the mailing list now.
>> But the most unpleasant thing is that after a while the monitor turns
>> off and does not go on again until the restart.
>> This is accompanied by an entry in the kernel log:
>>
>> amdgpu 0000:0b:00.0: amdgpu: 00000000ff7d8b94 pin failed
>> [drm:dm_plane_helper_prepare_fb [amdgpu]] *ERROR* Failed to pin
>> framebuffer with error -12
>
> -12 is just -ENOMEM. Looks like a memory leak to me, maybe caused by
> the problem above, maybe something completely unrelated.
>
> I will take a look.
The looks like a completely unrelated memory leak to me.
Probably best if you open up a bug report for this.
Thanks,
Christian.
>
> Thanks,
> Christian.
>
>>
>> $ grep "Failed to pin framebuffer with error" -Rn .
>> ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:5816:
>> DRM_ERROR("Failed to pin framebuffer with error %d\n", r);
>>
>> $ git blame -L 5811,5821
>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> Blaming lines: 0% (11/9167), done.
>> 5d43be0ccbc2f (Christian König 2017-10-26 18:06:23 +0200 5811)
>> domain = AMDGPU_GEM_DOMAIN_VRAM;
>> e7b07ceef2a65 (Harry Wentland 2017-08-10 13:29:07 -0400 5812)
>> 7b7c6c81b3a37 (Junwei Zhang 2018-06-25 12:51:14 +0800 5813) r =
>> amdgpu_bo_pin(rbo, domain);
>> e7b07ceef2a65 (Harry Wentland 2017-08-10 13:29:07 -0400 5814) if
>> (unlikely(r != 0)) {
>> 30b7c6147d18d (Harry Wentland 2017-10-26 15:35:14 -0400 5815)
>> if (r != -ERESTARTSYS)
>> 30b7c6147d18d (Harry Wentland 2017-10-26 15:35:14 -0400 5816)
>> DRM_ERROR("Failed to pin framebuffer with error %d\n", r);
>> 0f257b09531b4 (Chunming Zhou 2019-05-07 19:45:31 +0800 5817)
>> ttm_eu_backoff_reservation(&ticket, &list);
>> e7b07ceef2a65 (Harry Wentland 2017-08-10 13:29:07 -0400 5818)
>> return r;
>> e7b07ceef2a65 (Harry Wentland 2017-08-10 13:29:07 -0400 5819) }
>> e7b07ceef2a65 (Harry Wentland 2017-08-10 13:29:07 -0400 5820)
>> bb812f1ea87dd (Junwei Zhang 2018-06-25 13:32:24 +0800 5821) r =
>> amdgpu_ttm_alloc_gart(&rbo->tbo);
>>
>> Who knows how to fix it?
>>
>> Full kernel logs is here:
>> [1]
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpastebin.com%2FfLasjDHX&data=04%7C01%7Cchristian.koenig%40amd.com%7C15ef83e462e049429be208d8b5b6c6bb%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637459143942981908%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Uj9Ob3lUCAsH8NrxC715zSfl5Yqc44ySVo%2FZkdyTpCM%3D&reserved=0
>> [2]
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpastebin.com%2Fg3wR2r9e&data=04%7C01%7Cchristian.koenig%40amd.com%7C15ef83e462e049429be208d8b5b6c6bb%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637459143942981908%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=u8irMU3i8c37W5SkyiaAi%2FtwMoPorezm3NI1EYI3csE%3D&reserved=0
>>
>> --
>> Best Regards,
>> Mike Gavrilov.
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2021-01-11 14:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-10 22:26 [drm:dm_plane_helper_prepare_fb [amdgpu]] *ERROR* Failed to pin framebuffer with error -12 Mikhail Gavrilov
2021-01-11 9:03 ` Christian König
2021-01-11 14:01 ` Christian König [this message]
2021-01-11 19:23 ` Mikhail Gavrilov
2021-01-11 20:45 ` Christian König
2021-01-11 21:51 ` Mikhail Gavrilov
2021-01-14 0:22 ` Mikhail Gavrilov
2021-01-14 13:56 ` Christian König
2021-01-14 14:06 ` Daniel Vetter
2021-01-14 22:43 ` Mikhail Gavrilov
2021-01-20 0:59 ` Mikhail Gavrilov
2021-01-21 13:27 ` Christian König
2021-01-25 5:28 ` Mikhail Gavrilov
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=6e55d84c-7b9a-167c-34cf-9e980f8e2354@amd.com \
--to=christian.koenig@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikhail.v.gavrilov@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).