Thread (16 messages) 16 messages, 5 authors, 2021-07-16

Re: [PATCH -V10 3/9] mm/migrate: enable returning precise migrate_pages() success count

From: Zi Yan <ziy@nvidia.com>
Date: 2021-07-15 18:02:58
Also in: lkml

On 15 Jul 2021, at 1:51, Huang Ying wrote:
From: Yang Shi <redacted>

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 <redacted>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: "Huang, Ying" <redacted>
Suggested-by: osalvador <osalvador@suse.de> [optional parameter]
Reviewed-by: Yang Shi <redacted>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Wei Xu <weixugc@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Dan Williams <redacted>
Cc: David Hildenbrand <redacted>

--

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 [off-list ref]

—
Best Regards,
Yan, Zi

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help