Re: [PATCH v3 18/34] parisc: Implement the new page table range API

From: John David Anglin
Date: Sat Mar 04 2023 - 11:27:28 EST


On 2023-03-02 3:40 p.m., John David Anglin wrote:
On 2023-03-02 11:43 a.m., John David Anglin wrote:
On 2023-02-28 4:37 p.m., Matthew Wilcox (Oracle) wrote:
Add set_ptes(), update_mmu_cache_range(), flush_dcache_folio()
and flush_icache_pages().  Change the PG_arch_1 (aka PG_dcache_dirty) flag
from being per-page to per-folio.
I have tested this change on rp3440 at mainline commit e492250d5252635b6c97d52eddf2792ec26f1ec1
and c8000 at mainline commit ee3f96b164688dae21e2466a57f2e806b64e8a37.
Here's another one:

------------[ cut here ]------------
kernel BUG at mm/memory.c:3865!
CPU: 1 PID: 6972 Comm: sbuild Not tainted 6.2.0+ #1
Hardware name: 9000/800/rp3440

     YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
PSW: 00001000000001101111111100001111 Not tainted
r00-03  000000000806ff0f 000000004fab8d40 00000000404584b0 000000004fab8d40
r04-07  0000000040c2f4c0 0000000047fe60c0 000000004fab8b98 0000000000000953
r08-11  000000004de3de00 0000000000000000 0000000047fe60c0 0000004093ff4660
r12-15  0000000000000001 0000000047fe60c0 0000000040000540 000000022f8e9540
r16-19  0000000000000000 000000004c694c40 000000004fab8860 00000000000003d0
r20-23  0000000007be3a40 0000000000000fff 0000000000000000 000000004109f1a0
r24-27  0000000000000000 0000000000000cc0 0000000046de3a68 0000000040c2f4c0
r28-31  80e00000000a0435 000000004fab8df0 000000004fab8e20 0000000000000001
sr00-03  0000000000207c00 0000000000000000 0000000000000000 0000000002f11c00
sr04-07  0000000000000000 0000000000000000 0000000000000000 0000000000000000

IASQ: 0000000000000000 0000000000000000 IAOQ: 000000004045908c 0000000040459090
 IIR: 03ffe01f    ISR: 0000000000000000  IOR: 0000000000000000
 CPU:        1   CR30: 0000004095d64c20 CR31: ffffffffffffffff
 ORIG_R28: 000000001c569ad0
 IAOQ[0]: do_swap_page+0x108c/0x1168
 IAOQ[1]: do_swap_page+0x1090/0x1168
 RP(r2): do_swap_page+0x4b0/0x1168
Backtrace:
 [<000000004045a554>] handle_pte_fault+0x244/0x358
 [<000000004045c58c>] __handle_mm_fault+0x104/0x1b8
 [<000000004045c81c>] handle_mm_fault+0x1dc/0x318
 [<000000004044cb38>] faultin_page+0xa8/0x178
 [<000000004044e848>] __get_user_pages+0x328/0x560
 [<0000000040450ac4>] get_dump_page+0x9c/0x128
 [<0000000040596cb8>] dump_user_range+0xc0/0x2d8
 [<000000004058e790>] elf_core_dump+0x5f8/0x708
 [<0000000040596384>] do_coredump+0xc2c/0x14a0
 [<0000000040259040>] get_signal+0x4a8/0xb60
 [<000000004021a570>] do_signal+0x50/0x228
 [<000000004021ab38>] do_notify_resume+0x68/0x150
 [<0000000040203ee0>] syscall_do_signal+0x54/0xa0
Removed new page table API change and still see a swap issue on rp3440.  So, these bugs are probably
unrelated to the API change.

get_swap_device: Bad swap file entry 600000000014ee20
get_swap_device: Bad swap file entry 600000000014ee20
[...]
get_swap_device: Bad swap file entry 600000000014ee20
_swap_info_get: Bad swap file entry 600000000014ee20
BUG: Bad page map in process sh  pte:14ee2418 pmd:01372913
addr:00000000f8406000 vm_flags:00000075 anon_vma:0000000000000000 mapping:000000007f67e1a8 index:25
file:libc.so.6 fault:xfs_filemap_fault [xfs] mmap:xfs_file_mmap [xfs] read_folio:xfs_vm_read_folio [xfs]
CPU: 3 PID: 12702 Comm: sh Not tainted 6.2.0+ #1
Hardware name: 9000/800/rp3440
Backtrace:
 [<000000004020ac50>] show_stack+0x70/0x90
 [<0000000040b7c148>] dump_stack_lvl+0xd8/0x128
 [<0000000040b7c1cc>] dump_stack+0x34/0x48
 [<000000004045020c>] print_bad_pte+0x24c/0x318
 [<0000000040454f78>] zap_pte_range+0x908/0x990
 [<0000000040455238>] unmap_page_range+0x1d8/0x490
 [<00000000404556bc>] unmap_vmas+0x10c/0x1a8
 [<0000000040465278>] exit_mmap+0x198/0x4a0
 [<0000000040234a3c>] mmput+0x114/0x2a8
 [<0000000040243c10>] do_exit+0x4e0/0xc68
 [<00000000402446b8>] do_group_exit+0x68/0x128
 [<00000000402583fc>] get_signal+0xae4/0xb60
 [<0000000040219310>] do_signal+0x50/0x228
 [<00000000402198d8>] do_notify_resume+0x68/0x150
 [<00000000402030b4>] intr_check_sig+0x38/0x3c

Dave

--
John David Anglin dave.anglin@xxxxxxxx