On Wed, Oct 23, 2024 at 04:04:05PM -0700, Andrew Morton wrote: > On Wed, 23 Oct 2024 17:24:38 +0100 Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx> wrote: > > > > > ... > > > > Existing mechanism for performing a walk which also installs page table > > entries if necessary are heavily duplicated throughout the kernel, > > How complicated is it to migrate those to use this? I would say probably somewhat difficult as very often people are doing quite custom things, but I will take a look at seeing if we can't make things a little more generic. I am also mildly motivated to look at trying to find a generic way to do replaces... Both on the TODO! > > > ... > > > > We explicitly do not allow the existing page walk API to expose this > > feature as it is dangerous and intended for internal mm use only. Therefore > > we provide a new walk_page_range_mm() function exposed only to > > mm/internal.h. > > > > Is this decision compatible with the above migrations? Yes, nobody but mm should be doing this. You have to be enormously careful about locks, caches, accounting and the various other machinery around actually setting a PTE, and this allows you to establish entirely new mappings, so could very much be abused.