From: Randolph Chung <randolph@tausq.org>
To: varenet@parisc-linux.org
Cc: parisc-linux@lists.parisc-linux.org
Subject: [parisc-linux] spinlock debug
Date: Tue, 13 Jul 2004 21:29:10 -0700 [thread overview]
Message-ID: <20040714042909.GM546@tausq.org> (raw)
Thibaut,
I'm just looking at your debuglocks stuff again. It doesn't look right
to me.
/* Do the actual locking */
/* <T-Bone> ggg: we can't get stuck on the outter loop?
* <ggg> T-Bone: We only hit the outer loop when the data
* changes and the first time. We can hit the outer one
* alot if multiple CPUs are constantly racing for a lock
* and the backplane is NOT fair about which CPU sees
* the update first. But it won't hang since every failed
* attempt will drop us back into the inner loop and
* decrement `stuck'.
* <ggg> K-class and some of the others are NOT fair in the HW
* implementation so we could see false positives.
* But fixing the lock contention is easier than
* fixing the HW to be fair.
*/
a = __ldcw_align(lock);
while ((__ldcw(a) == 0))
while ((*a == 0) && --stuck);
I don't think the comment is correct. Lets say someone is holding the
lock when you enter this code, your outer loop test always succeeds, and
you spin on the inner loop until stuck == 0. At that point you go back
to the outer loop, the lock is still held, so you go back to the inner
loop and continue spinning, and you never timeout the lock.
you probably need a "&& stuck > 0" in the outer loop.
for some reason this still doesn't work for me though, but i don't see
why :( with a TOC i see we are spinning and i never see the printk.
it might be that it's actually printing and just that the output is not
going to the console... dunno
what am i missing? :)
randolph
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
next reply other threads:[~2004-07-14 4:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-14 4:29 Randolph Chung [this message]
2004-07-14 5:08 ` [parisc-linux] spinlock debug Randolph Chung
2004-07-14 5:28 ` Grant Grundler
2004-07-14 5:30 ` Randolph Chung
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=20040714042909.GM546@tausq.org \
--to=randolph@tausq.org \
--cc=parisc-linux@lists.parisc-linux.org \
--cc=varenet@parisc-linux.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.