<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/cpu.c, branch v4.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-07-13T07:29:39Z</updated>
<entry>
<title>cpu/hotplug: Keep enough storage space if SMP=n to avoid array out of bounds scribble</title>
<updated>2016-07-13T07:29:39Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-07-12T19:59:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a7c734140aa36413944eef0f8c660e0e2256357d'/>
<id>urn:sha1:a7c734140aa36413944eef0f8c660e0e2256357d</id>
<content type='text'>
Xiaolong Ye reported lock debug warnings triggered by the following commit:

  8de4a0066106 ("perf/x86: Convert the core to the hotplug state machine")

The bug is the following: the cpuhp_bp_states[] array is cut short when
CONFIG_SMP=n, but the dynamically registered callbacks are stored nevertheless
and happily scribble outside of the array bounds...

We need to store them in case that the state is unregistered so we can invoke
the teardown function. That's independent of CONFIG_SMP. Make sure the array
is large enough.

Reported-by: kernel test robot &lt;xiaolong.ye@intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Adam Borowski &lt;kilobyte@angband.pl&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Anna-Maria Gleixner &lt;anna-maria@linutronix.de&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Kan Liang &lt;kan.liang@intel.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Cc: lkp@01.org
Cc: stable@vger.kernel.org
Cc: tipbuild@zytor.com
Fixes: cff7d378d3fd "cpu/hotplug: Convert to a state machine for the control processor"
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1607122144560.4083@nanos
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>sched/hotplug: Make activate() the last hotplug step</title>
<updated>2016-05-06T12:58:25Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-03-10T11:54:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aaddd7d1c740ab3c5efaad7a34650b6dc680c21c'/>
<id>urn:sha1:aaddd7d1c740ab3c5efaad7a34650b6dc680c21c</id>
<content type='text'>
The scheduler can handle per cpu threads before the cpu is set to active and
it does not allow user space threads on the cpu before active is
set. Attaching to the scheduling domains is also not required before user
space threads can be handled.

Move the activation to the end of the hotplug state space. That also means
that deactivation is the first action when a cpu is shut down.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160310120025.597477199@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>sched/hotplug: Move migration CPU_DYING to sched_cpu_dying()</title>
<updated>2016-05-06T12:58:25Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-03-10T11:54:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f2785ddb5367e217365099294b89d6a84668069e'/>
<id>urn:sha1:f2785ddb5367e217365099294b89d6a84668069e</id>
<content type='text'>
Remove the hotplug notifier and make it an explicit state.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160310120025.502222097@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>sched/hotplug: Move sync_rcu to be with set_cpu_active(false)</title>
<updated>2016-05-06T12:58:24Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2016-03-10T11:54:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b2454caa8977ade27292a71f2def5e403e24b4d5'/>
<id>urn:sha1:b2454caa8977ade27292a71f2def5e403e24b4d5</id>
<content type='text'>
The sync_rcu stuff is specificically for clearing bits in the active
mask, such that everybody will observe the bit cleared and will not
consider the cleared CPU for load-balancing etc.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160310120025.169219710@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>sched/hotplug: Convert cpu_[in]active notifiers to state machine</title>
<updated>2016-05-06T12:58:24Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-03-10T11:54:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=40190a78f85fec29f0fdd21f6b4415712085711e'/>
<id>urn:sha1:40190a78f85fec29f0fdd21f6b4415712085711e</id>
<content type='text'>
Now that we reduced everything into single notifiers, it's simple to move them
into the hotplug state machine space.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: rt@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>sched: Make set_cpu_rq_start_time() a built in hotplug state</title>
<updated>2016-05-06T12:58:23Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-03-10T11:54:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9cf7243d5d83d27aca47f842107bfa02b5f11d16'/>
<id>urn:sha1:9cf7243d5d83d27aca47f842107bfa02b5f11d16</id>
<content type='text'>
Start distangling the maze of hotplug notifiers in the scheduler.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: rt@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>cpu/hotplug: Fix rollback during error-out in __cpu_disable()</title>
<updated>2016-04-22T07:49:49Z</updated>
<author>
<name>Sebastian Andrzej Siewior</name>
<email>bigeasy@linutronix.de</email>
</author>
<published>2016-04-08T12:40:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3b9d6da67e11ca8f78fde887918983523a36b0fa'/>
<id>urn:sha1:3b9d6da67e11ca8f78fde887918983523a36b0fa</id>
<content type='text'>
The recent introduction of the hotplug thread which invokes the callbacks on
the plugged cpu, cased the following regression:

If takedown_cpu() fails, then we run into several issues:

 1) The rollback of the target cpu states is not invoked. That leaves the smp
    threads and the hotplug thread in disabled state.

 2) notify_online() is executed due to a missing skip_onerr flag. That causes
    that both CPU_DOWN_FAILED and CPU_ONLINE notifications are invoked which
    confuses quite some notifiers.

 3) The CPU_DOWN_FAILED notification is not invoked on the target CPU. That's
    not an issue per se, but it is inconsistent and in consequence blocks the
    patches which rely on these states being invoked on the target CPU and not
    on the controlling cpu. It also does not preserve the strict call order on
    rollback which is problematic for the ongoing state machine conversion as
    well.

To fix this we add a rollback flag to the remote callback machinery and invoke
the rollback including the CPU_DOWN_FAILED notification on the remote
cpu. Further mark the notify online state with 'skip_onerr' so we don't get a
double invokation.

This workaround will go away once we moved the unplug invocation to the target
cpu itself.

[ tglx: Massaged changelog and moved the CPU_DOWN_FAILED notifiaction to the
  	target cpu ]

Fixes: 4cb28ced23c4 ("cpu/hotplug: Create hotplug threads")
Reported-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Cc: linux-s390@vger.kernel.org
Cc: rt@linutronix.de
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Anna-Maria Gleixner &lt;anna-maria@linutronix.de&gt;
Link: http://lkml.kernel.org/r/20160408124015.GA21960@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>cpu/hotplug: Document states better</title>
<updated>2016-03-12T19:57:38Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-03-08T09:36:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d10ef6f9380b8853c4b48eb104268fccfdc0b0c5'/>
<id>urn:sha1:d10ef6f9380b8853c4b48eb104268fccfdc0b0c5</id>
<content type='text'>
Requested-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>cpu/hotplug: Fix smpboot thread ordering</title>
<updated>2016-03-10T20:21:59Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-03-10T19:42:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a58c527bb566b7abad96289fa5b973040c33c82'/>
<id>urn:sha1:2a58c527bb566b7abad96289fa5b973040c33c82</id>
<content type='text'>
Commit 931ef163309e moved the smpboot thread park/unpark invocation to the
state machine. The move of the unpark invocation was premature as it depends
on work in progress patches.

As a result cpu down can fail, because rcu synchronization in takedown_cpu()
eventually requires a functional softirq thread. I never encountered the
problem in testing, but 0day testing managed to provide a reliable reproducer.

Remove the smpboot_threads_park() call from the state machine for now and put
it back into the original place after the rcu synchronization.

I'm embarrassed as I knew about the dependency and still managed to get it
wrong. Hotplug induced brain melt seems to be the only sensible explanation
for that.

Fixes: 931ef163309e "cpu/hotplug: Unpark smpboot threads from the state machine"
Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>cpu/hotplug: Remove redundant state check</title>
<updated>2016-03-06T15:59:42Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-03-03T11:24:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5d8eb84253333f8f63ec704276e3f0a8ec8f3189'/>
<id>urn:sha1:5d8eb84253333f8f63ec704276e3f0a8ec8f3189</id>
<content type='text'>
The check for the AP range in cpuhp_is_ap_state() is redundant after commit
8df3e07e7f21 "cpu/hotplug: Let upcoming cpu bring itself fully up" because all
states above CPUHP_BRINGUP_CPU are invoked on the hotplugged cpu. Remove it.

Reported-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
</feed>
