1. 21 2月, 2018 10 次提交
    • M
      rcu: Use wrapper for lockdep asserts · a32e01ee
      Matthew Wilcox 提交于
      Commits c0b334c5 and ea9b0c8a introduced new sparse warnings
      by accessing rcu_node->lock directly and ignoring the __private
      marker.  Introduce a new wrapper and use it.  Also fix a similar problem
      in srcutree.c introduced by a3883df3.
      Signed-off-by: NMatthew Wilcox <mawilcox@microsoft.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      a32e01ee
    • L
      rcu: Remove redundant nxttail index macro define · 65518db8
      Liu, Changcheng 提交于
      RCU's nxttail has been optimized to be a rcu_segcblist, which is
      a multi-tailed linked list with macros defined for the indexes for
      each tail.  The indexes have been defined in linux/rcu_segcblist.h,
      so this commit removes the redundant definitions in kernel/rcu/tree.h.
      Signed-off-by: NLiu Changcheng <changcheng.liu@intel.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      65518db8
    • P
      rcu: Consolidate rcu.h #ifdefs · bfbd767d
      Paul E. McKenney 提交于
      The kernel/rcu/rcu.h file has a pair of consecutive #ifdefs on
      CONFIG_TINY_RCU, so this commit consolidates them, thus saving a few
      lines of code.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      bfbd767d
    • P
      rcu: More clearly identify grace-period kthread stack dump · d07aee2c
      Paul E. McKenney 提交于
      It is not always obvious that the stack dump from a starved grace-period
      kthread isn't instead that of a CPU stalling the current grace period.
      This commit therefore adds a pr_err() flagging these dumps.
      Reported-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      d07aee2c
    • P
      rcu: Remove obsolete force-quiescent-state statistics for debugfs · d62df573
      Paul E. McKenney 提交于
      The debugfs interface displayed statistics on RCU-pending checks but
      this interface has since been removed.  This commit therefore removes the
      no-longer-used rcu_state structure's ->n_force_qs_lh and ->n_force_qs_ngp
      fields along with their updates.  (Though the ->n_force_qs_ngp field
      was actually not used at all, embarrassingly enough.)
      
      If this information proves necessary in the future, the corresponding
      event traces will be added.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      d62df573
    • P
      rcu: Remove obsolete __rcu_pending() statistics for debugfs · 01c495f7
      Paul E. McKenney 提交于
      The debugfs interface displayed statistics on RCU-pending checks
      but this interface has since been removed.  This commit therefore
      removes the no-longer-used rcu_data structure's ->n_rcu_pending,
      ->n_rp_core_needs_qs, ->n_rp_report_qs, ->n_rp_cb_ready,
      ->n_rp_cpu_needs_gp, ->n_rp_gp_completed, ->n_rp_gp_started,
      ->n_rp_nocb_defer_wakeup, and ->n_rp_need_nothing fields along with
      their updates.
      
      If this information proves necessary in the future, the corresponding
      event traces will be added.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      01c495f7
    • P
      rcu: Remove obsolete callback-invocation statistics for debugfs · 62df63e0
      Paul E. McKenney 提交于
      The debugfs interface displayed statistics on RCU callback invocation but
      this interface has since been removed.  This commit therefore removes the
      no-longer-used rcu_data structure's ->n_cbs_invoked and ->n_nocbs_invoked
      fields along with their updates.
      
      If this information proves necessary in the future, the corresponding
      event traces will be added.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      62df63e0
    • P
      rcu: Remove obsolete boost statistics for debugfs · bec06785
      Paul E. McKenney 提交于
      The debugfs interface displayed statistics on RCU priority boosting,
      but this interface has since been removed.  This commit therefore
      removes the no-longer-used rcu_data structure's ->n_tasks_boosted,
      ->n_exp_boosts, and ->n_exp_boosts and their updates.
      
      If this information proves necessary in the future, the corresponding
      event traces will be added.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      bec06785
    • T
      rcu: Call touch_nmi_watchdog() while printing stall warnings · 3caa973b
      Tejun Heo 提交于
      When RCU stall warning triggers, it can print out a lot of messages
      while holding spinlocks.  If the console device is slow (e.g. an
      actual or IPMI serial console), it may end up triggering NMI hard
      lockup watchdog like the following.
      
      *** CPU printking while holding RCU spinlock
      
        PID: 4149739  TASK: ffff881a46baa880  CPU: 13  COMMAND: "CPUThreadPool8"
         #0 [ffff881fff945e48] crash_nmi_callback at ffffffff8103f7d0
         #1 [ffff881fff945e58] nmi_handle at ffffffff81020653
         #2 [ffff881fff945eb0] default_do_nmi at ffffffff81020c36
         #3 [ffff881fff945ed0] do_nmi at ffffffff81020d32
         #4 [ffff881fff945ef0] end_repeat_nmi at ffffffff81956a7e
            [exception RIP: io_serial_in+21]
            RIP: ffffffff81630e55  RSP: ffff881fff943b88  RFLAGS: 00000002
            RAX: 000000000000ca00  RBX: ffffffff8230e188  RCX: 0000000000000000
            RDX: 00000000000002fd  RSI: 0000000000000005  RDI: ffffffff8230e188
            RBP: ffff881fff943bb0   R8: 0000000000000000   R9: ffffffff820cb3c4
            R10: 0000000000000019  R11: 0000000000002000  R12: 00000000000026e1
            R13: 0000000000000020  R14: ffffffff820cd398  R15: 0000000000000035
            ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0000
        --- <NMI exception stack> ---
         #5 [ffff881fff943b88] io_serial_in at ffffffff81630e55
         #6 [ffff881fff943b90] wait_for_xmitr at ffffffff8163175c
         #7 [ffff881fff943bb8] serial8250_console_putchar at ffffffff816317dc
         #8 [ffff881fff943bd8] uart_console_write at ffffffff8162ac00
         #9 [ffff881fff943c08] serial8250_console_write at ffffffff81634691
        #10 [ffff881fff943c80] univ8250_console_write at ffffffff8162f7c2
        #11 [ffff881fff943c90] console_unlock at ffffffff810dfc55
        #12 [ffff881fff943cf0] vprintk_emit at ffffffff810dffb5
        #13 [ffff881fff943d50] vprintk_default at ffffffff810e01bf
        #14 [ffff881fff943d60] vprintk_func at ffffffff810e1127
        #15 [ffff881fff943d70] printk at ffffffff8119a8a4
        #16 [ffff881fff943dd0] print_cpu_stall_info at ffffffff810eb78c
        #17 [ffff881fff943e88] rcu_check_callbacks at ffffffff810ef133
        #18 [ffff881fff943ee8] update_process_times at ffffffff810f3497
        #19 [ffff881fff943f10] tick_sched_timer at ffffffff81103037
        #20 [ffff881fff943f38] __hrtimer_run_queues at ffffffff810f3f38
        #21 [ffff881fff943f88] hrtimer_interrupt at ffffffff810f442b
      
      *** CPU triggering the hardlockup watchdog
      
        PID: 4149709  TASK: ffff88010f88c380  CPU: 26  COMMAND: "CPUThreadPool35"
         #0 [ffff883fff1059d0] machine_kexec at ffffffff8104a874
         #1 [ffff883fff105a30] __crash_kexec at ffffffff811116cc
         #2 [ffff883fff105af0] __crash_kexec at ffffffff81111795
         #3 [ffff883fff105b08] panic at ffffffff8119a6ae
         #4 [ffff883fff105b98] watchdog_overflow_callback at ffffffff81135dbd
         #5 [ffff883fff105bb0] __perf_event_overflow at ffffffff81186866
         #6 [ffff883fff105be8] perf_event_overflow at ffffffff81192bc4
         #7 [ffff883fff105bf8] intel_pmu_handle_irq at ffffffff8100b265
         #8 [ffff883fff105df8] perf_event_nmi_handler at ffffffff8100489f
         #9 [ffff883fff105e58] nmi_handle at ffffffff81020653
        #10 [ffff883fff105eb0] default_do_nmi at ffffffff81020b94
        #11 [ffff883fff105ed0] do_nmi at ffffffff81020d32
        #12 [ffff883fff105ef0] end_repeat_nmi at ffffffff81956a7e
            [exception RIP: queued_spin_lock_slowpath+248]
            RIP: ffffffff810da958  RSP: ffff883fff103e68  RFLAGS: 00000046
            RAX: 0000000000000000  RBX: 0000000000000046  RCX: 00000000006d0000
            RDX: ffff883fff49a950  RSI: 0000000000d10101  RDI: ffffffff81e54300
            RBP: ffff883fff103e80   R8: ffff883fff11a950   R9: 0000000000000000
            R10: 000000000e5873ba  R11: 000000000000010f  R12: ffffffff81e54300
            R13: 0000000000000000  R14: ffff88010f88c380  R15: ffffffff81e54300
            ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
        --- <NMI exception stack> ---
        #13 [ffff883fff103e68] queued_spin_lock_slowpath at ffffffff810da958
        #14 [ffff883fff103e70] _raw_spin_lock_irqsave at ffffffff8195550b
        #15 [ffff883fff103e88] rcu_check_callbacks at ffffffff810eed18
        #16 [ffff883fff103ee8] update_process_times at ffffffff810f3497
        #17 [ffff883fff103f10] tick_sched_timer at ffffffff81103037
        #18 [ffff883fff103f38] __hrtimer_run_queues at ffffffff810f3f38
        #19 [ffff883fff103f88] hrtimer_interrupt at ffffffff810f442b
        --- <IRQ stack> ---
      
      Avoid spuriously triggering NMI hardlockup watchdog by touching it
      from the print functions.  show_state_filter() shares the same problem
      and solution.
      
      v2: Relocate the comment to where it belongs.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      3caa973b
    • P
      rcu: Fix CPU offload boot message when no CPUs are offloaded · 3016611e
      Paul E. McKenney 提交于
      In CONFIG_RCU_NOCB_CPU=y kernels, if the boot parameters indicate that
      none of the CPUs should in fact be offloaded, the following somewhat
      obtuse message appears:
      
      	Offload RCU callbacks from CPUs: .
      
      This commit therefore makes the message at least grammatically correct
      in this case:
      
      	Offload RCU callbacks from CPUs: (none)
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      3016611e
  2. 16 2月, 2018 1 次提交
  3. 12 12月, 2017 5 次提交
    • P
      torture: Eliminate torture_runnable and perf_runnable · a2f2577d
      Paul E. McKenney 提交于
      The purpose of torture_runnable is to allow rcutorture and locktorture
      to be started and stopped via sysfs when they are built into the kernel
      (as in not compiled as loadable modules).  However, the 0444 permissions
      for both instances of torture_runnable prevent this use case from ever
      being put into practice.  Given that there have been no complaints
      about this deficiency, it is reasonable to conclude that no one actually
      makes use of this sysfs capability.  The perf_runnable module parameter
      for rcuperf is in the same situation.
      
      This commit therefore removes both torture_runnable instances as well
      as perf_runnable.
      Reported-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      a2f2577d
    • P
      rcutorture: Preempt RCU-preempt readers more vigorously · e8302739
      Paul E. McKenney 提交于
      This commit attempts to make a very rare rcutorture failure happen
      more often by increasing the fraction of RCU-preempt read-side critical
      sections that are preempted.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      e8302739
    • P
      torture: Reduce #ifdefs for preempt_schedule() · cc1321c9
      Paul E. McKenney 提交于
      This commit adds a torture_preempt_schedule() that is nothingness
      in !PREEMPT builds and is preempt_schedule() otherwise.  Then
      torture_preempt_schedule() is used to eliminate several ugly #ifdefs,
      both in rcutorture and in locktorture.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      cc1321c9
    • R
      rcu: Remove have_rcu_nocb_mask from tree_plugin.h · 84b12b75
      Rakib Mullick 提交于
      Currently have_rcu_nocb_mask is used to avoid double allocation of
      rcu_nocb_mask during boot up. Due to different representation of
      cpumask_var_t on different kernel config CPUMASK=y(or n) it was okay.
      But now we have a helper cpumask_available(), which can be utilized
      to check whether rcu_nocb_mask has been allocated or not without using
      a variable.
      
      Removing the variable also reduces vmlinux size.
      
      Unpatched version:
      text	   data	    bss	    dec	    hex	filename
      13050393	7852470	14543408	35446271	21cddff	vmlinux
      
      Patched version:
       text	   data	    bss	    dec	    hex	filename
      13050390	7852438	14543408	35446236	21cdddc	vmlinux
      Signed-off-by: NRakib Mullick <rakib.mullick@gmail.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Lai Jiangshan <jiangshanlai@gmail.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      84b12b75
    • P
      rcu: Add comment giving debug strategy for double call_rcu() · efd88b02
      Paul E. McKenney 提交于
      The following statement has for some reason proven non-intuitive:
      
      	WARN_ON_ONCE(rcu_segcblist_empty(&rdp->cblist) != (count == 0));
      
      This commit therefore adds a comment that states that this warning
      usually triggers in response to a double call_rcu(), which is sort
      of like a double free.  The comment also suggests building with
      CONFIG_DEBUG_OBJECTS_RCU_HEAD=y to track down the double call_rcu().
      Reported-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      efd88b02
  4. 08 12月, 2017 1 次提交
  5. 29 11月, 2017 9 次提交
  6. 28 11月, 2017 7 次提交
  7. 08 11月, 2017 1 次提交
  8. 03 11月, 2017 1 次提交
    • K
      rcu: Convert timers to use timer_setup() · fd30b717
      Kees Cook 提交于
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly.
      
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Lai Jiangshan <jiangshanlai@gmail.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      fd30b717
  9. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  10. 27 10月, 2017 2 次提交
  11. 21 10月, 2017 1 次提交
  12. 20 10月, 2017 1 次提交