Repository navigation
arm64: user4k: turn 4K userspace on by default, keep user4k=off - #2272
RyanTheTide wants to merge 1 commit into
Conversation
Commit 1705968 ("arm64: user4k: keep 4K userspace off unless booted with user4k=on") made the per-process user granule an opt-in while it had been tested only on the J700. Since then every Aurora distribution boots every supported Mac with user4k=on: Fedora's kiwi images and aurora-userpages' %posttrans, Arch's /etc/default/grub.d/50-aurora-user4k.cfg and NixOS's aurora.userpages module all add it, and the lab fleet (M1 Pro, M2, J616s, Neo) runs with it. The option that decides the behaviour of every shipped system should be the kernel's default, not a command-line knob each distribution has to add. Initialise arm64_user4k_on to true. The early parameter is unchanged: user4k=off (or 0/n) still turns the feature off for that boot, with the same effects as before (the page-size prctls refuse non-native sizes, every exec gets the native granule, no 4K user granule capability is detected and the page_ext record is not reserved). user4k=on stays accepted and is now a no-op. The decision is still per CPU capability: a CPU without the 4K translation granule gets no alternative, as before. Update the comments, Kconfig help, kernel-parameters.txt, user4k.rst, user_page_size.rst and the userpages launcher's hint and README to describe user4k=off as the switch. Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Hardware rows, 2026-11-20: one-shot boots of
All four Macs:
Each Mac went back to its normal kernel afterwards. Not covered by these rows: suspend/resume, GPU/NVMe throughput against the current kernel, and audio. |
|
Hardware rows for this head (198b011), built into 7.3.0-aurora-fleet77 (integration/aurora b4cd7b3 + this PR + 15 other open PRs as plain merges), booted with no
All five: SELinux enforcing, 0 failed units, 0 AVC, 0 oops, s2idle 2/2 on the PMU RTC, and the dEQP-VK smoke list (16541 cases) unchanged from the previous kernel. Marking this ready; the image and spec changes that drop the argument (fedora-aurora#417, nixos-aurora#326) stay ordered after the kernel bump that carries it, as their descriptions say. |
|
No blockers. The change is the initialiser of arm64_user4k_on; kstrtobool still parses user4k=off/0/n and user4k=on becomes a no-op. All readers (has_user4k_granule, arm64_bprm_prepare_mm, arch_mm_init_exec, subpage_ext_needed) run after early parameters, so there is no ordering change. With the default on, the page_ext subpage record (about 32 bytes per 16K page) is reserved on every boot; distributions already boot with user4k=on, so this matches what users run today. Nit: the edited ARM64_USER4K_KUNIT_TEST help line in arch/arm64/Kconfig.debug is not reflowed. Rows still to add: a 13-inch M4 Air (J713) boot with no user4k= argument and |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed at 198b01135512.
The functional change itself (arch/arm64/mm/context.c:48 initializing arm64_user4k_on = true) is clean, CPU-capability-gated via ID_AA64MMFR0_EL1.TGran4, and all 7 CI checks (host-tests, source, rust-build, kunit, DWC3/ATC matrix) are green.
Hard-rule blocker
- Agent
Co-Authored-Bytrailer in commit198b01135512b794213760d2a48d644ce78bad98
The commit carries:PerCo-Authored-By: Claude Opus 5.5 <[email protected]>pre-pr-checklist.md§4 (hard rule), commits must carry human identity and a humanSigned-off-byonly — no agentCo-Authored-By, no agent sign-off, and noAssisted-byin commit messages. Agent attribution belongs only on the last line of the PR body (which is already present). Please drop theCo-Authored-Bytrailer from the commit.
Hardware rows still needed
user4k=offopt-out boot row: explicitly listed in the PR body ("boot once withuser4k=offand expect the capability line gone anduserpages 4k trueto fail with the off hint"), but neither thesweepk2norfleet77row comment booted withuser4k=off.- T8132 row (J713 M4 Air or J773g M4 mini) booted without
user4k=plususerpages 4k true(and noteuserpages 4k truewas "booted, not run" on T6040 and T8122 in thefleet77table).
Nits
tools/aurora-userpages/userpages.c:23-29:off_hint()now prints"Smaller page sizes are off: the kernel was booted with user4k=off.\n"onEINVAL, which is misleading on a kernel built withoutCONFIG_ARM64_USER4K_EXPERIMENTAL(that also returnsEINVAL).arch/arm64/Kconfig.debug:74-75: line 75 is un-reflowed (107 columns).
Assisted-by: LLM (Google:Gemini 4 Neon)
|
Replaced by #2731: the same code change with a commit that carries only the human sign-off, and the two nits from the review fixed (userpages hint, Kconfig help reflow). The 13-inch M4 Air (J713) now runs it on its default kernel with no |
|
Superseded by #2731 (same change, commit without the trailer). |
Per-process 4K userspace pages (
CONFIG_ARM64_USER4K_EXPERIMENTAL, default y) became an opt-in behind theuser4k=onearly parameter in 1705968. Every Aurora distribution now adds that parameter on every supported Mac:kernelcmdline, plusaurora-userpages'%posttransvia grubby./etc/default/grub.d/50-aurora-user4k.cfg.aurora.userpages→boot.kernelParams.The lab machines (M1 Pro, M2, J616s, Neo) also boot with it. The behaviour every shipped system runs with should be the kernel's default, not a command-line knob each distribution has to add.
This change:
arm64_user4k_onis initialised totrue. The early parameter is unchanged:user4k=off(or0/n) still turns the feature off for that boot, with the same effects as before. The page-size prctls refuse non-native sizes, every exec gets the native granule, the 4K user granule capability is not detected, and theMM_SUBPAGEpage_ext record (32 bytes per native page, about 0.2% of RAM with 16K pages) is not reserved.user4k=onis still accepted and does nothing.ID_AA64MMFR0_EL1.TGran4says every CPU supports it, as before.kernel-parameters.txt,user4k.rst,user_page_size.rstand theuserpageslauncher's hint and README now describeuser4k=offas the switch.Testing:
arch/arm64/mm/context.c,arch/arm64/kernel/process.c,arch/arm64/kernel/cpufeature.c, with the editedasm/mmu.handasm/mmu_context.h) were compiled with the exact clang command lines of the current fleet release build (LLVM=1, release config). They build cleanly.arm64_user4k_onlands in.data..ro_after_initwith value 1.__ro_after_initbool. Existing test configs pass--kernel_args user4k=onand keep working. Thearm64-user4k-policysuite still covers the off state withuser4k=off.Hardware rows still needed: boot this kernel without any
user4k=on Neo (T8140), J616s (T6040), M1 Pro (T6000) and M2 (T8112). On each, expect the4K userspace translation granulecapability line in dmesg,userpages 4k trueto succeed anduserpages --statusto report 4K under the launcher. Then boot once withuser4k=offand expect the capability line gone anduserpages 4k trueto fail with the off hint.Ordering: merge this first. The distribution changes that stop adding
user4k=onmust ship in the same package build as a kernel containing this commit:Assisted-by: LLM (Claude:Opus 5.5)