lkml.org 
[lkml]   [2016]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 3/5] futex: Throughput-optimized (TO) futexes
On 09/22/2016 09:23 AM, Peter Zijlstra wrote:
> On Tue, Sep 20, 2016 at 09:42:41AM -0400, Waiman Long wrote:
>> +/*
>> + * Spinning threshold before enabling lock handoff.
>> + * Each sleep will decrement the threshold by 1/32 of the start value.
>> + */
>> +#define TO_SPIN_THRESHOLD (1<< 13)
>> +#define TO_SLEEP_DECREMENT (TO_SPIN_THRESHOLD/32)
> Argh, we should really get rid of those stupid numbers. Wasn't there a
> patch set working on implementing paravirt functions that would make all
> this fixable in a sane way?

These thresholds are not paravirt related. They are there to determine
when we should activate explicit lock handoff when the waiter is waiting
for too long. Yes, it is arbitrary. The numbers are on the high side as
setting them too low will limit lock stealing and hence overall
performance. The FUTEX_WAITERS bit is only turned on when either the top
waiter is sleeping or a lock handoff is needed. Otherwise, it is off to
encourage lock stealing in the userspace as well as in the kernel.

Cheers,
Longman


\
 
 \ /
  Last update: 2016-09-23 00:03    [W:0.104 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site