linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] LoongArch: Fix vmalloc test issue
@ 2024-10-10  3:50 Bibo Mao
  2024-10-10  3:50 ` [PATCH 1/4] LoongArch: Set pte entry with PAGE_GLOBAL for kernel space Bibo Mao
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Bibo Mao @ 2024-10-10  3:50 UTC (permalink / raw)
  To: Huacai Chen, Andrey Ryabinin, Andrew Morton
  Cc: David Hildenbrand, Barry Song, loongarch, linux-kernel,
	kasan-dev, linux-mm

On LoongArch 3C5000 Dual-Way machine, there are 32 CPUs and 128G RAM,
there are some errors with run vmalloc test with command like this
  insmod test_vmalloc.ko   nr_threads=32  run_test_mask=0x3af

Here is part of error message,
 WARNING: CPU: 13 PID: 1457 at mm/vmalloc.c:503 vmap_small_pages_range_noflush+0x388/0x510
 CPU: 13 UID: 0 PID: 1457 Comm: vmalloc_test/15 Not tainted 6.12.0-rc2+ #93

 Trying to vfree() nonexistent vm area (000000004dec9ced)
 WARNING: CPU: 3 PID: 1444 at mm/vmalloc.c:3345 vfree+0x1e8/0x4c8
 CPU: 3 UID: 0 PID: 1444 Comm: vmalloc_test/2

 Trying to vfree() bad address (00000000fc7c9da5)
 WARNING: CPU: 10 PID: 1552 at mm/vmalloc.c:3210 remove_vm_area+0x88/0x98
 CPU: 10 UID: 0 PID: 1552 Comm: kworker/u144:3

The mainly problem is that function set_pte() and pte_free() is atomic,
there is contension between them. Since these functions need modify
two consecutive pte entries for kernel space area, to assure that both
pte entries with PAGE_GLOBAL bit set.

With this patchset, vmalloc test case passes to run with command
  insmod test_vmalloc.ko   nr_threads=32  run_test_mask=0x3af

Bibo Mao (4):
  LoongArch: Set pte entry with PAGE_GLOBAL for kernel space
  mm/sparse-vmemmap: set pte_init when vmemmap is created
  LoongArch: Add barrier between set_pte and memory access
  LoongArch: Use atomic operation with set_pte and pte_clear function

 arch/loongarch/include/asm/cacheflush.h | 14 +++++++-
 arch/loongarch/include/asm/pgalloc.h    | 13 +++++++
 arch/loongarch/include/asm/pgtable.h    | 45 +++++++++----------------
 arch/loongarch/mm/init.c                |  4 ++-
 arch/loongarch/mm/kasan_init.c          |  4 ++-
 arch/loongarch/mm/pgtable.c             | 22 ++++++++++++
 mm/sparse-vmemmap.c                     |  5 +++
 7 files changed, 75 insertions(+), 32 deletions(-)


base-commit: 87d6aab2389e5ce0197d8257d5f8ee965a67c4cd
-- 
2.39.3



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-10-12  2:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-10  3:50 [PATCH 0/4] LoongArch: Fix vmalloc test issue Bibo Mao
2024-10-10  3:50 ` [PATCH 1/4] LoongArch: Set pte entry with PAGE_GLOBAL for kernel space Bibo Mao
2024-10-12  2:15   ` Huacai Chen
2024-10-12  2:40     ` maobibo
2024-10-10  3:50 ` [PATCH 2/4] mm/sparse-vmemmap: set pte_init when vmemmap is created Bibo Mao
2024-10-11  4:42   ` kernel test robot
2024-10-11  4:42   ` kernel test robot
2024-10-12  2:17   ` Huacai Chen
2024-10-10  3:50 ` [PATCH 3/4] LoongArch: Add barrier between set_pte and memory access Bibo Mao
2024-10-12  2:16   ` Huacai Chen
2024-10-12  2:48     ` maobibo
2024-10-10  3:50 ` [PATCH 4/4] LoongArch: Use atomic operation with set_pte and pte_clear function Bibo Mao
2024-10-12  2:16   ` Huacai Chen
2024-10-12  2:51     ` maobibo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox