1. 14 6月, 2019 1 次提交
  2. 29 5月, 2019 1 次提交
  3. 27 3月, 2019 1 次提交
    • N
      rcu: Do a single rhp->func read in rcu_head_after_call_rcu() · b699cce1
      Neeraj Upadhyay 提交于
      The rcu_head_after_call_rcu() function reads the rhp->func pointer twice,
      which can result in a false-positive WARN_ON_ONCE() if the callback
      were passed to call_rcu() between the two reads.  Although racing
      rcu_head_after_call_rcu() with call_rcu() is to be a dubious use case
      (the return value is not reliable in that case), intermittent and
      irreproducible warnings are also quite dubious.  This commit therefore
      uses a single READ_ONCE() to pick up the value of rhp->func once, then
      tests that value twice, thus guaranteeing consistent processing within
      rcu_head_after_call_rcu()().
      
      Neverthless, racing rcu_head_after_call_rcu() with call_rcu() is still
      a dubious use case.
      Signed-off-by: NNeeraj Upadhyay <neeraju@codeaurora.org>
      [ paulmck: Add blank line after declaration per checkpatch.pl. ]
      Signed-off-by: NPaul E. McKenney <paulmck@linux.ibm.com>
      b699cce1
  4. 10 2月, 2019 1 次提交
  5. 26 1月, 2019 4 次提交
    • J
      rcu: Add sparse check to rcu_assign_pointer() · 423a86a6
      Joel Fernandes (Google) 提交于
      The rcu_assign_pointer() function currently doesn't do any sparse checking
      on the assigned-to pointer.  So its possible that a pointer that is
      not __rcu annotated is assigned with rcu_assign_pointer without sparse
      complaints.  Because rcu_dereference() already does such checking,
      this commit makes rcu_assign_pointer() to do the same. The extra
      error could be helpful in cases where an RCU pointer is assigned with
      rcu_assign_pointer() but not annotated with __rcu.
      
      This doesn't generate any code in the normal case because __CHECKER__ is
      defined only in the context of sparse.
      
      This commit also renames rcu_dereference_sparse() to rcu_check_parse()
      since the checking now happens not only during derereferencing but also
      during assignment.
      
      Test: Introduced an rcu_assign_pointer in code and checked the output of
      sparse with and without this change. The change correctly causes sparse
      to throw an error.
      Signed-off-by: NJoel Fernandes (Google) <joel@joelfernandes.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.ibm.com>
      423a86a6
    • P
      rcu: Rename rcu_check_callbacks() to rcu_sched_clock_irq() · c98cac60
      Paul E. McKenney 提交于
      The name rcu_check_callbacks() arguably made sense back in the early
      2000s when RCU was quite a bit simpler than it is today, but it has
      become quite misleading, especially with the advent of dyntick-idle
      and NO_HZ_FULL.  The rcu_check_callbacks() function is RCU's hook into
      the scheduling-clock interrupt, and is now but one of many ways that
      callbacks get promoted to invocable state.
      
      This commit therefore changes the name to rcu_sched_clock_irq(),
      which is the same number of characters and clearly indicates this
      function's relation to the rest of the Linux kernel.  In addition, for
      the sake of consistency, rcu_flavor_check_callbacks() is also renamed
      to rcu_flavor_sched_clock_irq().
      
      While in the area, the header comments for both functions are reworked.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.ibm.com>
      c98cac60
    • P
      rcu: Docbook for rcu_head_init() and rcu_head_after_call_rcu() · 2aa55030
      Paul E. McKenney 提交于
      This commit adds the missing asterisks required to make Sphinx pick up
      the current header comments for these two functions.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.ibm.com>
      2aa55030
    • P
      rcu: Remove wrapper definitions for obsolete RCU update functions · 6ba7d681
      Paul E. McKenney 提交于
      None of synchronize_rcu_bh, synchronize_rcu_bh_expedited, call_rcu_bh,
      rcu_barrier_bh, synchronize_sched, synchronize_sched_expedited,
      call_rcu_sched, rcu_barrier_sched, get_state_synchronize_sched, and
      cond_synchronize_sched are actually used.  This commit therefore removes
      their trivial wrapper-function definitions.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.ibm.com>
      6ba7d681
  6. 31 8月, 2018 9 次提交
  7. 13 7月, 2018 4 次提交
  8. 10 6月, 2018 1 次提交
  9. 23 5月, 2018 1 次提交
  10. 16 5月, 2018 1 次提交
    • P
      rcu: Rename cond_resched_rcu_qs() to cond_resched_tasks_rcu_qs() · cee43939
      Paul E. McKenney 提交于
      Commit e31d28b6 ("trace: Eliminate cond_resched_rcu_qs() in favor
      of cond_resched()") substituted cond_resched() for the earlier call
      to cond_resched_rcu_qs().  However, the new-age cond_resched() does
      not do anything to help RCU-tasks grace periods because (1) RCU-tasks
      is only enabled when CONFIG_PREEMPT=y and (2) cond_resched() is a
      complete no-op when preemption is enabled.  This situation results
      in hangs when running the trace benchmarks.
      
      A number of potential fixes were discussed on LKML
      (https://lkml.kernel.org/r/20180224151240.0d63a059@vmware.local.home),
      including making cond_resched() not be a no-op; making cond_resched()
      not be a no-op, but only when running tracing benchmarks; reverting
      the aforementioned commit (which works because cond_resched_rcu_qs()
      does provide an RCU-tasks quiescent state; and adding a call to the
      scheduler/RCU rcu_note_voluntary_context_switch() function.  All were
      deemed unsatisfactory, either due to added cond_resched() overhead or
      due to magic functions inviting cargo culting.
      
      This commit renames cond_resched_rcu_qs() to cond_resched_tasks_rcu_qs(),
      which provides a clear hint as to what this function is doing and
      why and where it should be used, and then replaces the call to
      cond_resched() with cond_resched_tasks_rcu_qs() in the trace benchmark's
      benchmark_event_kthread() function.
      Reported-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Tested-by: NNicholas Piggin <npiggin@gmail.com>
      cee43939
  11. 21 2月, 2018 1 次提交
  12. 17 12月, 2017 1 次提交
  13. 05 12月, 2017 2 次提交
  14. 24 10月, 2017 1 次提交
  15. 20 10月, 2017 1 次提交
  16. 30 8月, 2017 1 次提交
  17. 17 8月, 2017 2 次提交
  18. 26 7月, 2017 1 次提交
    • P
      rcu: Migrate callbacks earlier in the CPU-offline timeline · a58163d8
      Paul E. McKenney 提交于
      RCU callbacks must be migrated away from an outgoing CPU, and this is
      done near the end of the CPU-hotplug operation, after the outgoing CPU is
      long gone.  Unfortunately, this means that other CPU-hotplug callbacks
      can execute while the outgoing CPU's callbacks are still immobilized
      on the long-gone CPU's callback lists.  If any of these CPU-hotplug
      callbacks must wait, either directly or indirectly, for the invocation
      of any of the immobilized RCU callbacks, the system will hang.
      
      This commit avoids such hangs by migrating the callbacks away from the
      outgoing CPU immediately upon its departure, shortly after the return
      from __cpu_die() in takedown_cpu().  Thus, RCU is able to advance these
      callbacks and invoke them, which allows all the after-the-fact CPU-hotplug
      callbacks to wait on these RCU callbacks without risk of a hang.
      
      While in the neighborhood, this commit also moves rcu_send_cbs_to_orphanage()
      and rcu_adopt_orphan_cbs() under a pre-existing #ifdef to avoid including
      dead code on the one hand and to avoid define-without-use warnings on the
      other hand.
      Reported-by: NJeffrey Hugo <jhugo@codeaurora.org>
      Link: http://lkml.kernel.org/r/db9c91f6-1b17-6136-84f0-03c3c2581ab4@codeaurora.orgSigned-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Richard Weinberger <richard@nod.at>
      a58163d8
  19. 25 7月, 2017 1 次提交
  20. 09 6月, 2017 5 次提交