From: Abel Vesa <abelvesa@gmail.com>
To: mingo@redhat.com, peterz@infradead.org
Cc: linux-kernel@vger.kernel.org, Abel Vesa <abelvesa@gmail.com>
Subject: [PATCH] sched/core: Remove wakeup_gran with single call calc_delta_fair
Date: Mon, 6 Apr 2015 21:43:43 +0300 [thread overview]
Message-ID: <1428345823-8491-1-git-send-email-abelvesa@gmail.com> (raw)
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
next reply other threads:[~2015-04-06 18:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-06 18:43 Abel Vesa [this message]
2015-04-07 10:30 ` Peter Zijlstra
2015-04-07 13:37 ` Abel Vesa
2015-04-07 16:55 ` Mike Galbraith
2015-04-07 17:25 ` Abel Vesa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1428345823-8491-1-git-send-email-abelvesa@gmail.com \
--to=abelvesa@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome