lkml.org 
[lkml]   [2014]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] [PATCH] Pre-emption control for userspace
On Thu, 6 Mar 2014, Kevin Easton wrote:

> On Tue, Mar 04, 2014 at 04:51:15PM -0800, Andi Kleen wrote:
>> Anything else?
>
> If it was possible to make the time remaining in the current timeslice
> available to userspace through the vdso, the thread could do something like:
>
> if (sys_timeleft() < CRITICAL_SECTION_SIZE)
> yield();
> lock();
>
> to avoid running out of timeslice in the middle of the critical section.

but won't the system call result in context switches? According to Kevin, even a
context switch to another thread and back immediatly is bad enough to need to be
avoided, so replacing that with the context switch to the kernel and back isn't
a subtantial win.

David Lang


\
 
 \ /
  Last update: 2014-03-09 16:02    [W:0.360 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site