sched: fix updating sd->balance_interval in idle_balance()
PATCH 1/1 sched: fix updating sd->balance_interval in idle_balance()
sd->balance_interval is updated incorrectly when SD_BALANCE_NEWIDLE is not set in sd->flags. This patch updates sd->balance_interval only when we balance the domain.
Signed-off-by Nikhil Rao <[email protected]>
--- kernel/sched_fair.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
kernel/sched_fair.c +6 -5
@@ -2996,11 +2996,12 @@ static void idle_balance(int this_cpu, struct rq *this_rq)if (!(sd->flags &SD_LOAD_BALANCE ))continue ; -if (sd->flags &SD_BALANCE_NEWIDLE ) { -/* If we've pulled tasks over stop searching: */ - pulled_task =load_balance (this_cpu, this_rq, - sd,CPU_NEWLY_IDLE , &balance); - } +if (!(sd->flags &SD_BALANCE_NEWIDLE )) +continue ; + +/* If we've pulled tasks over stop searching: */ + pulled_task =load_balance (this_cpu, this_rq, sd, +CPU_NEWLY_IDLE , &balance); interval =msecs_to_jiffies (sd->balance_interval);if (time_after (next_balance, sd->last_balance + interval))
Signature · 1 line
1.7.0.1
Quoted 3 lines · Nikhil Rao
sd->balance_intervalis updated incorrectly whenSD_BALANCE_NEWIDLEis not set insd->flags. This patch updatessd->balance_intervalonly when we balance the domain.
I really need more than that.
Why is it wrong, what are the (measurable) effects of changing it and how did it come to be this way.
I could of course go and try to reverse engineer your patch, but it would be awesome if I didn't have to.