Re: [PATCH 04/10] mm/migrate: make migrate_pages() return nr_succeeded

From: Dave Hansen
Date: Thu Apr 01 2021 - 19:21:57 EST


On 4/1/21 3:35 PM, Wei Xu wrote:
> A small suggestion: Given that migrate_pages() requires that
> *nr_succeeded should be initialized to 0 when it is called due to its
> use of *nr_succeeded in count_vm_events() and trace_mm_migrate_pages(),
> it would be less error-prone if migrate_pages() initializes
> *nr_succeeded itself.

That's a good point, especially if a caller made multiple
migrate_pages() calls without resetting it, which a number of callers
do. That could really have caused some interesting problems. Thanks
for catching that!

I'll do what you suggested.