On Fri, Apr 20, 2001 at 12:28:09AM +0100, D . W . Howells wrote:
> I benchmarked four different environments:
>
> (1) 2.4.4-pre3 + Andrea's generic rwsem patch
> (2) 2.4.4-pre4 using XADD to implement the rwsems
> (3) same as (2) but with a tweak to make rwsem_wake() less fair
> (4) 2.4.4-pre3 using my generic spinlock code to implement the rwsems
>
> David
>
>
> TEST NUM READERS NUM WRITERS CONTENTION
> =============== =============== =============== ==========
> rwsem-rw 4 2 r-w & w-w
> rwsem-ro 4 0 no
> rwsem-wo 0 4 w-w only
> rwsem-r1 1 0 no
> rwsem-w1 0 1 no
> rwsem-r2 2 0 no
>
>
> ENVIRONMENT TEST SCHED READERS WRITERS
> =============================== ======= ======= =============== =======
> Linux-2.4.4-pre3 + AA-rwsem rws-rw no 3330281 1009
> 3331972 994
[..]
> ------------------------------- ------- ------- --------------- -------
> Linux-2.4.4-pre4 [GENERIC-SPIN] rws-rw no 545138 274002
> 545378 273785
> yes 755343 187874
> 745888 185562
Some explanation on the above extreme difference. In the misc rw benchmark the
reason in the same amount of time I get a total number of down 3332966 and you
get only 819163 is that I provide recursive down_read and that in turn can
starve the down_write (my first patches weren't implementing fair semaphores).
As you can see in my post of yesterday I made my semaphores fair in my last
patches (from rwsem-generic-5). (you didn't said which patch you used exactly
but obviously it was earlier than the -5 revision)
I'm uncertain if I should drop the list_empty() check from the fast path and if
I should still allow up_* to be called from irq/softirq, if I reduce the max
number of sleepers to 2^16 and I will provide weaker wakeup semantics I won't
be penalizied anymore and then we'll really compare apples to orange making the
comparison more interesting (probably I will do because later on I can probably
re-add that two features without too much pain).
About the benchmark you wrote it looks good measure to me, thanks.
Andrea
-
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:34 EST