Thread (19 messages) 19 messages, 5 authors, 2021-01-15

Re: [RFC PATCH 2/3] hugetlb: convert page_huge_active() to HPageMigratable flag

From: Oscar Salvador <osalvador@suse.de>
Date: 2021-01-15 20:38:49
Also in: lkml

On Fri, Jan 15, 2021 at 09:43:36AM -0800, Mike Kravetz wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help