lkml.org 
[lkml]   [2021]   [Mar]   [17]   [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 Wed 17-03-21 12:12:50, Oscar Salvador wrote:
    > alloc_contig_range() will fail if it finds a HugeTLB page within the range,
    > without a chance to handle them. Since HugeTLB pages can be migrated as any
    > LRU or Movable page, it does not make sense to bail out without trying.
    > Enable the interface to recognize in-use HugeTLB pages so we can migrate
    > them, and have much better chances to succeed the call.
    >
    > Signed-off-by: Oscar Salvador <osalvador@suse.de>
    > Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

    Acked-by: Michal Hocko <mhocko@suse.com>

    I am still not entirely happy about this
    > @@ -2347,7 +2351,19 @@ int isolate_or_dissolve_huge_page(struct page *page)
    > if (hstate_is_gigantic(h))
    > return -ENOMEM;
    >
    > - return alloc_and_dissolve_huge_page(h, head);
    > +retry:
    > + if (page_count(head) && isolate_huge_page(head, list)) {
    > + ret = 0;
    > + } else if (!page_count(head)) {
    > + ret = alloc_and_dissolve_huge_page(h, head);
    > +
    > + if (ret == -EBUSY && try_again) {
    > + try_again = false;
    > + goto retry;
    > + }
    > + }
    > +
    > + return ret;
    > }

    it would be imho better to retry inside alloc_and_dissolve_huge_page
    because it already has its retry logic implemented.

    But not something I will insist on.

    --
    Michal Hocko
    SUSE Labs

    \
     
     \ /
      Last update: 2021-03-17 15:29    [W:4.155 / U:0.124 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site