[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170616080502.GA30580@dhcp22.suse.cz>
Date: Fri, 16 Jun 2017 10:05:02 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Wei Yang <richard.weiyang@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
Mel Gorman <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
Andrea Arcangeli <aarcange@...hat.com>,
Jerome Glisse <jglisse@...hat.com>,
Reza Arbab <arbab@...ux.vnet.ibm.com>,
Yasuaki Ishimatsu <yasu.isimatu@...il.com>,
qiuxishi@...wei.com, Kani Toshimitsu <toshi.kani@....com>,
slaoub@...il.com, Joonsoo Kim <js1304@...il.com>,
Andi Kleen <ak@...ux.intel.com>,
David Rientjes <rientjes@...gle.com>,
Daniel Kiper <daniel.kiper@...cle.com>,
Igor Mammedov <imammedo@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Dan Williams <dan.j.williams@...el.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [PATCH 11/14] mm, memory_hotplug: do not associate hotadded
memory to zones until online
[Please try to trim the context you are replying to]
On Fri 16-06-17 12:20:58, Wei Yang wrote:
> On Mon, May 15, 2017 at 10:58:24AM +0200, Michal Hocko wrote:
[...]
> > /*
> >+ * Return true if [start_pfn, start_pfn + nr_pages) range has a non-empty
> >+ * intersection with the given zone
> >+ */
> >+static inline bool zone_intersects(struct zone *zone,
> >+ unsigned long start_pfn, unsigned long nr_pages)
> >+{
> >+ if (zone_is_empty(zone))
> >+ return false;
> >+ if (start_pfn >= zone_end_pfn(zone))
> >+ return false;
> >+
> >+ if (zone->zone_start_pfn <= start_pfn)
> >+ return true;
> >+ if (start_pfn + nr_pages > zone->zone_start_pfn)
> >+ return true;
> >+
> >+ return false;
> >+}
>
> I think this could be simplified as:
>
> static inline bool zone_intersects(struct zone *zone,
> unsigned long start_pfn, unsigned long nr_pages)
> {
> if (zone_is_empty(zone))
> return false;
>
> if (start_pfn >= zone_end_pfn(zone) ||
> start_pfn + nr_pages <= zone->zone_start_pfn)
> return false;
>
> return true;
> }
Feel free to send a patch.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists