On 2026-07-07 15:33:32 [+0100], Lorenzo Stoakes wrote: > On Tue, Jul 07, 2026 at 08:59:23PM +0800, Wandun Chen wrote: > > From: Wandun Chen <[email protected]> > > > > In RT kernels, sysctl_compact_unevictable_allowed is false by default, > > when the mlock/mlockall system call try to lock all the present page, > > the mlock_pte_range function skips non-present entries. If these > > non-present entries are migration entries, and the migration is not > > guaranteed to have completed before the mlock/mlockall, it may result > > in a page fault on subsequent access, which then waits for the > > migration to finish, causing spike latency in RT kernels. > > Is this really noticable and measurable?
You want to avoid page faults like this which is why you do mlock in the first place. If the thread has a RT priority and it blocks here then other RT threads will be scheduled and your migration thread, which will resolve this, is SCHED_OTHER and the last one in the line. Assuming that thread has a 1ms cycle/ deadline then it will likely miss it. > I suppose not too many ranges should be mock Sebastian
