mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/fair: refine maximum periods for decay_load
@ 2016-08-05  6:34 Leo Yan
  2016-08-05  7:56 ` Vincent Guittot
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Yan @ 2016-08-05  6:34 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, linux-kernel; +Cc: Leo Yan

In current code, decay_load() will consider to set load value to zero
after passing 32*64 ms. So this means max_load * (0.5^64) ~= 0.

Kernel can support maximum number of processes and threads to 2^29 and
set task with highest priority with nice=-20 (weight = 88761). So in
worst case, one CPU may have maximum load value is:

    max_load = 2^29 * 88761 < 2^46

In theory after pass 46 periods we can ensure load value will be decayed
to zero. So this patch is to change maximum periods from 64 to 48.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e342159..55cb134 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2622,7 +2622,7 @@ static __always_inline u64 decay_load(u64 val, u64 n)
 
 	if (!n)
 		return val;
-	else if (unlikely(n > LOAD_AVG_PERIOD * 63))
+	else if (unlikely(n > LOAD_AVG_PERIOD * 47))
 		return 0;
 
 	/* after bounds checking we can collapse to 32-bit */
-- 
1.9.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-05  8:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-05  6:34 [PATCH] sched/fair: refine maximum periods for decay_load Leo Yan
2016-08-05  7:56 ` Vincent Guittot
2016-08-05  8:17   ` Leo Yan
2016-08-05  8:31     ` Vincent Guittot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®