mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
mm/migrate: enable returning precise migrate_pages() success count
Under normal circumstances, migrate_pages() returns the number of pages migrated. In error conditions, it returns an error code. When returning an error code, there is no way to know how many pages were migrated or not migrated. Make migrate_pages() return how many pages are demoted successfully for all cases, including when encountering errors. Page reclaim behavior will depend on this in subsequent patches. Link: https://lkml.kernel.org/r/20210721063926.3024591-3-ying.huang@intel.com Link: https://lkml.kernel.org/r/20210715055145.195411-4-ying.huang@intel.com Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: "Huang, Ying" <ying.huang@intel.com> Suggested-by: Oscar Salvador <osalvador@suse.de> [optional parameter] Reviewed-by: Yang Shi <shy828301@gmail.com> Reviewed-by: Zi Yan <ziy@nvidia.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Wei Xu <weixugc@google.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: David Hildenbrand <david@redhat.com> Cc: David Rientjes <rientjes@google.com> Cc: Greg Thelen <gthelen@google.com> Cc: Keith Busch <kbusch@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
884a6e5d1f
commit
5ac95884a7
8 changed files with 18 additions and 12 deletions
|
@ -41,7 +41,8 @@ extern int migrate_page(struct address_space *mapping,
|
|||
struct page *newpage, struct page *page,
|
||||
enum migrate_mode mode);
|
||||
extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free,
|
||||
unsigned long private, enum migrate_mode mode, int reason);
|
||||
unsigned long private, enum migrate_mode mode, int reason,
|
||||
unsigned int *ret_succeeded);
|
||||
extern struct page *alloc_migration_target(struct page *page, unsigned long private);
|
||||
extern int isolate_movable_page(struct page *page, isolate_mode_t mode);
|
||||
|
||||
|
@ -56,7 +57,7 @@ extern int migrate_page_move_mapping(struct address_space *mapping,
|
|||
static inline void putback_movable_pages(struct list_head *l) {}
|
||||
static inline int migrate_pages(struct list_head *l, new_page_t new,
|
||||
free_page_t free, unsigned long private, enum migrate_mode mode,
|
||||
int reason)
|
||||
int reason, unsigned int *ret_succeeded)
|
||||
{ return -ENOSYS; }
|
||||
static inline struct page *alloc_migration_target(struct page *page,
|
||||
unsigned long private)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue