Skip to content

Commit 4211a9a

Browse files
Christoph LameterLinus Torvalds
authored andcommitted
[PATCH] sched: remove staggering of load balancing
Timer interrupts already are staggered. We do not need an additional layer of time staggering for short load balancing actions that take a reasonably small portion of the time slice. For load balancing on large sched_domains we will add a serialization later that avoids concurrent load balance operations and thus has the same effect as load staggering. Signed-off-by: Christoph Lameter <[email protected]> Cc: Peter Williams <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: "Siddha, Suresh B" <[email protected]> Cc: "Chen, Kenneth W" <[email protected]> Acked-by: Ingo Molnar <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 571f6d2 commit 4211a9a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

kernel/sched.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,16 +2841,10 @@ static void active_load_balance(struct rq *busiest_rq, int busiest_cpu)
28412841
* Balancing parameters are set up in arch_init_sched_domains.
28422842
*/
28432843

2844-
/* Don't have all balancing operations going off at once: */
2845-
static inline unsigned long cpu_offset(int cpu)
2846-
{
2847-
return jiffies + cpu * HZ / NR_CPUS;
2848-
}
2849-
28502844
static void
28512845
rebalance_tick(int this_cpu, struct rq *this_rq, enum idle_type idle)
28522846
{
2853-
unsigned long this_load, interval, j = cpu_offset(this_cpu);
2847+
unsigned long this_load, interval;
28542848
struct sched_domain *sd;
28552849
int i, scale;
28562850

@@ -2885,7 +2879,7 @@ rebalance_tick(int this_cpu, struct rq *this_rq, enum idle_type idle)
28852879
if (unlikely(!interval))
28862880
interval = 1;
28872881

2888-
if (j - sd->last_balance >= interval) {
2882+
if (jiffies - sd->last_balance >= interval) {
28892883
if (load_balance(this_cpu, this_rq, sd, idle)) {
28902884
/*
28912885
* We've pulled tasks over so either we're no

0 commit comments

Comments
 (0)