archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <>
Cc: Linux kernel <>
Subject: Re: SMP spin-locks
Date: Thu, 14 Jun 2001 10:32:13 -0700 (PDT)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>
In-Reply-To: <>

Richard B. Johnson writes:
 > Spin-locks now transfer control to the .text.lock segment.
 > This is a separate segment that can be at an offset that
 > is far away from the currently executing code. That may
 > cause the cache to be reloaded. Further, each spin-lock
 > invocation generates separate code within that segment.
 > Question 1: Why?

Because this increases the code density of the common
case, getting the lock immediately.

 > Question 2: What is the purpose of the code sequence, "repz nop" 
 > generated by the spin-lock code? Is this a processor BUG work-around?
 > `as` doesn't "like" this sequence and, Intel doesn't seem to
 > document it.

It is a hint to the processor that we are executing a spinlock loop
(it does something wrt. keeping the cacheline of the lock in shared
state when possible).

I believe it is documented in the Pentium 4 manuals, previous chips
ignore this sequence and treat it as a pure nop from what I understand.

David S. Miller

  reply	other threads:[~2001-06-14 17:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-14 17:26 Richard B. Johnson
2001-06-14 17:32 ` David S. Miller [this message]
2001-06-14 17:35 ` Kurt Garloff
2001-06-15  6:51   ` Doug Ledford
2001-06-14 20:42 ` Roger Larsson
2001-06-14 21:05   ` Richard B. Johnson
2001-06-14 21:30     ` Roger Larsson
2001-06-15  3:21       ` Richard B. Johnson
2001-06-15  2:33         ` David Lang
2001-06-15 10:35         ` David Schwartz
2001-06-15 13:26           ` Richard B. Johnson
2001-06-15 12:10     ` Ingo Oeser
2001-06-15 12:49       ` Richard B. Johnson
2001-06-15 15:52     ` Pavel Machek

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:

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

  git send-email \ \ \ \ \
    --subject='Re: SMP spin-locks' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).