From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
"Theodore Ts'o" <tytso@mit.edu>,
Randy Dunlap <rdunlap@xenotime.net>,
Dave Jones <davej@redhat.com>,
Chuck Wolber <chuckw@quantumlinux.com>,
Chris Wedgwood <reviews@ml.cw.f00f.org>,
Michael Krufky <mkrufky@linuxtv.org>,
Chuck Ebbert <cebbert@redhat.com>,
Domenico Andreoli <cavokz@gmail.com>, Willy Tarreau <w@1wt.eu>,
Rodrigo Rubira Branco <rbranco@la.checkpoint.com>,
Jake Edge <jake@lwn.net>, Eugene Teo <eteo@redhat.com>,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Mel Gorman <mel@csn.ul.ie>,
Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: [patch 14/96] mm: clean up for early_pfn_to_nid()
Date: Fri, 13 Mar 2009 17:05:22 -0700 [thread overview]
Message-ID: <20090314000740.790717520@mini.kroah.org> (raw)
In-Reply-To: <20090314001449.GA4485@kroah.com>
[-- Attachment #1: mm-clean-up-for-early_pfn_to_nid.patch --]
[-- Type: text/plain, Size: 6963 bytes --]
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
commit f2dbcfa738368c8a40d4a5f0b65dc9879577cb21 upstream.
What's happening is that the assertion in mm/page_alloc.c:move_freepages()
is triggering:
BUG_ON(page_zone(start_page) != page_zone(end_page));
Once I knew this is what was happening, I added some annotations:
if (unlikely(page_zone(start_page) != page_zone(end_page))) {
printk(KERN_ERR "move_freepages: Bogus zones: "
"start_page[%p] end_page[%p] zone[%p]\n",
start_page, end_page, zone);
printk(KERN_ERR "move_freepages: "
"start_zone[%p] end_zone[%p]\n",
page_zone(start_page), page_zone(end_page));
printk(KERN_ERR "move_freepages: "
"start_pfn[0x%lx] end_pfn[0x%lx]\n",
page_to_pfn(start_page), page_to_pfn(end_page));
printk(KERN_ERR "move_freepages: "
"start_nid[%d] end_nid[%d]\n",
page_to_nid(start_page), page_to_nid(end_page));
...
And here's what I got:
move_freepages: Bogus zones: start_page[2207d0000] end_page[2207dffc0] zone[fffff8103effcb00]
move_freepages: start_zone[fffff8103effcb00] end_zone[fffff8003fffeb00]
move_freepages: start_pfn[0x81f600] end_pfn[0x81f7ff]
move_freepages: start_nid[1] end_nid[0]
My memory layout on this box is:
[ 0.000000] Zone PFN ranges:
[ 0.000000] Normal 0x00000000 -> 0x0081ff5d
[ 0.000000] Movable zone start PFN for each node
[ 0.000000] early_node_map[8] active PFN ranges
[ 0.000000] 0: 0x00000000 -> 0x00020000
[ 0.000000] 1: 0x00800000 -> 0x0081f7ff
[ 0.000000] 1: 0x0081f800 -> 0x0081fe50
[ 0.000000] 1: 0x0081fed1 -> 0x0081fed8
[ 0.000000] 1: 0x0081feda -> 0x0081fedb
[ 0.000000] 1: 0x0081fedd -> 0x0081fee5
[ 0.000000] 1: 0x0081fee7 -> 0x0081ff51
[ 0.000000] 1: 0x0081ff59 -> 0x0081ff5d
So it's a block move in that 0x81f600-->0x81f7ff region which triggers
the problem.
This patch:
Declaration of early_pfn_to_nid() is scattered over per-arch include
files, and it seems it's complicated to know when the declaration is used.
I think it makes fix-for-memmap-init not easy.
This patch moves all declaration to include/linux/mm.h
After this,
if !CONFIG_NODES_POPULATES_NODE_MAP && !CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
-> Use static definition in include/linux/mm.h
else if !CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
-> Use generic definition in mm/page_alloc.c
else
-> per-arch back end function will be called.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reported-by: David Miller <davem@davemlloft.net>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/ia64/include/asm/mmzone.h | 4 ----
arch/ia64/mm/numa.c | 2 +-
arch/x86/mm/numa_64.c | 2 +-
include/asm-x86/mmzone_32.h | 2 --
include/asm-x86/mmzone_64.h | 2 --
include/linux/mm.h | 19 ++++++++++++++++---
mm/page_alloc.c | 8 +++++++-
7 files changed, 25 insertions(+), 14 deletions(-)
--- a/arch/ia64/include/asm/mmzone.h
+++ b/arch/ia64/include/asm/mmzone.h
@@ -31,10 +31,6 @@ static inline int pfn_to_nid(unsigned lo
#endif
}
-#ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
-extern int early_pfn_to_nid(unsigned long pfn);
-#endif
-
#ifdef CONFIG_IA64_DIG /* DIG systems are small */
# define MAX_PHYSNODE_ID 8
# define NR_NODE_MEMBLKS (MAX_NUMNODES * 8)
--- a/arch/ia64/mm/numa.c
+++ b/arch/ia64/mm/numa.c
@@ -58,7 +58,7 @@ paddr_to_nid(unsigned long paddr)
* SPARSEMEM to allocate the SPARSEMEM sectionmap on the NUMA node where
* the section resides.
*/
-int early_pfn_to_nid(unsigned long pfn)
+int __meminit __early_pfn_to_nid(unsigned long pfn)
{
int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec;
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -145,7 +145,7 @@ int __init compute_hash_shift(struct boo
return shift;
}
-int early_pfn_to_nid(unsigned long pfn)
+int __meminit __early_pfn_to_nid(unsigned long pfn)
{
return phys_to_nid(pfn << PAGE_SHIFT);
}
--- a/include/asm-x86/mmzone_32.h
+++ b/include/asm-x86/mmzone_32.h
@@ -32,8 +32,6 @@ static inline void get_memcfg_numa(void)
get_memcfg_numa_flat();
}
-extern int early_pfn_to_nid(unsigned long pfn);
-
extern void resume_map_numa_kva(pgd_t *pgd);
#else /* !CONFIG_NUMA */
--- a/include/asm-x86/mmzone_64.h
+++ b/include/asm-x86/mmzone_64.h
@@ -41,8 +41,6 @@ static inline __attribute__((pure)) int
#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \
NODE_DATA(nid)->node_spanned_pages)
-extern int early_pfn_to_nid(unsigned long pfn);
-
#ifdef CONFIG_NUMA_EMU
#define FAKE_NODE_MIN_SIZE (64 * 1024 * 1024)
#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1027,10 +1027,23 @@ extern void free_bootmem_with_active_reg
typedef int (*work_fn_t)(unsigned long, unsigned long, void *);
extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data);
extern void sparse_memory_present_with_active_regions(int nid);
-#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
-extern int early_pfn_to_nid(unsigned long pfn);
-#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
+
+#if !defined(CONFIG_ARCH_POPULATES_NODE_MAP) && \
+ !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID)
+static inline int __early_pfn_to_nid(unsigned long pfn)
+{
+ return 0;
+}
+#else
+/* please see mm/page_alloc.c */
+extern int __meminit early_pfn_to_nid(unsigned long pfn);
+#ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
+/* there is a per-arch backend function. */
+extern int __meminit __early_pfn_to_nid(unsigned long pfn);
+#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
+#endif
+
extern void set_dma_reserve(unsigned long new_dma_reserve);
extern void memmap_init_zone(unsigned long, int, unsigned long,
unsigned long, enum memmap_context);
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2949,7 +2949,7 @@ static int __meminit next_active_region_
* was used and there are no special requirements, this is a convenient
* alternative
*/
-int __meminit early_pfn_to_nid(unsigned long pfn)
+int __meminit __early_pfn_to_nid(unsigned long pfn)
{
int i;
@@ -2965,6 +2965,12 @@ int __meminit early_pfn_to_nid(unsigned
}
#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
+int __meminit early_pfn_to_nid(unsigned long pfn)
+{
+ return __early_pfn_to_nid(pfn);
+}
+
+
/* Basic iterator support to walk early_node_map[] */
#define for_each_active_range_index_in_nid(i, nid) \
for (i = first_active_region_index_in_nid(nid); i != -1; \
next prev parent reply other threads:[~2009-03-14 0:23 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090314000508.803142980@mini.kroah.org>
2009-03-14 0:14 ` [patch 00/96] 2.6.27.20-stable review Greg KH
2009-03-14 0:05 ` [patch 01/96] USB: net: asix: add support for Cables-to-Go USB Ethernet adapter Greg KH
2009-03-14 0:05 ` [patch 02/96] bridge: netfilter: fix update_pmtu crash with GRE Greg KH
2009-03-14 0:05 ` [patch 03/96] net: amend the fix for SO_BSDCOMPAT gsopt infoleak Greg KH
2009-03-14 0:05 ` [patch 04/96] net: Kill skb_truesize_check(), it only catches false-positives Greg KH
2009-03-14 0:05 ` [patch 05/96] sparc64: Fix DAX handling via userspace access from kernel Greg KH
2009-03-14 0:05 ` [patch 06/96] sparc: We need to implement arch_ptrace_stop() Greg KH
2009-03-14 0:05 ` [patch 07/96] documnt FMODE_ constants Greg KH
2009-03-14 12:46 ` Christoph Hellwig
2009-03-14 15:38 ` Greg KH
2009-03-14 19:18 ` Christoph Hellwig
2009-03-14 0:05 ` [patch 08/96] vfs: separate FMODE_PREAD/FMODE_PWRITE into separate flags Greg KH
2009-03-14 0:05 ` [patch 09/96] seq_file: properly cope with pread Greg KH
2009-03-14 0:05 ` [patch 10/96] vt: Declare PIO_CMAP/GIO_CMAP as compatbile ioctls Greg KH
2009-03-14 0:05 ` [patch 11/96] aoe: ignore vendor extension AoE responses Greg KH
2009-03-14 0:05 ` [patch 12/96] [CIFS] Fix oops in cifs_strfromUCS_le mounting to servers which do not specify their OS Greg KH
2009-03-14 0:05 ` [patch 13/96] JFFS2: fix mount crash caused by removed nodes Greg KH
[not found] ` <17cc26190905290126l8158b10t44ff0649feb5d7a9@mail.gmail.com>
2009-05-29 11:02 ` David Woodhouse
2009-03-14 0:05 ` Greg KH [this message]
2009-03-14 0:05 ` [patch 15/96] mm: fix memmap init for handling memory hole Greg KH
2009-03-14 0:05 ` [patch 16/96] PCI quirk: enable MSI on 8132 Greg KH
2009-03-14 0:05 ` [patch 17/96] rtl8187: New USB IDs for RTL8187L Greg KH
2009-03-14 0:05 ` [patch 18/96] SCSI: hptiop: Add new PCI device ID Greg KH
2009-03-14 0:05 ` [patch 19/96] SCSI: sd: revive sd_index_lock Greg KH
2009-03-14 0:05 ` [patch 20/96] timerfd: add flags check Greg KH
2009-03-14 0:05 ` [patch 21/96] USB: cdc-acm: add usb id for motomagx phones Greg KH
2009-03-14 0:05 ` [patch 22/96] USB: usb_get_string should check the descriptor type Greg KH
2009-03-14 0:05 ` [patch 23/96] USB: usb-storage: add IGNORE_RESIDUE flag for Genesys Logic adapters Greg KH
2009-03-14 0:05 ` [patch 24/96] WATCHDOG: ks8695_wdt.c: CLOCK_TICK_RATE undeclared Greg KH
2009-03-14 0:05 ` [patch 25/96] WATCHDOG: rc32434_wdt: fix watchdog driver Greg KH
2009-03-14 0:05 ` [patch 26/96] WATCHDOG: rc32434_wdt: fix sections Greg KH
2009-03-14 0:05 ` [patch 27/96] 8250: fix boot hang with serial console when using with Serial Over Lan port Greg KH
2009-03-14 0:05 ` [patch 28/96] ALSA: aw2: do not grab every saa7146 based device Greg KH
2009-03-14 0:05 ` [patch 29/96] ALSA: fix excessive background noise introduced by OSS emulation rate shrink Greg KH
2009-03-14 0:05 ` [patch 30/96] ALSA: hda - add another MacBook Pro 3,1 SSID Greg KH
2009-03-14 0:05 ` [patch 31/96] ALSA: usb-audio - Fix non-continuous rate detection Greg KH
2009-03-14 0:05 ` [patch 32/96] ALSA: usb-audio - Workaround for misdetected sample rate with CM6207 Greg KH
2009-03-14 0:05 ` [patch 33/96] asix: new device ids Greg KH
2009-03-14 0:05 ` [patch 34/96] cdc_ether: add usb id for Ericsson F3507g Greg KH
2009-03-14 0:05 ` [patch 35/96] copy_process: fix CLONE_PARENT && parent_exec_id interaction Greg KH
2009-03-14 0:05 ` [patch 36/96] Fix fixpoint divide exception in acct_update_integrals Greg KH
2009-03-14 0:05 ` [patch 37/96] fore200: fix oops on failed firmware load Greg KH
2009-03-14 0:05 ` [patch 38/96] fs: new inode i_state corruption fix Greg KH
2009-03-14 0:05 ` [patch 39/96] hpilo: new pci device Greg KH
2009-03-14 0:05 ` [patch 40/96] inotify: fix GFP_KERNEL related deadlock Greg KH
2009-03-14 0:05 ` [patch 41/96] intel-agp: fix a panic with 1M of shared memory, no GTT entries Greg KH
2009-03-14 0:05 ` [patch 42/96] jsm: additional device support Greg KH
2009-03-14 0:05 ` [patch 43/96] libata: Dont trust current capacity values in identify words 57-58 Greg KH
2009-03-14 0:05 ` [patch 44/96] libata: make sure port is thawed when skipping resets Greg KH
2009-03-14 0:05 ` [patch 45/96] md: avoid races when stopping resync Greg KH
2009-03-14 0:05 ` [patch 46/96] md/raid10: Dont call bitmap_cond_end_sync when we are doing recovery Greg KH
2009-03-14 0:05 ` [patch 47/96] md/raid10: Dont skip more than 1 bitmap-chunk at a time during recovery Greg KH
2009-03-14 0:05 ` [patch 48/96] mmc: s3cmci: fix s3c2410_dma_config() arguments Greg KH
2009-03-14 0:05 ` [patch 49/96] mmc_test: fix basic read test Greg KH
2009-03-14 0:05 ` [patch 50/96] mtd_dataflash: fix probing of AT45DB321C chips Greg KH
2009-03-14 0:05 ` [patch 51/96] PCI: Add PCI quirk to disable L0s ASPM state for 82575 and 82598 Greg KH
2009-03-14 0:06 ` [patch 52/96] PCI: dont enable too many HT MSI mappings Greg KH
2009-03-14 0:06 ` [patch 53/96] PCI: Enable PCIe AER only after checking firmware support Greg KH
2009-03-14 0:06 ` [patch 54/96] PCIe: portdrv: call pci_disable_device during remove Greg KH
2009-03-14 0:06 ` [patch 55/96] powerpc: Fix load/store float double alignment handler Greg KH
2009-03-14 0:06 ` [patch 56/96] proc: fix kflags to uflags copying in /proc/kpageflags Greg KH
2009-03-14 0:06 ` [patch 57/96] proc: fix PG_locked reporting " Greg KH
2009-03-14 0:06 ` [patch 58/96] RDMA/nes: Dont allow userspace QPs to use STag zero Greg KH
2009-03-14 0:06 ` [patch 59/96] sdhci: fix led naming Greg KH
2009-03-14 0:06 ` [patch 60/96] selinux: Fix a panic in selinux_netlbl_inode_permission() Greg KH
2009-03-14 0:06 ` [patch 61/96] selinux: Fix the NetLabel glue code for setsockopt() Greg KH
2009-03-14 0:06 ` [patch 62/96] sis190: add identifier for Atheros AR8021 PHY Greg KH
2009-03-14 0:06 ` [patch 63/96] sound: usb-audio: fix uninitialized variable with M-Audio MIDI interfaces Greg KH
2009-03-14 0:06 ` [patch 64/96] sound: virtuoso: revert "do not overwrite EEPROM on Xonar D2/D2X" Greg KH
2009-03-14 0:06 ` [patch 65/96] USB: EHCI: slow down ITD reuse Greg KH
2009-03-14 0:06 ` [patch 66/96] USB: option: add BenQ 3g modem information Greg KH
2009-03-14 0:06 ` [patch 67/96] x86-64: fix int $0x80 -ENOSYS return Greg KH
2009-03-14 0:06 ` [patch 68/96] x86-64: seccomp: fix 32/64 syscall hole Greg KH
2009-03-14 0:06 ` [patch 69/96] x86-64: syscall-audit: " Greg KH
2009-03-14 0:06 ` [patch 70/96] x86: add Dell XPS710 reboot quirk Greg KH
2009-03-14 0:06 ` [patch 71/96] x86: tone down mtrr_trim_uncached_memory() warning Greg KH
2009-03-14 0:06 ` [patch 72/96] x86, vmi: TSC going backwards check in vmi clocksource Greg KH
2009-03-14 0:06 ` [patch 73/96] xen/blkfront: use blk_rq_map_sg to generate ring entries Greg KH
2009-03-14 0:06 ` [patch 74/96] xen: disable interrupts early, as start_kernel expects Greg KH
2009-03-14 0:06 ` [patch 75/96] zaurus: add usb id for motomagx phones Greg KH
2009-03-14 0:06 ` [patch 76/96] DVB: s5h1409: Perform s5h1409 soft reset after tuning Greg KH
2009-03-14 0:06 ` [patch 77/96] [PATCH] V4L: tda8290: fix TDA8290 + TDA18271 initialization Greg KH
2009-03-14 0:06 ` [patch 78/96] V4L: ivtv: fix decoder crash regression Greg KH
2009-03-14 0:06 ` [patch 79/96] ACPI: fix broken usage of name.ascii Greg KH
2009-03-14 0:06 ` [patch 80/96] hwmon: (f71882fg) Hide misleading error message Greg KH
2009-03-14 0:06 ` [patch 81/96] i2c: Fix misplaced parentheses Greg KH
2009-03-14 0:06 ` [patch 82/96] i2c: Timeouts reach -1 Greg KH
2009-03-14 0:06 ` [patch 83/96] ide-iops: fix odd-length ATAPI PIO transfers Greg KH
2009-03-14 0:06 ` [patch 84/96] ARM: Add i2c_board_info for RiscPC PCF8583 Greg KH
2009-03-14 0:06 ` [patch 85/96] Fix no_timer_check on x86_64 Greg KH
2009-03-14 0:06 ` [patch 86/96] jbd2: Fix return value of jbd2_journal_start_commit() Greg KH
2009-03-14 0:06 ` [patch 87/96] Revert "ext4: wait on all pending commits in ext4_sync_fs()" Greg KH
2009-03-14 0:06 ` [patch 88/96] jbd2: Avoid possible NULL dereference in jbd2_journal_begin_ordered_truncate() Greg KH
2009-03-14 0:06 ` [patch 89/96] ext4: Fix to read empty directory blocks correctly in 64k Greg KH
2009-03-14 0:06 ` [patch 90/96] ext4: Fix lockdep warning Greg KH
2009-03-14 0:06 ` [patch 91/96] ext4: Initialize preallocation list_heads properly Greg KH
2009-03-14 0:06 ` [patch 92/96] ext4: Fix NULL dereference in ext4_ext_migrate()s error handling Greg KH
2009-03-14 0:06 ` [patch 93/96] ext4: Add fallback for find_group_flex Greg KH
2009-03-14 0:06 ` [patch 94/96] ext4: Fix deadlock in ext4_write_begin() and ext4_da_write_begin() Greg KH
2009-03-14 0:06 ` [patch 95/96] MIPS: compat: Implement is_compat_task Greg KH
2009-03-14 0:06 ` [patch 96/96] hwmon: (it87) Properly decode -128 degrees C temperature Greg KH
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=20090314000740.790717520@mini.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=cavokz@gmail.com \
--cc=cebbert@redhat.com \
--cc=chuckw@quantumlinux.com \
--cc=davej@redhat.com \
--cc=eteo@redhat.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jake@lwn.net \
--cc=jmforbes@linuxtx.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=mkrufky@linuxtv.org \
--cc=rbranco@la.checkpoint.com \
--cc=rdunlap@xenotime.net \
--cc=reviews@ml.cw.f00f.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=w@1wt.eu \
--cc=zwane@arm.linux.org.uk \
/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