1. 15 1月, 2017 1 次提交
  2. 11 10月, 2016 1 次提交
    • E
      latent_entropy: Mark functions with __latent_entropy · 0766f788
      Emese Revfy 提交于
      The __latent_entropy gcc attribute can be used only on functions and
      variables.  If it is on a function then the plugin will instrument it for
      gathering control-flow entropy. If the attribute is on a variable then
      the plugin will initialize it with random contents.  The variable must
      be an integer, an integer array type or a structure with integer fields.
      
      These specific functions have been selected because they are init
      functions (to help gather boot-time entropy), are called at unpredictable
      times, or they have variable loops, each of which provide some level of
      latent entropy.
      Signed-off-by: NEmese Revfy <re.emese@gmail.com>
      [kees: expanded commit message]
      Signed-off-by: NKees Cook <keescook@chromium.org>
      0766f788
  3. 07 10月, 2015 1 次提交
  4. 23 7月, 2015 1 次提交
  5. 28 5月, 2015 2 次提交
    • P
      rcu: Correctly handle non-empty Tiny RCU callback list with none ready · 6e91f8cb
      Paul E. McKenney 提交于
      If, at the time __rcu_process_callbacks() is invoked,  there are callbacks
      in Tiny RCU's callback list, but none of them are ready to be invoked,
      the current list-management code will knit the non-ready callbacks out
      of the list.  This can result in hangs and possibly worse.  This commit
      therefore inserts a check for there being no callbacks that can be
      invoked immediately.
      
      This bug is unlikely to occur -- you have to get a new callback between
      the time rcu_sched_qs() or rcu_bh_qs() was called, but before we get to
      __rcu_process_callbacks().  It was detected by the addition of RCU-bh
      testing to rcutorture, which in turn was instigated by Iftekhar Ahmed's
      mutation testing.  Although this bug was made much more likely by
      915e8a4f (rcu: Remove fastpath from __rcu_process_callbacks()), this
      did not cause the bug, but rather made it much more probable.   That
      said, it takes more than 40 hours of rcutorture testing, on average,
      for this bug to appear, so this fix cannot be considered an emergency.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      6e91f8cb
    • P
      rcu: Further shrink Tiny RCU by making empty functions static inlines · 51952bc6
      Paul E. McKenney 提交于
      The Tiny RCU counterparts to rcu_idle_enter(), rcu_idle_exit(),
      rcu_irq_enter(), and rcu_irq_exit() are empty functions, but each has
      EXPORT_SYMBOL_GPL(), which needlessly consumes extra memory, especially
      in kernels built with module support.  This commit therefore moves these
      functions to static inlines in rcutiny.h, removing the need for exports.
      
      This won't affect the size of the tiniest kernels, which are likely
      built without module support, but might help semi-tiny kernels that
      might include module support.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      51952bc6
  6. 14 5月, 2015 1 次提交
  7. 27 2月, 2015 2 次提交
  8. 16 1月, 2015 1 次提交
  9. 07 1月, 2015 1 次提交
    • L
      tiny_rcu: Directly force QS when call_rcu_[bh|sched]() on idle_task · 5f6130fa
      Lai Jiangshan 提交于
      For RCU in UP, context-switch = QS = GP, thus we can force a
      context-switch when any call_rcu_[bh|sched]() is happened on idle_task.
      After doing so, rcu_idle/irq_enter/exit() are useless, so we can simply
      make these functions empty.
      
      More important, this change does not change the functionality logically.
      Note: raise_softirq(RCU_SOFTIRQ)/rcu_sched_qs() in rcu_idle_enter() and
      outmost rcu_irq_exit() will have to wake up the ksoftirqd
      (due to in_interrupt() == 0).
      
      Before this patch		After this patch:
      call_rcu_sched() in idle;	call_rcu_sched() in idle
      				  set resched
      do other stuffs;		do other stuffs
      outmost rcu_irq_exit()		outmost rcu_irq_exit() (empty function)
        (or rcu_idle_enter())		  (or rcu_idle_enter(), also empty function)
      				start to resched. (see above)
        rcu_sched_qs()		rcu_sched_qs()
          QS,and GP and advance cb	  QS,and GP and advance cb
          wake up the ksoftirqd	    wake up the ksoftirqd
            set resched
      resched to ksoftirqd (or other)	resched to ksoftirqd (or other)
      
      These two code patches are almost the same.
      
      Size changed after patched:
      
      size kernel/rcu/tiny-old.o kernel/rcu/tiny-patched.o
         text	   data	    bss	    dec	    hex	filename
         3449	    206	      8	   3663	    e4f	kernel/rcu/tiny-old.o
         2406	    144	      8	   2558	    9fe	kernel/rcu/tiny-patched.o
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      5f6130fa
  10. 31 12月, 2014 1 次提交
    • A
      rcu: Remove redundant rcu_is_cpu_rrupt_from_idle() from tiny RCU · ca9558a3
      Alexander Gordeev 提交于
      Let's start assuming that something in the idle loop posts a callback,
      and scheduling-clock interrupt occurs:
      
      1. The system is idle and stays that way, no runnable tasks.
      
      2. Scheduling-clock interrupt occurs, rcu_check_callbacks() is called
         as result, which in turn calls rcu_is_cpu_rrupt_from_idle().
      
      3. rcu_is_cpu_rrupt_from_idle() reports the CPU was interrupted from
         idle, which results in rcu_sched_qs() call, which does a
         raise_softirq(RCU_SOFTIRQ).
      
      4. Upon return from interrupt, rcu_irq_exit() is invoked, which calls
         rcu_idle_enter_common(), which in turn calls rcu_sched_qs() again,
         which does another raise_softirq(RCU_SOFTIRQ).
      
      5. The softirq happens shortly and invokes rcu_process_callbacks(),
         which invokes __rcu_process_callbacks().
      
      6. So now callbacks can be invoked. At least they can be if
         ->donetail has been updated. Which it will have been because
         rcu_sched_qs() invokes rcu_qsctr_help().
      
      In the described scenario rcu_sched_qs() and raise_softirq(RCU_SOFTIRQ)
      get called twice in steps 3 and 4. This redundancy could be eliminated
      by removing rcu_is_cpu_rrupt_from_idle() function.
      Signed-off-by: NAlexander Gordeev <agordeev@redhat.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      ca9558a3
  11. 04 11月, 2014 2 次提交
  12. 08 9月, 2014 4 次提交
    • P
      rcu: Per-CPU operation cleanups to rcu_*_qs() functions · 284a8c93
      Paul E. McKenney 提交于
      The rcu_bh_qs(), rcu_preempt_qs(), and rcu_sched_qs() functions use
      old-style per-CPU variable access and write to ->passed_quiesce even
      if it is already set.  This commit therefore updates to use the new-style
      per-CPU variable access functions and avoids the spurious writes.
      This commit also eliminates the "cpu" argument to these functions because
      they are always invoked on the indicated CPU.
      Reported-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      284a8c93
    • P
      rcu: Add call_rcu_tasks() · 8315f422
      Paul E. McKenney 提交于
      This commit adds a new RCU-tasks flavor of RCU, which provides
      call_rcu_tasks().  This RCU flavor's quiescent states are voluntary
      context switch (not preemption!) and userspace execution (not the idle
      loop -- use some sort of schedule_on_each_cpu() if you need to handle the
      idle tasks.  Note that unlike other RCU flavors, these quiescent states
      occur in tasks, not necessarily CPUs.  Includes fixes from Steven Rostedt.
      
      This RCU flavor is assumed to have very infrequent latency-tolerant
      updaters.  This assumption permits significant simplifications, including
      a single global callback list protected by a single global lock, along
      with a single task-private linked list containing all tasks that have not
      yet passed through a quiescent state.  If experience shows this assumption
      to be incorrect, the required additional complexity will be added.
      Suggested-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      8315f422
    • P
      rcu: Make TINY_RCU tinier by putting error checks under #ifdef · ade98624
      Paul E. McKenney 提交于
      The rcu_idle_enter_common() and rcu_idle_exit_common() functions contain
      error checks that have to the best of my knowledge have never triggered
      over the past several years.  These are nevertheless valuable when
      creating new architectures or doing other low-level changes, so the
      checks should not be deleted.  This commit instead places these checks
      under #ifdef CONFIG_RCU_TRACE so that they are executed only when
      specifically requested.
      
      The savings are significant:
      
      	Before:
      
      	   text    data     bss     dec     hex filename
      	   1749      39       0    1788     6fc /tmp/b/kernel/rcu/tiny.o
      	    632     152       0     784     310 /tmp/b/kernel/rcu/update.o
      				   ----
      				   2572
      
      	After:
      
      	   text    data     bss     dec     hex filename
      	   1281      37       0    1318     526 /tmp/b/kernel/rcu/tiny.o
      	    632     152       0     784     310 /tmp/b/kernel/rcu/update.o
      				   ----
      				   2102
      
      This amounts to 470 bytes, or 18% of the original.
      
      Switched from #ifdef to IS_ENABLED() on Josh Triplett's advice.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      ade98624
    • P
      rcu: Update tiny.c references to tree.c · fafb6e84
      Pranith Kumar 提交于
      This commit updates the references to rcutree.c which is now rcu/tree.c
      Signed-off-by: NPranith Kumar <bobby.prani@gmail.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      fafb6e84
  13. 26 2月, 2014 1 次提交
    • P
      rcu: Ensure kernel/rcu/rcu.h can be sourced/used stand-alone · 5cb5c6e1
      Paul Gortmaker 提交于
      The kbuild test bot uncovered an implicit dependence on the
      trace header being present before rcu.h in ia64 allmodconfig
      that looks like this:
      
      In file included from kernel/ksysfs.c:22:0:
      kernel/rcu/rcu.h: In function '__rcu_reclaim':
      kernel/rcu/rcu.h:107:3: error: implicit declaration of function 'trace_rcu_invoke_kfree_callback' [-Werror=implicit-function-declaration]
      kernel/rcu/rcu.h:112:3: error: implicit declaration of function 'trace_rcu_invoke_callback' [-Werror=implicit-function-declaration]
      cc1: some warnings being treated as errors
      
      Looking at other rcu.h users, we can find that they all
      were sourcing the trace header in advance of rcu.h itself,
      as seen in the context of this diff.  There were also some
      inconsistencies as to whether it was or wasn't sourced based
      on the parent tracing Kconfig.
      
      Rather than "fix" it at each use site, and have inconsistent
      use based on whether "#ifdef CONFIG_RCU_TRACE" was used or not,
      lets just source the trace header just once, in the actual consumer
      of it, which is rcu.h itself.  We include it unconditionally, as
      build testing shows us that is a hard requirement for some files.
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      5cb5c6e1
  14. 18 2月, 2014 1 次提交
  15. 16 10月, 2013 1 次提交
  16. 25 9月, 2013 2 次提交
  17. 24 9月, 2013 2 次提交
  18. 30 7月, 2013 1 次提交
    • S
      rcu: Add const annotation to char * for RCU tracepoints and functions · e66c33d5
      Steven Rostedt (Red Hat) 提交于
      All the RCU tracepoints and functions that reference char pointers do
      so with just 'char *' even though they do not modify the contents of
      the string itself. This will cause warnings if a const char * is used
      in one of these functions.
      
      The RCU tracepoints store the pointer to the string to refer back to them
      when the trace output is displayed. As this can be minutes, hours or
      even days later, those strings had better be constant.
      
      This change also opens the door to allow the RCU tracepoint strings and
      their addresses to be exported so that userspace tracing tools can
      translate the contents of the pointers of the RCU tracepoints.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      e66c33d5
  19. 11 6月, 2013 5 次提交
  20. 29 1月, 2013 1 次提交
  21. 09 1月, 2013 1 次提交
  22. 14 11月, 2012 1 次提交
  23. 23 9月, 2012 3 次提交
  24. 03 7月, 2012 1 次提交
  25. 22 2月, 2012 2 次提交