All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yong Zhang <yong.zhang0@gmail.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Michael Witten <mfwitten@gmail.com>,
	linux-kernel@vger.kernel.org,
	Christian Kujau <christian@nerdbynature.de>,
	Mike Galbraith <efault@gmx.de>, Ingo Molnar <mingo@elte.hu>
Subject: [PATCH] sched: fix autogroup nice tune on UP
Date: Sun, 23 Jan 2011 23:03:41 +0800	[thread overview]
Message-ID: <20110123150341.GA2643@zhy> (raw)
In-Reply-To: <20110123145429.GA2523@zhy>

And there is another issue on UP when FAIR_GROUP_SCHED
enabled.

---
From: Yong Zhang <yong.zhang0@gmail.com>
Subject: [PATCH] sched: fix autogroup nice tune on UP

When on UP with FAIR_GROUP_SCHED enabled, tune shares
only affect tg->shares, but is not reflected on
tg->se->load, the reason is update_cfs_shares()
do nothing on SMP.
So let sched_group_set_shares() update tg->se->load
directly for UP && FAIR_GROUP_SCHED.

This issue is found when enable autogroup, but also
exists on cgroup.cpu on UP.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
---
 kernel/sched.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 3ec2c6c..b8ed459 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -8483,8 +8483,8 @@ static DEFINE_MUTEX(shares_mutex);
 
 int sched_group_set_shares(struct task_group *tg, unsigned long shares)
 {
-	int i;
-	unsigned long flags;
+	int uninitialized_var(i);
+	unsigned long uninitialized_var(flags);
 
 	/*
 	 * We can't change the weight of the root cgroup.
@@ -8502,6 +8502,7 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
 		goto done;
 
 	tg->shares = shares;
+#ifdef CONFIG_SMP
 	for_each_possible_cpu(i) {
 		struct rq *rq = cpu_rq(i);
 		struct sched_entity *se;
@@ -8513,6 +8514,9 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
 			update_cfs_shares(group_cfs_rq(se), 0);
 		raw_spin_unlock_irqrestore(&rq->lock, flags);
 	}
+#else
+	update_load_set(&tg->se[0]->load, shares);
+#endif
 
 done:
 	mutex_unlock(&shares_mutex);
-- 
1.7.1


  reply	other threads:[~2011-01-23 15:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21 18:20 'autogroup' sched code KILLING responsiveness Michael Witten
2011-01-21 22:27 ` Mike Galbraith
2011-01-21 22:39   ` Michael Witten
2011-01-22  3:22     ` Mike Galbraith
2011-01-22 21:23   ` Michael Witten
2011-01-23  3:32     ` Michael Witten
2011-01-23  5:42       ` Mike Galbraith
2011-01-23 10:50 ` Christian Kujau
2011-01-23 11:19   ` Christian Kujau
2011-01-23 14:54   ` Yong Zhang
2011-01-23 15:03     ` Yong Zhang [this message]
2011-01-23 15:16       ` [PATCH] sched: fix autogroup nice tune on UP Pekka Enberg
2011-01-24  3:17         ` Yong Zhang
2011-01-24  5:40       ` [PATCH V2] " Yong Zhang
2011-01-24  5:54         ` Pekka Enberg
2011-01-24  6:11           ` Yong Zhang
2011-01-24  6:18             ` Pekka Enberg
2011-01-24  7:33               ` [PATCH V3] " Yong Zhang
2011-01-24  8:01                 ` Pekka Enberg
2011-01-24  9:00                 ` Mike Galbraith
2011-01-24 10:51                 ` [tip:sched/urgent] sched: Fix poor interactivity on UP systems due to group scheduler nice tune bug tip-bot for Yong Zhang
2011-01-23 15:15     ` 'autogroup' sched code KILLING responsiveness Ingo Molnar
2011-01-23 15:53       ` Michael Witten
2011-01-23 18:52       ` Andreas Mohr
2011-01-23 23:57       ` Christian Kujau

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=20110123150341.GA2643@zhy \
    --to=yong.zhang0@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=christian@nerdbynature.de \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfwitten@gmail.com \
    --cc=mingo@elte.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.