lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 22 Jul 2014 14:28:17 -0400
From:	Waiman Long <>
To:	Andi Kleen <>
CC:	Thomas Gleixner <>,
	Ingo Molnar <>,
	Peter Zijlstra <>,
	Darren Hart <>,
	Davidlohr Bueso <>,
	Heiko Carstens <>,,,, Jason Low <>,
	Scott J Norton <>
Subject: Re: [RFC PATCH 0/5] futex: introduce an optimistic spinning futex

On 07/21/2014 12:42 PM, Andi Kleen wrote:
> Waiman Long<>  writes:
>> This patch series introduces two new futex command codes to support
>> a new optimistic spinning futex for implementing an exclusive lock
>> primitive that should perform better than the same primitive using
>> the wait-wake futex in cases where the lock owner is actively working
>> instead of waiting for I/O completion.
> How would you distinguish those two cases automatically?

I don't really distinguish between these two. The purpose of this 
paragraph is to show the best use cases for the spinning futexes is when 
the lock owner is not likely to sleep while in the critical section.

>> This patch series improves futex performance on two different fronts:
>>   1) Reducing the amount of the futex spinlock contention by using 2
>>      different spinlocks instead of just one for the wait-wake futex.
>>   2) Eliminating the context switching overhead and latency due to the
>>      sleeping and the waking of the waiting tasks.
> FWIW the main problem is currently that switch-through-idle is so
> slow. I think improving that would give a boost to far more
> situations.

If we can improve the context switching overhead, that can certainly 
help a lot of applications.

>> Patch 4 changes sleeping queue from a simple FIFO list to an rbtree
>> sorted by process priority as well as the sequeunce the tasks enter
>> the kernel.
> This seems to mix new functionality with performance improvements?
> Generally adding new ordering in an user interface is risky because
> often user programs have been tuned for specific old ordering.

Not really, this patch is to emulate the current behavior of the 
wait-wake futex which is queued in a priority queue. Because of 
spinning, tasks may enter into sleep state in different order than when 
they enter into the kernel. That is why I keep a sequence number to 
track who go into the kernel first.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists