lkml.org 
[lkml]   [2020]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/2] mm,thp,compaction,cma: allow THP migration for CMA allocations
From
Date
On 2/28/20 3:32 PM, Rik van Riel wrote:

>>> Does that need to be the following, then?
>>>
>>> if (PageTransHuge(head) && !PageHuge(page) && !PageLRU(head)
>>> &&
>>> !__PageMovable(head))
>>> return page;
>>
>> I would instead make it an "else if" to the "if (PageHuge(page)...)"
>> above.
>
> That was my first thought too, but that could break on
> pages that are PageHuge when hugepage_migration_supported
> returns true.

Right, so then

if (PageHuge()) {
if (!migration_supported) return false;
} else if (!PageLRU(head) ...) {
etc...

IMHO it's better than adding more tests to the second if.

\
 
 \ /
  Last update: 2020-02-28 15:41    [W:0.040 / U:6.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site