lkml.org 
[lkml]   [2021]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v5 4/5] mm: Make alloc_contig_range handle in-use hugetlb pages
    On Thu 18-03-21 09:54:01, Oscar Salvador wrote:
    [...]
    > @@ -2287,10 +2288,12 @@ static int alloc_and_dissolve_huge_page(struct hstate *h, struct page *old_page)
    > goto unlock;
    > } else if (page_count(old_page)) {
    > /*
    > - * Someone has grabbed the page, fail for now.
    > + * Someone has grabbed the page, try to isolate it here.
    > + * Fail with -EBUSY if not possible.
    > */
    > - ret = -EBUSY;
    > update_and_free_page(h, new_page);
    > + if (!isolate_huge_page(old_page, list)
    > + ret = -EBUSY;
    > goto unlock;
    > } else if (!HPageFreed(old_page)) {

    I do not think you want to call isolate_huge_page with hugetlb_lock
    held. You would need to drop the lock before calling isolate_huge_page.
    --
    Michal Hocko
    SUSE Labs

    \
     
     \ /
      Last update: 2021-03-18 10:31    [W:2.963 / U:0.244 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site