From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Vikram Mulukutla <markivx@codeaurora.org>,
Rusty Russell <rusty@rustcorp.com.au>, Tejun Heo <tj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
Sebastian Sewior <bigeasy@linutronix.de>
Subject: Re: [PATCH] smp/hotplug: Move unparking of percpu threads to the control CPU
Date: Wed, 5 Jul 2017 11:07:34 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1707051105500.2019@nanos> (raw)
In-Reply-To: <20170705090440.hxnpsj2pgxykg3t6@hirez.programming.kicks-ass.net>
On Wed, 5 Jul 2017, Peter Zijlstra wrote:
> On Tue, Jul 04, 2017 at 10:20:23PM +0200, Thomas Gleixner wrote:
> > @@ -775,23 +787,13 @@ void notify_cpu_starting(unsigned int cp
>
> The comment right above this function now seems stale..
Will fix.
> > void cpuhp_online_idle(enum cpuhp_state state)
> > {
> > struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
> > - unsigned int cpu = smp_processor_id();
> >
> > /* Happens for the boot cpu */
> > if (state != CPUHP_AP_ONLINE_IDLE)
> > return;
> >
> > st->state = CPUHP_AP_ONLINE_IDLE;
> > -
> > - /* Unpark the stopper thread and the hotplug thread of this cpu */
> > - stop_machine_unpark(cpu);
> > - kthread_unpark(st->thread);
> > -
> > - /* Should we go further up ? */
> > - if (st->target > CPUHP_AP_ONLINE_IDLE)
> > - __cpuhp_kick_ap_work(st);
> > - else
> > - complete(&st->done);
> > + complete(&st->done);
> > }
>
>
> OK, so if I get this right we do something like:
>
>
> BP AP
>
> bringup_cpu();
> __cpu_up() ------------> /* stuff */
> bringup_wait_for_ap()
> wait_for_completion();
> cpuhp_online_idle();
> <------------ complete(&st->done);
> unpark()
> while(1)
> do_idle();
actually I added after unpark():
kick_ap()
wait_for_completion()
So the AP will execute the online callbacks in its own hotplug thread.
> Where you moved the unpark() from the AP's idle thread to the BP's
> context and thus allow scheduling etc..
>
> Yes that should work fine I think.
Thanks,
tglx
next prev parent reply other threads:[~2017-07-05 9:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 20:20 Thomas Gleixner
2017-07-05 9:04 ` Peter Zijlstra
2017-07-05 9:07 ` Thomas Gleixner [this message]
2017-07-05 9:17 ` Peter Zijlstra
2017-07-06 8:57 ` [tip:smp/urgent] " tip-bot for Thomas Gleixner
2017-07-07 7:47 ` [PATCH] " Vikram Mulukutla
2017-07-07 7:53 ` Vikram Mulukutla
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=alpine.DEB.2.20.1707051105500.2019@nanos \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=markivx@codeaurora.org \
--cc=peterz@infradead.org \
--cc=rusty@rustcorp.com.au \
--cc=tj@kernel.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
all inboxes | Powered by JetHome®