diff mbox

回复:[PATCH v1 1/2] mm: fix race on soft-offlining free huge pages

Message ID cd929d16-b167-4775-8686-df21fa7f583f.xishi.qiuxishi@alibaba-inc.com (mailing list archive)
State New, archived
Headers show

Commit Message

=?UTF-8?B?6KOY56iA55+zKOeogOefsyk=?= July 13, 2018, 5:28 a.m. UTC
Sorry, I missed patch 2/2, it already changed.



Hi Naoya,

Shall we change the return value in soft_offline_free_page()?

 If we still return void in offline free pages no matter it success 
or fail later. echo xxx > soft_offline_pages, return 0, success, 
but the number of "cat /proc/meminfo | grep HardwareCorrupted"
is not  increased, this makes confusion for users.

Thanks,
Xishi Qiu

...
 static void soft_offline_free_page(struct page *page) {
+ int rc = 0;
  struct page *head = compound_head(page);

- if (!TestSetPageHWPoison(head)) {
+ if (PageHuge(head))
+  rc = dissolve_free_huge_page(page);
+ if (!rc && !TestSetPageHWPoison(page))
   num_poisoned_pages_inc();
-  if (PageHuge(head))
-   dissolve_free_huge_page(page);
- }
 }

 /**
diff mbox

Patch

diff --git v4.18-rc4-mmotm-2018-07-10-16-50/mm/migrate.c v4.18-rc4-mmotm-2018-07-10-16-50_patched/mm/migrate.c
index 198af42..3ae213b 100644
--- v4.18-rc4-mmotm-2018-07-10-16-50/mm/migrate.c
+++ v4.18-rc4-mmotm-2018-07-10-16-50_patched/mm/migrate.c
@@ -1318,8 +1318,6 @@  static int unmap_and_move_huge_page(new_page_t get_new_page,
 out:
  if (rc != -EAGAIN)
   putback_active_hugepage(hpage);
- if (reason == MR_MEMORY_FAILURE && !test_set_page_hwpoison(hpage))
-  num_poisoned_pages_inc();

  /*
   * If migration was not successful and there's a freeing callback, use