linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Cody P Schafer <cody@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>, Linux MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Cody P Schafer <cody@linux.vnet.ibm.com>,
	Simon Jeons <simon.jeons@gmail.com>
Subject: [RFC PATCH v2 05/25] mm/memory_hotplug: use {pgdat,zone}_is_empty() when resizing zones & pgdats
Date: Thu, 11 Apr 2013 18:13:37 -0700	[thread overview]
Message-ID: <1365729237-29711-6-git-send-email-cody@linux.vnet.ibm.com> (raw)
In-Reply-To: <1365729237-29711-1-git-send-email-cody@linux.vnet.ibm.com>

Use the *_is_empty() helpers to be more clear about what we're actually
checking for.

Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
---
 mm/memory_hotplug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index df04c36..deea8c2 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -242,7 +242,7 @@ static void grow_zone_span(struct zone *zone, unsigned long start_pfn,
 	zone_span_writelock(zone);
 
 	old_zone_end_pfn = zone->zone_start_pfn + zone->spanned_pages;
-	if (!zone->spanned_pages || start_pfn < zone->zone_start_pfn)
+	if (zone_is_empty(zone) || start_pfn < zone->zone_start_pfn)
 		zone->zone_start_pfn = start_pfn;
 
 	zone->spanned_pages = max(old_zone_end_pfn, end_pfn) -
@@ -383,7 +383,7 @@ static void grow_pgdat_span(struct pglist_data *pgdat, unsigned long start_pfn,
 	unsigned long old_pgdat_end_pfn =
 		pgdat->node_start_pfn + pgdat->node_spanned_pages;
 
-	if (!pgdat->node_spanned_pages || start_pfn < pgdat->node_start_pfn)
+	if (pgdat_is_empty(pgdat) || start_pfn < pgdat->node_start_pfn)
 		pgdat->node_start_pfn = start_pfn;
 
 	pgdat->node_spanned_pages = max(old_pgdat_end_pfn, end_pfn) -
-- 
1.8.2.1

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2013-04-12  1:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12  1:13 [RFC PATCH v2 00/25] Dynamic NUMA: Runtime NUMA memory layout reconfiguration Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 01/25] rbtree: add postorder iteration functions Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 02/25] rbtree: add rbtree_postorder_for_each_entry_safe() helper Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 03/25] mm/memory_hotplug: factor out zone+pgdat growth Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 04/25] memory_hotplug: export ensure_zone_is_initialized() in mm/internal.h Cody P Schafer
2013-04-12  1:13 ` Cody P Schafer [this message]
2013-04-12  1:13 ` [RFC PATCH v2 06/25] mm: add nid_zone() helper Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 07/25] page_alloc: add return_pages_to_zone() when DYNAMIC_NUMA is enabled Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 08/25] page_alloc: in move_freepages(), skip pages instead of VM_BUG on node differences Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 09/25] page_alloc: when dynamic numa is enabled, don't check that all pages in a block belong to the same zone Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 10/25] page-flags dnuma: reserve a pageflag for determining if a page needs a node lookup Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 11/25] memory_hotplug: factor out locks in mem_online_cpu() Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 12/25] mm: add memlayout & dnuma to track pfn->nid & transplant pages between nodes Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 13/25] mm: memlayout+dnuma: add debugfs interface Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 14/25] page_alloc: use dnuma to transplant newly freed pages in __free_pages_ok() Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 15/25] page_alloc: use dnuma to transplant newly freed pages in free_hot_cold_page() Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 16/25] page_alloc: transplant pages that are being flushed from the per-cpu lists Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 17/25] x86: memlayout: add a arch specific inital memlayout setter Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 18/25] init/main: call memlayout_global_init() in start_kernel() Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 19/25] dnuma: memlayout: add memory_add_physaddr_to_nid() for memory_hotplug Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 20/25] x86/mm/numa: when dnuma is enabled, use memlayout to handle memory hotplug's physaddr_to_nid Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 21/25] mm/memory_hotplug: VM_BUG if nid is too large Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 22/25] mm/page_alloc: in page_outside_zone_boundaries(), avoid premature decisions Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 23/25] mm/page_alloc: make pr_err() in page_outside_zone_boundaries() more useful Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 24/25] mm/page_alloc: use manage_pages instead of present pages when calculating default_zonelist_order() Cody P Schafer
2013-04-12  1:13 ` [RFC PATCH v2 25/25] mm: add a early_param "extra_nr_node_ids" to increase nr_node_ids above the minimum by a percentage Cody P Schafer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365729237-29711-6-git-send-email-cody@linux.vnet.ibm.com \
    --to=cody@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=simon.jeons@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).