public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Juergen Doelle <jdoelle@de.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Pls apply this spinlock patch to the kernel
Date: Sat, 3 Nov 2001 11:55:56 -0800	[thread overview]
Message-ID: <20011103115556.A5984@twiddle.net> (raw)
In-Reply-To: <E15yG7P-0003Kb-00@the-village.bc.nu> <Pine.LNX.4.33.0110290930540.8904-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0110290930540.8904-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Mon, Oct 29, 2001 at 09:32:52AM -0800

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.


r~

  reply	other threads:[~2001-11-03 19:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-29 16:22 Pls apply this spinlock patch to the kernel Juergen Doelle
2001-10-29 17:13 ` Linus Torvalds
2001-10-29 17:22 ` Alan Cox
2001-10-29 17:32   ` Linus Torvalds
2001-11-03 19:55     ` Richard Henderson [this message]
2001-11-03 20:20       ` Linus Torvalds
2001-11-03 21:01         ` Richard Henderson
2001-11-04  0:43           ` Linus Torvalds
2001-10-30 13:14   ` Anton Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011103115556.A5984@twiddle.net \
    --to=rth@twiddle.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jdoelle@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox