All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] steal_account_process_tick() should return jiffies
@ 2016-03-04 22:59 Chris Friesen
  2016-03-05 10:27 ` Thomas Gleixner
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Friesen @ 2016-03-04 22:59 UTC (permalink / raw)
  To: John Stultz, Thomas Gleixner, Daniel Lezcano, Frederic Weisbecker,
	lkml

The callers of steal_account_process_tick() expect it to return whether
the last jiffy was stolen or not.
    
Currently the return value of steal_account_process_tick() is in units
of cputime, which vary between either jiffies or nsecs depending on
CONFIG_VIRT_CPU_ACCOUNTING_GEN.
    
The fix is to change steal_account_process_tick() to always return
jiffies.  If CONFIG_VIRT_CPU_ACCOUNTING_GEN is not enabled then this
is a no-op.

As far as I can tell this bug has been present since commit dee08a72.

Signed-off-by: Chris Friesen <chris.friesen@windriver.com>
---

 kernel/sched/cputime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index b2ab2ff..e724496 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -276,7 +276,7 @@ static __always_inline bool steal_account_process_tick(void)
 		this_rq()->prev_steal_time += cputime_to_nsecs(steal_ct);
 
 		account_steal_time(steal_ct);
-		return steal_ct;
+		return cputime_to_jiffies(steal_ct);
 	}
 #endif
 	return false;

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

end of thread, other threads:[~2016-03-08 13:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-04 22:59 [PATCH] steal_account_process_tick() should return jiffies Chris Friesen
2016-03-05 10:27 ` Thomas Gleixner
2016-03-05 13:19   ` Frederic Weisbecker
2016-03-06  4:17     ` Chris Friesen
2016-03-06  5:18       ` [PATCH v2] sched/cputime: " Chris Friesen
2016-03-06 10:58         ` Thomas Gleixner
2016-03-08 12:29         ` Frederic Weisbecker
2016-03-08 13:18         ` [tip:sched/core] sched/cputime: Fix steal_account_process_tick() to always " tip-bot for Chris Friesen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.