[PATCH] rw_semaphores, optimisations try #3

From: D.W.Howells (dhowells@astarte.free-online.co.uk)
Date: Mon Apr 23 2001 - 15:35:34 EST


This patch (made against linux-2.4.4-pre6) makes a number of changes to the
rwsem implementation:

 (1) Everything in try #2

plus

 (2) Changes proposed by Linus for the generic semaphore code.

 (3) Ideas from Andrea and how he implemented his semaphores.

Linus, you suggested that the generic list handling stuff would be faster (2
unconditional stores) than mine (1 unconditional store and 1 conditional
store and branch to jump round it). You are both right and wrong. The generic
code does two stores per _process_ woken up (list_del) mine does the 1 or 2
stores per _batch_ of processes woken up. So the generic way is better when
the queue is an even mixture of readers or writers and my way is better when
there are far greater numbers of waiting readers. However, that said, there
is not much in it either way, so I've reverted it to the generic list stuff.

David


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



This archive was generated by hypermail 2b29 : Mon Apr 23 2001 - 21:00:47 EST