1. 27 12月, 2016 1 次提交
  2. 25 12月, 2016 2 次提交
  3. 21 12月, 2016 1 次提交
  4. 16 12月, 2016 1 次提交
  5. 08 12月, 2016 1 次提交
    • M
      hotplug: Make register and unregister notifier API symmetric · 777c6e0d
      Michal Hocko 提交于
      Yu Zhao has noticed that __unregister_cpu_notifier only unregisters its
      notifiers when HOTPLUG_CPU=y while the registration might succeed even
      when HOTPLUG_CPU=n if MODULE is enabled. This means that e.g. zswap
      might keep a stale notifier on the list on the manual clean up during
      the pool tear down and thus corrupt the list. Resulting in the following
      
      [  144.964346] BUG: unable to handle kernel paging request at ffff880658a2be78
      [  144.971337] IP: [<ffffffffa290b00b>] raw_notifier_chain_register+0x1b/0x40
      <snipped>
      [  145.122628] Call Trace:
      [  145.125086]  [<ffffffffa28e5cf8>] __register_cpu_notifier+0x18/0x20
      [  145.131350]  [<ffffffffa2a5dd73>] zswap_pool_create+0x273/0x400
      [  145.137268]  [<ffffffffa2a5e0fc>] __zswap_param_set+0x1fc/0x300
      [  145.143188]  [<ffffffffa2944c1d>] ? trace_hardirqs_on+0xd/0x10
      [  145.149018]  [<ffffffffa2908798>] ? kernel_param_lock+0x28/0x30
      [  145.154940]  [<ffffffffa2a3e8cf>] ? __might_fault+0x4f/0xa0
      [  145.160511]  [<ffffffffa2a5e237>] zswap_compressor_param_set+0x17/0x20
      [  145.167035]  [<ffffffffa2908d3c>] param_attr_store+0x5c/0xb0
      [  145.172694]  [<ffffffffa290848d>] module_attr_store+0x1d/0x30
      [  145.178443]  [<ffffffffa2b2b41f>] sysfs_kf_write+0x4f/0x70
      [  145.183925]  [<ffffffffa2b2a5b9>] kernfs_fop_write+0x149/0x180
      [  145.189761]  [<ffffffffa2a99248>] __vfs_write+0x18/0x40
      [  145.194982]  [<ffffffffa2a9a412>] vfs_write+0xb2/0x1a0
      [  145.200122]  [<ffffffffa2a9a732>] SyS_write+0x52/0xa0
      [  145.205177]  [<ffffffffa2ff4d97>] entry_SYSCALL_64_fastpath+0x12/0x17
      
      This can be even triggered manually by changing
      /sys/module/zswap/parameters/compressor multiple times.
      
      Fix this issue by making unregister APIs symmetric to the register so
      there are no surprises.
      
      Fixes: 47e627bc ("[PATCH] hotplug: Allow modules to use the cpu hotplug notifiers even if !CONFIG_HOTPLUG_CPU")
      Reported-and-tested-by: NYu Zhao <yuzhao@google.com>
      Signed-off-by: NMichal Hocko <mhocko@suse.com>
      Cc: linux-mm@kvack.org
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dan Streetman <ddstreet@ieee.org>
      Link: http://lkml.kernel.org/r/20161207135438.4310-1-mhocko@kernel.orgSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      777c6e0d
  6. 16 10月, 2016 1 次提交
  7. 07 9月, 2016 3 次提交
  8. 06 9月, 2016 1 次提交
  9. 05 9月, 2016 1 次提交
  10. 03 9月, 2016 3 次提交
  11. 26 8月, 2016 1 次提交
    • J
      cpu/hotplug: Allow suspend/resume CPU to be specified · d391e552
      James Morse 提交于
      disable_nonboot_cpus() assumes that the lowest numbered online CPU is
      the boot CPU, and that this is the correct CPU to run any power
      management code on.
      
      On x86 this is always correct, as CPU0 cannot (easily) by taken offline.
      
      On arm64 CPU0 can be taken offline. For hibernate/resume this means we
      may hibernate on a CPU other than CPU0. If the system is rebooted with
      kexec 'CPU0' will be assigned to a different physical CPU. This
      complicates hibernate/resume as now we can't trust the CPU numbers.
      Arch code can find the correct physical CPU, and ensure it is online
      before resume from hibernate begins, but also needs to influence
      disable_nonboot_cpus()s choice of CPU.
      
      Rename disable_nonboot_cpus() as freeze_secondary_cpus() and add an
      argument indicating which CPU should be left standing. Follow the logic
      in migrate_to_reboot_cpu() to use the lowest numbered online CPU if the
      requested CPU is not online.
      Add disable_nonboot_cpus() as an inline function that has the existing
      behaviour.
      
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      d391e552
  12. 25 8月, 2016 1 次提交
  13. 23 8月, 2016 2 次提交
    • S
      cpu/hotplug: Get rid of CPU_STARTING reference · 0c6d4576
      Sebastian Andrzej Siewior 提交于
      CPU_STARTING is scheduled for removal. There is no use of it in drivers
      and core code uses it only for compatibility with old-style CPU-hotplug
      notifiers.  This patch removes therefore removes CPU_STARTING from an
      RCU-related comment.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      0c6d4576
    • P
      rcu: Provide exact CPU-online tracking for RCU · 7ec99de3
      Paul E. McKenney 提交于
      Up to now, RCU has assumed that the CPU-online process makes it from
      CPU_UP_PREPARE to set_cpu_online() within one jiffy.  Given the recent
      rise of virtualized environments, this assumption is very clearly
      obsolete.  Failing to meet this deadline can result in RCU paying
      attention to an incoming CPU for one jiffy, then ignoring it until the
      grace period following the one in which that CPU sets itself online.
      This situation might prove to be fatally disappointing to any RCU
      read-side critical sections that had the misfortune to execute during
      the time in which RCU was ignoring the slow-to-come-online CPU.
      
      This commit therefore updates RCU's internal CPU state-tracking
      information at notify_cpu_starting() time, thus providing RCU with
      an exact transition of the CPU's state from offline to online.
      
      Note that this means that incoming CPUs must not use RCU read-side
      critical section (other than those of SRCU) until notify_cpu_starting()
      time.  Note also that the CPU_STARTING notifiers -are- allowed to use
      RCU read-side critical sections.  (Of course, CPU-hotplug notifiers are
      rapidly becoming obsolete, so you need to act fast!)
      
      If a given architecture or CPU family needs to use RCU read-side
      critical sections earlier, the call to rcu_cpu_starting() from
      notify_cpu_starting() will need to be architecture-specific, with
      architectures that need early use being required to hand-place
      the call to rcu_cpu_starting() at some point preceding the call to
      notify_cpu_starting().
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      7ec99de3
  14. 10 8月, 2016 1 次提交
  15. 29 7月, 2016 1 次提交
  16. 15 7月, 2016 4 次提交
  17. 14 7月, 2016 3 次提交
  18. 13 7月, 2016 1 次提交
    • T
      cpu/hotplug: Keep enough storage space if SMP=n to avoid array out of bounds scribble · a7c73414
      Thomas Gleixner 提交于
      Xiaolong Ye reported lock debug warnings triggered by the following commit:
      
        8de4a0066106 ("perf/x86: Convert the core to the hotplug state machine")
      
      The bug is the following: the cpuhp_bp_states[] array is cut short when
      CONFIG_SMP=n, but the dynamically registered callbacks are stored nevertheless
      and happily scribble outside of the array bounds...
      
      We need to store them in case that the state is unregistered so we can invoke
      the teardown function. That's independent of CONFIG_SMP. Make sure the array
      is large enough.
      Reported-by: Nkernel test robot <xiaolong.ye@intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Adam Borowski <kilobyte@angband.pl>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: lkp@01.org
      Cc: stable@vger.kernel.org
      Cc: tipbuild@zytor.com
      Fixes: cff7d378 "cpu/hotplug: Convert to a state machine for the control processor"
      Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1607122144560.4083@nanosSigned-off-by: NIngo Molnar <mingo@kernel.org>
      a7c73414
  19. 06 5月, 2016 5 次提交
  20. 22 4月, 2016 1 次提交
    • S
      cpu/hotplug: Fix rollback during error-out in __cpu_disable() · 3b9d6da6
      Sebastian Andrzej Siewior 提交于
      The recent introduction of the hotplug thread which invokes the callbacks on
      the plugged cpu, cased the following regression:
      
      If takedown_cpu() fails, then we run into several issues:
      
       1) The rollback of the target cpu states is not invoked. That leaves the smp
          threads and the hotplug thread in disabled state.
      
       2) notify_online() is executed due to a missing skip_onerr flag. That causes
          that both CPU_DOWN_FAILED and CPU_ONLINE notifications are invoked which
          confuses quite some notifiers.
      
       3) The CPU_DOWN_FAILED notification is not invoked on the target CPU. That's
          not an issue per se, but it is inconsistent and in consequence blocks the
          patches which rely on these states being invoked on the target CPU and not
          on the controlling cpu. It also does not preserve the strict call order on
          rollback which is problematic for the ongoing state machine conversion as
          well.
      
      To fix this we add a rollback flag to the remote callback machinery and invoke
      the rollback including the CPU_DOWN_FAILED notification on the remote
      cpu. Further mark the notify online state with 'skip_onerr' so we don't get a
      double invokation.
      
      This workaround will go away once we moved the unplug invocation to the target
      cpu itself.
      
      [ tglx: Massaged changelog and moved the CPU_DOWN_FAILED notifiaction to the
        	target cpu ]
      
      Fixes: 4cb28ced ("cpu/hotplug: Create hotplug threads")
      Reported-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: linux-s390@vger.kernel.org
      Cc: rt@linutronix.de
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
      Link: http://lkml.kernel.org/r/20160408124015.GA21960@linutronix.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      3b9d6da6
  21. 13 3月, 2016 1 次提交
  22. 11 3月, 2016 1 次提交
    • T
      cpu/hotplug: Fix smpboot thread ordering · 2a58c527
      Thomas Gleixner 提交于
      Commit 931ef163 moved the smpboot thread park/unpark invocation to the
      state machine. The move of the unpark invocation was premature as it depends
      on work in progress patches.
      
      As a result cpu down can fail, because rcu synchronization in takedown_cpu()
      eventually requires a functional softirq thread. I never encountered the
      problem in testing, but 0day testing managed to provide a reliable reproducer.
      
      Remove the smpboot_threads_park() call from the state machine for now and put
      it back into the original place after the rcu synchronization.
      
      I'm embarrassed as I knew about the dependency and still managed to get it
      wrong. Hotplug induced brain melt seems to be the only sensible explanation
      for that.
      
      Fixes: 931ef163 "cpu/hotplug: Unpark smpboot threads from the state machine"
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      2a58c527
  23. 06 3月, 2016 1 次提交
  24. 03 3月, 2016 1 次提交
  25. 02 3月, 2016 1 次提交
    • T
      rcu: Make CPU_DYING_IDLE an explicit call · 27d50c7e
      Thomas Gleixner 提交于
      Make the RCU CPU_DYING_IDLE callback an explicit function call, so it gets
      invoked at the proper place.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: linux-arch@vger.kernel.org
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Rafael Wysocki <rafael.j.wysocki@intel.com>
      Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Sebastian Siewior <bigeasy@linutronix.de>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul Turner <pjt@google.com>
      Link: http://lkml.kernel.org/r/20160226182341.870167933@linutronix.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      27d50c7e