lkml.org 
[lkml]   [2017]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] mm: use is_migrate_isolate_page() to simplify the code
On Fri 03-03-17 19:12:49, Xishi Qiu wrote:
> Use is_migrate_isolate_page() to simplify the code, no functional changes.
>
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
> mm/page_isolation.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
> index f4e17a5..7927bbb 100644
> --- a/mm/page_isolation.c
> +++ b/mm/page_isolation.c
> @@ -88,7 +88,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
>
> zone = page_zone(page);
> spin_lock_irqsave(&zone->lock, flags);
> - if (get_pageblock_migratetype(page) != MIGRATE_ISOLATE)
> + if (!is_migrate_isolate_page(page))
> goto out;
>
> /*
> @@ -205,7 +205,7 @@ int undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
> pfn < end_pfn;
> pfn += pageblock_nr_pages) {
> page = __first_valid_page(pfn, pageblock_nr_pages);
> - if (!page || get_pageblock_migratetype(page) != MIGRATE_ISOLATE)
> + if (!page || !is_migrate_isolate_page(page))
> continue;
> unset_migratetype_isolate(page, migratetype);
> }
> @@ -262,7 +262,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
> */
> for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
> page = __first_valid_page(pfn, pageblock_nr_pages);
> - if (page && get_pageblock_migratetype(page) != MIGRATE_ISOLATE)
> + if (page && !is_migrate_isolate_page(page))
> break;
> }
> page = __first_valid_page(start_pfn, end_pfn - start_pfn);
> --
> 1.8.3.1
>

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2017-03-03 14:20    [W:0.067 / U:1.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site