On 15 Jul 2021, at 1:51, Huang Ying wrote: > From: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx> > > 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. > > Signed-off-by: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx> > Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> > Signed-off-by: "Huang, Ying" <ying.huang@xxxxxxxxx> > Suggested-by: osalvador <osalvador@xxxxxxx> [optional parameter] > Reviewed-by: Yang Shi <shy828301@xxxxxxxxx> > Cc: Michal Hocko <mhocko@xxxxxxxx> > Cc: Wei Xu <weixugc@xxxxxxxxxx> > Cc: Zi Yan <ziy@xxxxxxxxxx> > Cc: Dan Williams <dan.j.williams@xxxxxxxxx> > Cc: David Hildenbrand <david@xxxxxxxxxx> > > -- > > Note: Yang Shi originally wrote the patch, thus the SoB. There was > also a Reviewed-by provided since there were some modifications made > to this after the original work. > > Changes since 20210618: > * Reword some bits of the changelog/subject > * Allow callers to pass a NULL 'ret_succeeded'. This ensures that > callers don't have to declare and pass a dummy variable. > > Changes since 20210302: > * Fix definition of CONFIG_MIGRATION=n stub migrate_pages(). Its > parameters were wrong, but oddly enough did not generate any > compile errors. > > Changes since 20200122: > * Fix migrate_pages() to manipulate nr_succeeded *value* > rather than the pointer. > --- > include/linux/migrate.h | 5 +++-- > mm/compaction.c | 2 +- > mm/gup.c | 2 +- > mm/memory-failure.c | 2 +- > mm/memory_hotplug.c | 2 +- > mm/mempolicy.c | 4 ++-- > mm/migrate.c | 11 ++++++++--- > mm/page_alloc.c | 2 +- > 8 files changed, 18 insertions(+), 12 deletions(-) > LGTM. Reviewed-by: Zi Yan <ziy@xxxxxxxxxx> — Best Regards, Yan, Zi
Attachment:
signature.asc
Description: OpenPGP digital signature