[parisc-linux] some more questions about __raw_write_trylock() hppa implementation

Grant Grundler grundler at parisc-linux.org
Thu Aug 31 10:08:44 MDT 2006


On Thu, Aug 31, 2006 at 07:13:40AM -0600, Matthew Wilcox wrote:
> One thing we could do is limit the number of times we retry.

Yes, we have to or we face a variant of deadlock.

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

nononono...please don't go there. It's complicated enough already.
Adding more code just makes it slower and harder to maintain.
I'd much rather block interrupts in the writer code path as
proposed in your previous email.

grant



More information about the parisc-linux mailing list