[PATCH] __cacheline_aligned always in own section

From: Rusty Russell
Date: Thu Feb 26 2004 - 01:47:18 EST


Name: Always Put Cache Aligned Code in Own Section: Even Modules
Status: Tested on 2.6.3-bk7

We put ____cacheline_aligned things in their own section, simply
because we waste less space that way. Otherwise we end up padding
innocent variables to the next cacheline to get the required
alignment.

There's no reason not to do this in modules, too.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .16274-linux-2.6.3-bk7/include/linux/cache.h .16274-linux-2.6.3-bk7.updated/include/linux/cache.h
--- .16274-linux-2.6.3-bk7/include/linux/cache.h 2003-09-22 09:47:16.000000000 +1000
+++ .16274-linux-2.6.3-bk7.updated/include/linux/cache.h 2004-02-26 16:43:49.000000000 +1100
@@ -26,13 +26,9 @@
#endif

#ifndef __cacheline_aligned
-#ifdef MODULE
-#define __cacheline_aligned ____cacheline_aligned
-#else
#define __cacheline_aligned \
__attribute__((__aligned__(SMP_CACHE_BYTES), \
__section__(".data.cacheline_aligned")))
-#endif
#endif /* __cacheline_aligned */

#ifndef __cacheline_aligned_in_smp

--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
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/