From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] sched: don't rebalance if attached on NULL domain
Date: Thu, 5 Mar 2009 02:03:19 +0100 [thread overview]
Message-ID: <20090305010318.GB8949@nowhere> (raw)
In-Reply-To: <49af242d.1c07d00a.32d5.ffffc019@mx.google.com>
On Thu, Mar 05, 2009 at 01:27:02AM +0100, Frederic Weisbecker wrote:
> Impact: fix function graph trace hang / drop pointless softirq on UP
>
> While debugging a function graph trace hang on an old PII, I saw that it
> consumed most of its time on the timer interrupt.
> And the domain rebalancing softirq was the most concerned.
>
> The timer interrupt calls trigger_load_balance() which will decide if it is
> worth to schedule a rebalancing softirq.
>
> In case of builtin UP kernel, no problem arises because there is no
> domain question.
>
> In case of builtin SMP kernel running on an SMP box, still no problem,
> the softirq will be raised each time we reach the next_balance time.
>
> In case of builtin SMP kernel running on a UP box (most distros provide default SMP
> kernels, whatever the box you have), then the CPU is attached to the NULL sched domain.
> So a kind of unexpected behaviour happen:
>
> trigger_load_balance() -> raises the rebalancing softirq
> later on softirq: run_rebalance_domains() -> rebalance_domains() where
> the for_each_domain(cpu, sd) is not taken because of the NULL domain we are attached at.
> Which means rq->next_balance is never updated.
> So on the next timer tick, we will enter trigger_load_balance() which will always reschedule()
> the rebalacing softirq:
>
> if (time_after_eq(jiffies, rq->next_balance))
> raise_softirq(SCHED_SOFTIRQ);
>
> So for each tick, we process this pointless softirq.
>
> This patch fixes it by checking if we are attached to the null domain before raising the softirq,
> another possible fix would be to set the maximal possible JIFFIES value to rq->next_balance if we are
> attached to the NULL domain.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
And speacking about the function graph hang, Reported-by: Ingo Molnar <mingo@elte.hu>
next prev parent reply other threads:[~2009-03-05 1:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-05 0:27 [PATCH 1/2] sched: don't rebalance if attached on NULL domain Frederic Weisbecker
2009-03-05 1:03 ` Frederic Weisbecker [this message]
2009-03-05 11:03 ` [tip:sched/core] " Frederic Weisbecker
2009-03-05 14:40 ` Steven Rostedt
2009-03-05 13:06 ` Frederic Weisbecker
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=20090305010318.GB8949@nowhere \
--to=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/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