Re: [v2 PATCH] mm: move_pages: return valid node id in status if the page is already on the target node

From: John Hubbard
Date: Thu Dec 05 2019 - 00:53:29 EST


On 12/4/19 9:44 PM, John Hubbard wrote:
...ÂÂÂÂÂÂÂÂÂÂ */

Let's change the comment above add_page_for_migration(), to read:

ÂÂÂÂÂÂÂ /*
ÂÂÂÂÂÂÂÂ * Most errors in the page lookup or isolation are not fatal
ÂÂÂÂÂÂÂÂ * and we simply report them via the status array. However,
ÂÂÂÂÂÂÂÂ * positive error values are fatal.
ÂÂÂÂÂÂÂÂ */


ÂÂÂÂÂÂÂÂÂ err = add_page_for_migration(mm, addr, current_node,
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ &pagelist, flags & MPOL_MF_MOVE_ALL);
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ &pagelist, flags & MPOL_MF_MOVE_ALL, status,
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ i);
+
ÂÂÂÂÂÂÂÂÂ if (!err)
ÂÂÂÂÂÂÂÂÂÂÂÂÂ continue;
+ÂÂÂÂÂÂÂ /* store_status() failed in add_page_for_migration() */

...and let's replace the above line, with the following:


Correction, I experienced a fatal editor copy-paste mistake here. :) I meant to
suggest this:

/*
* add_page_for_migration() experienced a fatal failure (see the
* comments in that routine for details).
*/



+ÂÂÂÂÂÂÂ if (err > 0) {
+ÂÂÂÂÂÂÂÂÂÂÂ err = -EFAULT;
+ÂÂÂÂÂÂÂÂÂÂÂ goto out_flush;
+ÂÂÂÂÂÂÂ }
+
ÂÂÂÂÂÂÂÂÂ err = store_status(status, i, err, 1);
ÂÂÂÂÂÂÂÂÂ if (err)
ÂÂÂÂÂÂÂÂÂÂÂÂÂ goto out_flush;


thanks,
--
John Hubbard
NVIDIA