lkml.org 
[lkml]   [2004]   [Feb]   [26]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
FromRusty Russell <>
Subject[PATCH] __cacheline_aligned always in own section
DateThu, 26 Feb 2004 17:44:47 +1100
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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:01    [from the cache]
©2003-2008