Re: Warning on Kernel 5.9.0-rc1 on PowerBook G4 (ppc32), bisected to a5c3b9ffb0f4

From: Christophe Leroy
Date: Mon Aug 31 2020 - 08:37:29 EST




Le 31/08/2020 à 12:46, Anshuman Khandual a écrit :


On 08/29/2020 06:40 AM, Larry Finger wrote:
In kernel 5.9.0-rc1 on a PowerBook G4 (ppc32), several warnings of the following type are logged:

 ------------[ cut here ]------------
 WARNING: CPU: 0 PID: 1 at arch/powerpc/mm/pgtable.c:185 set_pte_at+0x20/0x100

All those warnings triggered at the same place i.e arch/powerpc/mm/pgtable.c:185 ?

 Modules linked in:
 CPU: 0 PID: 1 Comm: swapper Not tainted 5.9.0-rc2 #2
 NIP:  c002add4 LR: c07dba40 CTR: 00000000
 REGS: f1019d70 TRAP: 0700   Not tainted  (5.9.0-rc2)
 MSR:  00029032 <EE,ME,IR,DR,RI>  CR: 22000888  XER: 00000000

   GPR00: c07dba40 f1019e28 eeca3220 eef7ace0 4e999000 eef7d664 f1019e50 00000000
   GPR08: 007c2315 00000001 007c2315 f1019e48 22000888 00000000 c00054dc 00000000
   GPR16: 00000000 00000000 2ef7d000 000007c2 fffffff0 eef7b000 000004e8 eef7d000
   GPR24: eef7c5c0 00000000 007c2315 4e999000 c05ef548 eef7d664 c087cda8 007c2315
 NIP [c002add4] set_pte_at+0x20/0x100
 LR [c07dba40] debug_vm_pgtable+0x29c/0x654
 Call Trace:
 [f1019e28] [c002b4ac] pte_fragment_alloc+0x24/0xe4 (unreliable)
 [f1019e48] [c07dba40] debug_vm_pgtable+0x29c/0x654
 [f1019e98] [c0005160] do_one_initcall+0x70/0x158
 [f1019ef8] [c07c352c] kernel_init_freeable+0x1f4/0x1f8
 [f1019f28] [c00054f0] kernel_init+0x14/0xfc
 [f1019f38] [c001516c] ret_from_kernel_thread+0x14/0x1c
 Instruction dump:
 57ff053e 39610010 7c63fa14 4800308c 9421ffe0 7c0802a6 81250000 bfa10014
 7cbd2b78 90010024 552907fe 83e60000 <0f090000> 3d20c089 83c91280 813e0018
 ---[ end trace 4ef67686e5133716 ]---

Although the warnings do no harm, I suspect that they should be fixed in case some future modification turns the warning statements into BUGS.

These warnings are from mm/debug_vm_pgtable.c test, wont be converted into BUGS.
But nonetheless, need to be addressed though.


The problem was bisected to commit a5c3b9ffb0f4 ("mm/debug_vm_pgtable: add tests validating advanced arch page table helpers") by Anshuman Khandual <anshuman.khandual@xxxxxxx>

There are some known issues wrt DEBUG_VM_PGTABLE on certain ppc64 platforms. But
I thought it worked all right on ppc32 platforms though. Adding Christophe Leroy
here. Currently, there is a series under review that makes DEBUG_VM_PGTABLE work
correctly on ppc64 platforms. Could you please give it a try and see if it fixes
these warnings ?

I think all the tests I did were without CONFIG_DEBUG_VM. The warning at arch/powerpc/mm/pgtable.c:185 is a VM_WARN_ON(), it means it generates a real WARNING only when CONFIG_DEBUG_VM is set.

But that's one of the points reported by Aneesh for ppc64: set_pte_at() should never be used to update an already existing PTE. That should be fixed by Aneesh's series.

Christophe