Thread (21 messages) 21 messages, 4 authors, 2021-01-13

Re: [External] Re: [PATCH v4 1/6] mm: migrate: do not migrate HugeTLB page whose refcount is one

From: Muchun Song <hidden>
Date: 2021-01-13 11:04:58
Also in: lkml

On Wed, Jan 13, 2021 at 6:57 PM Oscar Salvador [off-list ref] wrote:
On Wed, Jan 13, 2021 at 01:22:04PM +0800, Muchun Song wrote:
quoted
diff --git a/mm/migrate.c b/mm/migrate.c
index 4385f2fb5d18..a6631c4eb6a6 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1279,6 +1279,12 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
              return -ENOSYS;
      }

+     if (page_count(hpage) == 1) {
+             /* page was freed from under us. So we are done. */
+             putback_active_hugepage(hpage);
+             return MIGRATEPAGE_SUCCESS;
+     }
+
I was a bit puzzled as why we did not go to the "goto" block that already does
this, but then I saw the put_new_page/new_hpage handlind further down.
It could be re-arranged but out of scope, so:
Agree. I also thought about this. :)
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Thanks.
--
Oscar Salvador
SUSE L3
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help