From: Rik van Riel <riel@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, Kirill Tkhai <ktkhai@parallels.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
Nicolas Pitre <nicolas.pitre@linaro.org>,
mingo@kernel.org, pjt@google.com
Subject: [PATCH] sched: update last_balance only when actually balanced
Date: Tue, 22 Jul 2014 02:21:21 -0400 [thread overview]
Message-ID: <20140722022121.4589c63b@annuminas.surriel.com> (raw)
Currently rebalance_domains will happily update sd->last_balance
even if should_we_balance() decides that this CPU should not do
any load balancing for the sd.
This can prevent the CPU that should load balance for the sd from
doing load balancing, which can delay active balancing essentially
forever.
The solution is to only update sd->last_balance when load_balance()
actually did something.
Signed-off-by: Rik van Riel <riel@redhat.com>
---
kernel/sched/fair.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 45943b2..4f7fee2 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7187,7 +7187,9 @@ static void rebalance_domains(struct rq *rq, enum cpu_idle_type idle)
*/
idle = idle_cpu(cpu) ? CPU_IDLE : CPU_NOT_IDLE;
}
- sd->last_balance = jiffies;
+ /* Only update if we actually balanced. */
+ if (continue_balancing)
+ sd->last_balance = jiffies;
interval = get_sd_balance_interval(sd, idle != CPU_IDLE);
}
if (need_serialize)
next reply other threads:[~2014-07-22 6:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 6:21 Rik van Riel [this message]
2014-07-22 12:04 ` Peter Zijlstra
2014-07-22 15:46 ` Rik van Riel
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=20140722022121.4589c63b@annuminas.surriel.com \
--to=riel@redhat.com \
--cc=ktkhai@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=nicolas.pitre@linaro.org \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=tim.c.chen@linux.intel.com \
/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
all inboxes | Powered by JetHome®