lkml.org 
[lkml]   [2016]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] prctl: Add PR_SET_TIMERSLACK_PID for setting timer slack of an arbitrary thread.
From
On Fri, Feb 5, 2016 at 6:15 PM, Arjan van de Ven <arjan@linux.intel.com> wrote:
> On 2/5/2016 4:51 PM, John Stultz wrote:
>>
>> Arjan/Thomas: One curious thing I noticed here while writing some
>> documentation. The timer_slack_ns value in the task struct is a
>> unsigned long.
>>
>> So this means PR_SET_TIMERSLACK limits the maximum slack on 32 bit
>> machines to ~4 seconds. Where on 64bit machines it can be quite a bit
>> longer (unreasonably long, really :).
>
>
> originally when we created timerslack, 4 seconds was an eternity and good
> enough for everyone
> by a mile... (assumption was practical upper limit being in the 15 msec
> range)
> and most of the RT guys would only tolerate a little bit of it
>
> is there any real/practial use of going longer than 4 seconds? if there
> is then yeah fixing it makes sense.
> if it's just theoretical... shrug... 32 bit systems have a bunch of
> other limits/differences a well.

So I'd think it would be mostly theoretical, but in my testing on a
VM, setting the timerslack for bash to 10 secs made time sleep 1 take
~10.5 seconds. So its apparently not too hard to coalesce fairly far
out (I need to spend a bit more time to verify that events really
weren't happening during that time and we're not just doing
unnecessary delays with the extra slack).

But yea. My main concern is that if we do a consistent 64bit interface
for all arches in the /proc/<pid>/timerslack_ns interface, it will
make PR_GET_TIMERSLACK return incorrect results on 32bit systems when
the slack is >= 2^32.

I've got a first pass of the patch done which just uses ULONG_MAX on
the respective arch, but I've got to close up for the day, so I'll see
about doing a follow on patch that makes the task timer_slack_ns value
be a u64 and extends the interface to use that as well on all arches,
and send out both on monday so folks can see which they prefer.

thanks
-john

thanks
-john

\
 
 \ /
  Last update: 2016-02-06 04:01    [W:0.056 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site