Skip to content

sched/loadavg: Fix loadavg spikes and sprinkle {READ,WRITE}_ONCE()

Matt Fleming lkml stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v11 patch 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2sched/loadavg: Avoid loadavg spikes caused by delayed NO_HZ accountingkernel/sched/loadavg.c+2 -22 replies
2/2sched/loadavg: Use {READ,WRITE}_ONCE() for sample windowkernel/sched/loadavg.c+11 -70 replies

Reviews trailers per patch

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

PatchFrederic WeisbeckerWanpeng Li
1/2A-b R-b
2/2

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

Read the v2 thread

Cover letter [PATCH v2 0/2] sched/loadavg: Fix loadavg spikes and sprinkle {READ,WRITE}_ONCE()

Peter, Frederic,

Here's a v2 of the patch series to fix the loadavg spikes I'm seeing on a v3.12 based kernel, caused by delaying load sampling if a sample period was crossed while in NO_HZ idle.

I tried to make the changelog for PATCH 1 clearer this time around by incorporating suggestions from both of you. Please let me know if it's still unclear.

PATCH 2 addresses Peter's comment:

"Irrespective the above though; should we not make this:

+ this_rq->calc_load_update = READ_ONCE(calc_load_update);

because if for some reason we do a double load of calc_load_update and see two different values, weird stuff could happen.

And because, on general principle, a READ_ONCE() should be paired with a WRITE_ONCE(), that should be done too I suppose."

The v1 of the patch can be found here:

https://lkml.kernel.org/r/[email protected]

Matt Fleming (2):
sched/loadavg: Avoid loadavg spikes caused by delayed NO_HZ accounting sched/loadavg: Use {READ,WRITE}_ONCE() for sample window

 kernel/sched/loadavg.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
Signature · 1 line
2.10.0