Re: [PATCH] i386 rwlock bug?

manfreds@colorfullife.com
Fri, 20 Aug 1999 13:50:58 -0400 (EDT)


>
> Bug or feature?
> I've modified this to leave the high bit on while waiting for the
> readers to go away, thus making the high bit a 'write lock pending'
> bit. This makes sure that while the writer is waiting for the write
> lock no more readers can come in.
I think this is a feature:
rw-locks can be use partially in interrupts:
* write only from outside interrupts
* read from everywhere

if a writer spins (interupts are enabled), then an interrupt occurs,
then you have a dead-lock.

WinNT has special "acquire_shared_starve_writer()"-calls but I don't
think this is required.

> Does anyone consider the current behaviour a feature? Are there
> arguments against my patch? Agreed, there isn't always much lock
> contention, so you can say "Leave it this way." but I use rwlocks in
> 'heavy contention' situations and (for example) with 10 readers and 1
> writer the writer never acquires the write lock without this patch.
add your code as a "rw-don't-starve-lock", but I think the normal
rw_lock must starve writers.

--
	Manfred

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/