All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for v3.17-rc1] Revert "slab: remove BAD_ALIEN_MAGIC"
@ 2014-08-08  7:00 ` Joonsoo Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Joonsoo Kim @ 2014-08-08  7:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Christoph Lameter, Pekka Enberg, David Rientjes, linux-mm,
	linux-kernel, Geert Uytterhoeven, Vladimir Davydov, Joonsoo Kim

This reverts commit a640616822b2 ("slab: remove BAD_ALIEN_MAGIC").

commit a640616822b2 ("slab: remove BAD_ALIEN_MAGIC") assumes that the
system with !CONFIG_NUMA has only one memory node. But, it turns out to
be false by the report from Geert. His system, m68k, has many memory nodes
and is configured in !CONFIG_NUMA. So it couldn't boot with above change.

Here goes his failure report.

  With latest mainline, I'm getting a crash during bootup on m68k/ARAnyM:

  enable_cpucache failed for radix_tree_node, error 12.
  kernel BUG at /scratch/geert/linux/linux-m68k/mm/slab.c:1522!
  *** TRAP #7 ***   FORMAT=0
  Current process id is 0
  BAD KERNEL TRAP: 00000000
  Modules linked in:
  PC: [<0039c92c>] kmem_cache_init_late+0x70/0x8c
  SR: 2200  SP: 00345f90  a2: 0034c2e8
  d0: 0000003d    d1: 00000000    d2: 00000000    d3: 003ac942
  d4: 00000000    d5: 00000000    a0: 0034f686    a1: 0034f682
  Process swapper (pid: 0, task=0034c2e8)
  Frame format=0
  Stack from 00345fc4:
          002f69ef 002ff7e5 000005f2 000360fa 0017d806 003921d4 00000000
          00000000 00000000 00000000 00000000 00000000 003ac942 00000000
          003912d6
  Call Trace: [<000360fa>] parse_args+0x0/0x2ca
   [<0017d806>] strlen+0x0/0x1a
   [<003921d4>] start_kernel+0x23c/0x428
   [<003912d6>] _sinittext+0x2d6/0x95e

  Code: f7e5 4879 002f 69ef 61ff ffca 462a 4e47 <4879> 0035 4b1c 61ff
  fff0 0cc4 7005 23c0 0037 fd20 588f 265f 285f 4e75 48e7 301c
  Disabling lock debugging due to kernel taint
  Kernel panic - not syncing: Attempted to kill the idle task!
  ---[ end Kernel panic - not syncing: Attempted to kill the idle task!

Although there is a alternative way to fix this issue such as disabling
use of alien cache on !CONFIG_NUMA, but, reverting issued commit is better
to me in this time.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
---
 mm/slab.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/slab.c b/mm/slab.c
index c727a16..0376429 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -470,6 +470,8 @@ static struct kmem_cache kmem_cache_boot = {
 	.name = "kmem_cache",
 };
 
+#define BAD_ALIEN_MAGIC 0x01020304ul
+
 static DEFINE_PER_CPU(struct delayed_work, slab_reap_work);
 
 static inline struct array_cache *cpu_cache_get(struct kmem_cache *cachep)
@@ -836,7 +838,7 @@ static int transfer_objects(struct array_cache *to,
 static inline struct alien_cache **alloc_alien_cache(int node,
 						int limit, gfp_t gfp)
 {
-	return NULL;
+	return (struct alien_cache **)BAD_ALIEN_MAGIC;
 }
 
 static inline void free_alien_cache(struct alien_cache **ac_ptr)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH for v3.17-rc1] Revert "slab: remove BAD_ALIEN_MAGIC"
@ 2014-08-08  7:00 ` Joonsoo Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Joonsoo Kim @ 2014-08-08  7:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Christoph Lameter, Pekka Enberg, David Rientjes, linux-mm,
	linux-kernel, Geert Uytterhoeven, Vladimir Davydov, Joonsoo Kim

This reverts commit a640616822b2 ("slab: remove BAD_ALIEN_MAGIC").

commit a640616822b2 ("slab: remove BAD_ALIEN_MAGIC") assumes that the
system with !CONFIG_NUMA has only one memory node. But, it turns out to
be false by the report from Geert. His system, m68k, has many memory nodes
and is configured in !CONFIG_NUMA. So it couldn't boot with above change.

Here goes his failure report.

  With latest mainline, I'm getting a crash during bootup on m68k/ARAnyM:

  enable_cpucache failed for radix_tree_node, error 12.
  kernel BUG at /scratch/geert/linux/linux-m68k/mm/slab.c:1522!
  *** TRAP #7 ***   FORMAT=0
  Current process id is 0
  BAD KERNEL TRAP: 00000000
  Modules linked in:
  PC: [<0039c92c>] kmem_cache_init_late+0x70/0x8c
  SR: 2200  SP: 00345f90  a2: 0034c2e8
  d0: 0000003d    d1: 00000000    d2: 00000000    d3: 003ac942
  d4: 00000000    d5: 00000000    a0: 0034f686    a1: 0034f682
  Process swapper (pid: 0, task=0034c2e8)
  Frame format=0
  Stack from 00345fc4:
          002f69ef 002ff7e5 000005f2 000360fa 0017d806 003921d4 00000000
          00000000 00000000 00000000 00000000 00000000 003ac942 00000000
          003912d6
  Call Trace: [<000360fa>] parse_args+0x0/0x2ca
   [<0017d806>] strlen+0x0/0x1a
   [<003921d4>] start_kernel+0x23c/0x428
   [<003912d6>] _sinittext+0x2d6/0x95e

  Code: f7e5 4879 002f 69ef 61ff ffca 462a 4e47 <4879> 0035 4b1c 61ff
  fff0 0cc4 7005 23c0 0037 fd20 588f 265f 285f 4e75 48e7 301c
  Disabling lock debugging due to kernel taint
  Kernel panic - not syncing: Attempted to kill the idle task!
  ---[ end Kernel panic - not syncing: Attempted to kill the idle task!

Although there is a alternative way to fix this issue such as disabling
use of alien cache on !CONFIG_NUMA, but, reverting issued commit is better
to me in this time.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
---
 mm/slab.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/slab.c b/mm/slab.c
index c727a16..0376429 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -470,6 +470,8 @@ static struct kmem_cache kmem_cache_boot = {
 	.name = "kmem_cache",
 };
 
+#define BAD_ALIEN_MAGIC 0x01020304ul
+
 static DEFINE_PER_CPU(struct delayed_work, slab_reap_work);
 
 static inline struct array_cache *cpu_cache_get(struct kmem_cache *cachep)
@@ -836,7 +838,7 @@ static int transfer_objects(struct array_cache *to,
 static inline struct alien_cache **alloc_alien_cache(int node,
 						int limit, gfp_t gfp)
 {
-	return NULL;
+	return (struct alien_cache **)BAD_ALIEN_MAGIC;
 }
 
 static inline void free_alien_cache(struct alien_cache **ac_ptr)
-- 
1.7.9.5

--
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] 8+ messages in thread

* Re: [PATCH for v3.17-rc1] Revert "slab: remove BAD_ALIEN_MAGIC"
  2014-08-08  7:00 ` Joonsoo Kim
@ 2014-08-08 14:44   ` Christoph Lameter
  -1 siblings, 0 replies; 8+ messages in thread
From: Christoph Lameter @ 2014-08-08 14:44 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: Andrew Morton, Pekka Enberg, David Rientjes, linux-mm,
	linux-kernel, Geert Uytterhoeven, Vladimir Davydov

On Fri, 8 Aug 2014, Joonsoo Kim wrote:

> This reverts commit a640616822b2 ("slab: remove BAD_ALIEN_MAGIC").

Lets hold off on this one. I am bit confused as to why a non NUMA system
would have multiple NUMA nodes.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH for v3.17-rc1] Revert "slab: remove BAD_ALIEN_MAGIC"
@ 2014-08-08 14:44   ` Christoph Lameter
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Lameter @ 2014-08-08 14:44 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: Andrew Morton, Pekka Enberg, David Rientjes, linux-mm,
	linux-kernel, Geert Uytterhoeven, Vladimir Davydov

On Fri, 8 Aug 2014, Joonsoo Kim wrote:

> This reverts commit a640616822b2 ("slab: remove BAD_ALIEN_MAGIC").

Lets hold off on this one. I am bit confused as to why a non NUMA system
would have multiple NUMA nodes.

--
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] 8+ messages in thread

* Re: [PATCH for v3.17-rc1] Revert "slab: remove BAD_ALIEN_MAGIC"
  2014-08-08 14:44   ` Christoph Lameter
@ 2014-08-08 15:08     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2014-08-08 15:08 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Joonsoo Kim, Andrew Morton, Pekka Enberg, David Rientjes,
	Linux MM, linux-kernel, Vladimir Davydov

On Fri, Aug 8, 2014 at 4:44 PM, Christoph Lameter <cl@linux.com> wrote:
> On Fri, 8 Aug 2014, Joonsoo Kim wrote:
>
>> This reverts commit a640616822b2 ("slab: remove BAD_ALIEN_MAGIC").
>
> Lets hold off on this one. I am bit confused as to why a non NUMA system
> would have multiple NUMA nodes.

DISCONTIGMEM

mm/Kconfig:

#
# Both the NUMA code and DISCONTIGMEM use arrays of pg_data_t's
# to represent different areas of memory.  This variable allows
# those dependencies to exist individually.
#
config NEED_MULTIPLE_NODES
        def_bool y
        depends on DISCONTIGMEM || NUMA

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] 8+ messages in thread

* Re: [PATCH for v3.17-rc1] Revert "slab: remove BAD_ALIEN_MAGIC"
@ 2014-08-08 15:08     ` Geert Uytterhoeven
  0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2014-08-08 15:08 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Joonsoo Kim, Andrew Morton, Pekka Enberg, David Rientjes,
	Linux MM, linux-kernel, Vladimir Davydov

On Fri, Aug 8, 2014 at 4:44 PM, Christoph Lameter <cl@linux.com> wrote:
> On Fri, 8 Aug 2014, Joonsoo Kim wrote:
>
>> This reverts commit a640616822b2 ("slab: remove BAD_ALIEN_MAGIC").
>
> Lets hold off on this one. I am bit confused as to why a non NUMA system
> would have multiple NUMA nodes.

DISCONTIGMEM

mm/Kconfig:

#
# Both the NUMA code and DISCONTIGMEM use arrays of pg_data_t's
# to represent different areas of memory.  This variable allows
# those dependencies to exist individually.
#
config NEED_MULTIPLE_NODES
        def_bool y
        depends on DISCONTIGMEM || NUMA

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

--
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] 8+ messages in thread

* Re: [PATCH for v3.17-rc1] Revert "slab: remove BAD_ALIEN_MAGIC"
  2014-08-08 15:08     ` Geert Uytterhoeven
@ 2014-08-08 15:54       ` Christoph Lameter
  -1 siblings, 0 replies; 8+ messages in thread
From: Christoph Lameter @ 2014-08-08 15:54 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Joonsoo Kim, Andrew Morton, Pekka Enberg, David Rientjes,
	Linux MM, linux-kernel, Vladimir Davydov

On Fri, 8 Aug 2014, Geert Uytterhoeven wrote:

> On Fri, Aug 8, 2014 at 4:44 PM, Christoph Lameter <cl@linux.com> wrote:
> > On Fri, 8 Aug 2014, Joonsoo Kim wrote:
> >
> >> This reverts commit a640616822b2 ("slab: remove BAD_ALIEN_MAGIC").
> >
> > Lets hold off on this one. I am bit confused as to why a non NUMA system
> > would have multiple NUMA nodes.
>
> DISCONTIGMEM
>
> mm/Kconfig:
>
> #
> # Both the NUMA code and DISCONTIGMEM use arrays of pg_data_t's
> # to represent different areas of memory.  This variable allows
> # those dependencies to exist individually.
> #
> config NEED_MULTIPLE_NODES
>         def_bool y
>         depends on DISCONTIGMEM || NUMA

Uhhh... And how does one access memory when the node is != 0 given that
zone_to_nid always returns 0 in the !CONFIG_NUMA case? AFAICT there are
numerous of these node == 0 assumptions in the kernel for !NUMA.

include/linux/mmzone.h:

#ifdef CONFIG_NUMA
#define pfn_to_nid(pfn)                                                 \
({                                                                      \
        unsigned long __pfn_to_nid_pfn = (pfn);                         \
        page_to_nid(pfn_to_page(__pfn_to_nid_pfn));                     \
})
#else
#define pfn_to_nid(pfn)         (0)
#endif


How can this work at all????





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH for v3.17-rc1] Revert "slab: remove BAD_ALIEN_MAGIC"
@ 2014-08-08 15:54       ` Christoph Lameter
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Lameter @ 2014-08-08 15:54 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Joonsoo Kim, Andrew Morton, Pekka Enberg, David Rientjes,
	Linux MM, linux-kernel, Vladimir Davydov

On Fri, 8 Aug 2014, Geert Uytterhoeven wrote:

> On Fri, Aug 8, 2014 at 4:44 PM, Christoph Lameter <cl@linux.com> wrote:
> > On Fri, 8 Aug 2014, Joonsoo Kim wrote:
> >
> >> This reverts commit a640616822b2 ("slab: remove BAD_ALIEN_MAGIC").
> >
> > Lets hold off on this one. I am bit confused as to why a non NUMA system
> > would have multiple NUMA nodes.
>
> DISCONTIGMEM
>
> mm/Kconfig:
>
> #
> # Both the NUMA code and DISCONTIGMEM use arrays of pg_data_t's
> # to represent different areas of memory.  This variable allows
> # those dependencies to exist individually.
> #
> config NEED_MULTIPLE_NODES
>         def_bool y
>         depends on DISCONTIGMEM || NUMA

Uhhh... And how does one access memory when the node is != 0 given that
zone_to_nid always returns 0 in the !CONFIG_NUMA case? AFAICT there are
numerous of these node == 0 assumptions in the kernel for !NUMA.

include/linux/mmzone.h:

#ifdef CONFIG_NUMA
#define pfn_to_nid(pfn)                                                 \
({                                                                      \
        unsigned long __pfn_to_nid_pfn = (pfn);                         \
        page_to_nid(pfn_to_page(__pfn_to_nid_pfn));                     \
})
#else
#define pfn_to_nid(pfn)         (0)
#endif


How can this work at all????




--
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] 8+ messages in thread

end of thread, other threads:[~2014-08-08 15:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-08  7:00 [PATCH for v3.17-rc1] Revert "slab: remove BAD_ALIEN_MAGIC" Joonsoo Kim
2014-08-08  7:00 ` Joonsoo Kim
2014-08-08 14:44 ` Christoph Lameter
2014-08-08 14:44   ` Christoph Lameter
2014-08-08 15:08   ` Geert Uytterhoeven
2014-08-08 15:08     ` Geert Uytterhoeven
2014-08-08 15:54     ` Christoph Lameter
2014-08-08 15:54       ` Christoph Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.