i386: single node SPARSEMEM fix
PATCH 1/1 i386: single node SPARSEMEM fix
This patch for 2.6.13-git5 fixes single node sparsemem support. In the case when multiple nodes are used, setup_memory() in arch/i386/mm/discontig.c calls get_memcfg_numa() which calls memory_present(). The single node case with setup_memory() in arch/i386/kernel/setup.c does not call memory_present() without this patch, which breaks single node support.
----
arch/i386/Kconfig +2 -2
@@ -758,7 +758,6 @@ config NUMA depends on SMP && HIGHMEM64G && (X86_NUMAQ || X86_GENERICARCH || (X86_SUMMIT && ACPI)) default n if X86_PC default y if (X86_NUMAQ || X86_SUMMIT) - select SPARSEMEM_STATIC # Need comments to help the hapless user trying to turn on NUMA support comment "NUMA (NUMA-Q) requires SMP, 64GB highmem support"
@@ -797,7 +796,8 @@ config ARCH_DISCONTIGMEM_DEFAULT config ARCH_SPARSEMEM_ENABLE def_bool y - depends on NUMA + depends on NUMA || (X86_PC && EXPERIMENTAL) + select SPARSEMEM_STATIC config ARCH_SELECT_MEMORY_MODEL def_bool y
arch/i386/kernel/setup.c +3 -0
@@ -1127,6 +1127,9 @@ static unsigned long __init setup_memoryprintk (KERN_NOTICE "%ldMB LOWMEM available.\n" ,pages_to_mb (max_low_pfn)); +#ifdef CONFIG_SPARSEMEM +memory_present (0 ,0 , max_pfn); +#endif setup_bootmem_allocator ();return max_low_pfn;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 5 lines · Magnus Damm
This patch for 2.6.13-git5 fixes single node sparsemem support. In the case when multiple nodes are used,
setup_memory()inarch/i386/mm/discontig.ccallsget_memcfg_numa()which callsmemory_present(). The single node case withsetup_memory()inarch/i386/kernel/setup.cdoes not callmemory_present()without this patch, which breaks single node support.
First of all, this is really a feature addition, not a bug fix. :)
The reason we haven't included this so far is that we don't really have any machines that need sparsemem on i386 that aren't NUMA. So, we disabled it for now, and probably need to decide first why we need it before a patch like that goes in.
I actually have exactly the same patch that you sent out in my tree, but it's just for testing. Magnus, perhaps we can get some of my testing patches in good enough shape to put them in -mm so that the non-NUMA folks can do more sparsemem testing.
-- Dave
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · --On Wednesday, September 07, 2005 10:28:36 -0700 Dave Hansen…
Quoted 5 lines · Magnus Damm
This patch for 2.6.13-git5 fixes single node sparsemem support. In the case when multiple nodes are used,
setup_memory()inarch/i386/mm/discontig.ccallsget_memcfg_numa()which callsmemory_present(). The single node case withsetup_memory()inarch/i386/kernel/setup.cdoes not callmemory_present()without this patch, which breaks single node support.
Quoted 6 lines
First of all, this is really a feature addition, not a bug fix. :)
The reason we haven't included this so far is that we don't really have any machines that need sparsemem on i386 that aren't NUMA. So, we disabled it for now, and probably need to decide first why we need it before a patch like that goes in.
CONFIG_NUMA was meant to (and did at one point) support both NUMA and flat machines. This is essential in order for the distros to support it - same will go for sparsemem.
M.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 3 lines · Martin J. Bligh
CONFIG_NUMAwas meant to (and did at one point) support both NUMA and flat machines. This is essential in order for the distros to support it - same will go for sparsemem.
That's a different issue. The current code works if you boot a NUMA=y SPARSEMEM=y machine with a single node. The current Kconfig options also enforce that SPARSEMEM depends on NUMA on i386.
Magnus would like to enable SPARSEMEM=y while CONFIG_NUMA=n. That requires some Kconfig changes, as well as an extra memory present call. I'm questioning why we need to do that when we could never do DISCONTIG=y while NUMA=n on i386.
-- Dave
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 5 lines · --On Wednesday, September 07, 2005 11:27:54 -0700 Dave Hansen…
Quoted 3 lines · Martin J. Bligh
CONFIG_NUMAwas meant to (and did at one point) support both NUMA and flat machines. This is essential in order for the distros to support it - same will go for sparsemem.
Quoted 8 lines
That's a different issue. The current code works if you boot a NUMA=y SPARSEMEM=y machine with a single node. The current
Kconfigoptions also enforce that SPARSEMEM depends on NUMA on i386.Magnus would like to enable SPARSEMEM=y while
CONFIG_NUMA=n. That requires someKconfigchanges, as well as an extra memory present call. I'm questioning why we need to do that when we could never do DISCONTIG=y while NUMA=n on i386.
Ah, OK - makes more sense. However, some machines do have large holes in e820 map setups - is not really critical, more of an efficiency thing.
M.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 14 lines · Martin J. Bligh
Quoted 9 lines · --On Wednesday, September 07, 2005 11:27:54 -0700 Dave Hansen…
Quoted 3 lines · Martin J. Bligh
CONFIG_NUMAwas meant to (and did at one point) support both NUMA and flat machines. This is essential in order for the distros to support it - same will go for sparsemem.That's a different issue. The current code works if you boot a NUMA=y SPARSEMEM=y machine with a single node. The current
Kconfigoptions also enforce that SPARSEMEM depends on NUMA on i386.
Quoted 8 lines
Quoted 4 lines
Magnus would like to enable SPARSEMEM=y while
CONFIG_NUMA=n. That requires someKconfigchanges, as well as an extra memory present call. I'm questioning why we need to do that when we could never do DISCONTIG=y while NUMA=n on i386.Ah, OK - makes more sense. However, some machines do have large holes in e820 map setups - is not really critical, more of an efficiency thing.
Confused. Does all this mean that we want the patch, or not?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 10 lines · Dave Hansen
Quoted 5 lines · Magnus Damm
This patch for 2.6.13-git5 fixes single node sparsemem support. In the case when multiple nodes are used,
setup_memory()inarch/i386/mm/discontig.ccallsget_memcfg_numa()which callsmemory_present(). The single node case withsetup_memory()inarch/i386/kernel/setup.cdoes not callmemory_present()without this patch, which breaks single node support.First of all, this is really a feature addition, not a bug fix. :)
From the POV that you can use sparsemem on a PC, yes. But from the POV
that setup_memory() in arch/i386/kernel/setup.c not includes a call to memory_present(), I think it is a fix. =)
While at it, why do we have two copies of setup_memory()? Couldn't NUMA and non-NUMA share the same code? OTOH, NUMA and discontigmem seems very integrated/mixed up and there seems to be much activity in this field so maybe it is nice to keep the NUMA part separated anyway.
Quoted 4 lines
The reason we haven't included this so far is that we don't really have any machines that need sparsemem on i386 that aren't NUMA. So, we disabled it for now, and probably need to decide first why we need it before a patch like that goes in.
Well, I do not have any hardware here that requires sparsemem either, but I wanted to add NUMA emulation code to be able to run some multiple-memory-nodes tests on a virtual PC in QEMU. And this little patch shows my first step which involved getting sparsememto run on a PC.
Quoted 4 lines
I actually have exactly the same patch that you sent out in my tree, but it's just for testing. Magnus, perhaps we can get some of my testing patches in good enough shape to put them in -mm so that the non-NUMA folks can do more sparsemem testing.
Well, my NUMA emulation project has been postponed a bit now, but sooner or later I or someone else will need sparsemem on non-NUMA. So getting your testing patches in to -mm seems like a good idea!
Thanks!
/ magnus
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 11 lines · Martin J. Bligh
Quoted 9 lines · --On Wednesday, September 07, 2005 10:28:36 -0700 Dave Hansen…
Quoted 5 lines · Magnus Damm
This patch for 2.6.13-git5 fixes single node sparsemem support. In the case when multiple nodes are used,
setup_memory()inarch/i386/mm/discontig.ccallsget_memcfg_numa()which callsmemory_present(). The single node case withsetup_memory()inarch/i386/kernel/setup.cdoes not callmemory_present()without this patch, which breaks single node support.First of all, this is really a feature addition, not a bug fix. :)
Quoted 8 lines
Quoted 4 lines
The reason we haven't included this so far is that we don't really have any machines that need sparsemem on i386 that aren't NUMA. So, we disabled it for now, and probably need to decide first why we need it before a patch like that goes in.
CONFIG_NUMAwas meant to (and did at one point) support both NUMA and flat machines. This is essential in order for the distros to support it - same will go for sparsemem.
Yes, by reading the code this becomes very clear. But what is the current status? Is CONFIG_X86_GENERICARCH working right out of the box on 2.6.13?
Thanks!
/ magnus
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 5 lines · Dave Hansen
Quoted 3 lines · Martin J. Bligh
CONFIG_NUMAwas meant to (and did at one point) support both NUMA and flat machines. This is essential in order for the distros to support it - same will go for sparsemem.
Quoted 8 lines
That's a different issue. The current code works if you boot a NUMA=y SPARSEMEM=y machine with a single node. The current
Kconfigoptions also enforce that SPARSEMEM depends on NUMA on i386.Magnus would like to enable SPARSEMEM=y while
CONFIG_NUMA=n. That requires someKconfigchanges, as well as an extra memory present call. I'm questioning why we need to do that when we could never do DISCONTIG=y while NUMA=n on i386.
Actually, I do not really care about the Kconfig stuff. I just added that to show you guys why and when the change in arch/i386/kernel/setup.c was needed. So my main interest is to include the fix to the single-node version of setup_memory(). This to sync up the single-node case with the multiple-node version of setup_memory(), and to make it easier for me and other people to start using sparsemem om single-node (or non-NUMA if you prefer that) configurations.
/ magnus
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 20 lines · Andrew Morton
Quoted 19 lines · Martin J. Bligh
Quoted 13 lines · --On Wednesday, September 07, 2005 11:27:54 -0700 Dave Hansen…
Quoted 3 lines · Martin J. Bligh
CONFIG_NUMAwas meant to (and did at one point) support both NUMA and flat machines. This is essential in order for the distros to support it - same will go for sparsemem.That's a different issue. The current code works if you boot a NUMA=y SPARSEMEM=y machine with a single node. The current
Kconfigoptions also enforce that SPARSEMEM depends on NUMA on i386.Magnus would like to enable SPARSEMEM=y while
CONFIG_NUMA=n. That requires someKconfigchanges, as well as an extra memory present call. I'm questioning why we need to do that when we could never do DISCONTIG=y while NUMA=n on i386.
Quoted 5 lines
Quoted 3 lines
Ah, OK - makes more sense. However, some machines do have large holes in e820 map setups - is not really critical, more of an efficiency thing.
Confused. Does all this mean that we want the patch, or not?
What about if I remove the Kconfig stuff and just keep the "fix" for the non-NUMA version of setup_memory()?
/ magnus
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
Quoted 3 lines
CONFIG_NUMAwas meant to (and did at one point) support both NUMA and flat machines. This is essential in order for the distros to support it - same will go for sparsemem.That's a different issue. The current code works if you boot a NUMA=y SPARSEMEM=y machine with a single node. The current
Kconfigoptions also enforce that SPARSEMEM depends on NUMA on i386.Magnus would like to enable SPARSEMEM=y while
CONFIG_NUMA=n. That requires someKconfigchanges, as well as an extra memory present call. I'm questioning why we need to do that when we could never do DISCONTIG=y while NUMA=n on i386.
Quoted 7 lines
Quoted 3 lines
Ah, OK - makes more sense. However, some machines do have large holes in e820 map setups - is not really critical, more of an efficiency thing.
Confused. Does all this mean that we want the patch, or not?
From that POV, nothing urgent, and would require more work to make use
of it anyway. Not sure if Magnus had another more immediate use for it?
M.
Quoted 13 lines · Martin J. Bligh
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
Quoted 3 lines
CONFIG_NUMAwas meant to (and did at one point) support both NUMA and flat machines. This is essential in order for the distros to support it - same will go for sparsemem.That's a different issue. The current code works if you boot a NUMA=y SPARSEMEM=y machine with a single node. The current
Kconfigoptions also enforce that SPARSEMEM depends on NUMA on i386.Magnus would like to enable SPARSEMEM=y while
CONFIG_NUMA=n. That requires someKconfigchanges, as well as an extra memory present call. I'm questioning why we need to do that when we could never do DISCONTIG=y while NUMA=n on i386.
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
Ah, OK - makes more sense. However, some machines do have large holes in e820 map setups - is not really critical, more of an efficiency thing.
Confused. Does all this mean that we want the patch, or not?
From that POV, nothing urgent, and would require more work to make use
of it anyway. Not sure if Magnus had another more immediate use for it?
Just wanted to make sure that both versions of setup_memory() behaved in a similar way and they both called memory_present(). But nothing urgent, and no immediate use.
/ magnus
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 6 lines · Andrew Morton
Quoted 3 lines · Martin J. Bligh
Ah, OK - makes more sense. However, some machines do have large holes in e820 map setups - is not really critical, more of an efficiency thing.
Confused. Does all this mean that we want the patch, or not?
I say we wait on it.
Martin brings up a scenario in which SPARSEMEM is useful without NUMA, but it Magnus's patch doesn't actually deal with systems like that. Let's do it right, and base the memory_present() calls off of real data from the e820 or efi data.
-- Dave
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>