On 11/16/26 22:11, Thomas Hellström wrote: > On Mon, 2026-11-16 at 21:12 +0100, David Hildenbrand (Arm) wrote: >> On 11/16/26 15:53, Thomas Hellström wrote: >>> >>> Yes, I got that part, but that's is only for a single scan, right? >> >> Well, one NUMA-hinting protects again, you would get an MMU notifier, >> and fault >> again here? >> >> It all gets pretty unpredictable for these PTEs, no? > > True, it does. But again, my point is that exact same thing happens if > hmm_range_fault() is allowed to take the fault and migrate? Which > happens here.
Yes, and the right fix is then to either disable NUMA hinting or to allow consumption of prot_none entries -- like KVM does with GUP. The writable side is the tricky one. >>> We can't do that globally, really, for these type of apps. But one >>> remedy might be recommending the app to mbind() with a no- >>> migration-on- >>> fault policy. >> >> Yeah, something like this. I mean, it's hard to see how NUMA >> balancing makes any >> sense here. You're just trying to fight the mechanism because it ends >> up causing >> more harm then good. >> >>> >>> Also the hmm O(n²) complexity in this situation isn't really ideal. >>> We >>> might need to look at that as well. >> I didn't quite get that, can you elaborate? > > My understanding is that due to the migration invalidations > hmm_range_fault() is restarted from the beginning roughly on each PMD, > leading to O(n_pages²) complexity, although with a small constant. Ah, got it. -- Cheers, David
