Re: [PATCH 3/3] softirq: Use const char * const forsoftirq_to_name, whitespace neatening

From: Joe Perches
Date: Tue Dec 24 2013 - 10:28:27 EST


On Tue, 2013-12-24 at 23:19 +0800, Wang YanQing wrote:
> On Sun, Nov 17, 2013 at 01:55:12AM -0800, Joe Perches wrote:
> > Reduce data size a little.
> > Reduce checkpatch noise.
> >
> > $ size kernel/softirq.o*
> > text data bss dec hex filename
> > 11554 6013 4008 21575 5447 kernel/softirq.o.new
> > 11474 6093 4008 21575 5447 kernel/softirq.o.old
>
> Hi, could you tell me why this patch could reduce data size?

It moves the softirq_to_name array of 10 char *
from data (non-const) to text (const).

-char *softirq_to_name[NR_SOFTIRQS] = {
+const char * const softirq_to_name[NR_SOFTIRQS] = {
"HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL",
"TASKLET", "SCHED", "HRTIMER", "RCU"
};

Use objdump or "make kernel/softirq.lst" and inspect
the object code produced to see for yourself.

cheers, Joe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/