The patch titled Subject: mm-hugetlb-soft-offline-dissolve_free_huge_page-return-zero-on-pagehuge-v3 has been added to the -mm tree. Its filename is mm-hugetlb-soft-offline-dissolve_free_huge_page-return-zero-on-pagehuge-v3.patch
This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-hugetlb-soft-offline-dissolve_fr... and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-hugetlb-soft-offline-dissolve_fr...
Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------ From: Naoya Horiguchi n-horiguchi@ah.jp.nec.com Subject: mm-hugetlb-soft-offline-dissolve_free_huge_page-return-zero-on-pagehuge-v3
- add PageHuge check in dissolve_free_huge_page() outside hugetlb_lock - update comment on dissolve_free_huge_page() about return value
Link: http://lkml.kernel.org/r/1560761476-4651-3-git-send-email-n-horiguchi@ah.jp.... Reported-by: Chen, Jerry T jerry.t.chen@intel.com Tested-by: Chen, Jerry T jerry.t.chen@intel.com Signed-off-by: Naoya Horiguchi n-horiguchi@ah.jp.nec.com Fixes: 6bc9b56433b76 ("mm: fix race on soft-offlining") Cc: Michal Hocko mhocko@kernel.org Cc: Mike Kravetz mike.kravetz@oracle.com Cc: Xishi Qiu xishi.qiuxishi@alibaba-inc.com Cc: "Chen, Jerry T" jerry.t.chen@intel.com Cc: "Zhuo, Qiuxu" qiuxu.zhuo@intel.com Cc: stable@vger.kernel.org [4.19+] Signed-off-by: Andrew Morton akpm@linux-foundation.org ---
mm/hugetlb.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
--- a/mm/hugetlb.c~mm-hugetlb-soft-offline-dissolve_free_huge_page-return-zero-on-pagehuge-v3 +++ a/mm/hugetlb.c @@ -1510,14 +1510,22 @@ static int free_pool_huge_page(struct hs
/* * Dissolve a given free hugepage into free buddy pages. This function does - * nothing for in-use (including surplus) hugepages. Returns -EBUSY if the - * dissolution fails because a give page is not a free hugepage, or because - * free hugepages are fully reserved. + * nothing for in-use hugepages and non-hugepages. + * This function returns values like below: + * + * -EBUSY: failed to dissolved free hugepages or the hugepage is in-use + * (allocated or reserved.) + * 0: successfully dissolved free hugepages or the page is not a + * hugepage (considered as already dissolved) */ int dissolve_free_huge_page(struct page *page) { int rc = -EBUSY;
+ /* Not to disrupt normal path by vainly holding hugetlb_lock */ + if (!PageHuge(page)) + return 0; + spin_lock(&hugetlb_lock); if (!PageHuge(page)) { rc = 0; _
Patches currently in -mm which might be from n-horiguchi@ah.jp.nec.com are
mm-soft-offline-return-ebusy-if-set_hwpoison_free_buddy_page-fails.patch mm-hugetlb-soft-offline-dissolve_free_huge_page-return-zero-on-pagehuge.patch mm-hugetlb-soft-offline-dissolve_free_huge_page-return-zero-on-pagehuge-v3.patch