mm: page_isolation: write proper kerneldoc
Subsystems (3)
Johannes Weiner
reviewerPATCH 1/1 mm: page_isolation: write proper kerneldoc
And remove the incorrect header comments.
Signed-off-by Johannes Weiner <[email protected]>
--- include/linux/page-isolation.h | 24 ++++++------------------ mm/page_isolation.c | 29 ++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 23 deletions(-)
include/linux/page-isolation.h +6 -18
@@ -37,24 +37,12 @@ void set_pageblock_migratetype(struct page *page, int migratetype);int move_freepages_block (struct zone *zone,struct page *page,int migratetype,int *num_movable); -/* -* Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. -*/ -int -start_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, -int migratetype,int flags,gfp_t gfp_flags); - -/* -* Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. -* target range is [start_pfn, end_pfn) -*/ -void -undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, -int migratetype); - -/* -* Test all pages in [start_pfn, end_pfn) are isolated or not. -*/ +int start_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, +int migratetype,int flags,gfp_t gfp_flags); + +void undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, +int migratetype); +int test_pages_isolated (unsigned long start_pfn,unsigned long end_pfn,int isol_flags);
mm/page_isolation.c +24 -5
@@ -481,8 +481,7 @@ static int isolate_single_pageblock(unsigned long boundary_pfn, int flags, }/** -* start_isolate_page_range() - make page-allocation-type of range of pages to -* be MIGRATE_ISOLATE. +* start_isolate_page_range() - mark page range MIGRATE_ISOLATE * @start_pfn: The lower PFN of the range to be isolated. * @end_pfn: The upper PFN of the range to be isolated. * @migratetype: Migrate type to set in error recovery.
@@ -571,8 +570,14 @@ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,return 0 ; } -/* -* Make isolated pages available again. +/** +* undo_isolate_page_range - undo effects of start_isolate_page_range() +* @start_pfn: The lower PFN of the isolated range +* @end_pfn: The upper PFN of the isolated range +* @migratetype: New migrate type to set on the range +* +* This finds every MIGRATE_ISOLATE page block in the given range +* and switches it to @migratetype. */ void undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn,int migratetype)
@@ -631,7 +636,21 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,return pfn; } -/* Caller should ensure that requested range is in a single zone */ +/** +* test_pages_isolated - check if pageblocks in range are isolated +* @start_pfn: The first PFN of the isolated range +* @end_pfn: The first PFN *after* the isolated range +* @isol_flags: Testing mode flags +* +* This tests if all in the specified range are free. +* +* If %MEMORY_OFFLINE is specified in @flags, it will consider +* poisoned and offlined pages free as well. +* +* Caller must ensure the requested range doesn't span zones. +* +* Returns 0 if true, -EBUSY if one or more pages are in use. +*/ int test_pages_isolated (unsigned long start_pfn,unsigned long end_pfn,int isol_flags) {
Signature · 1 line
2.40.0
Mike Rapoport
reviewerQuoted 48 lines · Johannes Weiner
And remove the incorrect header comments.
Signed-off-by Johannes Weiner <[email protected]>--- include/linux/page-isolation.h | 24 ++++++------------------ mm/page_isolation.c | 29 ++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 23 deletions(-)include/linux/page-isolation.h +6
-18@@ -37,24 +37,12 @@ void set_pageblock_migratetype(struct page *page, int migratetype);int move_freepages_block (struct zone *zone,struct page *page,int migratetype,int *num_movable); -/* -* Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. -*/ -int -start_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, -int migratetype,int flags,gfp_t gfp_flags); - -/* -* Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. -* target range is [start_pfn, end_pfn) -*/ -void -undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, -int migratetype); - -/* -* Test all pages in [start_pfn, end_pfn) are isolated or not. -*/ +int start_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, +int migratetype,int flags,gfp_t gfp_flags); + +void undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn, +int migratetype); +int test_pages_isolated (unsigned long start_pfn,unsigned long end_pfn,int isol_flags);mm/page_isolation.c +0
-0
mm/page_isolation.c static int isolate_single_pageblock(unsigned long boundary_pfn, int flags, · line 486
Quoted 8 lines
mm/page_isolation.c +1
-2@@ -481,8 +481,7 @@ static int isolate_single_pageblock(unsigned long boundary_pfn, int flags, }/** -* start_isolate_page_range() - make page-allocation-type of range of pages to -* be MIGRATE_ISOLATE. +* start_isolate_page_range() - mark page range MIGRATE_ISOLATE * @start_pfn: The lower PFN of the range to be isolated. * @end_pfn: The upper PFN of the range to be isolated.
I don't remember seeing lower and upper to describe memory ranges in our docs. Do you mind changing these to first/last?
mm/page_isolation.c int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, · line 576
Quoted 11 lines
mm/page_isolation.c +4
-2* @migratetype: Migrate type to set in error recovery. @@ -571,8 +570,14 @@ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,return 0 ; } -/* -* Make isolated pages available again. +/** +* undo_isolate_page_range - undo effects of start_isolate_page_range() +* @start_pfn: The lower PFN of the isolated range +* @end_pfn: The upper PFN of the isolated range
Here as well
Quoted 34 lines
mm/page_isolation.c +19
-1+* @migratetype: New migrate type to set on the range +* +* This finds every MIGRATE_ISOLATE page block in the given range +* and switches it to @migratetype. */ void undo_isolate_page_range (unsigned long start_pfn,unsigned long end_pfn,int migratetype)@@ -631,7 +636,21 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,return pfn; } -/* Caller should ensure that requested range is in a single zone */ +/** +* test_pages_isolated - check if pageblocks in range are isolated +* @start_pfn: The first PFN of the isolated range +* @end_pfn: The first PFN *after* the isolated range +* @isol_flags: Testing mode flags +* +* This tests if all in the specified range are free. +* +* If %MEMORY_OFFLINE is specified in @flags, it will consider +* poisoned and offlined pages free as well. +* +* Caller must ensure the requested range doesn't span zones. +* +* Returns 0 if true, -EBUSY if one or more pages are in use. +*/ int test_pages_isolated (unsigned long start_pfn,unsigned long end_pfn,int isol_flags) {Signature · 1 line
2.40.0
Signature · 2 lines
Sincerely yours, Mike.