public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] __cacheline_aligned always in own section
@ 2004-02-26  6:44 Rusty Russell
  2004-02-26  6:53 ` viro
  2004-02-26 22:09 ` Denis Vlasenko
  0 siblings, 2 replies; 5+ messages in thread
From: Rusty Russell @ 2004-02-26  6:44 UTC (permalink / raw)
  To: akpm, torvalds; +Cc: viro, linux-kernel

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-27  1:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-26  6:44 [PATCH] __cacheline_aligned always in own section Rusty Russell
2004-02-26  6:53 ` viro
2004-02-26 22:09 ` Denis Vlasenko
2004-02-26 23:21   ` Andrew Morton
2004-02-27  1:01     ` Matt Mackall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox