lkml.org 
[lkml]   [2021]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/2] mm: Make alloc_contig_range handle in-use hugetlb pages
On Mon 22-02-21 14:51:37, Oscar Salvador wrote:
[...]
> @@ -2394,9 +2397,19 @@ bool isolate_or_dissolve_huge_page(struct page *page)
> */
> if (hstate_is_gigantic(h))
> return ret;
> -
> - if (!page_count(head) && alloc_and_dissolve_huge_page(h, head))
> +retry:
> + if (page_count(head) && isolate_huge_page(head, list)) {
> ret = true;
> + } else if (!page_count(head)) {

This is rather head spinning. Do we need to test page_count in the else
branch? Do you want to optimize for a case where the page cannot be
isolated because of page_huge_active?

> + int err = alloc_and_dissolve_huge_page(h, head);
> +
> + if (!err) {
> + ret = true;
> + } else if (err == -EBUSY && try_again) {
> + try_again = false;
> + goto retry;
> + }

Is this retry once logic really needed? Does it really give us any real
benefit? alloc_and_dissolve_huge_page already retries when the page is
being freed.

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2021-02-26 09:49    [W:0.179 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site