aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 15:53:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-23 15:53:48 -0400
commit15a3d11b0f2ebdfb3591e411e268aa81998d4723 (patch)
tree56e1d7715653871f015341c7edabd08045f5fc28 /include/linux/sched.h
parent1f3a8e093f470ef193b0ca6011d90180331c8b53 (diff)
parentc8b281161dfa4bb5d5be63fb036ce19347b88c63 (diff)
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sched: Increase SCHED_LOAD_SCALE resolution sched: Introduce SCHED_POWER_SCALE to scale cpu_power calculations sched: Cleanup set_load_weight()
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 340f5ee57334..aaf71e08222c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -786,17 +786,39 @@ enum cpu_idle_type {
786}; 786};
787 787
788/* 788/*
789 * sched-domains (multiprocessor balancing) declarations: 789 * Increase resolution of nice-level calculations for 64-bit architectures.
790 * The extra resolution improves shares distribution and load balancing of
791 * low-weight task groups (eg. nice +19 on an autogroup), deeper taskgroup
792 * hierarchies, especially on larger systems. This is not a user-visible change
793 * and does not change the user-interface for setting shares/weights.
794 *
795 * We increase resolution only if we have enough bits to allow this increased
796 * resolution (i.e. BITS_PER_LONG > 32). The costs for increasing resolution
797 * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the
798 * increased costs.
790 */ 799 */
800#if BITS_PER_LONG > 32
801# define SCHED_LOAD_RESOLUTION 10
802# define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION)
803# define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION)
804#else
805# define SCHED_LOAD_RESOLUTION 0
806# define scale_load(w) (w)
807# define scale_load_down(w) (w)
808#endif
791 809
792/* 810#define SCHED_LOAD_SHIFT (10 + SCHED_LOAD_RESOLUTION)
793 * Increase resolution of nice-level calculations:
794 */
795#define SCHED_LOAD_SHIFT 10
796#define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) 811#define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT)
797 812
798#define SCHED_LOAD_SCALE_FUZZ SCHED_LOAD_SCALE 813/*
814 * Increase resolution of cpu_power calculations
815 */
816#define SCHED_POWER_SHIFT 10
817#define SCHED_POWER_SCALE (1L << SCHED_POWER_SHIFT)
799 818
819/*
820 * sched-domains (multiprocessor balancing) declarations:
821 */
800#ifdef CONFIG_SMP 822#ifdef CONFIG_SMP
801#define SD_LOAD_BALANCE 0x0001 /* Do load balancing on this domain. */ 823#define SD_LOAD_BALANCE 0x0001 /* Do load balancing on this domain. */
802#define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */ 824#define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */