linux/arch/mn10300
David Howells 5260562754 MN10300: Fix the PERCPU() alignment to allow for workqueues
In the MN10300 arch, we occasionally see an assertion being tripped in
alloc_cwqs() at the following line:

        /* just in case, make sure it's actually aligned */
  --->  BUG_ON(!IS_ALIGNED(wq->cpu_wq.v, align));
        return wq->cpu_wq.v ? 0 : -ENOMEM;

The values are:

        wa->cpu_wq.v => 0x902776e0
        align => 0x100

and align is calculated by the following:

        const size_t align = max_t(size_t, 1 << WORK_STRUCT_FLAG_BITS,
                                   __alignof__(unsigned long long));

This is because the pointer in question (wq->cpu_wq.v) loses some of its
lower bits to control flags, and so the object it points to must be
sufficiently aligned to avoid the need to use those bits for pointing to
things.

Currently, 4 control bits and 4 colour bits are used in normal
circumstances, plus a debugging bit if debugging is set.  This requires
the cpu_workqueue_struct struct to be at least 256 bytes aligned (or 512
bytes aligned with debugging).

PERCPU() alignment on MN13000, however, is only 32 bytes as set in
vmlinux.lds.S.  So we set this to PAGE_SIZE (4096) to match most other
arches and stick a comment in alloc_cwqs() for anyone else who triggers
the assertion.

Reported-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Mark Salter <msalter@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-25 16:24:06 -07:00
..
boot MN10300: Don't try and #include <linux/slab.h> in lib/inflate.c from bootloader 2010-08-12 09:51:35 -07:00
configs defconfig reduction 2010-08-14 22:26:53 +02:00
include/asm Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2010-10-22 19:59:04 -07:00
kernel MN10300: Fix the PERCPU() alignment to allow for workqueues 2010-10-25 16:24:06 -07:00
lib mn10300: add cc clobbers to asm statements 2010-01-11 09:34:10 -08:00
mm MN10300: Fix flush_icache_range() 2010-10-01 15:01:47 -07:00
oprofile MN10300: Kill MN10300's own profiling Kconfig 2009-04-09 10:53:16 -07:00
proc-mn103e010 Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
unit-asb2303 mn10300: fix kernel build failures when using gcc-4.x 2009-10-01 16:11:12 -07:00
unit-asb2305 PCI: clear bridge resource range if BIOS assigned bad one 2010-06-11 13:24:51 -07:00
Kconfig MN10300: Arch doesn't support HAVE_ARCH_TRACEHOOK 2010-09-23 10:20:58 -07:00
Kconfig.debug MN10300: Default config choice GDBSTUB_TTYSM0 should be GDBSTUB_ON_TTYSM0 2010-09-27 16:29:06 -07:00
Makefile mn10300: objcopy flags fix 2010-01-11 09:34:09 -08:00