public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Li Zefan <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	peterz@infradead.org, tglx@linutronix.de, lizefan@huawei.com
Subject: [tip:sched/core] sched: Move SCHED_LOAD_SHIFT macros to kernel/ sched/sched.h
Date: Wed, 6 Mar 2013 06:35:19 -0800	[thread overview]
Message-ID: <tip-cc1f4b1f3faed9f2040eff2a75f510b424b3cf18@git.kernel.org> (raw)
In-Reply-To: <5135A771.4070104@huawei.com>

Commit-ID:  cc1f4b1f3faed9f2040eff2a75f510b424b3cf18
Gitweb:     http://git.kernel.org/tip/cc1f4b1f3faed9f2040eff2a75f510b424b3cf18
Author:     Li Zefan <lizefan@huawei.com>
AuthorDate: Tue, 5 Mar 2013 16:06:09 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 6 Mar 2013 11:24:30 +0100

sched: Move SCHED_LOAD_SHIFT macros to kernel/sched/sched.h

They are used internally only.

Signed-off-by: Li Zefan <lizefan@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/5135A771.4070104@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/sched.h | 25 -------------------------
 kernel/sched/sched.h  | 26 +++++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index e880d7d..f8826d0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -756,31 +756,6 @@ enum cpu_idle_type {
 };
 
 /*
- * Increase resolution of nice-level calculations for 64-bit architectures.
- * The extra resolution improves shares distribution and load balancing of
- * low-weight task groups (eg. nice +19 on an autogroup), deeper taskgroup
- * hierarchies, especially on larger systems. This is not a user-visible change
- * and does not change the user-interface for setting shares/weights.
- *
- * We increase resolution only if we have enough bits to allow this increased
- * resolution (i.e. BITS_PER_LONG > 32). The costs for increasing resolution
- * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the
- * increased costs.
- */
-#if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load  */
-# define SCHED_LOAD_RESOLUTION	10
-# define scale_load(w)		((w) << SCHED_LOAD_RESOLUTION)
-# define scale_load_down(w)	((w) >> SCHED_LOAD_RESOLUTION)
-#else
-# define SCHED_LOAD_RESOLUTION	0
-# define scale_load(w)		(w)
-# define scale_load_down(w)	(w)
-#endif
-
-#define SCHED_LOAD_SHIFT	(10 + SCHED_LOAD_RESOLUTION)
-#define SCHED_LOAD_SCALE	(1L << SCHED_LOAD_SHIFT)
-
-/*
  * Increase resolution of cpu_power calculations
  */
 #define SCHED_POWER_SHIFT	10
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index cc03cfd..709a30c 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -33,6 +33,31 @@ extern __read_mostly int scheduler_running;
  */
 #define NS_TO_JIFFIES(TIME)	((unsigned long)(TIME) / (NSEC_PER_SEC / HZ))
 
+/*
+ * Increase resolution of nice-level calculations for 64-bit architectures.
+ * The extra resolution improves shares distribution and load balancing of
+ * low-weight task groups (eg. nice +19 on an autogroup), deeper taskgroup
+ * hierarchies, especially on larger systems. This is not a user-visible change
+ * and does not change the user-interface for setting shares/weights.
+ *
+ * We increase resolution only if we have enough bits to allow this increased
+ * resolution (i.e. BITS_PER_LONG > 32). The costs for increasing resolution
+ * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the
+ * increased costs.
+ */
+#if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load  */
+# define SCHED_LOAD_RESOLUTION	10
+# define scale_load(w)		((w) << SCHED_LOAD_RESOLUTION)
+# define scale_load_down(w)	((w) >> SCHED_LOAD_RESOLUTION)
+#else
+# define SCHED_LOAD_RESOLUTION	0
+# define scale_load(w)		(w)
+# define scale_load_down(w)	(w)
+#endif
+
+#define SCHED_LOAD_SHIFT	(10 + SCHED_LOAD_RESOLUTION)
+#define SCHED_LOAD_SCALE	(1L << SCHED_LOAD_SHIFT)
+
 #define NICE_0_LOAD		SCHED_LOAD_SCALE
 #define NICE_0_SHIFT		SCHED_LOAD_SHIFT
 
@@ -784,7 +809,6 @@ static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev)
 }
 #endif /* __ARCH_WANT_UNLOCKED_CTXSW */
 
-
 static inline void update_load_add(struct load_weight *lw, unsigned long inc)
 {
 	lw->weight += inc;

  reply	other threads:[~2013-03-06 14:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05  8:05 [PATCH 0/9] sched: Shrink include/linux/sched.h Li Zefan
2013-03-05  8:05 ` [PATCH 1/9] sched: Remove some dummpy functions Li Zefan
2013-03-06 14:32   ` [tip:sched/core] sched: Remove some dummy functions tip-bot for Li Zefan
2013-03-05  8:05 ` [PATCH 2/9] sched: Remove test_sd_parent() Li Zefan
2013-03-06 14:34   ` [tip:sched/core] " tip-bot for Li Zefan
2013-03-05  8:06 ` [PATCH 3/9] sched: Move SCHED_LOAD_SHIFT macros to kernel/sched/sched.h Li Zefan
2013-03-06 14:35   ` tip-bot for Li Zefan [this message]
2013-03-05  8:06 ` [PATCH 4/9] sched: Move struct sched_group " Li Zefan
2013-03-06 14:36   ` [tip:sched/core] sched: Move struct sched_group to kernel/sched/ sched.h tip-bot for Li Zefan
2013-03-05  8:06 ` [PATCH 5/9] sched: Move wake flags to kernel/sched/sched.h Li Zefan
2013-03-06 14:37   ` [tip:sched/core] " tip-bot for Li Zefan
2013-03-05  8:06 ` [PATCH 6/9] sched: Move struct sched_class " Li Zefan
2013-03-06 14:38   ` [tip:sched/core] sched: Move struct sched_class to kernel/sched/ sched.h tip-bot for Li Zefan
2013-03-05  8:07 ` [PATCH 7/9] sched: Make default_scale_freq_power() static Li Zefan
2013-03-06 14:40   ` [tip:sched/core] " tip-bot for Li Zefan
2013-03-05  8:07 ` [PATCH 8/9] sched: Move group scheduling functions out of include/linux/sched.h Li Zefan
2013-03-06 14:41   ` [tip:sched/core] " tip-bot for Li Zefan
2013-03-05  8:07 ` [PATCH 9/9] sched: Remove double declaration of root_task_group Li Zefan
2013-03-06 14:42   ` [tip:sched/core] " tip-bot for Li Zefan
2013-03-05 16:43 ` [PATCH 0/9] sched: Shrink include/linux/sched.h Lai Jiangshan

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-cc1f4b1f3faed9f2040eff2a75f510b424b3cf18@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --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