lkml.org 
[lkml]   [2019]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 07/16] locking/rwsem: Implement lock handoff to prevent lock starvation
From
Date
On 04/16/2019 10:12 AM, Peter Zijlstra wrote:
> On Sat, Apr 13, 2019 at 01:22:50PM -0400, Waiman Long wrote:
>> +/*
>> + * The typical HZ value is either 250 or 1000. So set the minimum waiting
>> + * time to 4ms in the wait queue before initiating the handoff protocol.
>> + */
>> +#define RWSEM_WAIT_TIMEOUT (HZ/250)
> That seems equally unfortunate. For HZ=100 that results in 0ms, and for
> HZ=300 that results in 3 1/3-rd ms.
>
> (and this is not considering Alpha,ARM and MIPS, who all have various
> other 'creative' HZ values)
>
> In general aiming for sub 10ms timing using jiffies seems 'optimistic'.

I see your point. I will change it to use sched_clock() instead.

Thanks,
Longman

\
 
 \ /
  Last update: 2019-04-16 22:27    [W:0.132 / U:5.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site