From: Randolph Chung <randolph@tausq.org>
To: varenet@parisc-linux.org
Cc: parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] spinlock debug
Date: Tue, 13 Jul 2004 22:08:32 -0700 [thread overview]
Message-ID: <20040714050832.GN546@tausq.org> (raw)
In-Reply-To: <20040714042909.GM546@tausq.org>
> a = __ldcw_align(lock);
> while ((__ldcw(a) == 0))
> while ((*a == 0) && --stuck);
There's another race in the code. Suppose stuck becomes 0, so you go
back to the outer loop, and you manage to acquire the lock, then you
will hit the next if:
52 if (unlikely(stuck <= 0)) {
53 printk(KERN_ERR
54 "%s:%d: spin_lock(%s/%p) stuck in %s at %p(%d)"
55 " owned by %s:%d in %s at %p(%d)\n",
56 base_file, line_no, lock->module, lock,
57 current->comm, inline_pc, cpu,
58 lock->bfile, lock->bline, lock->task->comm,
59 lock->previous, lock->oncpu);
60 stuck = INIT_STUCK;
61 printed = 1;
62 goto try_again;
63 }
so you erroneously detect that the lock was not taken, print an error,
and go back to get the lock again. now you will not be able to acquire
the lock and you are deadlocked.
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 prev parent reply other threads:[~2004-07-14 5:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-14 4:29 [parisc-linux] spinlock debug Randolph Chung
2004-07-14 5:08 ` Randolph Chung [this message]
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=20040714050832.GN546@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.