* [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
[not found] ` <alpine.DEB.2.00.1104211411540.20201@chino.kir.corp.google.com>
@ 2011-04-21 22:02 ` David Rientjes
2011-04-24 1:59 ` Michael Schmitz
0 siblings, 1 reply; 18+ messages in thread
From: David Rientjes @ 2011-04-21 22:02 UTC (permalink / raw)
To: Geert Uytterhoeven, Andrew Morton, Roman Zippel; +Cc: linux-m68k, linux-kernel
For m68k, N_NORMAL_MEMORY represents all nodes that have present memory
since it does not support HIGHMEM. This patch sets the bit at the time
the node is brought online.
If N_NORMAL_MEMORY is not accurate, slub may encounter errors since it
uses this nodemask to setup per-cache kmem_cache_node data structures.
Signed-off-by: David Rientjes <rientjes@google.com>
---
arch/m68k/mm/init_mm.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/m68k/mm/init_mm.c b/arch/m68k/mm/init_mm.c
--- a/arch/m68k/mm/init_mm.c
+++ b/arch/m68k/mm/init_mm.c
@@ -59,6 +59,8 @@ void __init m68k_setup_node(int node)
}
#endif
pg_data_map[node].bdata = bootmem_node_data + node;
+ if (node_present_pages(node))
+ node_set_state(node, N_NORMAL_MEMORY);
node_set_online(node);
}
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-21 22:02 ` [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY David Rientjes
@ 2011-04-24 1:59 ` Michael Schmitz
2011-04-24 3:14 ` KOSAKI Motohiro
` (2 more replies)
0 siblings, 3 replies; 18+ messages in thread
From: Michael Schmitz @ 2011-04-24 1:59 UTC (permalink / raw)
To: David Rientjes
Cc: Geert Uytterhoeven, Andrew Morton, Roman Zippel, linux-m68k,
linux-kernel, schwab, tg@mirbsd.de >> Thorsten Glaser
David Rientjes wrote:
> For m68k, N_NORMAL_MEMORY represents all nodes that have present memory
> since it does not support HIGHMEM. This patch sets the bit at the time
> the node is brought online.
>
> If N_NORMAL_MEMORY is not accurate, slub may encounter errors since it
> uses this nodemask to setup per-cache kmem_cache_node data structures.
>
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
> arch/m68k/mm/init_mm.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/m68k/mm/init_mm.c b/arch/m68k/mm/init_mm.c
> --- a/arch/m68k/mm/init_mm.c
> +++ b/arch/m68k/mm/init_mm.c
> @@ -59,6 +59,8 @@ void __init m68k_setup_node(int node)
> }
> #endif
> pg_data_map[node].bdata = bootmem_node_data + node;
> + if (node_present_pages(node))
> + node_set_state(node, N_NORMAL_MEMORY);
> node_set_online(node);
> }
>
>
As Andreas pointed out, node_present_pages is set in free_area_init_node
which only gets called at the very end of m68k mm paging_init.
The correct patch would be something like this - the need for the
conditional is perhaps debatable, seeing as we set the pages present
just before node_set_state.
Tested on my ARAnyM test setup so far. I'd like to wait for an
independent kernel image built by Thorsten before I test on the actual
hardware. Sorry but you'll have to restart your build Thorsten :-)
Signed-off-by: Michael Schmitz <schmitz@debian.org>
--
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 02b7a03..b806c19 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -300,6 +300,8 @@ void __init paging_init(void)
zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
free_area_init_node(i, zones_size,
m68k_memory[i].addr >> PAGE_SHIFT,
NULL);
+ if (node_present_pages(i))
+ node_set_state(i, N_NORMAL_MEMORY);
}
}
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-24 1:59 ` Michael Schmitz
@ 2011-04-24 3:14 ` KOSAKI Motohiro
2011-04-24 4:01 ` Michael Schmitz
2011-04-24 11:32 ` Thorsten Glaser
2011-04-24 12:18 ` Thorsten Glaser
2011-04-25 20:56 ` David Rientjes
2 siblings, 2 replies; 18+ messages in thread
From: KOSAKI Motohiro @ 2011-04-24 3:14 UTC (permalink / raw)
To: Michael Schmitz
Cc: David Rientjes, Geert Uytterhoeven, Andrew Morton, Roman Zippel,
linux-m68k, linux-kernel, schwab,
tg@mirbsd.de >> Thorsten Glaser
2011/4/24 Michael Schmitz <schmitzmic@googlemail.com>:
> David Rientjes wrote:
>>
>> For m68k, N_NORMAL_MEMORY represents all nodes that have present memory
>> since it does not support HIGHMEM. This patch sets the bit at the time the
>> node is brought online.
>>
>> If N_NORMAL_MEMORY is not accurate, slub may encounter errors since it
>> uses this nodemask to setup per-cache kmem_cache_node data structures.
>>
>> Signed-off-by: David Rientjes <rientjes@google.com>
>> ---
>> arch/m68k/mm/init_mm.c | 2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/m68k/mm/init_mm.c b/arch/m68k/mm/init_mm.c
>> --- a/arch/m68k/mm/init_mm.c
>> +++ b/arch/m68k/mm/init_mm.c
>> @@ -59,6 +59,8 @@ void __init m68k_setup_node(int node)
>> }
>> #endif
>> pg_data_map[node].bdata = bootmem_node_data + node;
>> + if (node_present_pages(node))
>> + node_set_state(node, N_NORMAL_MEMORY);
>> node_set_online(node);
>> }
>>
>
> As Andreas pointed out, node_present_pages is set in free_area_init_node
> which only gets called at the very end of m68k mm paging_init.
>
> The correct patch would be something like this - the need for the
> conditional is perhaps debatable, seeing as we set the pages present just
> before node_set_state.
>
> Tested on my ARAnyM test setup so far. I'd like to wait for an independent
> kernel image built by Thorsten before I test on the actual hardware. Sorry
> but you'll have to restart your build Thorsten :-)
>
> Signed-off-by: Michael Schmitz <schmitz@debian.org>
> --
> diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
> index 02b7a03..b806c19 100644
> --- a/arch/m68k/mm/motorola.c
> +++ b/arch/m68k/mm/motorola.c
> @@ -300,6 +300,8 @@ void __init paging_init(void)
> zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
> free_area_init_node(i, zones_size,
> m68k_memory[i].addr >> PAGE_SHIFT, NULL);
> + if (node_present_pages(i))
> + node_set_state(i, N_NORMAL_MEMORY);
> }
> }
I think you are right. however I doubt m68k need to care memoryless node check.
probably following patch just work.
------------------------------------
diff --git a/arch/m68k/mm/init_mm.c b/arch/m68k/mm/init_mm.c
--- a/arch/m68k/mm/init_mm.c
+++ b/arch/m68k/mm/init_mm.c
@@ -59,6 +59,8 @@ void __init m68k_setup_node(int node)
}
#endif
pg_data_map[node].bdata = bootmem_node_data + node;
node_set_online(node);
+ node_set_state(node, N_NORMAL_MEMORY);
Maybe, the correct solution is to use CONFIG_ARCH_POPULATES_NODE_MAP feature.
the usage is simple, adding add_active_range() and replacing
free_area_init_node() with free_area_init_nodes().
Thanks.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-24 3:14 ` KOSAKI Motohiro
@ 2011-04-24 4:01 ` Michael Schmitz
2011-04-24 5:05 ` Michael Schmitz
2011-04-24 11:32 ` Thorsten Glaser
1 sibling, 1 reply; 18+ messages in thread
From: Michael Schmitz @ 2011-04-24 4:01 UTC (permalink / raw)
To: KOSAKI Motohiro
Cc: Michael Schmitz, David Rientjes, Geert Uytterhoeven,
Andrew Morton, Roman Zippel, linux-m68k, linux-kernel, schwab,
tg@mirbsd.de >> Thorsten Glaser
KOSAKI Motohiro wrote:
> 2011/4/24 Michael Schmitz <schmitzmic@googlemail.com>:
>
>> David Rientjes wrote:
>>
>>> For m68k, N_NORMAL_MEMORY represents all nodes that have present memory
>>> since it does not support HIGHMEM. This patch sets the bit at the time the
>>> node is brought online.
>>>
>>> If N_NORMAL_MEMORY is not accurate, slub may encounter errors since it
>>> uses this nodemask to setup per-cache kmem_cache_node data structures.
>>>
>>> Signed-off-by: David Rientjes <rientjes@google.com>
>>> ---
>>> arch/m68k/mm/init_mm.c | 2 ++
>>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/m68k/mm/init_mm.c b/arch/m68k/mm/init_mm.c
>>> --- a/arch/m68k/mm/init_mm.c
>>> +++ b/arch/m68k/mm/init_mm.c
>>> @@ -59,6 +59,8 @@ void __init m68k_setup_node(int node)
>>> }
>>> #endif
>>> pg_data_map[node].bdata = bootmem_node_data + node;
>>> + if (node_present_pages(node))
>>> + node_set_state(node, N_NORMAL_MEMORY);
>>> node_set_online(node);
>>> }
>>>
>>>
>> As Andreas pointed out, node_present_pages is set in free_area_init_node
>> which only gets called at the very end of m68k mm paging_init.
>>
>> The correct patch would be something like this - the need for the
>> conditional is perhaps debatable, seeing as we set the pages present just
>> before node_set_state.
>>
>> Tested on my ARAnyM test setup so far. I'd like to wait for an independent
>> kernel image built by Thorsten before I test on the actual hardware. Sorry
>> but you'll have to restart your build Thorsten :-)
>>
>> Signed-off-by: Michael Schmitz <schmitz@debian.org>
>> --
>> diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
>> index 02b7a03..b806c19 100644
>> --- a/arch/m68k/mm/motorola.c
>> +++ b/arch/m68k/mm/motorola.c
>> @@ -300,6 +300,8 @@ void __init paging_init(void)
>> zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
>> free_area_init_node(i, zones_size,
>> m68k_memory[i].addr >> PAGE_SHIFT, NULL);
>> + if (node_present_pages(i))
>> + node_set_state(i, N_NORMAL_MEMORY);
>> }
>> }
>>
>
> I think you are right. however I doubt m68k need to care memoryless node check.
> probably following patch just work.
>
> ------------------------------------
> diff --git a/arch/m68k/mm/init_mm.c b/arch/m68k/mm/init_mm.c
> --- a/arch/m68k/mm/init_mm.c
> +++ b/arch/m68k/mm/init_mm.c
> @@ -59,6 +59,8 @@ void __init m68k_setup_node(int node)
> }
> #endif
> pg_data_map[node].bdata = bootmem_node_data + node;
> node_set_online(node);
> + node_set_state(node, N_NORMAL_MEMORY);
>
It does in fact - that's what I had as a workaround before.
Memory node information is provided by the respective m68k bootstrap so
memoryless nodes won't be possible indeed.
> Maybe, the correct solution is to use CONFIG_ARCH_POPULATES_NODE_MAP feature.
> the usage is simple, adding add_active_range() and replacing
> free_area_init_node() with free_area_init_nodes().
>
Either of the patches should work as long as there is not a potential
problem with setting the node state before setting node_present_pages.
Your suggestion may work as well but I cannot judge whether there may be
side effects in relation to special case handling of node zero on m68k.
Do we need to call add_active_range at the time init_bootmem_node is
called? That would be a bit earlier in paging_init, and achieve much the
same thing as the proposed patch or the earlier workaround.
Besides, your solution would set N_HIGH_MEMORY not N_NORMAL_MEMORY if I
read free_area_init_nodes() right. Does that matter?
Cheers,
Michael
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-24 4:01 ` Michael Schmitz
@ 2011-04-24 5:05 ` Michael Schmitz
2011-04-24 6:04 ` KOSAKI Motohiro
0 siblings, 1 reply; 18+ messages in thread
From: Michael Schmitz @ 2011-04-24 5:05 UTC (permalink / raw)
To: Michael Schmitz
Cc: KOSAKI Motohiro, David Rientjes, Geert Uytterhoeven,
Andrew Morton, Roman Zippel, linux-m68k, linux-kernel, schwab,
tg@mirbsd.de >> Thorsten Glaser
Michael Schmitz wrote:
> Besides, your solution would set N_HIGH_MEMORY not N_NORMAL_MEMORY if
> I read free_area_init_nodes() right. Does that matter?
check_for_regular_memory() does take care of that - so it would be all
the same in the end. Whether it's worth it for a handful of nodes at
best I'm unsure. I'll leave that for Geert to decide.
Cheers,
Michael
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-24 5:05 ` Michael Schmitz
@ 2011-04-24 6:04 ` KOSAKI Motohiro
0 siblings, 0 replies; 18+ messages in thread
From: KOSAKI Motohiro @ 2011-04-24 6:04 UTC (permalink / raw)
To: Michael Schmitz
Cc: David Rientjes, Geert Uytterhoeven, Andrew Morton, Roman Zippel,
linux-m68k, linux-kernel, schwab,
tg@mirbsd.de >> Thorsten Glaser
2011/4/24 Michael Schmitz <schmitzmic@googlemail.com>:
> Michael Schmitz wrote:
>>
>> Besides, your solution would set N_HIGH_MEMORY not N_NORMAL_MEMORY if I
>> read free_area_init_nodes() right. Does that matter?
>
> check_for_regular_memory() does take care of that - so it would be all the
> same in the end. Whether it's worth it for a handful of nodes at best I'm
> unsure. I'll leave that for Geert to decide.
check_for_regular_memory() doesn't. It is CONFIG_HIGHMEM specific.
The trick is in node_status definition. N_NORMAL_MEMORY and
N_HIGHMEMORY share the same value. then
node_set_state(nid, N_HIGH_MEMORY) turn on both normal and
highmem bitmask.
--------------------------------------------------------------------
enum node_states {
N_POSSIBLE, /* The node could become online at some point */
N_ONLINE, /* The node is online */
N_NORMAL_MEMORY, /* The node has regular memory */
#ifdef CONFIG_HIGHMEM
N_HIGH_MEMORY, /* The node has regular or high memory */
#else
N_HIGH_MEMORY = N_NORMAL_MEMORY,
#endif
N_CPU, /* The node has one or more cpus */
NR_NODE_STATES
};
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-24 3:14 ` KOSAKI Motohiro
2011-04-24 4:01 ` Michael Schmitz
@ 2011-04-24 11:32 ` Thorsten Glaser
2011-04-25 2:41 ` Michael Schmitz
1 sibling, 1 reply; 18+ messages in thread
From: Thorsten Glaser @ 2011-04-24 11:32 UTC (permalink / raw)
To: Michael Schmitz, KOSAKI Motohiro
Cc: David Rientjes, Geert Uytterhoeven, Andrew Morton, Roman Zippel,
linux-m68k, linux-kernel, schwab
Michael Schmitz dixit:
> Tested on my ARAnyM test setup so far. I'd like to wait for an independent
> kernel image built by Thorsten before I test on the actual hardware. Sorry but
> you'll have to restart your build Thorsten :-)
Heh okay, if you want. But only cross-compiling :D
KOSAKI Motohiro dixit:
>I think you are right. however I doubt m68k need to care memoryless node check.
>probably following patch just work.
That’s what we have now. Compiles, boots, works fine.
So, which of these do you guys want?
bye,
//mirabilos
--
13:47⎜<tobiasu> if i were omnipotent, i would divide by zero
all day long ;)
(thinking about http://lobacevski.tumblr.com/post/3260866481 by waga)
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-24 1:59 ` Michael Schmitz
2011-04-24 3:14 ` KOSAKI Motohiro
@ 2011-04-24 12:18 ` Thorsten Glaser
2011-04-25 20:56 ` David Rientjes
2 siblings, 0 replies; 18+ messages in thread
From: Thorsten Glaser @ 2011-04-24 12:18 UTC (permalink / raw)
To: Michael Schmitz
Cc: David Rientjes, Geert Uytterhoeven, Andrew Morton, Roman Zippel,
linux-m68k, linux-kernel, schwab
Michael Schmitz dixit:
> Tested on my ARAnyM test setup so far. I'd like to wait for an independent
> kernel image built by Thorsten before I test on the actual hardware. Sorry but
ARAnyM too, but both this patch and the earlier one compile and boot
(on atari) and I’m building packages under both of them (two ARAnyM
instances) right now. Toolchain used:
binutils-m68k-linux-gnu 2.21.51.20110419-2
gcc-4.4-m68k-linux-gnu 4.4.6-2+m68k.1
(i.e. sid latest; gcc with only a patch to keep building libgcc2,
since we don’t have gcc-4.5 on m68k yet)
bye,
//mirabilos
--
13:47⎜<tobiasu> if i were omnipotent, i would divide by zero
all day long ;)
(thinking about http://lobacevski.tumblr.com/post/3260866481 by waga)
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-24 11:32 ` Thorsten Glaser
@ 2011-04-25 2:41 ` Michael Schmitz
2011-04-25 14:22 ` Thorsten Glaser
0 siblings, 1 reply; 18+ messages in thread
From: Michael Schmitz @ 2011-04-25 2:41 UTC (permalink / raw)
To: Thorsten Glaser
Cc: Michael Schmitz, KOSAKI Motohiro, David Rientjes,
Geert Uytterhoeven, Andrew Morton, Roman Zippel, linux-m68k,
linux-kernel, schwab
Hello Thorsten,
>> Tested on my ARAnyM test setup so far. I'd like to wait for an independent
>> kernel image built by Thorsten before I test on the actual hardware. Sorry but
>> you'll have to restart your build Thorsten :-)
>>
>
> Heh okay, if you want. But only cross-compiling :D
>
Thought so. That's fine actually. Your cross toolchain will be a lot
more recent than mine.
>
> KOSAKI Motohiro dixit:
>
>
>> I think you are right. however I doubt m68k need to care memoryless node check.
>> probably following patch just work.
>>
>
> That’s what we have now. Compiles, boots, works fine.
>
>
> So, which of these do you guys want?
>
Whatever is cleaner and easier to understand. I'm a poor judge of code
elegance.
Cheers,
Michael
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-25 2:41 ` Michael Schmitz
@ 2011-04-25 14:22 ` Thorsten Glaser
0 siblings, 0 replies; 18+ messages in thread
From: Thorsten Glaser @ 2011-04-25 14:22 UTC (permalink / raw)
To: Michael Schmitz
Cc: KOSAKI Motohiro, David Rientjes, Geert Uytterhoeven,
Andrew Morton, Roman Zippel, linux-m68k, linux-kernel, schwab
Michael Schmitz dixit:
> Thought so. That's fine actually. Your cross toolchain will be a lot more
> recent than mine.
Just these tools in the exact versions I’d use natively, too:
binutils-m68k-linux-gnu 2.21.51.20110419-2
gcc-4.4-m68k-linux-gnu 4.4.6-2+m68k.1
>> So, which of these do you guys want?
>>
> Whatever is cleaner and easier to understand. I'm a poor judge of code
> elegance.
I’d say the “correcter” one, if m68k would have to care about
memoryless nodes in the future (not sure whether it’s possible
for that to happen). But I’ve added your two-liner to Debian now.
bye,
//mirabilos
--
13:47⎜<tobiasu> if i were omnipotent, i would divide by zero
all day long ;)
(thinking about http://lobacevski.tumblr.com/post/3260866481 by waga)
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-24 1:59 ` Michael Schmitz
2011-04-24 3:14 ` KOSAKI Motohiro
2011-04-24 12:18 ` Thorsten Glaser
@ 2011-04-25 20:56 ` David Rientjes
2011-04-26 2:51 ` Michael Schmitz
2 siblings, 1 reply; 18+ messages in thread
From: David Rientjes @ 2011-04-25 20:56 UTC (permalink / raw)
To: Michael Schmitz
Cc: Geert Uytterhoeven, Andrew Morton, Roman Zippel, linux-m68k,
linux-kernel, schwab, tg@mirbsd.de >> Thorsten Glaser
On Sun, 24 Apr 2011, Michael Schmitz wrote:
> diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
> index 02b7a03..b806c19 100644
> --- a/arch/m68k/mm/motorola.c
> +++ b/arch/m68k/mm/motorola.c
> @@ -300,6 +300,8 @@ void __init paging_init(void)
> zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
> free_area_init_node(i, zones_size,
> m68k_memory[i].addr >> PAGE_SHIFT, NULL);
> + if (node_present_pages(i))
> + node_set_state(i, N_NORMAL_MEMORY);
> }
> }
>
Ok, would you like to write a changelog for this similar to mine and then
propose it as an alternative?
Thanks!
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-25 20:56 ` David Rientjes
@ 2011-04-26 2:51 ` Michael Schmitz
2011-04-26 10:50 ` Thorsten Glaser
0 siblings, 1 reply; 18+ messages in thread
From: Michael Schmitz @ 2011-04-26 2:51 UTC (permalink / raw)
To: David Rientjes
Cc: Michael Schmitz, Geert Uytterhoeven, Andrew Morton, Roman Zippel,
linux-m68k, linux-kernel, schwab,
tg@mirbsd.de >> Thorsten Glaser
David Rientjes wrote:
> Ok, would you like to write a changelog for this similar to mine and then
> propose it as an alternative?
>
> Thanks!
>
Will this one do?
Cheers,
Michael
commit 99b9c43cfb18a8e2222e9ef80b04a5c3e1dad254
Author: Michael Schmitz <schmitz@debian.org>
Date: Tue Apr 26 14:51:54 2011 +1200
[m68k] For m68k, N_NORMAL_MEMORY represents all nodes that have
present memory
since it does not support HIGHMEM. This patch sets the bit at
the time
node_present_pages has been set by free_area_init_node.
At the time the node is brought online, the the node state would
have to
be done unconditionally since information about present memory
has not yet
been recorded.
If N_NORMAL_MEMORY is not accurate, slub may encounter errors
since it
uses this nodemask to setup per-cache kmem_cache_node data
structures.
This pach is an alternative to the one proposed by David
Rientjes <rientjes@google.com>
attempting to set node state immediately when bringing the node
online.
Signed-off-by: Michael Schmitz <schmitz@debian.org>
---
arch/m68k/mm/motorola.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 02b7a03..b806c19 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -300,6 +300,8 @@ void __init paging_init(void)
zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
free_area_init_node(i, zones_size,
m68k_memory[i].addr >> PAGE_SHIFT,
NULL);
+ if (node_present_pages(i))
+ node_set_state(i, N_NORMAL_MEMORY);
}
}
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-26 2:51 ` Michael Schmitz
@ 2011-04-26 10:50 ` Thorsten Glaser
2011-04-27 13:19 ` Geert Uytterhoeven
0 siblings, 1 reply; 18+ messages in thread
From: Thorsten Glaser @ 2011-04-26 10:50 UTC (permalink / raw)
To: Michael Schmitz
Cc: David Rientjes, Geert Uytterhoeven, Andrew Morton, Roman Zippel,
linux-m68k, linux-kernel, schwab
Michael Schmitz dixit:
> be done unconditionally since information about present memory has not
> yet
> been recorded.
> If N_NORMAL_MEMORY is not accurate, slub may encounter
> errors since it
Hrm…
> @@ -300,6 +300,8 @@ void __init paging_init(void)
> zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
> free_area_init_node(i, zones_size,
> m68k_memory[i].addr >> PAGE_SHIFT, NULL);
> + if (node_present_pages(i))
> + node_set_state(i, N_NORMAL_MEMORY);
> }
> }
No, this has whitespace problems (tabs are expanded to spaces).
bye,
//mirabilos
--
13:47⎜<tobiasu> if i were omnipotent, i would divide by zero
all day long ;)
(thinking about http://lobacevski.tumblr.com/post/3260866481 by waga)
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-26 10:50 ` Thorsten Glaser
@ 2011-04-27 13:19 ` Geert Uytterhoeven
2011-04-27 15:09 ` Thorsten Glaser
` (2 more replies)
0 siblings, 3 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2011-04-27 13:19 UTC (permalink / raw)
To: Thorsten Glaser
Cc: Michael Schmitz, David Rientjes, Andrew Morton, Roman Zippel,
linux-m68k, linux-kernel, schwab
On Tue, Apr 26, 2011 at 12:50, Thorsten Glaser <tg@mirbsd.de> wrote:
> Michael Schmitz dixit:
>
>> be done unconditionally since information about present memory has not
>> yet
>> been recorded.
>> If N_NORMAL_MEMORY is not accurate, slub may encounter
>> errors since it
>
> Hrm…
>
>> @@ -300,6 +300,8 @@ void __init paging_init(void)
>> zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
>> free_area_init_node(i, zones_size,
>> m68k_memory[i].addr >> PAGE_SHIFT, NULL);
>> + if (node_present_pages(i))
>> + node_set_state(i, N_NORMAL_MEMORY);
>> }
>> }
>
> No, this has whitespace problems (tabs are expanded to spaces).
Fixed those up, applied, and will send to Linus for 2.6.39-final.
BTW, if I enable CONFIG_SLUB on my ARAnyM setup, I don't get a crash, but it
hangs after:
| INIT: version 2.86 booting
With Michael's patch, it continues fine.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-27 13:19 ` Geert Uytterhoeven
@ 2011-04-27 15:09 ` Thorsten Glaser
2011-04-27 15:11 ` Thorsten Glaser
2011-04-28 3:05 ` Michael Schmitz
2 siblings, 0 replies; 18+ messages in thread
From: Thorsten Glaser @ 2011-04-27 15:09 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Michael Schmitz, David Rientjes, Andrew Morton, Roman Zippel,
linux-m68k, linux-kernel, schwab
Geert Uytterhoeven dixit:
>Fixed those up, applied, and will send to Linus for 2.6.39-final.
Tested-by: Thorsten Glaser <tg@debian.org>
>BTW, if I enable CONFIG_SLUB on my ARAnyM setup, I don't get a crash, but it
>hangs after:
I think that’s toolchain, environment, etc. dependent…
>With Michael's patch, it continues fine.
Yeah, same here.
bye,
//mirabilos
--
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-27 13:19 ` Geert Uytterhoeven
2011-04-27 15:09 ` Thorsten Glaser
@ 2011-04-27 15:11 ` Thorsten Glaser
2011-04-28 2:35 ` Ben Hutchings
2011-04-28 3:05 ` Michael Schmitz
2 siblings, 1 reply; 18+ messages in thread
From: Thorsten Glaser @ 2011-04-27 15:11 UTC (permalink / raw)
To: Debian Kernel Team; +Cc: linux-m68k
[-- Attachment #1: Type: TEXT/PLAIN, Size: 780 bytes --]
Geert Uytterhoeven dixit:
>Fixed those up, applied, and will send to Linus for 2.6.39-final.
Attached patch
• synchronises the 0009-* patch against what will be in 2.6.39
(no changes in the patch area, only in the patch metadata)
• adds the series/5 file which seemingly was forgotten
I think you’ll still need the following patch for 2.6.39:
0008-m68k-atari-Reserve-some-ST-RAM-early-on-for-device-b.patch
We’re working on getting that functionality in 2.6.40 though.
bye,
//mirabilos
--
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence. -- Coywolf Qi Hunt
[-- Attachment #2: Type: TEXT/PLAIN, Size: 4400 bytes --]
Index: dists/sid/linux-2.6/debian/patches/bugfix/m68k/0009-m68k-mm-set-all-online-nodes-in-N_NORMAL_MEMORY.patch
===================================================================
--- dists/sid/linux-2.6/debian/patches/bugfix/m68k/0009-m68k-mm-set-all-online-nodes-in-N_NORMAL_MEMORY.patch (revision 17261)
+++ dists/sid/linux-2.6/debian/patches/bugfix/m68k/0009-m68k-mm-set-all-online-nodes-in-N_NORMAL_MEMORY.patch (working copy)
@@ -1,47 +1,25 @@
-From 678cf05cb8031c762644a393b7c943e7a9d2c288 Mon Sep 17 00:00:00 2001
+From fb5f44b4fd12bfd16019956d0d0795278a2f561b Mon Sep 17 00:00:00 2001
From: Michael Schmitz <schmitzmic@googlemail.com>
-Date: Sun, 24 Apr 2011 13:59:43 +1200
-Subject: [PATCH 9/9] m68k, mm: set all online nodes in N_NORMAL_MEMORY
+Date: Tue, 26 Apr 2011 14:51:53 +1200
+Subject: [PATCH] m68k/mm: Set all online nodes in N_NORMAL_MEMORY
-David Rientjes wrote:
-> For m68k, N_NORMAL_MEMORY represents all nodes that have present memory
-> since it does not support HIGHMEM. This patch sets the bit at the time
-> the node is brought online.
->
-> If N_NORMAL_MEMORY is not accurate, slub may encounter errors since it
-> uses this nodemask to setup per-cache kmem_cache_node data structures.
->
-> Signed-off-by: David Rientjes <rientjes@google.com>
-> ---
-> arch/m68k/mm/init_mm.c | 2 ++
-> 1 files changed, 2 insertions(+), 0 deletions(-)
->
-> diff --git a/arch/m68k/mm/init_mm.c b/arch/m68k/mm/init_mm.c
-> --- a/arch/m68k/mm/init_mm.c
-> +++ b/arch/m68k/mm/init_mm.c
-> @@ -59,6 +59,8 @@ void __init m68k_setup_node(int node)
-> }
-> #endif
-> pg_data_map[node].bdata = bootmem_node_data + node;
-> + if (node_present_pages(node))
-> + node_set_state(node, N_NORMAL_MEMORY);
-> node_set_online(node);
-> }
->
->
-As Andreas pointed out, node_present_pages is set in free_area_init_node
-which only gets called at the very end of m68k mm paging_init.
+For m68k, N_NORMAL_MEMORY represents all nodes that have present memory
+since it does not support HIGHMEM. This patch sets the bit at the time
+node_present_pages has been set by free_area_init_node.
+At the time the node is brought online, the node state would have to be
+done unconditionally since information about present memory has not yet
+been recorded.
-The correct patch would be something like this - the need for the
-conditional is perhaps debatable, seeing as we set the pages present
-just before node_set_state.
+If N_NORMAL_MEMORY is not accurate, slub may encounter errors since it
+uses this nodemask to setup per-cache kmem_cache_node data structures.
-Tested on my ARAnyM test setup so far. I'd like to wait for an
-independent kernel image built by Thorsten before I test on the actual
-hardware. Sorry but you'll have to restart your build Thorsten :-)
+This pach is an alternative to the one proposed by David Rientjes
+<rientjes@google.com> attempting to set node state immediately when
+bringing the node online.
Signed-off-by: Michael Schmitz <schmitz@debian.org>
-Tested-by: Thorsten Glaser <tg@debian.org>
+Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
+CC: stable@kernel.org
---
arch/m68k/mm/motorola.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
@@ -60,5 +38,5 @@
}
--
-1.7.4.4
+1.7.5
Index: dists/sid/linux-2.6/debian/patches/series/5
===================================================================
--- dists/sid/linux-2.6/debian/patches/series/5 (revision 0)
+++ dists/sid/linux-2.6/debian/patches/series/5 (revision 0)
@@ -0,0 +1,12 @@
+# will be in 2.6.39 (pulled from linus tree)
++ bugfix/m68k/0001-m68k-Add-helper-function-handle_kernel_fault.patch
++ bugfix/m68k/0002-m68k-Use-base_trap_init-to-initialize-vectors.patch
++ bugfix/m68k/0003-m68k-Allow-all-kernel-traps-to-be-handled-via-except.patch
++ bugfix/m68k/0004-m68k-atari-Initial-ARAnyM-support.patch
++ bugfix/m68k/0005-m68k-atari-ARAnyM-Add-support-for-block-access.patch
++ bugfix/m68k/0006-m68k-atari-ARAnyM-Add-support-for-console-access.patch
++ bugfix/m68k/0007-m68k-atari-ARAnyM-Add-support-for-network-access.patch
+# accepted by m68k subsystem maintainer; probably in 2.6.40
++ bugfix/m68k/0008-m68k-atari-Reserve-some-ST-RAM-early-on-for-device-b.patch
+# will be in 2.6.39
++ bugfix/m68k/0009-m68k-mm-set-all-online-nodes-in-N_NORMAL_MEMORY.patch
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-27 15:11 ` Thorsten Glaser
@ 2011-04-28 2:35 ` Ben Hutchings
0 siblings, 0 replies; 18+ messages in thread
From: Ben Hutchings @ 2011-04-28 2:35 UTC (permalink / raw)
To: Thorsten Glaser; +Cc: Debian Kernel Team, linux-m68k
[-- Attachment #1: Type: text/plain, Size: 621 bytes --]
On Wed, 2011-04-27 at 15:11 +0000, Thorsten Glaser wrote:
> Geert Uytterhoeven dixit:
>
> >Fixed those up, applied, and will send to Linus for 2.6.39-final.
>
> Attached patch
> • synchronises the 0009-* patch against what will be in 2.6.39
> (no changes in the patch area, only in the patch metadata)
OK.
> • adds the series/5 file which seemingly was forgotten
[...]
Duh, I have it here but didn't check it in. I'm normally so diligent
about running 'svn st' to check for untracked files...
Ben.
--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY
2011-04-27 13:19 ` Geert Uytterhoeven
2011-04-27 15:09 ` Thorsten Glaser
2011-04-27 15:11 ` Thorsten Glaser
@ 2011-04-28 3:05 ` Michael Schmitz
2 siblings, 0 replies; 18+ messages in thread
From: Michael Schmitz @ 2011-04-28 3:05 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Thorsten Glaser, David Rientjes, Andrew Morton, Roman Zippel,
linux-m68k, linux-kernel, schwab
Hi Geert,
>> No, this has whitespace problems (tabs are expanded to spaces).
>
> Fixed those up, applied, and will send to Linus for 2.6.39-final.
Thanks, I have no idea how that happened.
>
> BTW, if I enable CONFIG_SLUB on my ARAnyM setup, I don't get a crash, but it
> hangs after:
>
> | INIT: version 2.86 booting
>
> With Michael's patch, it continues fine.
It may just need a long time to crash - forcing e2fsck is a good way
to speed up the crash usually.
May depend on how much RAM you give to ARAnyM, on the kernel size and
any number of other parameters.
Cheers,
Michael
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2011-04-28 3:05 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1303317178.2587.30.camel@mulgrave.site>
[not found] ` <alpine.DEB.2.00.1104201410350.31768@chino.kir.corp.google.com>
[not found] ` <20110421220351.9180.A69D9226@jp.fujitsu.com>
[not found] ` <alpine.DEB.2.00.1104211237250.5829@chino.kir.corp.google.com>
[not found] ` <alpine.DEB.2.00.1104211500170.5741@router.home>
[not found] ` <alpine.DEB.2.00.1104211411540.20201@chino.kir.corp.google.com>
2011-04-21 22:02 ` [patch] m68k, mm: set all online nodes in N_NORMAL_MEMORY David Rientjes
2011-04-24 1:59 ` Michael Schmitz
2011-04-24 3:14 ` KOSAKI Motohiro
2011-04-24 4:01 ` Michael Schmitz
2011-04-24 5:05 ` Michael Schmitz
2011-04-24 6:04 ` KOSAKI Motohiro
2011-04-24 11:32 ` Thorsten Glaser
2011-04-25 2:41 ` Michael Schmitz
2011-04-25 14:22 ` Thorsten Glaser
2011-04-24 12:18 ` Thorsten Glaser
2011-04-25 20:56 ` David Rientjes
2011-04-26 2:51 ` Michael Schmitz
2011-04-26 10:50 ` Thorsten Glaser
2011-04-27 13:19 ` Geert Uytterhoeven
2011-04-27 15:09 ` Thorsten Glaser
2011-04-27 15:11 ` Thorsten Glaser
2011-04-28 2:35 ` Ben Hutchings
2011-04-28 3:05 ` Michael Schmitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox