lkml.org 
[lkml]   [2021]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 3/6] mm: hugetlb: fix a race between freeing and dissolving the page
On Sun 10-01-21 20:40:14, Muchun Song wrote:
[...]
> @@ -1770,6 +1788,14 @@ int dissolve_free_huge_page(struct page *page)
> int nid = page_to_nid(head);
> if (h->free_huge_pages - h->resv_huge_pages == 0)
> goto out;
> +
> + /*
> + * We should make sure that the page is already on the free list
> + * when it is dissolved.
> + */
> + if (unlikely(!PageHugeFreed(head)))
> + goto out;
> +

Do you really want to report EBUSY in this case? This doesn't make much
sense to me TBH. I believe you want to return 0 same as when you race
and the page is no longer PageHuge.

> /*
> * Move PageHWPoison flag from head page to the raw error page,
> * which makes any subpages rather than the error page reusable.
> --
> 2.11.0

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2021-01-12 11:03    [W:0.137 / U:0.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site