[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428345823-8491-1-git-send-email-abelvesa@gmail.com>
Date: Mon, 6 Apr 2015 21:43:43 +0300
From: Abel Vesa <abelvesa@...il.com>
To: mingo@...hat.com, peterz@...radead.org
Cc: linux-kernel@...r.kernel.org, Abel Vesa <abelvesa@...il.com>
Subject: [PATCH] sched/core: Remove wakeup_gran with single call calc_delta_fair
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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists