From: Andrey Savochkin <saw@sawoct.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andi Kleen <ak@suse.de>, Kirill Korotaev <dev@sw.ru>,
linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
xemul@sw.ru, st@sw.ru, discuss@x86-64.org
Subject: Re: SMP syncronization on AMD processors (broken?)
Date: Thu, 6 Oct 2005 19:21:06 +0400 [thread overview]
Message-ID: <20051006192106.A13978@castle.nmd.msu.ru> (raw)
In-Reply-To: <Pine.LNX.4.64.0510060750230.31407@g5.osdl.org>; from "Linus Torvalds" on Thu, Oct 06, 2005 at 07:52:17AM
On Thu, Oct 06, 2005 at 07:52:17AM -0700, Linus Torvalds wrote:
>
>
> On Thu, 6 Oct 2005, Andrey Savochkin wrote:
> >
> > Well, it's hard to swallow...
> > It's not about being not fully fair, it's about deadlocks that started
> > to appear after code changes inside retry loops...
>
> No, it's not about fairness.
>
> It's about BUGS IN YOUR CODE.
>
> If you need fairness, you need to implement that yourself. You can do so
> many ways. Either on top of spinlocks, by using an external side-band
> channel, or by using semaphores instead of spinlocks (semaphores are much
> higher cost, but part of the cost is that they _are_ fair).
Ok, let it be a bug.
I just want to repeat that nobody wanted or expected any fairness in this case.
But such extremety that on some CPU models one CPU never, not in billion
cycles, can get the lock if the other CPU repeatedly drops and acquires the
lock, and that in this scenario memory changes seem to never propagate to
other CPUs - well, all of that is a surprise.
I start to wonder about existing mainstream code, presumably bug-free, that
uses spinlocks without any problematic restart.
If one day some piece starts to be called too often by some legitimate
reasons, it might fall into the same pattern and completely block others who
want to take the same spinlock.
I'm not advocating for changing spinlock implementation, it's just a
thought...
Andrey
next prev parent reply other threads:[~2005-10-06 15:27 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-06 13:05 Kirill Korotaev
2005-10-06 13:14 ` linux-os (Dick Johnson)
2005-10-06 13:19 ` Arjan van de Ven
2005-10-06 13:32 ` Andrey Savochkin
2005-10-06 14:22 ` Arjan van de Ven
2005-10-06 13:32 ` Andi Kleen
2005-10-06 13:46 ` Andrey Savochkin
2005-10-06 14:02 ` [discuss] " Andi Kleen
2005-10-06 14:52 ` Linus Torvalds
2005-10-06 15:21 ` Andrey Savochkin [this message]
2005-10-06 15:46 ` Linus Torvalds
2005-10-11 0:59 ` Andrew Morton
2005-10-11 1:20 ` Andi Kleen
2005-10-11 3:20 ` Joe Seigh
2005-10-06 13:50 ` Eric Dumazet
2005-10-06 13:56 ` [discuss] " Andi Kleen
2005-10-06 14:10 ` Eric Dumazet
2005-10-06 14:11 ` Andi Kleen
2005-10-06 14:45 ` Linus Torvalds
2005-10-06 15:34 ` Hugh Dickins
2005-10-06 15:53 ` Eric Dumazet
2005-10-06 16:01 ` Linus Torvalds
2005-10-07 20:38 ` Joe Seigh
2005-10-07 20:57 ` Stephen Hemminger
2005-10-13 18:24 ` Joe Seigh
2005-10-08 9:31 Chuck Ebbert
2005-10-11 23:50 linux
2005-10-12 2:12 ` Christopher Friesen
2005-10-12 2:39 ` linux
2005-10-12 3:27 ` Kyle Moffett
2005-10-13 12:25 ` Kirill Korotaev
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=20051006192106.A13978@castle.nmd.msu.ru \
--to=saw@sawoct.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=dev@sw.ru \
--cc=discuss@x86-64.org \
--cc=linux-kernel@vger.kernel.org \
--cc=st@sw.ru \
--cc=torvalds@osdl.org \
--cc=xemul@sw.ru \
/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
all inboxes | Powered by JetHome®