linux/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 MN10300: Handle removal of struct uart_info 2009-09-23 10:15:21 -07:00
entry.S Fix IRQ flag handling naming 2010-10-07 14:08:55 +01:00
fpu-low.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
fpu.c mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
gdb-cache.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
gdb-io-serial-low.S Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
gdb-io-serial.c Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
gdb-io-ttysm-low.S Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
gdb-io-ttysm.c Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
gdb-low.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
gdb-stub.c Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
head.S mn10300: convert to use __HEAD and HEAD_TEXT macros. 2009-04-26 09:20:38 -07:00
init_task.c Use new __init_task_data macro in arch init_task.c files. 2009-09-21 06:27:08 +02:00
internal.h mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
io.c mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
irq.c genirq: Convert irq_desc.lock to raw_spinlock 2009-12-14 23:55:33 +01:00
kernel_execve.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
kprobes.c percpu: make misc percpu symbols unique 2009-10-29 22:34:14 +09:00
kthread.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
Makefile Generic semaphore implementation 2008-04-17 10:42:34 -04:00
mn10300_ksyms.c mn10300: provide __ucmpdi2() for MN10300 2008-07-04 10:40:07 -07:00
mn10300-debug.c mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
mn10300-serial-low.S MN10300: Handle removal of struct uart_info 2009-09-23 10:15:21 -07:00
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: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
mn10300-watchdog-low.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
mn10300-watchdog.c Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
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 mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
profile.c mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
ptrace.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
rtc.c MN10300: Fix RTC routines 2010-08-12 09:51:35 -07:00
setup.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sigframe.h mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
signal.c mn10300: check __get_user/__put_user results... 2010-09-27 12:19:53 -07:00
switch_to.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
sys_mn10300.c Add generic sys_ipc wrapper 2010-03-12 15:52:32 -08:00
time.c mn10300: Convert mn10300 to use read/update_persistent_clock 2010-03-13 01:14:09 +01:00
traps.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
vmlinux.lds.S MN10300: Fix the PERCPU() alignment to allow for workqueues 2010-10-25 16:24:06 -07:00