Andi Kleen wrote: > On Friday 24 February 2006 10:26, Nick Piggin wrote: > > >>[aside] >>Actually I have a scalability improvement for rwsems, that moves the >>actual task wakeups out from underneath the rwsem spinlock in the up() >>paths. This was useful exactly on a mixed read+write workload on mmap_sem. >> >>The difference was quite large for the "generic rwsem" algorithm because >>it uses the spinlock in fastpaths a lot more than the xadd algorithm. I >>think x86-64 uses the former, which is what I presume you're testing with? > > > I used the generic algorithm because Andrea originally expressed some doubts > on the correctness of the xadd algorithms and after trying to understand them > myself I wasn't sure myself. Generic was the safer choice. > > But if someone can show convincing numbers that XADD rwsems are faster > for some workload we can switch. I guess they are tested well enough now > on i386. > > Or would your scalability improvement remove that difference (if it really exists)? > Here is a forward port of my scalability improvement, untested. Unfortunately I didn't include absolute performance results, but the changelog indicates that there was some noticable delta between the rwsem implementations (and that's what I vaguely remember). Note: this was with volanomark, which can be quite variable at the best of times IIRC. Note2: this was on a 16-way NUMAQ, which had the interconnect performance of a string between two cans compared to a modern x86-64 of smaller size, so it may be harder to notice an improvement. -- SUSE Labs, Novell Inc.