lkml.org 
[lkml]   [2018]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] sched/core: uclamp: add CPU clamp groups accounting
On Fri, Apr 13, 2018 at 12:47:45PM +0100, Patrick Bellasi wrote:
> In the past I remember some funny dance in cgroup callbacks when a
> task was terminating (like being moved in the root-rq just before
> exiting). But, as you say, if we always have the task_rq_lock we
> should be safe.

The syscall does the whole:

task_rq_lock();
queued = task_on_rq_queued();
running = task_current();
if (queued)
dequeue_task();
if (running)
put_prev_task();

/*
* task is in invariant state here,
* muck with it.
*/

if (queued)
enqueue_task();
if (running)
set_curr_task()
task_rq_unlock();

pattern; which because C sucks, we've not found a good template for yet.

Without the dequeue/put,enqueue/set you have to jump a few extra hoops.

\
 
 \ /
  Last update: 2018-04-13 14:45    [W:0.059 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site