2001-04-21 01:12:43

by D.W.Howells

[permalink] [raw]
Subject: [PATCH] i386 rw_semaphore improvements

This patch (made against linux-2.4.4-pre5) makes several changes to the rwsem
implementation:

(1) It fixes the bug found by Andrea by changing how processes that are
waiting on the semaphore are managed.

(2) As a result of (1), the wake_up_ctx() stuff is no longer used and has
been removed.

(3) Contention handling in this rwsem implementation is now faster as a
result of (1). The increase from slightly to a fair amount depending on
the situation.

(4) The asm-i386/rwsem-spin.h implementation is now gone. i386 CPUs will use
the generic implementation instead.

(5) The asm-i386/rwsem-xadd.h has been subsumed by asm-i386/rwsem.h since
there's now only one i386-arch optimised version.

(6) Some alpha-arch fixes have been applied.

(7) The sparc64-arch optimised implementation has been updated to fall in
line with (1).

(8) The generic implementation now has a single spinlock which it uses both
for waiting process management and for guarding access to the counter.

I'll have a look tomorrow at making the generic spinlock implementation
non-inline.

David


Attachments:
rwsem-x.diff (40.03 kB)
rw-semaphore fixes