Re: [PATCH 3/3] smp.h: Move !SMP version of on_each_cpu() out-of-line

From: David Daney
Date: Fri Aug 02 2013 - 18:27:04 EST

On 08/02/2013 02:09 PM, David Daney wrote:
From: David Daney <david.daney@xxxxxxxxxx>

All of the other non-trivial !SMP versions of functions in smp.h are
out-of-line in up.c. Move on_each_cpu() there as well.

This allows us to get rid of the #include <linux/irqflags.h>. The
drawback is that this makes both the x86_64 and i386 defconfig !SMP
kernels about 200 bytes larger each.

I looked at the cause of the size difference and there are several main
parts to it.

1) kallsym data (28 bytes).

2) with the patch generating a function pointer to pass to on_each_cpu vs. direct call (7 bytes * 22 call sites) and generating the the ignored third parameter (5 bytes * 22 call sites); without the patch local_irq_save/local_irq_restore(5 bytes * 22 call sites) for a total of 7 * 22 == 154 bytes.

3) Other (21 bytes).

Signed-off-by: David Daney <david.daney@xxxxxxxxxx> ---
include/linux/smp.h | 21 +++++---------------- kernel/up.c |
11 +++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at