lkml.org 
[lkml]   [2018]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm, page_alloc: Fix has_unmovable_pages for HugePages
On Thu, Dec 20, 2018 at 01:49:28PM +0100, Oscar Salvador wrote:
>On Thu, Dec 20, 2018 at 10:12:28AM +0100, Michal Hocko wrote:
>> > <--
>> > skip_pages = (1 << compound_order(head)) - (page - head);
>> > iter = skip_pages - 1;
>> > --
>> >
>> > which looks more simple IMHO.
>>
>> Agreed!
>
>Andrew, can you please apply the next diff chunk on top of the patch:
>
>diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>index 4812287e56a0..978576d93783 100644
>--- a/mm/page_alloc.c
>+++ b/mm/page_alloc.c
>@@ -8094,7 +8094,7 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
> goto unmovable;
>
> skip_pages = (1 << compound_order(head)) - (page - head);
>- iter = round_up(iter + 1, skip_pages) - 1;
>+ iter = skip_pages - 1;

This complicated the calculation.

The original code is correct.

iter = round_up(iter + 1, 1<<compound_order(head)) - 1;

> continue;
> }
>
>Thanks!
>--
>Oscar Salvador
>SUSE L3

--
Wei Yang
Help you, Help me

\
 
 \ /
  Last update: 2018-12-20 14:10    [W:0.069 / U:29.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site