1. 17 5月, 2013 3 次提交
    • L
      Merge branch 'for-3.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · 4a007ed9
      Linus Torvalds 提交于
      Pull workqueue fixes from Tejun Heo:
       "Three more workqueue regression fixes.
      
         - Fix unbalanced unlock in trylock failure path of manage_workers().
           This shouldn't happen often in the wild but is possible.
      
         - While making schedule_work() and friends inline, they become
           unavailable to !GPL modules.  Allow !GPL modules to access basic
           stuff - system_wq and queue_*work_on() - so that schedule_work()
           and friends can be used.
      
         - During boot, the unbound NUMA support code allocates a cpumask for
           each possible node using alloc_cpumask_var_node(), which ends up
           trying to allocate node-specific memory even for offline nodes
           triggering BUG in the memory alloc code.  Use NUMA_NO_NODE for
           offline nodes."
      
      * 'for-3.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
        workqueue: don't perform NUMA-aware allocations on offline nodes in wq_numa_init()
        workqueue: Make schedule_work() available again to non GPL modules
        workqueue: correct handling of the pool spin_lock
      4a007ed9
    • L
      Merge branch 'rcu/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu · ff89acc5
      Linus Torvalds 提交于
      Pull RCU fixes from Paul McKenney:
       "A couple of fixes for RCU regressions:
      
         - A boneheaded boolean-logic bug that resulted in excessive delays on
           boot, hibernation and suspend that was reported by Borislav Petkov,
           Bjørn Mork, and Joerg Roedel.  The fix inserts a single "!".
      
         - A fix for a boot-time splat due to allocating from bootmem too late
           in boot, fix courtesy of Sasha Levin with additional help from
           Yinghai Lu."
      
      * 'rcu/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu:
        rcu: Don't allocate bootmem from rcu_init()
        rcu: Fix comparison sense in rcu_needs_cpu()
      ff89acc5
    • O
      usermodehelper: check subprocess_info->path != NULL · 264b83c0
      Oleg Nesterov 提交于
      argv_split(empty_or_all_spaces) happily succeeds, it simply returns
      argc == 0 and argv[0] == NULL. Change call_usermodehelper_exec() to
      check sub_info->path != NULL to avoid the crash.
      
      This is the minimal fix, todo:
      
       - perhaps we should change argv_split() to return NULL or change the
         callers.
      
       - kill or justify ->path[0] check
      
       - narrow the scope of helper_lock()
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Acked-By: NLucas De Marchi <lucas.demarchi@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      264b83c0
  2. 16 5月, 2013 14 次提交
    • L
      Merge branch 'queue' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 5c64e3a4
      Linus Torvalds 提交于
      Pull target fixes from Nicholas Bellinger:
       "A handful of fixes + minor changes this time around, along with one
        important >= v3.9 regression fix for IBLOCK backends.  The highlights
        include:
      
         - Use FD_MAX_SECTORS in FILEIO for block_device as
           well as files (agrover)
      
         - Fix processing of out-of-order CmdSNs with
           iSBD driver (shlomo)
      
         - Close long-standing target_put_sess_cmd() vs.
           core_tmr_abort_task() race with the addition of
           kref_put_spinlock_irqsave() (joern + greg-kh)
      
         - Fix IBLOCK WCE=1 + DPOFUA=1 backend WRITE
           regression in >= v3.9 (nab + bootc)
      
        Note these four patches are CC'ed to stable.
      
        Also, there is still some work left to be done on the active I/O
        shutdown path in target_wait_for_sess_cmds() used by tcm_qla2xxx +
        ib_isert fabrics that is still being discussed on the list, and will
        hopefully be resolved soon."
      
      * 'queue' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        target: close target_put_sess_cmd() vs. core_tmr_abort_task() race
        target: removed unused transport_state flag
        target/iblock: Fix WCE=1 + DPOFUA=1 backend WRITE regression
        MAINTAINERS: Update target git tree URL
        iscsi-target: Fix typos in RDMAEXTENSIONS macro usage
        target/rd: Add ramdisk bit for NULLIO operation
        iscsi-target: Fix processing of OOO commands
        iscsi-target: Make buf param of iscsit_do_crypto_hash_buf() const void *
        iscsi-target: Fix NULL pointer dereference in iscsit_send_reject
        target: Have dev/enable show if TCM device is configured
        target: Use FD_MAX_SECTORS/FD_BLOCKSIZE for blockdevs using fileio
        target: Remove unused struct members in se_dev_entry
      5c64e3a4
    • T
      workqueue: don't perform NUMA-aware allocations on offline nodes in wq_numa_init() · 1be0c25d
      Tejun Heo 提交于
      wq_numa_init() builds per-node cpumasks which are later used to make
      unbound workqueues NUMA-aware.  The cpumasks are allocated using
      alloc_cpumask_var_node() for all possible nodes.  Unfortunately, on
      machines with off-line nodes, this leads to NUMA-aware allocations on
      existing bug offline nodes, which in turn triggers BUG in the memory
      allocation code.
      
      Fix it by using NUMA_NO_NODE for cpumask allocations for offline
      nodes.
      
        kernel BUG at include/linux/gfp.h:323!
        invalid opcode: 0000 [#1] SMP
        Modules linked in:
        CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.9.0+ #1
        Hardware name: ProLiant BL465c G7, BIOS A19 12/10/2011
        task: ffff880234608000 ti: ffff880234602000 task.ti: ffff880234602000
        RIP: 0010:[<ffffffff8117495d>]  [<ffffffff8117495d>] new_slab+0x2ad/0x340
        RSP: 0000:ffff880234603bf8  EFLAGS: 00010246
        RAX: 0000000000000000 RBX: ffff880237404b40 RCX: 00000000000000d0
        RDX: 0000000000000001 RSI: 0000000000000003 RDI: 00000000002052d0
        RBP: ffff880234603c28 R08: 0000000000000000 R09: 0000000000000001
        R10: 0000000000000001 R11: ffffffff812e3aa8 R12: 0000000000000001
        R13: ffff8802378161c0 R14: 0000000000030027 R15: 00000000000040d0
        FS:  0000000000000000(0000) GS:ffff880237800000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
        CR2: ffff88043fdff000 CR3: 00000000018d5000 CR4: 00000000000007f0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
        Stack:
         ffff880234603c28 0000000000000001 00000000000000d0 ffff8802378161c0
         ffff880237404b40 ffff880237404b40 ffff880234603d28 ffffffff815edba1
         ffff880237816140 0000000000000000 ffff88023740e1c0
        Call Trace:
         [<ffffffff815edba1>] __slab_alloc+0x330/0x4f2
         [<ffffffff81174b25>] kmem_cache_alloc_node_trace+0xa5/0x200
         [<ffffffff812e3aa8>] alloc_cpumask_var_node+0x28/0x90
         [<ffffffff81a0bdb3>] wq_numa_init+0x10d/0x1be
         [<ffffffff81a0bec8>] init_workqueues+0x64/0x341
         [<ffffffff810002ea>] do_one_initcall+0xea/0x1a0
         [<ffffffff819f1f31>] kernel_init_freeable+0xb7/0x1ec
         [<ffffffff815d50de>] kernel_init+0xe/0xf0
         [<ffffffff815ff89c>] ret_from_fork+0x7c/0xb0
        Code: 45  84 ac 00 00 00 f0 41 80 4d 00 40 e9 f6 fe ff ff 66 0f 1f 84 00 00 00 00 00 e8 eb 4b ff ff 49 89 c5 e9 05 fe ff ff <0f> 0b 4c 8b 73 38 44 89 ff 81 cf 00 00 20 00 4c 89 f6 48 c1 ee
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-and-Tested-by: NLingzhu Xiang <lxiang@redhat.com>
      1be0c25d
    • L
      Merge tag 'trace-fixes-v3.10-rc1' of... · c240a539
      Linus Torvalds 提交于
      Merge tag 'trace-fixes-v3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      
      Pull tracing fixes from Steven Rostedt:
       "This includes a fix to a memory leak when adding filters to traces.
      
        Also, Masami Hiramatsu fixed up some minor bugs that were discovered
        by sparse."
      
      * tag 'trace-fixes-v3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing/kprobes: Make print_*probe_event static
        tracing/kprobes: Fix a sparse warning for incorrect type in assignment
        tracing/kprobes: Use rcu_dereference_raw for tp->files
        tracing: Fix leaks of filter preds
      c240a539
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ae3b29e6
      Linus Torvalds 提交于
      Pull x86 fixes from Thomas Gleixner:
      
       - Fix for a CPU hot-add deadlock in microcode update code
      
       - Fix for idle consolidation fallout
      
       - Documentation update for initial kernel direct mapping
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm: Add missing comments for initial kernel direct mapping
        x86/microcode: Add local mutex to fix physical CPU hot-add deadlock
        x86: Fix idle consolidation fallout
      ae3b29e6
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 652df602
      Linus Torvalds 提交于
      Pull perf fixes from Thomas Gleixner:
      
       - Fix for a task exit cleanup race caused by a missing a preempt
         disable
      
       - Cleanup of the event notification functions with a massive reduction
         of duplicated code
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf: Factor out auxiliary events notification
        perf: Fix EXIT event notification
      652df602
    • L
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · cc51bf6e
      Linus Torvalds 提交于
      Pull timer fixes from Thomas Gleixner:
      
       - Cure for not using zalloc in the first place, which leads to random
         crashes with CPUMASK_OFF_STACK.
      
       - Revert a user space visible change which broke udev
      
       - Add a missing cpu_online early return introduced by the new full
         dyntick conversions
      
       - Plug a long standing race in the timer wheel cpu hotplug code.
         Sigh...
      
       - Cleanup NOHZ per cpu data on cpu down to prevent stale data on cpu
         up.
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        time: Revert ALWAYS_USE_PERSISTENT_CLOCK compile time optimizaitons
        timer: Don't reinitialize the cpu base lock during CPU_UP_PREPARE
        tick: Don't invoke tick_nohz_stop_sched_tick() if the cpu is offline
        tick: Cleanup NOHZ per cpu data on cpu down
        tick: Use zalloc_cpumask_var for allocating offstack cpumasks
      cc51bf6e
    • L
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 37cae5e2
      Linus Torvalds 提交于
      Pull core fixes from Thomas Gleixner:
      
       - Two fixlets for the fallout of the generic idle task conversion
      
       - Documentation update
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        rcu/idle: Wrap cpu-idle poll mode within rcu_idle_enter/exit
        idle: Fix hlt/nohlt command-line handling in new generic idle
        kthread: Document ways of reducing OS jitter due to per-CPU kthreads
      37cae5e2
    • L
      Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm · d21572c5
      Linus Torvalds 提交于
      Pull ARM fixes from Russell King:
       "A small number of fixes for stuff from the last merge window, and in
        one case (IRQ time accounting) the previous merge window."
      
      * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
        ARM: 7720/1: ARM v6/v7 cmpxchg64 shouldn't clear upper 32 bits of the old/new value
        ARM: 7715/1: MCPM: adapt to GIC changes after upstream merge
        ARM: 7714/1: mmc: mmci: Ensure return value of regulator_enable() is checked
        ARM: 7712/1: Remove trailing whitespace in arch/arm/Makefile
        ARM: 7711/1: dove: fix Dove cpu type from V7 to PJ4
        ARM: finally enable IRQ time accounting config
      d21572c5
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 109c3c02
      Linus Torvalds 提交于
      Pull Ceph fixes from Sage Weil:
       "Yes, this is a much larger pull than I would like after -rc1.  There
        are a few things included:
      
         - a few fixes for leaks and incorrect assertions
         - a few patches fixing behavior when mapped images are resized
         - handling for cloned/layered images that are flattened out from
           underneath the client
      
        The last bit was non-trivial, and there is some code movement and
        associated cleanup mixed in.  This was ready and was meant to go in
        last week but I missed the boat on Friday.  My only excuse is that I
        was waiting for an all clear from the testing and there were many
        other shiny things to distract me.
      
        Strictly speaking, handling the flatten case isn't a regression and
        could wait, so if you like we can try to pull the series apart, but
        Alex and I would much prefer to have it all in as it is a case real
        users will hit with 3.10."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (33 commits)
        rbd: re-submit flattened write request (part 2)
        rbd: re-submit write request for flattened clone
        rbd: re-submit read request for flattened clone
        rbd: detect when clone image is flattened
        rbd: reference count parent requests
        rbd: define parent image request routines
        rbd: define rbd_dev_unparent()
        rbd: don't release write request until necessary
        rbd: get parent info on refresh
        rbd: ignore zero-overlap parent
        rbd: support reading parent page data for writes
        rbd: fix parent request size assumption
        libceph: init sent and completed when starting
        rbd: kill rbd_img_request_get()
        rbd: only set up watch for mapped images
        rbd: set mapping read-only flag in rbd_add()
        rbd: support reading parent page data
        rbd: fix an incorrect assertion condition
        rbd: define rbd_dev_v2_header_info()
        rbd: get rid of trivial v1 header wrappers
        ...
      109c3c02
    • M
      tracing/kprobes: Make print_*probe_event static · b62fdd97
      Masami Hiramatsu 提交于
      According to sparse warning, print_*probe_event static because
      those functions are not directly called from outside.
      
      Link: http://lkml.kernel.org/r/20130513115839.6545.83067.stgit@mhiramat-M0-7522
      
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Tom Zanussi <tom.zanussi@intel.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      b62fdd97
    • M
      tracing/kprobes: Fix a sparse warning for incorrect type in assignment · 3d1fc7b0
      Masami Hiramatsu 提交于
      Fix a sparse warning about the rcu operated pointer is
      defined without __rcu address space.
      
      Link: http://lkml.kernel.org/r/20130513115837.6545.23322.stgit@mhiramat-M0-7522
      
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Tom Zanussi <tom.zanussi@intel.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      3d1fc7b0
    • M
      tracing/kprobes: Use rcu_dereference_raw for tp->files · c02c7e65
      Masami Hiramatsu 提交于
      Use rcu_dereference_raw() for accessing tp->files. Because the
      write-side uses rcu_assign_pointer() for memory barrier,
      the read-side also has to use rcu_dereference_raw() with
      read memory barrier.
      
      Link: http://lkml.kernel.org/r/20130513115834.6545.17022.stgit@mhiramat-M0-7522
      
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Tom Zanussi <tom.zanussi@intel.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      c02c7e65
    • S
      tracing: Fix leaks of filter preds · 60705c89
      Steven Rostedt (Red Hat) 提交于
      Special preds are created when folding a series of preds that
      can be done in serial. These are allocated in an ops field of
      the pred structure. But they were never freed, causing memory
      leaks.
      
      This was discovered using the kmemleak checker:
      
      unreferenced object 0xffff8800797fd5e0 (size 32):
        comm "swapper/0", pid 1, jiffies 4294690605 (age 104.608s)
        hex dump (first 32 bytes):
          00 00 01 00 03 00 05 00 07 00 09 00 0b 00 0d 00  ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<ffffffff814b52af>] kmemleak_alloc+0x73/0x98
          [<ffffffff8111ff84>] kmemleak_alloc_recursive.constprop.42+0x16/0x18
          [<ffffffff81120e68>] __kmalloc+0xd7/0x125
          [<ffffffff810d47eb>] kcalloc.constprop.24+0x2d/0x2f
          [<ffffffff810d4896>] fold_pred_tree_cb+0xa9/0xf4
          [<ffffffff810d3781>] walk_pred_tree+0x47/0xcc
          [<ffffffff810d5030>] replace_preds.isra.20+0x6f8/0x72f
          [<ffffffff810d50b5>] create_filter+0x4e/0x8b
          [<ffffffff81b1c30d>] ftrace_test_event_filter+0x5a/0x155
          [<ffffffff8100028d>] do_one_initcall+0xa0/0x137
          [<ffffffff81afbedf>] kernel_init_freeable+0x14d/0x1dc
          [<ffffffff814b24b7>] kernel_init+0xe/0xdb
          [<ffffffff814d539c>] ret_from_fork+0x7c/0xb0
          [<ffffffffffffffff>] 0xffffffffffffffff
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: stable@vger.kernel.org # 2.6.39+
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      60705c89
    • S
      rcu: Don't allocate bootmem from rcu_init() · 615ee544
      Sasha Levin 提交于
      When rcu_init() is called we already have slab working, allocating
      bootmem at that point results in warnings and an allocation from
      slab.  This commit therefore changes alloc_bootmem_cpumask_var() to
      alloc_cpumask_var() in rcu_bootup_announce_oddness(), which is called
      from rcu_init().
      Signed-off-by: NSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Tested-by: NRobin Holt <holt@sgi.com>
      
      [paulmck: convert to zalloc_cpumask_var(), as suggested by Yinghai Lu.]
      615ee544
  3. 15 5月, 2013 9 次提交
  4. 14 5月, 2013 14 次提交
    • T
      timer: Don't reinitialize the cpu base lock during CPU_UP_PREPARE · 42a5cf46
      Tirupathi Reddy 提交于
      An inactive timer's base can refer to a offline cpu's base.
      
      In the current code, cpu_base's lock is blindly reinitialized each
      time a CPU is brought up. If a CPU is brought online during the period
      that another thread is trying to modify an inactive timer on that CPU
      with holding its timer base lock, then the lock will be reinitialized
      under its feet. This leads to following SPIN_BUG().
      
      <0> BUG: spinlock already unlocked on CPU#3, kworker/u:3/1466
      <0> lock: 0xe3ebe000, .magic: dead4ead, .owner: kworker/u:3/1466, .owner_cpu: 1
      <4> [<c0013dc4>] (unwind_backtrace+0x0/0x11c) from [<c026e794>] (do_raw_spin_unlock+0x40/0xcc)
      <4> [<c026e794>] (do_raw_spin_unlock+0x40/0xcc) from [<c076c160>] (_raw_spin_unlock+0x8/0x30)
      <4> [<c076c160>] (_raw_spin_unlock+0x8/0x30) from [<c009b858>] (mod_timer+0x294/0x310)
      <4> [<c009b858>] (mod_timer+0x294/0x310) from [<c00a5e04>] (queue_delayed_work_on+0x104/0x120)
      <4> [<c00a5e04>] (queue_delayed_work_on+0x104/0x120) from [<c04eae00>] (sdhci_msm_bus_voting+0x88/0x9c)
      <4> [<c04eae00>] (sdhci_msm_bus_voting+0x88/0x9c) from [<c04d8780>] (sdhci_disable+0x40/0x48)
      <4> [<c04d8780>] (sdhci_disable+0x40/0x48) from [<c04bf300>] (mmc_release_host+0x4c/0xb0)
      <4> [<c04bf300>] (mmc_release_host+0x4c/0xb0) from [<c04c7aac>] (mmc_sd_detect+0x90/0xfc)
      <4> [<c04c7aac>] (mmc_sd_detect+0x90/0xfc) from [<c04c2504>] (mmc_rescan+0x7c/0x2c4)
      <4> [<c04c2504>] (mmc_rescan+0x7c/0x2c4) from [<c00a6a7c>] (process_one_work+0x27c/0x484)
      <4> [<c00a6a7c>] (process_one_work+0x27c/0x484) from [<c00a6e94>] (worker_thread+0x210/0x3b0)
      <4> [<c00a6e94>] (worker_thread+0x210/0x3b0) from [<c00aad9c>] (kthread+0x80/0x8c)
      <4> [<c00aad9c>] (kthread+0x80/0x8c) from [<c000ea80>] (kernel_thread_exit+0x0/0x8)
      
      As an example, this particular crash occurred when CPU #3 is executing
      mod_timer() on an inactive timer whose base is refered to offlined CPU
      #2.  The code locked the timer_base corresponding to CPU #2. Before it
      could proceed, CPU #2 came online and reinitialized the spinlock
      corresponding to its base. Thus now CPU #3 held a lock which was
      reinitialized. When CPU #3 finally ended up unlocking the old cpu_base
      corresponding to CPU #2, we hit the above SPIN_BUG().
      
      CPU #0		CPU #3				       CPU #2
      ------		-------				       -------
      .....		 ......				      <Offline>
      		mod_timer()
      		 lock_timer_base
      		   spin_lock_irqsave(&base->lock)
      
      cpu_up(2)	 .....				        ......
      							init_timers_cpu()
      ....		 .....				    	spin_lock_init(&base->lock)
      .....		   spin_unlock_irqrestore(&base->lock)  ......
      		   <spin_bug>
      
      Allocation of per_cpu timer vector bases is done only once under
      "tvec_base_done[]" check. In the current code, spinlock_initialization
      of base->lock isn't under this check. When a CPU is up each time the
      base lock is reinitialized. Move base spinlock initialization under
      the check.
      Signed-off-by: NTirupathi Reddy <tirupath@codeaurora.org>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/1368520142-4136-1-git-send-email-tirupath@codeaurora.orgSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      42a5cf46
    • S
      rcu/idle: Wrap cpu-idle poll mode within rcu_idle_enter/exit · b47430d3
      Srivatsa S. Bhat 提交于
      Bjørn Mork reported the following warning when running powertop.
      
      [   49.289034] ------------[ cut here ]------------
      [   49.289055] WARNING: at kernel/rcutree.c:502 rcu_eqs_exit_common.isra.48+0x3d/0x125()
      [   49.289244] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.0-bisect-rcu-warn+ #107
      [   49.289251]  ffffffff8157d8c8 ffffffff81801e28 ffffffff8137e4e3 ffffffff81801e68
      [   49.289260]  ffffffff8103094f ffffffff81801e68 0000000000000000 ffff88023afcd9b0
      [   49.289268]  0000000000000000 0140000000000000 ffff88023bee7700 ffffffff81801e78
      [   49.289276] Call Trace:
      [   49.289285]  [<ffffffff8137e4e3>] dump_stack+0x19/0x1b
      [   49.289293]  [<ffffffff8103094f>] warn_slowpath_common+0x62/0x7b
      [   49.289300]  [<ffffffff8103097d>] warn_slowpath_null+0x15/0x17
      [   49.289306]  [<ffffffff810a9006>] rcu_eqs_exit_common.isra.48+0x3d/0x125
      [   49.289314]  [<ffffffff81079b49>] ? trace_hardirqs_off_caller+0x37/0xa6
      [   49.289320]  [<ffffffff810a9692>] rcu_idle_exit+0x85/0xa8
      [   49.289327]  [<ffffffff8107076e>] trace_cpu_idle_rcuidle+0xae/0xff
      [   49.289334]  [<ffffffff810708b1>] cpu_startup_entry+0x72/0x115
      [   49.289341]  [<ffffffff813689e5>] rest_init+0x149/0x150
      [   49.289347]  [<ffffffff8136889c>] ? csum_partial_copy_generic+0x16c/0x16c
      [   49.289355]  [<ffffffff81a82d34>] start_kernel+0x3f0/0x3fd
      [   49.289362]  [<ffffffff81a8274c>] ? repair_env_string+0x5a/0x5a
      [   49.289368]  [<ffffffff81a82481>] x86_64_start_reservations+0x2a/0x2c
      [   49.289375]  [<ffffffff81a82550>] x86_64_start_kernel+0xcd/0xd1
      [   49.289379] ---[ end trace 07a1cc95e29e9036 ]---
      
      The warning is that 'rdtp->dynticks' has an unexpected value, which roughly
      translates to - the calls to rcu_idle_enter() and rcu_idle_exit() were not
      made in the correct order, or otherwise messed up.
      
      And Bjørn's painstaking debugging indicated that this happens when the idle
      loop enters the poll mode. Looking at the poll function cpu_idle_poll(), and
      the implementation of trace_cpu_idle_rcuidle(), the problem becomes very clear:
      cpu_idle_poll() lacks calls to rcu_idle_enter/exit(), and trace_cpu_idle_rcuidle()
      calls them in the reverse order - first rcu_idle_exit(), and then rcu_idle_enter().
      Hence the even/odd alternative sequencing of rdtp->dynticks goes for a toss.
      
      And powertop readily triggers this because powertop uses the idle-tracing
      infrastructure extensively.
      
      So, to fix this, wrap the code in cpu_idle_poll() within rcu_idle_enter/exit(),
      so that it blends properly with the calls inside trace_cpu_idle_rcuidle() and
      thus get the function ordering right.
      Reported-and-tested-by: NBjørn Mork <bjorn@mork.no>
      Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Dipankar Sarma <dipankar@in.ibm.com>
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/519169BF.4080208@linux.vnet.ibm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      b47430d3
    • T
      tick: Don't invoke tick_nohz_stop_sched_tick() if the cpu is offline · f7ea0fd6
      Thomas Gleixner 提交于
      commit 5b39939a (nohz: Move ts->idle_calls incrementation into strict
      idle logic) moved code out of tick_nohz_stop_sched_tick() and missed
      to bail out when the cpu is offline. That's causing subsequent
      failures as an offline CPU is supposed to die and not to fiddle with
      nohz magic.
      
      Return false in can_stop_idle_tick() if the cpu is offline.
      Reported-and-tested-by: NJiri Kosina <jkosina@suse.cz>
      Reported-and-tested-by: NPrarit Bhargava <prarit@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: x86@kernel.org
      Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1305132138160.2863@ionosSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      f7ea0fd6
    • L
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · a2c7a54f
      Linus Torvalds 提交于
      Pull powerpc fixes from Benjamin Herrenschmidt:
       "This is mostly bug fixes (some of them regressions, some of them I
        deemed worth merging now) along with some patches from Li Zhong
        hooking up the new context tracking stuff (for the new full NO_HZ)"
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (25 commits)
        powerpc: Set show_unhandled_signals to 1 by default
        powerpc/perf: Fix setting of "to" addresses for BHRB
        powerpc/pmu: Fix order of interpreting BHRB target entries
        powerpc/perf: Move BHRB code into CONFIG_PPC64 region
        powerpc: select HAVE_CONTEXT_TRACKING for pSeries
        powerpc: Use the new schedule_user API on userspace preemption
        powerpc: Exit user context on notify resume
        powerpc: Exception hooks for context tracking subsystem
        powerpc: Syscall hooks for context tracking subsystem
        powerpc/booke64: Fix kernel hangs at kernel_dbg_exc
        powerpc: Fix irq_set_affinity() return values
        powerpc: Provide __bswapdi2
        powerpc/powernv: Fix starting of secondary CPUs on OPALv2 and v3
        powerpc/powernv: Detect OPAL v3 API version
        powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning again
        powerpc: Make CONFIG_RTAS_PROC depend on CONFIG_PROC_FS
        powerpc: Bring all threads online prior to migration/hibernation
        powerpc/rtas_flash: Fix validate_flash buffer overflow issue
        powerpc/kexec: Fix kexec when using VMX optimised memcpy
        powerpc: Fix build errors STRICT_MM_TYPECHECKS
        ...
      a2c7a54f
    • B
      powerpc: Set show_unhandled_signals to 1 by default · e34166ad
      Benjamin Herrenschmidt 提交于
      Just like other architectures
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e34166ad
    • M
      powerpc/perf: Fix setting of "to" addresses for BHRB · 69123184
      Michael Neuling 提交于
      Currently we only set the "to" address in the branch stack when the CPU
      explicitly gives us a value.  Unfortunately it only does this for XL form
      branches (eg blr, bctr, bctar) and not I and B form branches (eg b, bc).
      
      Fortunately if we read the instruction from memory we can extract the offset of
      a branch and calculate the target address.
      
      This adds a function power_pmu_bhrb_to() to calculate the target/to address of
      the corresponding I and B form branches.  It handles branches in both user and
      kernel spaces.  It also plumbs this into the perf brhb reading code.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      69123184
    • M
      powerpc/pmu: Fix order of interpreting BHRB target entries · 506e70d1
      Michael Neuling 提交于
      The current Branch History Rolling Buffer (BHRB) code misinterprets the order
      of entries in the hardware buffer.  It assumes that a branch target address
      will be read _after_ its corresponding branch.  In reality the branch target
      comes before (lower mfbhrb entry) it's corresponding branch.
      
      This is a rewrite of the code to take this into account.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      506e70d1
    • M
      powerpc/perf: Move BHRB code into CONFIG_PPC64 region · d52f2dc4
      Michael Neuling 提交于
      The new Branch History Rolling buffer (BHRB) code is only useful on 64bit
      processors, so move it into the #ifdef CONFIG_PPC64 region.
      
      This avoids code bloat on 32bit systems.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d52f2dc4
    • L
      powerpc: select HAVE_CONTEXT_TRACKING for pSeries · a1797b2f
      Li Zhong 提交于
      Start context tracking support from pSeries.
      Signed-off-by: NLi Zhong <zhong@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a1797b2f
    • L
      powerpc: Use the new schedule_user API on userspace preemption · 5d1c5745
      Li Zhong 提交于
      This patch corresponds to
      [PATCH] x86: Use the new schedule_user API on userspace preemption
        commit 0430499cSigned-off-by: NLi Zhong <zhong@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5d1c5745
    • L
      powerpc: Exit user context on notify resume · 106ed886
      Li Zhong 提交于
      This patch allows RCU usage in do_notify_resume, e.g. signal handling.
      It corresponds to
      [PATCH] x86: Exit RCU extended QS on notify resume
        commit edf55fdaSigned-off-by: NLi Zhong <zhong@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      106ed886
    • L
      powerpc: Exception hooks for context tracking subsystem · ba12eede
      Li Zhong 提交于
      This is the exception hooks for context tracking subsystem, including
      data access, program check, single step, instruction breakpoint, machine check,
      alignment, fp unavailable, altivec assist, unknown exception, whose handlers
      might use RCU.
      
      This patch corresponds to
      [PATCH] x86: Exception hooks for userspace RCU extended QS
        commit 6ba3c97a
      
      But after the exception handling moved to generic code, and some changes in
      following two commits:
      56dd9470
        context_tracking: Move exception handling to generic code
      6c1e0256
        context_tracking: Restore correct previous context state on exception exit
      
      it is able for exception hooks to use the generic code above instead of a
      redundant arch implementation.
      Signed-off-by: NLi Zhong <zhong@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ba12eede
    • L
      powerpc: Syscall hooks for context tracking subsystem · 22ecbe8d
      Li Zhong 提交于
      This is the syscall slow path hooks for context tracking subsystem,
      corresponding to
      [PATCH] x86: Syscall hooks for userspace RCU extended QS
        commit bf5a3c13
      
      TIF_MEMDIE is moved to the second 16-bits (with value 17), as it seems there
      is no asm code using it. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is
      better for it to be in the same 16 bits with others in the group, so in the
      asm code, andi. with this group could work.
      Signed-off-by: NLi Zhong <zhong@linux.vnet.ibm.com>
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      22ecbe8d
    • S
      powerpc/booke64: Fix kernel hangs at kernel_dbg_exc · 6cecf76b
      Scott Wood 提交于
      MSR_DE is not cleared on entry to the kernel, and we don't clear it
      explicitly outside of debug code.  If we have MSR_DE set in
      prime_debug_regs(), and the new thread has events enabled in DBCR0
      (e.g.  ICMP is set in thread->dbsr0, even though it was cleared in the
      real DBCR0 when the thread got scheduled out), we'll end up taking a
      debug exception in the kernel when DBCR0 is loaded.  DSRR0 will not
      point to an exception vector, and the kernel ends up hanging at
      kernel_dbg_exc.  Fix this by always clearing MSR_DE when we load new
      debug state.
      
      Another observed source of kernel_dbg_exc hangs is with the branch
      taken event.  If this event is active, but we take a non-debug trap
      (e.g. a TLB miss or an asynchronous interrupt) before the next branch.
      We end up taking a branch-taken debug exception on the initial branch
      instruction of the exception vector, but because the debug exception is
      DBSR_BT rather than DBSR_IC we branch to kernel_dbg_exc before even
      checking the DSRR0 address.  Fix this by checking for DBSR_BT as well
      as DBSR_IC, which is what 32-bit does and what the comments suggest was
      intended in the 64-bit code as well.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6cecf76b