Merge branch 'rcu/next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck...
authorIngo Molnar <mingo@kernel.org>
Thu, 20 Nov 2014 07:57:58 +0000 (08:57 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 20 Nov 2014 07:57:58 +0000 (08:57 +0100)
Pull RCU updates from Paul E. McKenney:

 - Streamline RCU's use of per-CPU variables, shifting from "cpu"
   arguments to functions to "this_"-style per-CPU variable accessors.

 - Signal-handling RCU updates.

 - Real-time updates.

 - Torture-test updates.

 - Miscellaneous fixes.

 - Documentation updates.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
Documentation/kernel-parameters.txt
include/linux/rcupdate.h
init/Kconfig
kernel/sched/core.c

index 479f33204a3727a51ece7ba2cc2b747e27788e36,92cdec9834cbef51a66e8ff38849c4e7719f8347..838f3776c9249e2cd3d5e17c966f0fb4acdad796
@@@ -1015,14 -1015,10 +1015,14 @@@ bytes respectively. Such letter suffixe
                        Format: {"off" | "on" | "skip[mbr]"}
  
        efi=            [EFI]
 -                      Format: { "old_map" }
 +                      Format: { "old_map", "nochunk", "noruntime" }
                        old_map [X86-64]: switch to the old ioremap-based EFI
                        runtime services mapping. 32-bit still uses this one by
                        default.
 +                      nochunk: disable reading files in "chunks" in the EFI
 +                      boot stub, as chunking can cause problems with some
 +                      firmware implementations.
 +                      noruntime : disable EFI runtime services support
  
        efi_no_storage_paranoia [EFI; X86]
                        Using this parameter you can use more than 50% of
        i8042.noloop    [HW] Disable the AUX Loopback command while probing
                             for the AUX port
        i8042.nomux     [HW] Don't check presence of an active multiplexing
 -                           controller. Default: true.
 +                           controller
        i8042.nopnp     [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
                             controllers
        i8042.notimeout [HW] Ignore timeout condition signalled by controller
                        .cdrom .chs .ignore_cable are additional options
                        See Documentation/ide/ide.txt.
  
 +      ide-generic.probe-mask= [HW] (E)IDE subsystem
 +                      Format: <int>
 +                      Probe mask for legacy ISA IDE ports.  Depending on
 +                      platform up to 6 ports are supported, enabled by
 +                      setting corresponding bits in the mask to 1.  The
 +                      default value is 0x0, which has a special meaning.
 +                      On systems that have PCI, it triggers scanning the
 +                      PCI bus for the first and the second port, which
 +                      are then probed.  On systems without PCI the value
 +                      of 0x0 enables probing the two first ports as if it
 +                      was 0x3.
 +
        ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
                        Claim all unknown PCI IDE storage controllers.
  
        kmemleak=       [KNL] Boot-time kmemleak enable/disable
                        Valid arguments: on, off
                        Default: on
 +                      Built with CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y,
 +                      the default is off.
  
        kmemcheck=      [X86] Boot-time kmemcheck enable/disable/one-shot mode
                        Valid arguments: 0, 1, 2
  
        nodsp           [SH] Disable hardware DSP at boot time.
  
 -      noefi           [X86] Disable EFI runtime services support.
 +      noefi           Disable EFI runtime services support.
  
        noexec          [IA-64]
  
                        quiescent states.  Units are jiffies, minimum
                        value is one, and maximum value is HZ.
  
+       rcutree.kthread_prio=    [KNL,BOOT]
+                       Set the SCHED_FIFO priority of the RCU
+                       per-CPU kthreads (rcuc/N). This value is also
+                       used for the priority of the RCU boost threads
+                       (rcub/N). Valid values are 1-99 and the default
+                       is 1 (the least-favored priority).
        rcutree.rcu_nocb_leader_stride= [KNL]
                        Set the number of NOCB kthread groups, which
                        defaults to the square root of the number of
                        messages.  Disable with a value less than or equal
                        to zero.
  
+       rcupdate.rcu_self_test= [KNL]
+                       Run the RCU early boot self tests
+       rcupdate.rcu_self_test_bh= [KNL]
+                       Run the RCU bh early boot self tests
+       rcupdate.rcu_self_test_sched= [KNL]
+                       Run the RCU sched early boot self tests
        rdinit=         [KNL]
                        Format: <full_path>
                        Run specified binary instead of /init from the ramdisk,
                        e.g. base its process migration decisions on it.
                        Default is on.
  
 +      topology_updates= [KNL, PPC, NUMA]
 +                      Format: {off}
 +                      Specify if the kernel should ignore (off)
 +                      topology updates sent by the hypervisor to this
 +                      LPAR.
 +
        tp720=          [HW,PS2]
  
        tpm_suspend_pcr=[HW,TPM]
  
        usb-storage.delay_use=
                        [UMS] The delay in seconds before a new device is
 -                      scanned for Logical Units (default 5).
 +                      scanned for Logical Units (default 1).
  
        usb-storage.quirks=
                        [UMS] A list of quirks entries to supplement or
diff --combined include/linux/rcupdate.h
index 53ff1a752d7e2baf17a5d9dcbfdec826c2b275ca,9575c2d403b527840f43cd3b3c58286d11bfc7ee..ed4f5939a452cb424671f87dc9911fe318cb1fc3
@@@ -57,7 -57,7 +57,7 @@@ enum rcutorture_type 
        INVALID_RCU_FLAVOR
  };
  
- #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
+ #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
  void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
                            unsigned long *gpnum, unsigned long *completed);
  void rcutorture_record_test_transition(void);
@@@ -260,7 -260,7 +260,7 @@@ static inline int rcu_preempt_depth(voi
  void rcu_init(void);
  void rcu_sched_qs(void);
  void rcu_bh_qs(void);
- void rcu_check_callbacks(int cpu, int user);
+ void rcu_check_callbacks(int user);
  struct notifier_block;
  void rcu_idle_enter(void);
  void rcu_idle_exit(void);
@@@ -348,8 -348,8 +348,8 @@@ extern struct srcu_struct tasks_rcu_exi
   */
  #define cond_resched_rcu_qs() \
  do { \
-       rcu_note_voluntary_context_switch(current); \
-       cond_resched(); \
+       if (!cond_resched()) \
+               rcu_note_voluntary_context_switch(current); \
  } while (0)
  
  #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP)
@@@ -365,7 -365,7 +365,7 @@@ typedef void call_rcu_func_t(struct rcu
                             void (*func)(struct rcu_head *head));
  void wait_rcu_gp(call_rcu_func_t crf);
  
- #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
+ #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
  #include <linux/rcutree.h>
  #elif defined(CONFIG_TINY_RCU)
  #include <linux/rcutiny.h>
@@@ -616,21 -616,6 +616,21 @@@ static inline void rcu_preempt_sleep_ch
   */
  #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
  
 +/**
 + * lockless_dereference() - safely load a pointer for later dereference
 + * @p: The pointer to load
 + *
 + * Similar to rcu_dereference(), but for situations where the pointed-to
 + * object's lifetime is managed by something other than RCU.  That
 + * "something other" might be reference counting or simple immortality.
 + */
 +#define lockless_dereference(p) \
 +({ \
 +      typeof(p) _________p1 = ACCESS_ONCE(p); \
 +      smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
 +      (_________p1); \
 +})
 +
  /**
   * rcu_assign_pointer() - assign to RCU-protected pointer
   * @p: pointer to assign to
   *
   * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU),
   * it is illegal to block while in an RCU read-side critical section.
-  * In preemptible RCU implementations (TREE_PREEMPT_RCU) in CONFIG_PREEMPT
+  * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPT
   * kernel builds, RCU read-side critical sections may be preempted,
   * but explicit blocking is illegal.  Finally, in preemptible RCU
   * implementations in real-time (with -rt patchset) kernel builds, RCU
@@@ -902,7 -887,9 +902,9 @@@ static inline void rcu_read_lock(void
   * Unfortunately, this function acquires the scheduler's runqueue and
   * priority-inheritance spinlocks.  This means that deadlock could result
   * if the caller of rcu_read_unlock() already holds one of these locks or
-  * any lock that is ever acquired while holding them.
+  * any lock that is ever acquired while holding them; or any lock which
+  * can be taken from interrupt context because rcu_boost()->rt_mutex_lock()
+  * does not disable irqs while taking ->wait_lock.
   *
   * That said, RCU readers are never priority boosted unless they were
   * preempted.  Therefore, one way to avoid deadlock is to make sure
@@@ -1062,6 -1049,7 +1064,7 @@@ static inline notrace void rcu_read_unl
   */
  #define RCU_INIT_POINTER(p, v) \
        do { \
+               rcu_dereference_sparse(p, __rcu); \
                p = RCU_INITIALIZER(v); \
        } while (0)
  
        __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head))
  
  #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL)
- static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies)
+ static inline int rcu_needs_cpu(unsigned long *delta_jiffies)
  {
        *delta_jiffies = ULONG_MAX;
        return 0;
diff --combined init/Kconfig
index 2081a4d3d9171f5323a077a1f3a9805223e715be,5ac596e2cb4bf9095eda64f9d9a6a85c23becda5..903505e66d1d710bc81416cc151e29533fea70c5
@@@ -477,7 -477,7 +477,7 @@@ config TREE_RC
          thousands of CPUs.  It also scales down nicely to
          smaller systems.
  
- config TREE_PREEMPT_RCU
+ config PREEMPT_RCU
        bool "Preemptible tree-based hierarchical RCU"
        depends on PREEMPT
        select IRQ_WORK
@@@ -501,12 -501,6 +501,6 @@@ config TINY_RC
  
  endchoice
  
- config PREEMPT_RCU
-       def_bool TREE_PREEMPT_RCU
-       help
-         This option enables preemptible-RCU code that is common between
-         TREE_PREEMPT_RCU and, in the old days, TINY_PREEMPT_RCU.
  config TASKS_RCU
        bool "Task_based RCU implementation using voluntary context switch"
        default n
          If unsure, say N.
  
  config RCU_STALL_COMMON
-       def_bool ( TREE_RCU || TREE_PREEMPT_RCU || RCU_TRACE )
+       def_bool ( TREE_RCU || PREEMPT_RCU || RCU_TRACE )
        help
          This option enables RCU CPU stall code that is common between
          the TINY and TREE variants of RCU.  The purpose is to allow
@@@ -576,7 -570,7 +570,7 @@@ config RCU_FANOU
        int "Tree-based hierarchical RCU fanout value"
        range 2 64 if 64BIT
        range 2 32 if !64BIT
-       depends on TREE_RCU || TREE_PREEMPT_RCU
+       depends on TREE_RCU || PREEMPT_RCU
        default 64 if 64BIT
        default 32 if !64BIT
        help
@@@ -596,7 -590,7 +590,7 @@@ config RCU_FANOUT_LEA
        int "Tree-based hierarchical RCU leaf-level fanout value"
        range 2 RCU_FANOUT if 64BIT
        range 2 RCU_FANOUT if !64BIT
-       depends on TREE_RCU || TREE_PREEMPT_RCU
+       depends on TREE_RCU || PREEMPT_RCU
        default 16
        help
          This option controls the leaf-level fanout of hierarchical
  
  config RCU_FANOUT_EXACT
        bool "Disable tree-based hierarchical RCU auto-balancing"
-       depends on TREE_RCU || TREE_PREEMPT_RCU
+       depends on TREE_RCU || PREEMPT_RCU
        default n
        help
          This option forces use of the exact RCU_FANOUT value specified,
@@@ -652,11 -646,11 +646,11 @@@ config RCU_FAST_NO_H
          Say N if you are unsure.
  
  config TREE_RCU_TRACE
-       def_bool RCU_TRACE && ( TREE_RCU || TREE_PREEMPT_RCU )
+       def_bool RCU_TRACE && ( TREE_RCU || PREEMPT_RCU )
        select DEBUG_FS
        help
          This option provides tracing for the TREE_RCU and
-         TREE_PREEMPT_RCU implementations, permitting Makefile to
+         PREEMPT_RCU implementations, permitting Makefile to
          trivially select kernel/rcutree_trace.c.
  
  config RCU_BOOST
          Say Y here if you are working with real-time apps or heavy loads
          Say N here if you are unsure.
  
- config RCU_BOOST_PRIO
-       int "Real-time priority to boost RCU readers to"
+ config RCU_KTHREAD_PRIO
+       int "Real-time priority to use for RCU worker threads"
        range 1 99
        depends on RCU_BOOST
        default 1
        help
-         This option specifies the real-time priority to which long-term
-         preempted RCU readers are to be boosted.  If you are working
-         with a real-time application that has one or more CPU-bound
-         threads running at a real-time priority level, you should set
-         RCU_BOOST_PRIO to a priority higher then the highest-priority
-         real-time CPU-bound thread.  The default RCU_BOOST_PRIO value
-         of 1 is appropriate in the common case, which is real-time
+         This option specifies the SCHED_FIFO priority value that will be
+         assigned to the rcuc/n and rcub/n threads and is also the value
+         used for RCU_BOOST (if enabled). If you are working with a
+         real-time application that has one or more CPU-bound threads
+         running at a real-time priority level, you should set
+         RCU_KTHREAD_PRIO to a priority higher than the highest-priority
+         real-time CPU-bound application thread.  The default RCU_KTHREAD_PRIO
+         value of 1 is appropriate in the common case, which is real-time
          applications that do not have any CPU-bound threads.
  
          Some real-time applications might not have a single real-time
          thread that saturates a given CPU, but instead might have
          multiple real-time threads that, taken together, fully utilize
-         that CPU.  In this case, you should set RCU_BOOST_PRIO to
+         that CPU.  In this case, you should set RCU_KTHREAD_PRIO to
          a priority higher than the lowest-priority thread that is
          conspiring to prevent the CPU from running any non-real-time
          tasks.  For example, if one thread at priority 10 and another
          thread at priority 5 are between themselves fully consuming
-         the CPU time on a given CPU, then RCU_BOOST_PRIO should be
+         the CPU time on a given CPU, then RCU_KTHREAD_PRIO should be
          set to priority 6 or higher.
  
          Specify the real-time priority, or take the default if unsure.
@@@ -715,7 -710,7 +710,7 @@@ config RCU_BOOST_DELA
  
  config RCU_NOCB_CPU
        bool "Offload RCU callback processing from boot-selected CPUs"
-       depends on TREE_RCU || TREE_PREEMPT_RCU
+       depends on TREE_RCU || PREEMPT_RCU
        default n
        help
          Use this option to reduce OS jitter for aggressive HPC or
  choice
        prompt "Build-forced no-CBs CPUs"
        default RCU_NOCB_CPU_NONE
+       depends on RCU_NOCB_CPU
        help
          This option allows no-CBs CPUs (whose RCU callbacks are invoked
          from kthreads rather than from softirq context) to be specified
  
  config RCU_NOCB_CPU_NONE
        bool "No build_forced no-CBs CPUs"
-       depends on RCU_NOCB_CPU
        help
          This option does not force any of the CPUs to be no-CBs CPUs.
          Only CPUs designated by the rcu_nocbs= boot parameter will be
  
  config RCU_NOCB_CPU_ZERO
        bool "CPU 0 is a build_forced no-CBs CPU"
-       depends on RCU_NOCB_CPU
        help
          This option forces CPU 0 to be a no-CBs CPU, so that its RCU
          callbacks are invoked by a per-CPU kthread whose name begins
  
  config RCU_NOCB_CPU_ALL
        bool "All CPUs are build_forced no-CBs CPUs"
-       depends on RCU_NOCB_CPU
        help
          This option forces all CPUs to be no-CBs CPUs.  The rcu_nocbs=
          boot parameter will be ignored.  All CPUs' RCU callbacks will
@@@ -1341,10 -1334,6 +1334,10 @@@ config SYSCTL_ARCH_UNALIGN_ALLO
  config HAVE_PCSPKR_PLATFORM
        bool
  
 +# interpreter that classic socket filters depend on
 +config BPF
 +      bool
 +
  menuconfig EXPERT
        bool "Configure standard kernel features (expert users)"
        # Unhide debug options, to make the on-by-default options visible
@@@ -1525,16 -1514,6 +1518,16 @@@ config EVENTF
  
          If unsure, say Y.
  
 +# syscall, maps, verifier
 +config BPF_SYSCALL
 +      bool "Enable bpf() system call" if EXPERT
 +      select ANON_INODES
 +      select BPF
 +      default n
 +      help
 +        Enable the bpf() system call that allows to manipulate eBPF
 +        programs and maps via file descriptors.
 +
  config SHMEM
        bool "Use full shmem filesystem" if EXPERT
        default y
diff --combined kernel/sched/core.c
index 240157c13ddc88508a4aafa87d8350394b38e94b,cc186945296da3750029ff8adf99bda4efaabb41..05e5c1ebc73b66761b2b8d6eaf4116b0a15a4c37
@@@ -2802,7 -2802,7 +2802,7 @@@ need_resched
        preempt_disable();
        cpu = smp_processor_id();
        rq = cpu_rq(cpu);
-       rcu_note_context_switch(cpu);
+       rcu_note_context_switch();
        prev = rq->curr;
  
        schedule_debug(prev);
@@@ -2951,47 -2951,6 +2951,47 @@@ asmlinkage __visible void __sched notra
  }
  NOKPROBE_SYMBOL(preempt_schedule);
  EXPORT_SYMBOL(preempt_schedule);
 +
 +#ifdef CONFIG_CONTEXT_TRACKING
 +/**
 + * preempt_schedule_context - preempt_schedule called by tracing
 + *
 + * The tracing infrastructure uses preempt_enable_notrace to prevent
 + * recursion and tracing preempt enabling caused by the tracing
 + * infrastructure itself. But as tracing can happen in areas coming
 + * from userspace or just about to enter userspace, a preempt enable
 + * can occur before user_exit() is called. This will cause the scheduler
 + * to be called when the system is still in usermode.
 + *
 + * To prevent this, the preempt_enable_notrace will use this function
 + * instead of preempt_schedule() to exit user context if needed before
 + * calling the scheduler.
 + */
 +asmlinkage __visible void __sched notrace preempt_schedule_context(void)
 +{
 +      enum ctx_state prev_ctx;
 +
 +      if (likely(!preemptible()))
 +              return;
 +
 +      do {
 +              __preempt_count_add(PREEMPT_ACTIVE);
 +              /*
 +               * Needs preempt disabled in case user_exit() is traced
 +               * and the tracer calls preempt_enable_notrace() causing
 +               * an infinite recursion.
 +               */
 +              prev_ctx = exception_enter();
 +              __schedule();
 +              exception_exit(prev_ctx);
 +
 +              __preempt_count_sub(PREEMPT_ACTIVE);
 +              barrier();
 +      } while (need_resched());
 +}
 +EXPORT_SYMBOL_GPL(preempt_schedule_context);
 +#endif /* CONFIG_CONTEXT_TRACKING */
 +
  #endif /* CONFIG_PREEMPT */
  
  /*
@@@ -7874,11 -7833,6 +7874,11 @@@ static void cpu_cgroup_css_offline(stru
        sched_offline_group(tg);
  }
  
 +static void cpu_cgroup_fork(struct task_struct *task)
 +{
 +      sched_move_task(task);
 +}
 +
  static int cpu_cgroup_can_attach(struct cgroup_subsys_state *css,
                                 struct cgroup_taskset *tset)
  {
@@@ -8251,7 -8205,6 +8251,7 @@@ struct cgroup_subsys cpu_cgrp_subsys = 
        .css_free       = cpu_cgroup_css_free,
        .css_online     = cpu_cgroup_css_online,
        .css_offline    = cpu_cgroup_css_offline,
 +      .fork           = cpu_cgroup_fork,
        .can_attach     = cpu_cgroup_can_attach,
        .attach         = cpu_cgroup_attach,
        .exit           = cpu_cgroup_exit,
This page took 0.129882 seconds and 5 git commands to generate.