All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: benh@kernel.crashing.org, yinghai@kernel.org, hpa@zytor.com,
	tony.luck@intel.com, ralf@linux-mips.org, schwidefsky@de.ibm.com,
	liqin.chen@sunplusct.com, lethal@linux-sh.org,
	davem@davemloft.net, linux-kernel@vger.kernel.org,
	linux-arch@vger.kernel.org, mingo@redhat.com, jonas@southpole.se,
	lennox.wu@gmail.com
Cc: Tejun Heo <tj@kernel.org>
Subject: [PATCH 05/23] memblock: Kill sentinel entries at the end of static region arrays
Date: Mon, 28 Nov 2011 11:31:07 -0800	[thread overview]
Message-ID: <1322508685-32532-6-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1322508685-32532-1-git-send-email-tj@kernel.org>

memblock no longer depends on having one more entry at the end during
addition making the sentinel entries at the end of region arrays not
too useful.  Remove the sentinels.  This eases further updates.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Yinghai Lu <yinghai@kernel.org>
---
 include/linux/poison.h |    6 ------
 mm/memblock.c          |   14 ++------------
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/include/linux/poison.h b/include/linux/poison.h
index 79159de..2110a81 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -40,12 +40,6 @@
 #define	RED_INACTIVE	0x09F911029D74E35BULL	/* when obj is inactive */
 #define	RED_ACTIVE	0xD84156C5635688C0ULL	/* when obj is active */
 
-#ifdef CONFIG_PHYS_ADDR_T_64BIT
-#define MEMBLOCK_INACTIVE	0x3a84fb0144c9e71bULL
-#else
-#define MEMBLOCK_INACTIVE	0x44c9e71bUL
-#endif
-
 #define SLUB_RED_INACTIVE	0xbb
 #define SLUB_RED_ACTIVE		0xcc
 
diff --git a/mm/memblock.c b/mm/memblock.c
index 4b80f6f..e808df8 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -24,8 +24,8 @@ struct memblock memblock __initdata_memblock;
 
 int memblock_debug __initdata_memblock;
 int memblock_can_resize __initdata_memblock;
-static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS + 1] __initdata_memblock;
-static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS + 1] __initdata_memblock;
+static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock;
+static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock;
 
 /* inline so we don't get a warning when pr_debug is compiled out */
 static inline const char *memblock_type_name(struct memblock_type *type)
@@ -911,12 +911,6 @@ void __init memblock_analyze(void)
 {
 	int i;
 
-	/* Check marker in the unused last array entry */
-	WARN_ON(memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS].base
-		!= MEMBLOCK_INACTIVE);
-	WARN_ON(memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS].base
-		!= MEMBLOCK_INACTIVE);
-
 	memblock.memory_size = 0;
 
 	for (i = 0; i < memblock.memory.cnt; i++)
@@ -940,10 +934,6 @@ void __init memblock_init(void)
 	memblock.reserved.regions	= memblock_reserved_init_regions;
 	memblock.reserved.max	= INIT_MEMBLOCK_REGIONS;
 
-	/* Write a marker in the unused last array entry */
-	memblock.memory.regions[INIT_MEMBLOCK_REGIONS].base = MEMBLOCK_INACTIVE;
-	memblock.reserved.regions[INIT_MEMBLOCK_REGIONS].base = MEMBLOCK_INACTIVE;
-
 	/* Create a dummy zero size MEMBLOCK which will get coalesced away later.
 	 * This simplifies the memblock_add() code below...
 	 */
-- 
1.7.3.1


  parent reply	other threads:[~2011-11-28 19:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28 19:31 [PATCHSET tip:x86/memblock] memblock: Kill early_node_map[], take 2 Tejun Heo
2011-11-28 19:31 ` [PATCH 01/23] memblock: Fix include breakages caused by 24aa07882b Tejun Heo
2011-11-28 19:31 ` [PATCH 02/23] memblock: Make memblock_{add|remove|free|reserve}() return int and update prototypes Tejun Heo
2011-11-28 19:31 ` [PATCH 03/23] memblock: Use memblock_reserve() in memblock internal functions Tejun Heo
2011-11-28 19:31 ` [PATCH 04/23] memblock: Add __memblock_dump_all() Tejun Heo
2011-11-28 19:31 ` Tejun Heo [this message]
2011-11-28 19:31 ` [PATCH 06/23] memblock: Kill memblock_init() Tejun Heo
2011-11-28 19:31 ` [PATCH 07/23] memblock: Separate out memblock_isolate_range() from memblock_set_node() Tejun Heo
2011-11-28 19:31 ` [PATCH 08/23] memblock: Reimplement __memblock_remove() using memblock_isolate_range() Tejun Heo
2011-11-28 19:31 ` [PATCH 09/23] memblock: Make memblock functions handle overflowing range @size Tejun Heo
2011-11-28 19:31 ` [PATCH 10/23] memblock: Reimplement memblock_enforce_memory_limit() using __memblock_remove() Tejun Heo
2011-11-28 19:31 ` [PATCH 11/23] powerpc: Cleanup memblock usage Tejun Heo
2011-11-28 19:31 ` [PATCH 12/23] memblock: Track total size of regions automatically Tejun Heo
2011-11-28 19:31 ` [PATCH 13/23] memblock: s/memblock_analyze()/memblock_allow_resize()/ and update users Tejun Heo
2011-11-28 19:31 ` [PATCH 14/23] memblock: Implement memblock_add_node() Tejun Heo
2011-11-28 19:31 ` [PATCH 15/23] powerpc: Use HAVE_MEMBLOCK_NODE_MAP Tejun Heo
2011-11-28 19:31 ` [PATCH 16/23] sparc: " Tejun Heo
2011-11-28 19:31   ` Tejun Heo
2011-11-28 19:31 ` [PATCH 17/23] SuperH: " Tejun Heo
2011-11-28 19:31   ` Tejun Heo
2011-11-28 19:31 ` [PATCH 18/23] ia64: " Tejun Heo
2011-11-28 19:31   ` Tejun Heo
2011-11-28 19:31 ` [PATCH 19/23] mips: " Tejun Heo
2011-12-08 16:19   ` Ralf Baechle
2011-11-28 19:31 ` [PATCH 20/23] s390: " Tejun Heo
2011-11-28 19:31 ` [PATCH 21/23] score: " Tejun Heo
2011-11-28 19:31 ` [PATCH 22/23] memblock: Kill early_node_map[] Tejun Heo
2011-11-28 19:31 ` [PATCH 23/23] memblock: Reimplement memblock allocation using reverse free area iterator Tejun Heo
2011-12-05 16:31 ` [PATCHSET tip:x86/memblock] memblock: Kill early_node_map[], take 2 Ingo Molnar
2011-12-05 17:12   ` Tejun Heo
2011-12-05 17:26     ` Ingo Molnar
2011-12-05 20:26   ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2011-07-26 15:35 [PATCHSET tip:x86/memblock] memblock: Kill early_node_map[] Tejun Heo
2011-07-26 15:35 ` [PATCH 05/23] memblock: Kill sentinel entries at the end of static region arrays Tejun Heo
2011-07-26 15:35   ` Tejun Heo

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=1322508685-32532-6-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=hpa@zytor.com \
    --cc=jonas@southpole.se \
    --cc=lennox.wu@gmail.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liqin.chen@sunplusct.com \
    --cc=mingo@redhat.com \
    --cc=ralf@linux-mips.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=tony.luck@intel.com \
    --cc=yinghai@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.