Skip to content

Per-task load tracking errors

Chris Redpath lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2sched: reset blocked load decay_count during synchronizationkernel/sched/fair.c+3 -51 reply
2/2sched: update runqueue clock before migrations awaykernel/sched/fair.c+30 -011 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchBen Segall
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] Per-task load tracking errors

Hi Paul, Peter etc.

I've found a couple of bugs in the load tracking code and here is my attempt to fix them. I have some test code available which can trigger the issues if anyone is interested.

The first one is straightforward. We can leave a number in se.avg.decay_count after a short sleep. If that task is later migrated while runnable, then the left-over decay looks like unaccounted sleep time so the load is decayed.

The second one is similar. Here we are losing sleep time for a task if it is migrated while sleeping and the CPU it previously ran on has entered nohz mode.

I don't really like this fix much, but the root of the problem is that load tracking more-or-less expects the runqueue's decay_counter to be up to date, and when nohz is in use it is not. The fix demonstrates the issue anyway, I haven't seen other occasions where nohz CPUs distort the tracked load.

Chris Redpath (2):
sched: reset blocked load decay_count during synchronization
sched: update runqueue clock before migrations away

 kernel/sched/fair.c |   38 +++++++++++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.9.5