From: Yasunori Goto <ygoto@us.fujitsu.com>
To: mbligh@aracnet.com
Cc: Linux Kernel ML <linux-kernel@vger.kernel.org>,
Linux Hotplug Memory Support <lhms-devel@lists.sourceforge.net>
Subject: [Patch] physnode_map definition should be signed
Date: Thu, 01 Apr 2004 11:14:52 -0800 [thread overview]
Message-ID: <20040401095436.DFDD.YGOTO@us.fujitsu.com> (raw)
Hello Martin-san.
In your modification of pfn_valid() for IA32 at 2.6.4 stock kernel,
it doesn't return 0 even if the node is offline.
True problem is physnode_map's definition.
Physnode_map[]'s default (offline) value is -1,
but it is defined as UNSIGNED 8.
So, pfn_to_nid() return 255.
I think this should be defined as signed like this patch.
Maximum node number of IA32 is 16, so this is enough yet.
I found this problem on multi-node emulation for memory-hotplug test.
When I started X on this emulation, system panicked at remap_pte_range()
by this problem.
I think that system will be down when a program will call mmap()
for hardware area.
Could you check this?
Or, Do you already know this problem?
Thanks.
-----------------------------------------------------------------
mem_node_hotplug-goto/arch/i386/mm/discontig.c | 2 +-
mem_node_hotplug-goto/include/asm-i386/mmzone.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff -puN include/asm-i386/mmzone.h~phys_nodemap_modify include/asm-i386/mmzone.h
--- mem_node_hotplug/include/asm-i386/mmzone.h~phys_nodemap_modify Wed Mar 31 12:34:33 2004
+++ mem_node_hotplug-goto/include/asm-i386/mmzone.h Wed Mar 31 12:35:07 2004
@@ -37,7 +37,7 @@ extern struct pglist_data *node_data[];
#define MAX_ELEMENTS 256
#define PAGES_PER_ELEMENT (MAX_NR_PAGES/MAX_ELEMENTS)
-extern u8 physnode_map[];
+extern s8 physnode_map[];
static inline int pfn_to_nid(unsigned long pfn)
{
diff -puN arch/i386/mm/discontig.c~phys_nodemap_modify arch/i386/mm/discontig.c
--- mem_node_hotplug/arch/i386/mm/discontig.c~phys_nodemap_modify Wed Mar 31 12:34:43 2004
+++ mem_node_hotplug-goto/arch/i386/mm/discontig.c Wed Mar 31 12:36:25 2004
@@ -56,7 +56,7 @@ bootmem_data_t node0_bdata;
* physnode_map[4-7] = 1;
* physnode_map[8- ] = -1;
*/
-u8 physnode_map[MAX_ELEMENTS] = { [0 ... (MAX_ELEMENTS - 1)] = -1};
+s8 physnode_map[MAX_ELEMENTS] = { [0 ... (MAX_ELEMENTS - 1)] = -1};
unsigned long node_start_pfn[MAX_NUMNODES];
unsigned long node_end_pfn[MAX_NUMNODES];
--
Yasunori Goto <ygoto at us.fujitsu.com>
next reply other threads:[~2004-04-01 19:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-01 19:14 Yasunori Goto [this message]
2004-04-02 15:13 ` Martin J. Bligh
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=20040401095436.DFDD.YGOTO@us.fujitsu.com \
--to=ygoto@us.fujitsu.com \
--cc=lhms-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@aracnet.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
all inboxes | Powered by JetHome®