Oscar Salvador <osalvador@xxxxxxx> writes: > On Fri, Jun 18, 2021 at 02:15:31PM +0800, Huang Ying wrote: >> From: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx> >> >> The migrate_pages() returns the number of pages that were not migrated, >> or an error code. When returning an error code, there is no way to know >> how many pages were migrated or not migrated. >> >> In the following patch, migrate_pages() is used to demote pages to PMEM >> node, we need account how many pages are reclaimed (demoted) since page >> reclaim behavior depends on this. Add *nr_succeeded parameter to make >> migrate_pages() return how many pages are demoted successfully for all >> cases. >> >> Signed-off-by: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx> >> Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> >> Signed-off-by: "Huang, Ying" <ying.huang@xxxxxxxxx> >> Reviewed-by: Yang Shi <shy828301@xxxxxxxxx> >> Cc: Michal Hocko <mhocko@xxxxxxxx> >> Cc: Wei Xu <weixugc@xxxxxxxxxx> >> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> >> Cc: David Hildenbrand <david@xxxxxxxxxx> >> Cc: osalvador <osalvador@xxxxxxx> > > I thought we all agreed on making nr_succeed an optional argument [1]. > It reduced the churn quite a lot. > > [1] https://patchwork.kernel.org/comment/24104453/ Sorry. Forget changing this. Will change it in the next version. Best Regards, Huang, Ying