Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1369409 > unrolled thread

[RFC v2 5/7] GRUB accounting

Started byLuca Abeni <luca.abeni@unitn.it>
First post2016-04-01 17:20 +0200
Last post2016-04-01 17:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC v2 5/7] GRUB accounting Luca Abeni <luca.abeni@unitn.it> - 2016-04-01 17:20 +0200

#1369409 — [RFC v2 5/7] GRUB accounting

FromLuca Abeni <luca.abeni@unitn.it>
Date2016-04-01 17:20 +0200
Subject[RFC v2 5/7] GRUB accounting
Message-ID<rj91E-6gd-3@gated-at.bofh.it>
Signed-off-by: Luca Abeni <luca.abeni@unitn.it>
---
 kernel/sched/deadline.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index ca7910a..647d779 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -783,6 +783,19 @@ int dl_runtime_exceeded(struct sched_dl_entity *dl_se)
 extern bool sched_rt_bandwidth_account(struct rt_rq *rt_rq);
 
 /*
+ * This function implements the GRUB accounting rule:
+ * according to the GRUB reclaiming algorithm, the runtime is
+ * not decreased as "dq = -dt", but as "dq = -Uact dt", where
+ * Uact is the (per-runqueue) active utilization.
+ * Since rq->dl.running_bw contains Uact * 2^20, the result
+ * has to be shifted right by 20.
+ */
+u64 grub_reclaim(u64 delta, struct rq *rq)
+{
+	return (delta * rq->dl.running_bw) >> 20;
+}
+
+/*
  * Update the current task's runtime statistics (provided it is still
  * a -deadline task and has not been removed from the dl_rq).
  */
@@ -821,6 +834,7 @@ static void update_curr_dl(struct rq *rq)
 
 	sched_rt_avg_update(rq, delta_exec);
 
+	delta_exec = grub_reclaim(delta_exec, rq);
 	dl_se->runtime -= delta_exec;
 
 throttle:
-- 
2.5.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web