All of lore.kernel.org
 help / color / mirror / Atom feed
* Understanding stop_machine() use for cpu_down()
@ 2017-01-25 23:41 Hardik H Bagdi
  2017-01-26  7:10 ` Greg KH
  2017-01-26 14:09 ` Hardik H Bagdi
  0 siblings, 2 replies; 4+ messages in thread
From: Hardik H Bagdi @ 2017-01-25 23:41 UTC (permalink / raw)
  To: linux-hotplug

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

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Understanding stop_machine() use for cpu_down()
@ 2017-01-26 14:12 Hardik H Bagdi
  0 siblings, 0 replies; 4+ messages in thread
From: Hardik H Bagdi @ 2017-01-26 14:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: rusty, vatsa, ashok.raj, zwanem

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-26 14:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25 23:41 Understanding stop_machine() use for cpu_down() Hardik H Bagdi
2017-01-26  7:10 ` Greg KH
2017-01-26 14:09 ` Hardik H Bagdi
2017-01-26 14:12 Hardik H Bagdi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.