All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@parisc-linux.org>
To: Randolph Chung <randolph@tausq.org>
Cc: parisc-linux@lists.parisc-linux.org, varenet@parisc-linux.org
Subject: Re: [parisc-linux] spinlock debug
Date: Tue, 13 Jul 2004 23:28:06 -0600	[thread overview]
Message-ID: <20040714052806.GB16639@colo.lackof.org> (raw)
In-Reply-To: <20040714042909.GM546@tausq.org>

On Tue, Jul 13, 2004 at 09:29:10PM -0700, Randolph Chung wrote:
> I don't think the comment is correct.

The comment is *mostly* correct.
It just doesn't get all the exit criteria right. :^)

> 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.

Yup - good catch.

> you probably need a "&& stuck > 0" in the outer loop.

Yes. This should be sufficient:
        a = __ldcw_align(lock);
        while ((__ldcw(a) == 0) && stuck)
                while ((*a == 0) && --stuck);

> 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

Do you happen to know which lock it's spinning on?
That should at least reduce the subset of code we need to look at.

grant
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

  parent reply	other threads:[~2004-07-14  5:28 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
2004-07-14  5:28 ` Grant Grundler [this message]
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=20040714052806.GB16639@colo.lackof.org \
    --to=grundler@parisc-linux.org \
    --cc=parisc-linux@lists.parisc-linux.org \
    --cc=randolph@tausq.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.