From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by kanga.kvack.org (Postfix) with ESMTP id 84C9790001D for ; Tue, 11 Nov 2014 21:03:03 -0500 (EST) Received: by mail-pa0-f45.google.com with SMTP id lf10so11885795pab.32 for ; Tue, 11 Nov 2014 18:03:03 -0800 (PST) Received: from fgwmail5.fujitsu.co.jp (fgwmail5.fujitsu.co.jp. [192.51.44.35]) by mx.google.com with ESMTPS id je2si7810786pbd.0.2014.11.11.18.03.01 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Nov 2014 18:03:02 -0800 (PST) Received: from kw-mxq.gw.nic.fujitsu.com (unknown [10.0.237.131]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 7AE543EE1E0 for ; Wed, 12 Nov 2014 11:03:00 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by kw-mxq.gw.nic.fujitsu.com (Postfix) with ESMTP id 5A251AC061C for ; Wed, 12 Nov 2014 11:02:59 +0900 (JST) Received: from g01jpfmpwkw03.exch.g01.fujitsu.local (g01jpfmpwkw03.exch.g01.fujitsu.local [10.0.193.57]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id ED8C61DB8045 for ; Wed, 12 Nov 2014 11:02:58 +0900 (JST) Message-ID: <5462BFBA.4010207@jp.fujitsu.com> Date: Wed, 12 Nov 2014 11:02:34 +0900 From: Yasuaki Ishimatsu MIME-Version: 1.0 Subject: Re: [PATCH 1/2] mm: page_isolation: check pfn validity before access References: <000001cff998$ee0b31d0$ca219570$%yang@samsung.com> In-Reply-To: <000001cff998$ee0b31d0$ca219570$%yang@samsung.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Weijie Yang Cc: kamezawa.hiroyu@jp.fujitsu.com, 'Minchan Kim' , 'Andrew Morton' , mgorman@suse.de, mina86@mina86.com, 'linux-kernel' , 'Linux-MM' , 'Weijie Yang' (2014/11/06 17:08), Weijie Yang wrote: > In the undo path of start_isolate_page_range(), we need to check > the pfn validity before access its page, or it will trigger an > addressing exception if there is hole in the zone. > > Signed-off-by: Weijie Yang > --- Looks good to me. Reviewed-by: Yasuaki Ishimatsu Thanks, Yasuaki Ishimatsu > mm/page_isolation.c | 7 +++++-- > 1 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/mm/page_isolation.c b/mm/page_isolation.c > index d1473b2..3ddc8b3 100644 > --- a/mm/page_isolation.c > +++ b/mm/page_isolation.c > @@ -137,8 +137,11 @@ int start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, > undo: > for (pfn = start_pfn; > pfn < undo_pfn; > - pfn += pageblock_nr_pages) > - unset_migratetype_isolate(pfn_to_page(pfn), migratetype); > + pfn += pageblock_nr_pages) { > + page = __first_valid_page(pfn, pageblock_nr_pages); > + if (page) > + unset_migratetype_isolate(page, migratetype); > + } > > return -EBUSY; > } > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org