* [PATCH v2] slub: correctly bootstrap boot caches
@ 2013-02-22 16:20 Glauber Costa
2013-02-22 16:34 ` Christoph Lameter
[not found] ` <alpine.DEB.2.02.1302221034380.7600@gentwo.org>
0 siblings, 2 replies; 12+ messages in thread
From: Glauber Costa @ 2013-02-22 16:20 UTC (permalink / raw)
To: linux-mm
Cc: linux-kernel, cgroups, Glauber Costa, Christoph Lameter,
Andrew Morton, Tejun Heo, Pekka Enberg
After we create a boot cache, we may allocate from it until it is bootstraped.
This will move the page from the partial list to the cpu slab list. If this
happens, the loop:
list_for_each_entry(p, &n->partial, lru)
that we use to scan for all partial pages will yield nothing, and the pages
will keep pointing to the boot cpu cache, which is of course, invalid. To do
that, we should flush the cache to make sure that the cpu slab is back to the
partial list.
Signed-off-by: Glauber Costa <glommer@parallels.com>
Reported-by: Steffen Michalke <StMichalke@web.de>
Tested-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Pekka Enberg <penberg@kernel.org>
mm/slub.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
---
mm/slub.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mm/slub.c b/mm/slub.c
index ba2ca53..31a494c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3617,6 +3617,12 @@ static struct kmem_cache * __init bootstrap(struct kmem_cache *static_cache)
memcpy(s, static_cache, kmem_cache->object_size);
+ /*
+ * This runs very early, and only the boot processor is supposed to be
+ * up. Even if it weren't true, IRQs are not up so we couldn't fire
+ * IPIs around.
+ */
+ __flush_cpu_slab(s, smp_processor_id());
for_each_node_state(node, N_NORMAL_MEMORY) {
struct kmem_cache_node *n = get_node(s, node);
struct page *p;
--
1.8.1.2
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2] slub: correctly bootstrap boot caches
2013-02-22 16:20 [PATCH v2] slub: correctly bootstrap boot caches Glauber Costa
@ 2013-02-22 16:34 ` Christoph Lameter
[not found] ` <alpine.DEB.2.02.1302221034380.7600@gentwo.org>
1 sibling, 0 replies; 12+ messages in thread
From: Christoph Lameter @ 2013-02-22 16:34 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-mm, linux-kernel, cgroups, Andrew Morton, Tejun Heo,
Pekka Enberg
On Fri, 22 Feb 2013, Glauber Costa wrote:
> After we create a boot cache, we may allocate from it until it is bootstraped.
> This will move the page from the partial list to the cpu slab list. If this
> happens, the loop:
Acked-by: Christoph Lameter <cl@linux.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <alpine.DEB.2.02.1302221034380.7600@gentwo.org>]
* Re: [PATCH v2] slub: correctly bootstrap boot caches
[not found] ` <alpine.DEB.2.02.1302221034380.7600@gentwo.org>
@ 2013-02-22 17:00 ` Christoph Lameter
[not found] ` <alpine.DEB.2.02.1302221057430.7600@gentwo.org>
1 sibling, 0 replies; 12+ messages in thread
From: Christoph Lameter @ 2013-02-22 17:00 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-mm, linux-kernel, cgroups, Andrew Morton, Tejun Heo,
Pekka Enberg, Joonsoo Kim
An earlier fix to this is available here:
https://patchwork.kernel.org/patch/1975301/
and
https://lkml.org/lkml/2013/1/15/55
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <alpine.DEB.2.02.1302221057430.7600@gentwo.org>]
* Re: [PATCH v2] slub: correctly bootstrap boot caches
[not found] ` <alpine.DEB.2.02.1302221057430.7600@gentwo.org>
@ 2013-02-22 17:01 ` Christoph Lameter
2013-02-22 17:08 ` Glauber Costa
0 siblings, 1 reply; 12+ messages in thread
From: Christoph Lameter @ 2013-02-22 17:01 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-mm, linux-kernel, cgroups, Andrew Morton, Tejun Heo,
Pekka Enberg, Joonsoo Kim
Argh. This one was the final version:
https://patchwork.kernel.org/patch/2009521/
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] slub: correctly bootstrap boot caches
2013-02-22 17:01 ` Christoph Lameter
@ 2013-02-22 17:08 ` Glauber Costa
2013-02-22 17:23 ` Christoph Lameter
0 siblings, 1 reply; 12+ messages in thread
From: Glauber Costa @ 2013-02-22 17:08 UTC (permalink / raw)
To: Christoph Lameter
Cc: linux-mm, linux-kernel, cgroups, Andrew Morton, Tejun Heo,
Pekka Enberg, Joonsoo Kim
On 02/22/2013 09:01 PM, Christoph Lameter wrote:
> Argh. This one was the final version:
>
> https://patchwork.kernel.org/patch/2009521/
>
It seems it would work. It is all the same to me.
Which one do you prefer?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] slub: correctly bootstrap boot caches
2013-02-22 17:08 ` Glauber Costa
@ 2013-02-22 17:23 ` Christoph Lameter
2013-02-22 23:20 ` JoonSoo Kim
2013-02-27 7:47 ` Pekka Enberg
0 siblings, 2 replies; 12+ messages in thread
From: Christoph Lameter @ 2013-02-22 17:23 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-mm, linux-kernel, cgroups, Andrew Morton, Tejun Heo,
Pekka Enberg, Joonsoo Kim
On Fri, 22 Feb 2013, Glauber Costa wrote:
> On 02/22/2013 09:01 PM, Christoph Lameter wrote:
> > Argh. This one was the final version:
> >
> > https://patchwork.kernel.org/patch/2009521/
> >
>
> It seems it would work. It is all the same to me.
> Which one do you prefer?
Flushing seems to be simpler and less code.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] slub: correctly bootstrap boot caches
2013-02-22 17:23 ` Christoph Lameter
@ 2013-02-22 23:20 ` JoonSoo Kim
2013-02-24 0:35 ` Christoph Lameter
2013-02-27 7:47 ` Pekka Enberg
1 sibling, 1 reply; 12+ messages in thread
From: JoonSoo Kim @ 2013-02-22 23:20 UTC (permalink / raw)
To: Christoph Lameter
Cc: Glauber Costa, linux-mm, linux-kernel, cgroups, Andrew Morton,
Tejun Heo, Pekka Enberg
2013/2/23 Christoph Lameter <cl@linux.com>:
> On Fri, 22 Feb 2013, Glauber Costa wrote:
>
>> On 02/22/2013 09:01 PM, Christoph Lameter wrote:
>> > Argh. This one was the final version:
>> >
>> > https://patchwork.kernel.org/patch/2009521/
>> >
>>
>> It seems it would work. It is all the same to me.
>> Which one do you prefer?
>
> Flushing seems to be simpler and less code.
>
Hello, Christoph, Glauber.
With flushing, deactivate_slab() occur and it has some overhead to
deactivate objects.
If my patch properly fix this situation, it is better to use mine
which has no overhead.
Thanks.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] slub: correctly bootstrap boot caches
2013-02-22 23:20 ` JoonSoo Kim
@ 2013-02-24 0:35 ` Christoph Lameter
2013-02-25 5:16 ` Joonsoo Kim
0 siblings, 1 reply; 12+ messages in thread
From: Christoph Lameter @ 2013-02-24 0:35 UTC (permalink / raw)
To: JoonSoo Kim
Cc: Glauber Costa, linux-mm, linux-kernel, cgroups, Andrew Morton,
Tejun Heo, Pekka Enberg
On Sat, 23 Feb 2013, JoonSoo Kim wrote:
> With flushing, deactivate_slab() occur and it has some overhead to
> deactivate objects.
> If my patch properly fix this situation, it is better to use mine
> which has no overhead.
Well this occurs during boot and its not that performance critical.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] slub: correctly bootstrap boot caches
2013-02-24 0:35 ` Christoph Lameter
@ 2013-02-25 5:16 ` Joonsoo Kim
0 siblings, 0 replies; 12+ messages in thread
From: Joonsoo Kim @ 2013-02-25 5:16 UTC (permalink / raw)
To: Christoph Lameter
Cc: Glauber Costa, linux-mm, linux-kernel, cgroups, Andrew Morton,
Tejun Heo, Pekka Enberg
Hello, Christoph.
On Sun, Feb 24, 2013 at 12:35:22AM +0000, Christoph Lameter wrote:
> On Sat, 23 Feb 2013, JoonSoo Kim wrote:
>
> > With flushing, deactivate_slab() occur and it has some overhead to
> > deactivate objects.
> > If my patch properly fix this situation, it is better to use mine
> > which has no overhead.
>
> Well this occurs during boot and its not that performance critical.
Hmm...
Yes, this is not performance critical place, but why do we use
a sub-optimal solution?
And flushing is abstration for complicated logic, so I think that
my raw implemntation is better for understanding.
But, I have no objection to merge Glauber's one
if you think that is better.
Thanks.
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] slub: correctly bootstrap boot caches
2013-02-22 17:23 ` Christoph Lameter
2013-02-22 23:20 ` JoonSoo Kim
@ 2013-02-27 7:47 ` Pekka Enberg
2013-02-27 13:46 ` Glauber Costa
1 sibling, 1 reply; 12+ messages in thread
From: Pekka Enberg @ 2013-02-27 7:47 UTC (permalink / raw)
To: Christoph Lameter
Cc: Glauber Costa, linux-mm, linux-kernel, cgroups, Andrew Morton,
Tejun Heo, Joonsoo Kim
On Fri, Feb 22, 2013 at 7:23 PM, Christoph Lameter <cl@linux.com> wrote:
> On Fri, 22 Feb 2013, Glauber Costa wrote:
>
>> On 02/22/2013 09:01 PM, Christoph Lameter wrote:
>> > Argh. This one was the final version:
>> >
>> > https://patchwork.kernel.org/patch/2009521/
>> >
>>
>> It seems it would work. It is all the same to me.
>> Which one do you prefer?
>
> Flushing seems to be simpler and less code.
Well, I completely lost track of what to apply... Can someone please
send me the final version that everybody agrees on with proper ACKs
and other attributions?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] slub: correctly bootstrap boot caches
2013-02-27 7:47 ` Pekka Enberg
@ 2013-02-27 13:46 ` Glauber Costa
2013-02-27 16:39 ` Christoph Lameter
0 siblings, 1 reply; 12+ messages in thread
From: Glauber Costa @ 2013-02-27 13:46 UTC (permalink / raw)
To: Pekka Enberg
Cc: Christoph Lameter, linux-mm, linux-kernel, cgroups, Andrew Morton,
Tejun Heo, Joonsoo Kim
On 02/27/2013 11:47 AM, Pekka Enberg wrote:
> On Fri, Feb 22, 2013 at 7:23 PM, Christoph Lameter <cl@linux.com> wrote:
>> On Fri, 22 Feb 2013, Glauber Costa wrote:
>>
>>> On 02/22/2013 09:01 PM, Christoph Lameter wrote:
>>>> Argh. This one was the final version:
>>>>
>>>> https://patchwork.kernel.org/patch/2009521/
>>>>
>>>
>>> It seems it would work. It is all the same to me.
>>> Which one do you prefer?
>>
>> Flushing seems to be simpler and less code.
>
> Well, I completely lost track of what to apply... Can someone please
> send me the final version that everybody agrees on with proper ACKs
> and other attributions?
>
You can apply this one as-is with Christoph's ACK.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] slub: correctly bootstrap boot caches
2013-02-27 13:46 ` Glauber Costa
@ 2013-02-27 16:39 ` Christoph Lameter
0 siblings, 0 replies; 12+ messages in thread
From: Christoph Lameter @ 2013-02-27 16:39 UTC (permalink / raw)
To: Glauber Costa
Cc: Pekka Enberg, linux-mm, linux-kernel, cgroups, Andrew Morton,
Tejun Heo, Joonsoo Kim
On Wed, 27 Feb 2013, Glauber Costa wrote:
> You can apply this one as-is with Christoph's ACK.
Right.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2013-02-27 16:39 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-22 16:20 [PATCH v2] slub: correctly bootstrap boot caches Glauber Costa
2013-02-22 16:34 ` Christoph Lameter
[not found] ` <alpine.DEB.2.02.1302221034380.7600@gentwo.org>
2013-02-22 17:00 ` Christoph Lameter
[not found] ` <alpine.DEB.2.02.1302221057430.7600@gentwo.org>
2013-02-22 17:01 ` Christoph Lameter
2013-02-22 17:08 ` Glauber Costa
2013-02-22 17:23 ` Christoph Lameter
2013-02-22 23:20 ` JoonSoo Kim
2013-02-24 0:35 ` Christoph Lameter
2013-02-25 5:16 ` Joonsoo Kim
2013-02-27 7:47 ` Pekka Enberg
2013-02-27 13:46 ` Glauber Costa
2013-02-27 16:39 ` Christoph Lameter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).