Skip to content

Commit

Permalink
mm: rewrite the comment over migrate_pages() more comprehensibly
Browse files Browse the repository at this point in the history
The comment over migrate_pages() looks quite weird, and makes it hard to
grasp what it is trying to say.  Rewrite it more comprehensibly.

Signed-off-by: Srivatsa S. Bhat <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Srivatsa S. Bhat authored and torvalds committed Apr 29, 2013
1 parent 52f3762 commit c73e5c9
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,19 +973,23 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
}

/*
* migrate_pages
* migrate_pages - migrate the pages specified in a list, to the free pages
* supplied as the target for the page migration
*
* The function takes one list of pages to migrate and a function
* that determines from the page to be migrated and the private data
* the target of the move and allocates the page.
* @from: The list of pages to be migrated.
* @get_new_page: The function used to allocate free pages to be used
* as the target of the page migration.
* @private: Private data to be passed on to get_new_page()
* @mode: The migration mode that specifies the constraints for
* page migration, if any.
* @reason: The reason for page migration.
*
* The function returns after 10 attempts or if no pages
* are movable anymore because to has become empty
* or no retryable pages exist anymore.
* Caller should call putback_lru_pages to return pages to the LRU
* The function returns after 10 attempts or if no pages are movable any more
* because the list has become empty or no retryable pages exist any more.
* The caller should call putback_lru_pages() to return pages to the LRU
* or free list only if ret != 0.
*
* Return: Number of pages not migrated or error code.
* Returns the number of pages that were not migrated, or an error code.
*/
int migrate_pages(struct list_head *from, new_page_t get_new_page,
unsigned long private, enum migrate_mode mode, int reason)
Expand Down

0 comments on commit c73e5c9

Please sign in to comment.