[lkml]   [2019]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/2] sched: Distangle worker accounting from rq lock

On Wed, Mar 13, 2019 at 05:55:48PM +0100, Sebastian Andrzej Siewior wrote:
> From: Thomas Gleixner <>
> The worker accounting for CPU bound workers is plugged into the core
> scheduler code and the wakeup code. This is not a hard requirement and
> can be avoided by keeping track of the state in the workqueue code
> itself.
> Keep track of the sleeping state in the worker itself and call the
> notifier before entering the core scheduler. There might be false
> positives when the task is woken between that call and actually
> scheduling, but that's not really different from scheduling and being
> woken immediately after switching away. When nr_running is updated when
> the task is retunrning from schedule() then it is later compared when it
> is done from ttwu().
> Signed-off-by: Thomas Gleixner <>
> Cc: Daniel Bristot de Oliveira <>
> Link:
> Link:
> Signed-off-by: Thomas Gleixner <>
> [bigeasy: preempt_disable() around wq_worker_sleeping() by Daniel Bristot de
> Oliveira]
> Signed-off-by: Sebastian Andrzej Siewior <>

This looks good from wq side. Peter, are you okay with routing this
through the wq tree? If you wanna take it through the sched tree,
please feel free to add

Acked-by: Tejun Heo <>



 \ /
  Last update: 2019-04-08 21:46    [W:0.106 / U:9.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site