public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] fix wrong usage of memory allocation APIs under PREEMPT_RT in arm64
@ 2026-01-05 20:23 Yeoreum Yun
  2026-01-05 20:23 ` [PATCH v5 1/3] arm64: mmu: introduce pgtable_alloc_t Yeoreum Yun
                   ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Yeoreum Yun @ 2026-01-05 20:23 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-rt-devel
  Cc: catalin.marinas, will, ryan.roberts, akpm, david, kevin.brodsky,
	quic_zhenhuah, dev.jain, yang, chaitanyas.prakash, bigeasy,
	clrkwllms, rostedt, lorenzo.stoakes, ardb, jackmanb, vbabka,
	mhocko, Yeoreum Yun

Under PREEMPT_RT, calling generic memory allocation/free APIs
(e.x) __get_free_pages(), pgtable_alloc(), free_pages() and etc
with preemption disabled is not allowed, but allow only nolock() APIs series
because it may acquire a spin lock that becomes sleepable on RT,
potentially causing a sleep during page allocation
(See Documentation/core-api/real-time/differences.rst, Memory allocation section).

However, In arm64, __linear_map_split_to_ptes() and
__kpti_install_ng_mappings() called by stopper thread via stop_machine()
use generic memory allocation/free APIs.

This patchset fixes this problem and based on v6.19-rc1

Patch History
==============
from v4 to v5:
  - rebase to v6.19-rc4
  - remove useless __always_inline
  - fix alignments
  - https://lore.kernel.org/all/20260102150736.1378818-1-yeoreum.yun@arm.com/

from v3 to v4:
  - rebase to v6.19-rc3
  - introduce pgtable_alloc_t
  - following several suggestions from @Ryan Roberts
  - https://lore.kernel.org/all/20251218194750.395301-1-yeoreum.yun@arm.com/

from v2 to v3:
  - remove split-mode and split_args.
    pass proper function pointer while spliting.
  - rename function name.
  - https://lore.kernel.org/all/20251217182007.2345700-1-yeoreum.yun@arm.com/

from v1 to v2:
  - drop pagetable_alloc_nolock()
  - following @Ryan Roberts suggestion.
  - https://lore.kernel.org/all/20251212161832.2067134-1-yeoreum.yun@arm.com/

Yeoreum Yun (3):
  arm64: mmu: introduce pgtable_alloc_t
  arm64: mmu: avoid allocating pages while splitting the linear mapping
  arm64: mmu: avoid allocating pages while installing ng-mapping for
    KPTI

 arch/arm64/mm/mmu.c | 241 ++++++++++++++++++++++++++++++++++----------
 1 file changed, 186 insertions(+), 55 deletions(-)

--
LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}



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

end of thread, other threads:[~2026-01-22 13:47 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05 20:23 [PATCH v5 0/3] fix wrong usage of memory allocation APIs under PREEMPT_RT in arm64 Yeoreum Yun
2026-01-05 20:23 ` [PATCH v5 1/3] arm64: mmu: introduce pgtable_alloc_t Yeoreum Yun
2026-01-05 20:23 ` [PATCH v5 2/3] arm64: mmu: avoid allocating pages while splitting the linear mapping Yeoreum Yun
2026-01-19 17:28   ` Will Deacon
2026-01-19 21:24     ` Yeoreum Yun
2026-01-20  8:56       ` Ryan Roberts
2026-01-20  9:29         ` Yeoreum Yun
2026-01-20 10:40           ` Ryan Roberts
2026-01-20 10:54             ` Yeoreum Yun
2026-01-20 15:53             ` Will Deacon
2026-01-20 16:16               ` Yeoreum Yun
2026-01-20 16:22               ` Ryan Roberts
2026-01-20 16:31                 ` Yeoreum Yun
2026-01-20 17:35                   ` Ryan Roberts
2026-01-20 17:49                     ` Yeoreum Yun
2026-01-21  0:12                     ` Yang Shi
2026-01-21  8:32                       ` Yeoreum Yun
2026-01-21 10:20                         ` Ryan Roberts
2026-01-21 11:30                           ` Yeoreum Yun
2026-01-21 22:57                           ` Yang Shi
2026-01-22  7:42                             ` Yeoreum Yun
2026-01-22 13:47                               ` Ryan Roberts
2026-01-20 22:24           ` Yang Shi
2026-01-20 23:01             ` Yeoreum Yun
2026-01-21  0:43               ` Yang Shi
2026-01-21  8:15                 ` Yeoreum Yun
2026-01-05 20:23 ` [PATCH v5 3/3] arm64: mmu: avoid allocating pages while installing ng-mapping for KPTI Yeoreum Yun
2026-01-19 17:31   ` Will Deacon
2026-01-19 21:30     ` Yeoreum Yun
2026-01-20 11:44       ` Will Deacon
2026-01-20 15:30         ` Yeoreum Yun

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