Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1667513

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

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 11/14] mm, memory_hotplug: do not associate hotadded memory to zones until online
Date 2017-06-16 10:10 +0200
Message-ID <tSUum-5Te-17@gated-at.bofh.it> (permalink)
References <tHk1b-5NW-9@gated-at.bofh.it> <tHkaU-67d-71@gated-at.bofh.it> <tSR3r-3AU-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 11/14] mm, memory_hotplug: do not associate hotadded  memory to zones until online Wei Yang <richard.weiyang@gmail.com> - 2017-06-16 06:30 +0200
  Re: [PATCH 11/14] mm, memory_hotplug: do not associate hotadded  memory to zones until online Michal Hocko <mhocko@kernel.org> - 2017-06-16 10:10 +0200

csiph-web