lkml.org 
[lkml]   [2015]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sched/core: Remove wakeup_gran with single call calc_delta_fair
Date
This patch removes function wakeup_gran and its call by calling directly
calc_delta_fair function with sysctl_sched_wakeup_granularity and se as arguments.

Signed-off-by: Abel Vesa <abelvesa@gmail.com>
---
kernel/sched/fair.c | 38 ++++++++++++++++----------------------
1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 46855d0..63a4051 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4927,27 +4927,6 @@ migrate_task_rq_fair(struct task_struct *p, int next_cpu)
}
#endif /* CONFIG_SMP */

-static unsigned long
-wakeup_gran(struct sched_entity *curr, struct sched_entity *se)
-{
- unsigned long gran = sysctl_sched_wakeup_granularity;
-
- /*
- * Since its curr running now, convert the gran from real-time
- * to virtual-time in his units.
- *
- * By using 'se' instead of 'curr' we penalize light tasks, so
- * they get preempted easier. That is, if 'se' < 'curr' then
- * the resulting gran will be larger, therefore penalizing the
- * lighter, if otoh 'se' > 'curr' then the resulting gran will
- * be smaller, again penalizing the lighter task.
- *
- * This is especially important for buddies when the leftmost
- * task is higher priority than the buddy.
- */
- return calc_delta_fair(gran, se);
-}
-
/*
* Should 'se' preempt 'curr'.
*
@@ -4970,7 +4949,22 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se)
if (vdiff <= 0)
return -1;

- gran = wakeup_gran(curr, se);
+ /*
+ * Since its curr running now, convert the gran from real-time
+ * to virtual-time in his units.
+ *
+ * By using 'se' instead of 'curr' we penalize light tasks, so
+ * they get preempted easier. That is, if 'se' < 'curr' then
+ * the resulting gran will be larger, therefore penalizing the
+ * lighter, if otoh 'se' > 'curr' then the resulting gran will
+ * be smaller, again penalizing the lighter task.
+ *
+ * This is especially important for buddies when the leftmost
+ * task is higher priority than the buddy.
+ */
+
+ gran = calc_delta_fair(sysctl_sched_wakeup_granularity, se);
+
if (vdiff > gran)
return 1;

--
1.9.1


\
 
 \ /
  Last update: 2015-04-06 21:21    [W:0.069 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site