From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Damien Wyart <damien.wyart@free.fr>, Ingo Molnar <mingo@elte.hu>,
Mike Galbraith <efault@gmx.de>,
linux-kernel@vger.kernel.org
Subject: Re: Very high CPU load when idle with 3.0-rc1
Date: Mon, 30 May 2011 14:29:55 -0700 [thread overview]
Message-ID: <20110530212955.GT2668@linux.vnet.ibm.com> (raw)
In-Reply-To: <1306773981.23844.2.camel@twins>
On Mon, May 30, 2011 at 06:46:21PM +0200, Peter Zijlstra wrote:
> On Mon, 2011-05-30 at 09:23 -0700, Paul E. McKenney wrote:
>
> > > @@ -1772,18 +1772,30 @@ static int __init rcu_spawn_kthreads(void)
> > > {
> > > int cpu;
> > > struct rcu_node *rnp;
> > > + struct task_struct *t;
> > >
> > > rcu_kthreads_spawnable = 1;
> > > for_each_possible_cpu(cpu) {
> > > per_cpu(rcu_cpu_has_work, cpu) = 0;
> > > - if (cpu_online(cpu))
> > > + if (cpu_online(cpu)) {
> > > (void)rcu_spawn_one_cpu_kthread(cpu);
> > > + t = per_cpu(rcu_cpu_kthread_task, cpu);
> > > + if (t)
> > > + wake_up_process(t);
> > > + }
> >
> > Would it be OK to simplify the code a bit by doing this initial wakeup
> > in rcu_spawn_one_cpu_kthread() itself? My thought would be to rearrange
> > rcu_spawn_one_cpu_kthread() as follows:
>
> well, no that would get us back to waking a task affine to an offline
> cpu :-)
My turn to say d'oh, then!
But I should be able to move them back in under "if (cpu_online(cpu))",
right?
> > > @@ -2209,6 +2221,31 @@ static void __cpuinit rcu_online_kthreads(int cpu)
> > > }
> > >
> > > /*
> > > + * kthread_create() creates threads in TASK_UNINTERRUPTIBLE state,
> > > + * but the RCU threads are woken on demand, and if demand is low this
> > > + * could be a while triggering the hung task watchdog.
> > > + *
> > > + * In order to avoid this, poke all tasks once the CPU is fully
> > > + * up and running.
> > > + */
> > > +static void __cpuinit rcu_online_kthreads(int cpu)
> > > +{
> > > + struct rcu_data *rdp = per_cpu_ptr(rcu_state->rda, cpu);
> > > + struct rcu_node *rnp = rdp->mynode;
> > > + struct task_struct *t;
> > > +
> > > + t = per_cpu(rcu_cpu_kthread_task, cpu);
> > > + if (t)
> > > + wake_up_process(t);
> > > +
> > > + t = rnp->node_kthread_task;
> > > + if (t)
> > > + wake_up_process(t);
> > > +
> > > + rcu_wake_one_boost_kthread(rnp);
> >
> > Interesting... So we are really awakening them twice, once at creation
> > time to get them to sleep interruptibly, and a second time when the CPU
> > comes online.
> >
> > What does this second set of wake_up_process() calls do?
>
> Ah, not so, see the initial one is conditional on cpu_online() and will
> fail for the CPU_UP_PREPARE case, this new function will be ran from
> CPU_ONLINE to then issue the first wakeup.
>
> The distinction comes from the initialize while cpus are already running
> vs hotplug.
OK, got it.
Thanx, Paul
next prev parent reply other threads:[~2011-05-30 21:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-30 5:59 Very high CPU load when idle with 3.0-rc1 Damien Wyart
2011-05-30 11:34 ` Peter Zijlstra
2011-05-30 12:17 ` Ingo Molnar
2011-05-30 13:10 ` Mike Galbraith
2011-05-30 16:23 ` Paul E. McKenney
2011-05-30 16:41 ` Paul E. McKenney
2011-05-30 16:47 ` Peter Zijlstra
2011-05-30 16:46 ` Peter Zijlstra
2011-05-30 21:29 ` Paul E. McKenney [this message]
2011-05-30 21:35 ` Peter Zijlstra
2011-05-31 1:45 ` Paul E. McKenney
2011-05-30 17:19 ` Peter Zijlstra
2011-05-30 21:28 ` Paul E. McKenney
2011-05-30 21:33 ` Peter Zijlstra
2011-05-31 1:45 ` Paul E. McKenney
2011-06-01 11:05 ` Peter Zijlstra
2011-06-01 14:37 ` Paul E. McKenney
2011-06-01 16:58 ` Peter Zijlstra
2011-06-01 18:19 ` Paul E. McKenney
2011-05-31 12:30 ` [tip:core/urgent] rcu: Cure load woes tip-bot for Peter Zijlstra
2011-05-30 11:50 ` Very high CPU load when idle with 3.0-rc1 Damien Wyart
2011-05-30 12:22 ` Morten P.D. Stevens
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=20110530212955.GT2668@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=damien.wyart@free.fr \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.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