Re: [4.2, Regression] Queued spinlocks cause major XFS performance regression

From: Dave Chinner
Date: Sun Sep 06 2015 - 19:33:02 EST


On Fri, Sep 04, 2015 at 05:25:23PM +0200, Peter Zijlstra wrote:
> Something like so...
>
> ---
> Subject: locking: Fix virt test-and-set lock implementation
>
> Dave ran into horrible performance on a VM without PARAVIRT_SPINLOCKS
> set and Linus noted that the test-and-set implementation was retarded.
>
> One should spin on the variable with a load, not a rmw.
>
> While there, remove the queued from the name, as the lock isn't queued
> at all, but a simple test-and-set.
>
> Reported-by: Dave Chinner <david@xxxxxxxxxxxxx>
> Suggested-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>

FSUse% Count Size Files/sec App Overhead
0 1600000 0 319511.8 9398733
0 3200000 0 301517.9 9516230
0 4800000 0 300357.6 9676651
0 6400000 0 282167.8 11513255

Looks OK.

Tested-by: Dave Chinner <david@xxxxxxxxxxxxx>

Cheers,

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