Re: [PATCH 11/14] mm, memory_hotplug: do not associate hotadded memory to zones until online

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux