lkml.org 
[lkml]   [2021]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 2/3] hugetlb: convert page_huge_active() to HPageMigratable flag
On Fri, Jan 15, 2021 at 09:43:36AM -0800, Mike Kravetz wrote:
> > Before the page_huge_active() in scan_movable_pages() we have the
> > if (!PageHuge(page)) check, but could it be that between that check and
> > the page_huge_active(), the page gets dissolved, and so we are checking
> > a wrong page[1]? Am I making sense?
>
> Yes, you are making sense.
>
> The reason I decided to drop the check is because it does not eliminate the
> race. Even with that check in page_huge_active, the page could be dissolved
> between that check and check of page[1]. There really is no way to eliminate
> the race without holding a reference to the page (or hugetlb_lock). That
> check in page_huge_active just shortens the race window.

Yeah, you are right, the race already exists.
Anyway, do_migrate_range should take care of making sure what it is
handling, so I think we are good.

--
Oscar Salvador
SUSE L3

\
 
 \ /
  Last update: 2021-01-15 21:39    [W:0.083 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site