<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/rcu/tree.c, branch v4.6</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.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-03-15T20:50:29Z</updated>
<entry>
<title>Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2016-03-15T20:50:29Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-03-15T20:50:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=710d60cbf1b312a8075a2158cbfbbd9c66132dcc'/>
<id>urn:sha1:710d60cbf1b312a8075a2158cbfbbd9c66132dcc</id>
<content type='text'>
Pull cpu hotplug updates from Thomas Gleixner:
 "This is the first part of the ongoing cpu hotplug rework:

   - Initial implementation of the state machine

   - Runs all online and prepare down callbacks on the plugged cpu and
     not on some random processor

   - Replaces busy loop waiting with completions

   - Adds tracepoints so the states can be followed"

More detailed commentary on this work from an earlier email:
 "What's wrong with the current cpu hotplug infrastructure?

   - Asymmetry

     The hotplug notifier mechanism is asymmetric versus the bringup and
     teardown.  This is mostly caused by the notifier mechanism.

   - Largely undocumented dependencies

     While some notifiers use explicitely defined notifier priorities,
     we have quite some notifiers which use numerical priorities to
     express dependencies without any documentation why.

   - Control processor driven

     Most of the bringup/teardown of a cpu is driven by a control
     processor.  While it is understandable, that preperatory steps,
     like idle thread creation, memory allocation for and initialization
     of essential facilities needs to be done before a cpu can boot,
     there is no reason why everything else must run on a control
     processor.  Before this patch series, bringup looks like this:

       Control CPU                     Booting CPU

       do preparatory steps
       kick cpu into life

                                       do low level init

       sync with booting cpu           sync with control cpu

       bring the rest up

   - All or nothing approach

     There is no way to do partial bringups.  That's something which is
     really desired because we waste e.g.  at boot substantial amount of
     time just busy waiting that the cpu comes to life.  That's stupid
     as we could very well do preparatory steps and the initial IPI for
     other cpus and then go back and do the necessary low level
     synchronization with the freshly booted cpu.

   - Minimal debuggability

     Due to the notifier based design, it's impossible to switch between
     two stages of the bringup/teardown back and forth in order to test
     the correctness.  So in many hotplug notifiers the cancel
     mechanisms are either not existant or completely untested.

   - Notifier [un]registering is tedious

     To [un]register notifiers we need to protect against hotplug at
     every callsite.  There is no mechanism that bringup/teardown
     callbacks are issued on the online cpus, so every caller needs to
     do it itself.  That also includes error rollback.

  What's the new design?

     The base of the new design is a symmetric state machine, where both
     the control processor and the booting/dying cpu execute a well
     defined set of states.  Each state is symmetric in the end, except
     for some well defined exceptions, and the bringup/teardown can be
     stopped and reversed at almost all states.

     So the bringup of a cpu will look like this in the future:

       Control CPU                     Booting CPU

       do preparatory steps
       kick cpu into life

                                       do low level init

       sync with booting cpu           sync with control cpu

                                       bring itself up

     The synchronization step does not require the control cpu to wait.
     That mechanism can be done asynchronously via a worker or some
     other mechanism.

     The teardown can be made very similar, so that the dying cpu cleans
     up and brings itself down.  Cleanups which need to be done after
     the cpu is gone, can be scheduled asynchronously as well.

  There is a long way to this, as we need to refactor the notion when a
  cpu is available.  Today we set the cpu online right after it comes
  out of the low level bringup, which is not really correct.

  The proper mechanism is to set it to available, i.e. cpu local
  threads, like softirqd, hotplug thread etc. can be scheduled on that
  cpu, and once it finished all booting steps, it's set to online, so
  general workloads can be scheduled on it.  The reverse happens on
  teardown.  First thing to do is to forbid scheduling of general
  workloads, then teardown all the per cpu resources and finally shut it
  off completely.

  This patch series implements the basic infrastructure for this at the
  core level.  This includes the following:

   - Basic state machine implementation with well defined states, so
     ordering and prioritization can be expressed.

   - Interfaces to [un]register state callbacks

     This invokes the bringup/teardown callback on all online cpus with
     the proper protection in place and [un]installs the callbacks in
     the state machine array.

     For callbacks which have no particular ordering requirement we have
     a dynamic state space, so that drivers don't have to register an
     explicit hotplug state.

     If a callback fails, the code automatically does a rollback to the
     previous state.

   - Sysfs interface to drive the state machine to a particular step.

     This is only partially functional today.  Full functionality and
     therefor testability will be achieved once we converted all
     existing hotplug notifiers over to the new scheme.

   - Run all CPU_ONLINE/DOWN_PREPARE notifiers on the booting/dying
     processor:

       Control CPU                     Booting CPU

       do preparatory steps
       kick cpu into life

                                       do low level init

       sync with booting cpu           sync with control cpu
       wait for boot
                                       bring itself up

                                       Signal completion to control cpu

     In a previous step of this work we've done a full tree mechanical
     conversion of all hotplug notifiers to the new scheme.  The balance
     is a net removal of about 4000 lines of code.

     This is not included in this series, as we decided to take a
     different approach.  Instead of mechanically converting everything
     over, we will do a proper overhaul of the usage sites one by one so
     they nicely fit into the symmetric callback scheme.

     I decided to do that after I looked at the ugliness of some of the
     converted sites and figured out that their hotplug mechanism is
     completely buggered anyway.  So there is no point to do a
     mechanical conversion first as we need to go through the usage
     sites one by one again in order to achieve a full symmetric and
     testable behaviour"

* 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
  cpu/hotplug: Document states better
  cpu/hotplug: Fix smpboot thread ordering
  cpu/hotplug: Remove redundant state check
  cpu/hotplug: Plug death reporting race
  rcu: Make CPU_DYING_IDLE an explicit call
  cpu/hotplug: Make wait for dead cpu completion based
  cpu/hotplug: Let upcoming cpu bring itself fully up
  arch/hotplug: Call into idle with a proper state
  cpu/hotplug: Move online calls to hotplugged cpu
  cpu/hotplug: Create hotplug threads
  cpu/hotplug: Split out the state walk into functions
  cpu/hotplug: Unpark smpboot threads from the state machine
  cpu/hotplug: Move scheduler cpu_online notifier to hotplug core
  cpu/hotplug: Implement setup/removal interface
  cpu/hotplug: Make target state writeable
  cpu/hotplug: Add sysfs state interface
  cpu/hotplug: Hand in target state to _cpu_up/down
  cpu/hotplug: Convert the hotplugged cpu work to a state machine
  cpu/hotplug: Convert to a state machine for the control processor
  cpu/hotplug: Add tracepoints
  ...
</content>
</entry>
<entry>
<title>Merge commit 'fixes.2015.02.23a' into core/rcu</title>
<updated>2016-03-15T08:01:06Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2016-03-15T08:00:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8bc6782fe20bd2584c73a35c47329c9fd0a8d34c'/>
<id>urn:sha1:8bc6782fe20bd2584c73a35c47329c9fd0a8d34c</id>
<content type='text'>
 Conflicts:
	kernel/rcu/tree.c

Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcu: Make CPU_DYING_IDLE an explicit call</title>
<updated>2016-03-01T19:36:58Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-02-26T18:43:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=27d50c7eeb0f03c3d3ca72aac4d2dd487ca1f3f0'/>
<id>urn:sha1:27d50c7eeb0f03c3d3ca72aac4d2dd487ca1f3f0</id>
<content type='text'>
Make the RCU CPU_DYING_IDLE callback an explicit function call, so it gets
invoked at the proper place.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Rafael Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: "Srivatsa S. Bhat" &lt;srivatsa@mit.edu&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Sebastian Siewior &lt;bigeasy@linutronix.de&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Paul McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Paul Turner &lt;pjt@google.com&gt;
Link: http://lkml.kernel.org/r/20160226182341.870167933@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>rcu: Use simple wait queues where possible in rcutree</title>
<updated>2016-02-25T10:27:16Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2016-02-19T08:46:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=abedf8e2419fb873d919dd74de2e84b510259339'/>
<id>urn:sha1:abedf8e2419fb873d919dd74de2e84b510259339</id>
<content type='text'>
As of commit dae6e64d2bcfd ("rcu: Introduce proper blocking to no-CBs kthreads
GP waits") the RCU subsystem started making use of wait queues.

Here we convert all additions of RCU wait queues to use simple wait queues,
since they don't need the extra overhead of the full wait queue features.

Originally this was done for RT kernels[1], since we would get things like...

  BUG: sleeping function called from invalid context at kernel/rtmutex.c:659
  in_atomic(): 1, irqs_disabled(): 1, pid: 8, name: rcu_preempt
  Pid: 8, comm: rcu_preempt Not tainted
  Call Trace:
   [&lt;ffffffff8106c8d0&gt;] __might_sleep+0xd0/0xf0
   [&lt;ffffffff817d77b4&gt;] rt_spin_lock+0x24/0x50
   [&lt;ffffffff8106fcf6&gt;] __wake_up+0x36/0x70
   [&lt;ffffffff810c4542&gt;] rcu_gp_kthread+0x4d2/0x680
   [&lt;ffffffff8105f910&gt;] ? __init_waitqueue_head+0x50/0x50
   [&lt;ffffffff810c4070&gt;] ? rcu_gp_fqs+0x80/0x80
   [&lt;ffffffff8105eabb&gt;] kthread+0xdb/0xe0
   [&lt;ffffffff8106b912&gt;] ? finish_task_switch+0x52/0x100
   [&lt;ffffffff817e0754&gt;] kernel_thread_helper+0x4/0x10
   [&lt;ffffffff8105e9e0&gt;] ? __init_kthread_worker+0x60/0x60
   [&lt;ffffffff817e0750&gt;] ? gs_change+0xb/0xb

...and hence simple wait queues were deployed on RT out of necessity
(as simple wait uses a raw lock), but mainline might as well take
advantage of the more streamline support as well.

[1] This is a carry forward of work from v3.10-rt; the original conversion
was by Thomas on an earlier -rt version, and Sebastian extended it to
additional post-3.10 added RCU waiters; here I've added a commit log and
unified the RCU changes into one, and uprev'd it to match mainline RCU.

Signed-off-by: Daniel Wagner &lt;daniel.wagner@bmw-carit.de&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: linux-rt-users@vger.kernel.org
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.vnet.ibm.com&gt;
Link: http://lkml.kernel.org/r/1455871601-27484-6-git-send-email-wagi@monom.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>rcu: Do not call rcu_nocb_gp_cleanup() while holding rnp-&gt;lock</title>
<updated>2016-02-25T10:27:16Z</updated>
<author>
<name>Daniel Wagner</name>
<email>daniel.wagner@bmw-carit.de</email>
</author>
<published>2016-02-19T08:46:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=065bb78c5b09df54d1c32e03227deb777ddff57b'/>
<id>urn:sha1:065bb78c5b09df54d1c32e03227deb777ddff57b</id>
<content type='text'>
rcu_nocb_gp_cleanup() is called while holding rnp-&gt;lock. Currently,
this is okay because the wake_up_all() in rcu_nocb_gp_cleanup() will
not enable the IRQs. lockdep is happy.

By switching over using swait this is not true anymore. swake_up_all()
enables the IRQs while processing the waiters. __do_softirq() can now
run and will eventually call rcu_process_callbacks() which wants to
grap nrp-&gt;lock.

Let's move the rcu_nocb_gp_cleanup() call outside the lock before we
switch over to swait.

If we would hold the rnp-&gt;lock and use swait, lockdep reports
following:

 =================================
 [ INFO: inconsistent lock state ]
 4.2.0-rc5-00025-g9a73ba0 #136 Not tainted
 ---------------------------------
 inconsistent {IN-SOFTIRQ-W} -&gt; {SOFTIRQ-ON-W} usage.
 rcu_preempt/8 [HC0[0]:SC0[0]:HE1:SE1] takes:
  (rcu_node_1){+.?...}, at: [&lt;ffffffff811387c7&gt;] rcu_gp_kthread+0xb97/0xeb0
 {IN-SOFTIRQ-W} state was registered at:
   [&lt;ffffffff81109b9f&gt;] __lock_acquire+0xd5f/0x21e0
   [&lt;ffffffff8110be0f&gt;] lock_acquire+0xdf/0x2b0
   [&lt;ffffffff81841cc9&gt;] _raw_spin_lock_irqsave+0x59/0xa0
   [&lt;ffffffff81136991&gt;] rcu_process_callbacks+0x141/0x3c0
   [&lt;ffffffff810b1a9d&gt;] __do_softirq+0x14d/0x670
   [&lt;ffffffff810b2214&gt;] irq_exit+0x104/0x110
   [&lt;ffffffff81844e96&gt;] smp_apic_timer_interrupt+0x46/0x60
   [&lt;ffffffff81842e70&gt;] apic_timer_interrupt+0x70/0x80
   [&lt;ffffffff810dba66&gt;] rq_attach_root+0xa6/0x100
   [&lt;ffffffff810dbc2d&gt;] cpu_attach_domain+0x16d/0x650
   [&lt;ffffffff810e4b42&gt;] build_sched_domains+0x942/0xb00
   [&lt;ffffffff821777c2&gt;] sched_init_smp+0x509/0x5c1
   [&lt;ffffffff821551e3&gt;] kernel_init_freeable+0x172/0x28f
   [&lt;ffffffff8182cdce&gt;] kernel_init+0xe/0xe0
   [&lt;ffffffff8184231f&gt;] ret_from_fork+0x3f/0x70
 irq event stamp: 76
 hardirqs last  enabled at (75): [&lt;ffffffff81841330&gt;] _raw_spin_unlock_irq+0x30/0x60
 hardirqs last disabled at (76): [&lt;ffffffff8184116f&gt;] _raw_spin_lock_irq+0x1f/0x90
 softirqs last  enabled at (0): [&lt;ffffffff810a8df2&gt;] copy_process.part.26+0x602/0x1cf0
 softirqs last disabled at (0): [&lt;          (null)&gt;]           (null)
 other info that might help us debug this:
  Possible unsafe locking scenario:
        CPU0
        ----
   lock(rcu_node_1);
   &lt;Interrupt&gt;
     lock(rcu_node_1);
  *** DEADLOCK ***
 1 lock held by rcu_preempt/8:
  #0:  (rcu_node_1){+.?...}, at: [&lt;ffffffff811387c7&gt;] rcu_gp_kthread+0xb97/0xeb0
 stack backtrace:
 CPU: 0 PID: 8 Comm: rcu_preempt Not tainted 4.2.0-rc5-00025-g9a73ba0 #136
 Hardware name: Dell Inc. PowerEdge R820/066N7P, BIOS 2.0.20 01/16/2014
  0000000000000000 000000006d7e67d8 ffff881fb081fbd8 ffffffff818379e0
  0000000000000000 ffff881fb0812a00 ffff881fb081fc38 ffffffff8110813b
  0000000000000000 0000000000000001 ffff881f00000001 ffffffff8102fa4f
 Call Trace:
  [&lt;ffffffff818379e0&gt;] dump_stack+0x4f/0x7b
  [&lt;ffffffff8110813b&gt;] print_usage_bug+0x1db/0x1e0
  [&lt;ffffffff8102fa4f&gt;] ? save_stack_trace+0x2f/0x50
  [&lt;ffffffff811087ad&gt;] mark_lock+0x66d/0x6e0
  [&lt;ffffffff81107790&gt;] ? check_usage_forwards+0x150/0x150
  [&lt;ffffffff81108898&gt;] mark_held_locks+0x78/0xa0
  [&lt;ffffffff81841330&gt;] ? _raw_spin_unlock_irq+0x30/0x60
  [&lt;ffffffff81108a28&gt;] trace_hardirqs_on_caller+0x168/0x220
  [&lt;ffffffff81108aed&gt;] trace_hardirqs_on+0xd/0x10
  [&lt;ffffffff81841330&gt;] _raw_spin_unlock_irq+0x30/0x60
  [&lt;ffffffff810fd1c7&gt;] swake_up_all+0xb7/0xe0
  [&lt;ffffffff811386e1&gt;] rcu_gp_kthread+0xab1/0xeb0
  [&lt;ffffffff811089bf&gt;] ? trace_hardirqs_on_caller+0xff/0x220
  [&lt;ffffffff81841341&gt;] ? _raw_spin_unlock_irq+0x41/0x60
  [&lt;ffffffff81137c30&gt;] ? rcu_barrier+0x20/0x20
  [&lt;ffffffff810d2014&gt;] kthread+0x104/0x120
  [&lt;ffffffff81841330&gt;] ? _raw_spin_unlock_irq+0x30/0x60
  [&lt;ffffffff810d1f10&gt;] ? kthread_create_on_node+0x260/0x260
  [&lt;ffffffff8184231f&gt;] ret_from_fork+0x3f/0x70
  [&lt;ffffffff810d1f10&gt;] ? kthread_create_on_node+0x260/0x260

Signed-off-by: Daniel Wagner &lt;daniel.wagner@bmw-carit.de&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: linux-rt-users@vger.kernel.org
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.vnet.ibm.com&gt;
Link: http://lkml.kernel.org/r/1455871601-27484-5-git-send-email-wagi@monom.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>rcu: Catch up rcu_report_qs_rdp() comment with reality</title>
<updated>2016-02-24T03:59:56Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2016-01-28T06:44:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4b455dc3e13064795ef2cd3415132df747e64063'/>
<id>urn:sha1:4b455dc3e13064795ef2cd3415132df747e64063</id>
<content type='text'>
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>RCU: Privatize rcu_node::lock</title>
<updated>2016-02-24T03:59:54Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2015-12-29T04:18:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=67c583a7de3433a971983490b37ad2bff3c55463'/>
<id>urn:sha1:67c583a7de3433a971983490b37ad2bff3c55463</id>
<content type='text'>
In patch:

"rcu: Add transitivity to remaining rcu_node -&gt;lock acquisitions"

All locking operations on rcu_node::lock are replaced with the wrappers
because of the need of transitivity, which indicates we should never
write code using LOCK primitives alone(i.e. without a proper barrier
following) on rcu_node::lock outside those wrappers. We could detect
this kind of misuses on rcu_node::lock in the future by adding __private
modifier on rcu_node::lock.

To privatize rcu_node::lock, unlock wrappers are also needed. Replacing
spinlock unlocks with these wrappers not only privatizes rcu_node::lock
but also makes it easier to figure out critical sections of rcu_node.

This patch adds __private modifier to rcu_node::lock and makes every
access to it wrapped by ACCESS_PRIVATE(). Besides, unlock wrappers are
added and raw_spin_unlock(&amp;rnp-&gt;lock) and its friends are replaced with
those wrappers.

Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: Remove useless rcu_data_p when !PREEMPT_RCU</title>
<updated>2016-02-24T03:59:53Z</updated>
<author>
<name>Chen Gang</name>
<email>chengang@emindsoft.com.cn</email>
</author>
<published>2015-12-26T13:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1914aab54319ed70608078df4f18ac4767753977'/>
<id>urn:sha1:1914aab54319ed70608078df4f18ac4767753977</id>
<content type='text'>
The related warning from gcc 6.0:

  In file included from kernel/rcu/tree.c:4630:0:
  kernel/rcu/tree_plugin.h:810:40: warning: ‘rcu_data_p’ defined but not used [-Wunused-const-variable]
   static struct rcu_data __percpu *const rcu_data_p = &amp;rcu_sched_data;
                                          ^~~~~~~~~~

Also remove always redundant rcu_data_p in tree.c.

Signed-off-by: Chen Gang &lt;gang.chen.5i5j@gmail.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: Set rdp-&gt;gpwrap when CPU is idle</title>
<updated>2016-02-24T03:59:52Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2015-12-13T16:57:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=23a9bacd357ab8388c7e07101b186a4282874992'/>
<id>urn:sha1:23a9bacd357ab8388c7e07101b186a4282874992</id>
<content type='text'>
Commit #e3663b1024d1 ("rcu: Handle gpnum/completed wrap while dyntick
idle") sets rdp-&gt;gpwrap on the wrong side of the "if" statement in
dyntick_save_progress_counter(), that is, it sets it when the CPU is
not idle instead of when it is idle.  Of course, if the CPU is not idle,
its rdp-&gt;gpnum won't be lagging beind the global rsp-&gt;gpnum, which means
that rdp-&gt;gpwrap will never be set.

This commit therefore moves this code to the proper leg of that "if"
statement.  This change means that the "else" cause is just "return 0"
and the "then" clause ends with "return 1", so also move the "return 0"
to follow the "if", dropping the "else" clause.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: Stop treating in-kernel CPU-bound workloads as errors</title>
<updated>2016-02-24T03:59:51Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2015-12-11T21:48:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4914950aaa12de8a2004b8031b45480526caf42b'/>
<id>urn:sha1:4914950aaa12de8a2004b8031b45480526caf42b</id>
<content type='text'>
Commit 4a81e8328d379 ("Reduce overhead of cond_resched() checks for RCU")
handles the error case where a nohz_full loops indefinitely in the kernel
with the scheduling-clock interrupt disabled.  However, this handling
includes IPIing the CPU running the offending loop, which is not what
we want for real-time workloads.  And there are starting to be real-time
CPU-bound in-kernel workloads, and these must be handled without IPIing
the CPU, at least not in the common case.  Therefore, this situation can
no longer be dismissed as an error case.

This commit therefore splits the handling out, so that the setting of
bits in the per-CPU rcu_sched_qs_mask variable is done relatively early,
but if the problem persists, resched_cpu() is eventually used to IPI the
CPU containing the offending loop.  Assuming that in-kernel CPU-bound
loops used by real-time tasks contain frequent calls cond_resched_rcu_qs()
(as in more than once per few tens of milliseconds), the real-time tasks
will never be IPIed.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
