linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hardik H Bagdi <hbagdi1@binghamton.edu>
To: linux-hotplug@vger.kernel.org
Subject: Understanding stop_machine() use for cpu_down()
Date: Wed, 25 Jan 2017 23:41:53 +0000	[thread overview]
Message-ID: <CADdiZBT-wvAmmtRem1=arnvPcyJrgH3s43ngAuzqk3poHe-FJA@mail.gmail.com> (raw)

Hi,

I'm trying to understand why stop_machine() is necessary for
cpu_down() operation.

I see that multi_cpu_stop() on every online cpu (which hogs the cpu
and then triggers state changes state)
and then, take_cpu_down is invoked on the outgoing cpu.
This happens by every cpu decrementing the msdata->thread_ack and last
one trigger a state change.

I'm trying to understand why is this necessary.

Is to wait for RCU grace period(s)?
If yes, what variable/struct is being protected and how does
stop_machine() help there?

I see there was a patch (https://lwn.net/Articles/538819/) but had
some issues with idle_loop.

Is there an alternative where the stop_machine would not be necessary?
Or more specifically, is there a reason why every CPU would need to stop?

Any help would be appreciated.

Thanks,
Hardik

             reply	other threads:[~2017-01-25 23:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 23:41 Hardik H Bagdi [this message]
2017-01-26  7:10 ` Understanding stop_machine() use for cpu_down() Greg KH
2017-01-26 14:09 ` Hardik H Bagdi

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='CADdiZBT-wvAmmtRem1=arnvPcyJrgH3s43ngAuzqk3poHe-FJA@mail.gmail.com' \
    --to=hbagdi1@binghamton.edu \
    --cc=linux-hotplug@vger.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).