diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index f2f440221b70..c34a718e20dd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -788,9 +788,28 @@ enum cpu_idle_type { | |||
788 | }; | 788 | }; |
789 | 789 | ||
790 | /* | 790 | /* |
791 | * Increase resolution of nice-level calculations: | 791 | * Increase resolution of nice-level calculations for 64-bit architectures. |
792 | * The extra resolution improves shares distribution and load balancing of | ||
793 | * low-weight task groups (eg. nice +19 on an autogroup), deeper taskgroup | ||
794 | * hierarchies, especially on larger systems. This is not a user-visible change | ||
795 | * and does not change the user-interface for setting shares/weights. | ||
796 | * | ||
797 | * We increase resolution only if we have enough bits to allow this increased | ||
798 | * resolution (i.e. BITS_PER_LONG > 32). The costs for increasing resolution | ||
799 | * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the | ||
800 | * increased costs. | ||
792 | */ | 801 | */ |
793 | #define SCHED_LOAD_SHIFT 10 | 802 | #if BITS_PER_LONG > 32 |
803 | # define SCHED_LOAD_RESOLUTION 10 | ||
804 | # define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION) | ||
805 | # define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION) | ||
806 | #else | ||
807 | # define SCHED_LOAD_RESOLUTION 0 | ||
808 | # define scale_load(w) (w) | ||
809 | # define scale_load_down(w) (w) | ||
810 | #endif | ||
811 | |||
812 | #define SCHED_LOAD_SHIFT (10 + SCHED_LOAD_RESOLUTION) | ||
794 | #define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) | 813 | #define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) |
795 | 814 | ||
796 | /* | 815 | /* |