From: Matthew Wilcox <matthew@wil.cx>
To: "Michael S. Zick" <mszick@morethan.org>
Cc: parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] some more questions about __raw_write_trylock() hppa implementation
Date: Thu, 31 Aug 2006 07:13:40 -0600 [thread overview]
Message-ID: <20060831131340.GD4919@parisc-linux.org> (raw)
In-Reply-To: <200608310801.30580.mszick@morethan.org>
On Thu, Aug 31, 2006 at 08:01:30AM -0500, Michael S. Zick wrote:
> better? not sure, but one thing I am looking at using is
> tri-state locks, defined as:
>
> 0 == Busy, change in process
> &lock == Locked
> other == Unlocked
>
> Since that can be done with load&clear and the information
> already on hand in the registers.
Yep, although I don't think that actually saves us from the
reader-interrupted-write-lock problem. The first thing the writer does
is ldcw, then if it's interrupted, the reader-in-interrupt-context can't
tell if it's a heavily contended read-lock (which would eventually
work), or if it's interrupted a write lock attempt.
One thing we could do is limit the number of times we retry.
Hmm, I just thought. If we interrupted a writer trying to acquire the
lock, the writer was about to successfully acquire the lock. But we
interrupted them, so they can't be running. And nobody else can acquire
the lock because the attempting writer holds the spinlock. So the
reader in interrupt context can be deemed to have successfully acquired
the lock. Now ... how do we handle releasing that lock, given that it
can't acquire the spinlock ...
_______________________________________________
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:[~2006-08-31 13:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-30 20:23 [parisc-linux] some more questions about __raw_write_trylock() hppa implementation Joel Soete
2006-08-31 3:59 ` Matthew Wilcox
2006-08-31 6:06 ` Grant Grundler
2006-08-31 12:31 ` Matthew Wilcox
2006-08-31 13:01 ` Michael S. Zick
2006-08-31 13:13 ` Matthew Wilcox [this message]
2006-08-31 16:08 ` Grant Grundler
2006-08-31 16:27 ` Grant Grundler
2006-09-01 14:01 ` Matthew Wilcox
2006-09-01 15:57 ` Grant Grundler
2006-09-01 17:19 ` Matthew Wilcox
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=20060831131340.GD4919@parisc-linux.org \
--to=matthew@wil.cx \
--cc=mszick@morethan.org \
--cc=parisc-linux@lists.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.