[lkml]   [2001]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Pls apply this spinlock patch to the kernel
On Mon, Oct 29, 2001 at 09:32:52AM -0800, Linus Torvalds wrote:
> On Mon, 29 Oct 2001, Alan Cox wrote:
> > spinlock_t pagecache_lock ____cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
> > cache_line_pad;
> >
> > where cache_line_pad is an asm(".align") - I would assume that is
> > sufficient - Linus ?

The "cache_line_pad" is useless. The __attribute__((aligned(N)))
is completely sufficient.

> Gcc won't guarantee that it puts different variables adjacently - the
> linker (or even the compiler) can move things around to make them fit
> better. Which is why it would be better to use the separate section trick.

Separate sections are also not needed. While you can't guarantee
adjacency, the object file *does* record the required alignment
and that must be honored by the linker.

Now, separate sections do make sense for minimizing accumulated
padding, but that is a separate issue.

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

 \ /
  Last update: 2005-03-22 13:12    [W:0.117 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site