kernel-fxtec-pro1x/arch/mn10300/kernel
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
..
asm-offsets.c
entry.S Fix IRQ flag handling naming 2010-10-07 14:08:55 +01:00
fpu-low.S
fpu.c
gdb-cache.S
gdb-io-serial-low.S
gdb-io-serial.c
gdb-io-ttysm-low.S
gdb-io-ttysm.c
gdb-low.S
gdb-stub.c
head.S
init_task.c
internal.h
io.c
irq.c
kernel_execve.S
kprobes.c
kthread.S
Makefile
mn10300-debug.c
mn10300-serial-low.S
mn10300-serial.c MN10300: Fix up the IRQ names for the on-chip serial ports 2010-09-14 17:06:28 -07:00
mn10300-serial.h
mn10300-watchdog-low.S
mn10300-watchdog.c
mn10300_ksyms.c
module.c modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
process.c Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
profile-low.S
profile.c
ptrace.c
rtc.c
setup.c
sigframe.h
signal.c mn10300: check __get_user/__put_user results... 2010-09-27 12:19:53 -07:00
switch_to.S
sys_mn10300.c
time.c
traps.c
vmlinux.lds.S MN10300: Fix the PERCPU() alignment to allow for workqueues 2010-10-25 16:24:06 -07:00