Skip to content

Commit 664dc4d

Browse files
lorenzo-stoakesakpm00
authored andcommitted
mm/mremap: thread state through move page table operation
Finish refactoring the page table logic by threading the PMC state throughout the operation, allowing us to control the operation as we go. Additionally, update the old_addr, new_addr fields in move_page_tables() as we progress through the process making use of the fact we have this state object now to track this. With these changes made, not only is the code far more readable, but we can finally transmit state throughout the entire operation, which lays the groundwork for sensibly making changes in future to how the mremap() operation is performed. Additionally take the opportunity to refactor the means of determining the progress of the operation, abstracting this to pmc_progress() and simplifying the logic to make it clearer what's going on. Link: https://lkml.kernel.org/r/230dd7a2b7b01a6eef442678f284d575e800356e.1741639347.git.lorenzo.stoakes@oracle.com Signed-off-by: Lorenzo Stoakes <[email protected]> Reviewed-by: Vlastimil Babka <[email protected]> Cc: Harry Yoo <[email protected]> Cc: Liam R. Howlett <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 2a4077f commit 664dc4d

File tree

2 files changed

+116
-83
lines changed

2 files changed

+116
-83
lines changed

mm/internal.h

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ struct folio_batch;
3636
*
3737
* Use the PAGETABLE_MOVE() macro to initialise this struct.
3838
*
39+
* The old_addr and new_addr fields are updated as the page table move is
40+
* executed.
41+
*
3942
* NOTE: The page table move is affected by reading from [old_addr, old_end),
4043
* and old_addr may be updated for better page table alignment, so len_in
4144
* represents the length of the range being copied as specified by the user.

0 commit comments

Comments
 (0)