[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190129073332.GB18811@dhcp22.suse.cz>
Date: Tue, 29 Jan 2019 08:33:32 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Oscar Salvador <osalvador@...e.de>,
David Hildenbrand <david@...hat.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm,memory_hotplug: Fix scan_movable_pages for gigantic
hugepages
On Mon 28-01-19 14:56:17, Andrew Morton wrote:
[...]
> --- a/mm/memory_hotplug.c~mmmemory_hotplug-fix-scan_movable_pages-for-gigantic-hugepages-fix
> +++ a/mm/memory_hotplug.c
> @@ -1305,28 +1305,27 @@ int test_pages_in_a_zone(unsigned long s
> static unsigned long scan_movable_pages(unsigned long start, unsigned long end)
> {
> unsigned long pfn;
> - struct page *page;
> +
> for (pfn = start; pfn < end; pfn++) {
> - if (pfn_valid(pfn)) {
> - page = pfn_to_page(pfn);
> - if (PageLRU(page))
> - return pfn;
> - if (__PageMovable(page))
> - return pfn;
> - if (PageHuge(page)) {
> - struct page *head = compound_head(page);
> + struct page *page, *head;
> + unsigned long skip;
>
> - if (hugepage_migration_supported(page_hstate(head)) &&
> - page_huge_active(head))
> - return pfn;
> - else {
> - unsigned long skip;
> + if (!pfn_valid(pfn))
> + continue;
> + page = pfn_to_page(pfn);
> + if (PageLRU(page))
> + return pfn;
> + if (__PageMovable(page))
> + return pfn;
>
> - skip = (1 << compound_order(head)) - (page - head);
> - pfn += skip - 1;
> - }
> - }
> - }
> + if (!PageHuge(page))
> + continue;
> + head = compound_head(page);
> + if (hugepage_migration_supported(page_hstate(head)) &&
> + page_huge_active(head))
> + return pfn;
> + skip = (1 << compound_order(head)) - (page - head);
> + pfn += skip - 1;
> }
> return 0;
> }
> _
>
LGTM
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists