From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: <peterz@infradead.org>, <mingo@redhat.com>,
<linux-kernel@vger.kernel.org>, <ktkhai@virtuozzo.com>
Subject: [PATCH 3/3] sched/fair: Kill task_change_group_fair()
Date: Tue, 21 Feb 2017 15:10:51 +0300 [thread overview]
Message-ID: <148767904663.5212.9972276733201696001.stgit@localhost.localdomain> (raw)
In-Reply-To: <148767900991.5212.16341443539923627997.stgit@localhost.localdomain>
Since we need the special behaviour for TASK_MOVE_GROUP case only,
we may move the switch up to sched_change_group() and kill
task_change_group_fair().
I suppose, this may simplify the code in some way.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
kernel/sched/core.c | 4 ++--
kernel/sched/fair.c | 15 +--------------
kernel/sched/sched.h | 2 +-
3 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 8f972df76eb2..5007892342b2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6395,8 +6395,8 @@ static void sched_change_group(struct task_struct *tsk, int type)
tsk->sched_task_group = tg;
#ifdef CONFIG_FAIR_GROUP_SCHED
- if (tsk->sched_class->task_change_group)
- tsk->sched_class->task_change_group(tsk, type);
+ if (tsk->sched_class->task_move_group && type == TASK_MOVE_GROUP)
+ tsk->sched_class->task_move_group(tsk);
else
#endif
set_task_rq(tsk, task_cpu(tsk));
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a005bee12e0b..cf6d12513a3f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9206,19 +9206,6 @@ static void task_move_group_fair(struct task_struct *p)
attach_task_cfs_rq(p);
}
-static void task_change_group_fair(struct task_struct *p, int type)
-{
- switch (type) {
- case TASK_SET_GROUP:
- set_task_rq(p, task_cpu(p));
- break;
-
- case TASK_MOVE_GROUP:
- task_move_group_fair(p);
- break;
- }
-}
-
void free_fair_sched_group(struct task_group *tg)
{
int i;
@@ -9462,7 +9449,7 @@ const struct sched_class fair_sched_class = {
.update_curr = update_curr_fair,
#ifdef CONFIG_FAIR_GROUP_SCHED
- .task_change_group = task_change_group_fair,
+ .task_move_group = task_move_group_fair,
#endif
};
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 4a9313f0b5c8..f2bc04826ea5 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1407,7 +1407,7 @@ struct sched_class {
#define TASK_MOVE_GROUP 1
#ifdef CONFIG_FAIR_GROUP_SCHED
- void (*task_change_group) (struct task_struct *p, int type);
+ void (*task_move_group) (struct task_struct *p);
#endif
};
prev parent reply other threads:[~2017-02-21 12:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 12:10 [PATCH 1/3] sched/fair: Set sched_entity::depth only when parent has changed Kirill Tkhai
2017-02-21 12:10 ` [PATCH 2/3] sched/fair: Kill task_set_group_fair() Kirill Tkhai
2017-02-21 12:10 ` Kirill Tkhai [this message]
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=148767904663.5212.9972276733201696001.stgit@localhost.localdomain \
--to=ktkhai@virtuozzo.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
all inboxes | Powered by JetHome®