[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190705091114.GG8231@dhcp22.suse.cz>
Date: Fri, 5 Jul 2019 11:11:14 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Anshuman Khandual <anshuman.khandual@....com>
Cc: linux-mm@...ck.org, Oscar Salvador <osalvador@...e.de>,
Qian Cai <cai@....pw>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/isolate: Drop pre-validating migrate type in
undo_isolate_page_range()
On Fri 05-07-19 11:42:41, Anshuman Khandual wrote:
> unset_migratetype_isolate() already validates under zone lock that a given
> page has already been isolated as MIGRATE_ISOLATE. There is no need for
> another check before. Hence just drop this redundant validation.
unset_migratetype_isolate take zone lock and it is always preferable to
skip not take this lock if we know it would be pointless. Besides that
undo_isolate_page_range is a slow path so a nano optimizing it is not
worth it.
> Cc: Oscar Salvador <osalvador@...e.de>
> Cc: Michal Hocko <mhocko@...e.com>
> Cc: Qian Cai <cai@....pw>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: linux-mm@...ck.org
> Cc: linux-kernel@...r.kernel.org
>
> Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>
> ---
> Is there any particular reason to do this migratetype pre-check without zone
> lock before calling unsert_migrate_isolate() ? If not this should be removed.
>
> mm/page_isolation.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
> index e3638a5bafff..f529d250c8a5 100644
> --- a/mm/page_isolation.c
> +++ b/mm/page_isolation.c
> @@ -243,7 +243,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 || !is_migrate_isolate_page(page))
> + if (!page)
> continue;
> unset_migratetype_isolate(page, migratetype);
> }
> --
> 2.20.1
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists