From: tip-bot for Venkatesh Pallipadi <venki@google.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
a.p.zijlstra@chello.nl, tglx@linutronix.de, mingo@elte.hu,
venki@google.com
Subject: [tip:sched/core] sched: Make set_*_buddy() work on non-task entities
Date: Tue, 19 Apr 2011 12:05:15 GMT [thread overview]
Message-ID: <tip-69c80f3e9d3c569f8a3cee94ba1a324b5a7fa6b9@git.kernel.org> (raw)
In-Reply-To: <1302744070-30079-2-git-send-email-venki@google.com>
Commit-ID: 69c80f3e9d3c569f8a3cee94ba1a324b5a7fa6b9
Gitweb: http://git.kernel.org/tip/69c80f3e9d3c569f8a3cee94ba1a324b5a7fa6b9
Author: Venkatesh Pallipadi <venki@google.com>
AuthorDate: Wed, 13 Apr 2011 18:21:09 -0700
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 19 Apr 2011 10:08:37 +0200
sched: Make set_*_buddy() work on non-task entities
Make set_*_buddy() work on non-task sched_entity, to facilitate the
use of next_buddy to cache a group entity in cases where one of the
tasks within that entity sleeps or gets preempted.
set_skip_buddy() was incorrectly comparing the policy of task that is
yielding to be not equal to SCHED_IDLE. Yielding should happen even
when task yielding is SCHED_IDLE. This change removes the policy check
on the yielding task.
Signed-off-by: Venkatesh Pallipadi <venki@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1302744070-30079-2-git-send-email-venki@google.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/sched_fair.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 8744593..501ab63 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1846,26 +1846,26 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se)
static void set_last_buddy(struct sched_entity *se)
{
- if (likely(task_of(se)->policy != SCHED_IDLE)) {
- for_each_sched_entity(se)
- cfs_rq_of(se)->last = se;
- }
+ if (entity_is_task(se) && unlikely(task_of(se)->policy == SCHED_IDLE))
+ return;
+
+ for_each_sched_entity(se)
+ cfs_rq_of(se)->last = se;
}
static void set_next_buddy(struct sched_entity *se)
{
- if (likely(task_of(se)->policy != SCHED_IDLE)) {
- for_each_sched_entity(se)
- cfs_rq_of(se)->next = se;
- }
+ if (entity_is_task(se) && unlikely(task_of(se)->policy == SCHED_IDLE))
+ return;
+
+ for_each_sched_entity(se)
+ cfs_rq_of(se)->next = se;
}
static void set_skip_buddy(struct sched_entity *se)
{
- if (likely(task_of(se)->policy != SCHED_IDLE)) {
- for_each_sched_entity(se)
- cfs_rq_of(se)->skip = se;
- }
+ for_each_sched_entity(se)
+ cfs_rq_of(se)->skip = se;
}
/*
next prev parent reply other threads:[~2011-04-19 12:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 23:33 [PATCH] sched: next buddy hint on sleep and preempt path Venkatesh Pallipadi
2011-03-02 2:44 ` Rik van Riel
2011-03-02 5:43 ` Paul Turner
2011-03-02 6:47 ` Mike Galbraith
2011-03-02 7:08 ` Paul Turner
2011-03-02 7:40 ` Mike Galbraith
2011-03-02 19:12 ` Venkatesh Pallipadi
2011-03-08 0:59 ` [PATCH] sched: next buddy hint on sleep and preempt path - v1 Venkatesh Pallipadi
2011-03-08 1:29 ` Paul Turner
2011-03-08 1:47 ` Venkatesh Pallipadi
2011-04-14 1:21 ` [PATCH 0/2] sched: Avoid frequent cross taskgroup switches -v2 Venkatesh Pallipadi
2011-04-14 1:21 ` [PATCH 1/2] sched: Make set_*_buddy work on non-task entity -v2 Venkatesh Pallipadi
2011-04-19 12:05 ` tip-bot for Venkatesh Pallipadi [this message]
2011-04-14 1:21 ` [PATCH 2/2] sched: next buddy hint on sleep and preempt path -v2 Venkatesh Pallipadi
2011-04-14 10:50 ` Peter Zijlstra
2011-04-14 17:30 ` Venkatesh Pallipadi
2011-04-15 21:45 ` Rik van Riel
2011-04-19 12:05 ` [tip:sched/core] sched: Next buddy hint on sleep and preempt path tip-bot for Venkatesh Pallipadi
2011-03-08 2:33 ` [PATCH] sched: next buddy hint on sleep and preempt path - v1 Venkatesh Pallipadi
2011-03-02 19:22 ` [PATCH] sched: next buddy hint on sleep and preempt path Venkatesh Pallipadi
2011-03-02 10:31 ` Peter Zijlstra
2011-03-02 15:25 ` Mike Galbraith
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=tip-69c80f3e9d3c569f8a3cee94ba1a324b5a7fa6b9@git.kernel.org \
--to=venki@google.com \
--cc=a.p.zijlstra@chello.nl \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).