All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v0 0/9] Remove CPU_*_FROZEN
@ 2015-09-04 13:34 Daniel Wagner
  2015-09-04 13:34 ` [RFC v0 1/9] smpboot: Add a separate CPU state when a surviving CPU times out Daniel Wagner
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Daniel Wagner @ 2015-09-04 13:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: Daniel Wagner

Hi

I was looking at Thomas' "CPU hotplug rework - episode I" series [1]
and noted the CPU_*_FROZEN bits in there.

In 2007 CPU_TASK_FROZEN was introduced to allow subsystem to
distinguish between normal CPU hotplug events and CPU hotplug events
under system-wide suspend or resume operations [2]. As it turns out
almost no subsystem is interested in this information. 

So this begs the question why having the additional complexity in the
CPU state handling instead of having an explicit function for
retrieving this information. Here and attempt to rip out
CPU_TASKS_FROZEN bits.

Overall I think it is worth doing so but you might see it differently.
FWIW, the image size is slightly smaller too in my sample
configuration.

   text    data     bss     dec     hex filename
16794542        4462208 14954496        36211246        2288a2e vmlinux
16794267        4462208 14954496        36210971        228891b vmlinux-wo-frozen

Patch 1: I think this patch fixes a real bug. Even Paul agreed during
a chat at LinuxCon. He needed an addition state to and grabbed just
one of the FROZEN ones.

Patch 2: Adds a new freeze_active() call which tells if PM is active
or not.

Patch 3, 4 and 5: Update the only users of FROZEN.

Patch 6: Is the refactoring patch from Thomas hotplug rework [1].

Patch 7: Remove all FROZEN references. It should contain only simple
changes. I did that manually. Probably some scripting could be done to
ensure the changes are more correct. This patch could be spitted and
the pieces could be applied one after the other.

Patch 8: Get rid of the definitions of FROZEN.

Patch 9: And finally update the documentation.

I starred at this code for while and compiled it for different
architectures (x86, ARM, S390, powerpc). I also tested by executing
Steven's stress-cpu-hotplug script and then do suspend-resume cycles.
Nothing exploded but that is not a real proof all is okay. So please
have a close look at the changes on the FROZEN users.

Thanks,
Daniel

[1] https://lwn.net/Articles/535764/
[2] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8bb7844286fb8c9fce6f65d8288aeb09d03a5e0d


"H. Peter Anvin" <hpa@zytor.com>
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Akinobu Mita <akinobu.mita@gmail.com>
Andrew Morton <akpm@linux-foundation.org>
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Borislav Petkov <bp@alien8.de>
Chris Metcalf <cmetcalf@ezchip.com>
Daniel Wagner <daniel.wagner@bmw-carit.de>
David Hildenbrand <dahi@linux.vnet.ibm.com>
David Vrabel <david.vrabel@citrix.com>
Don Zickus <dzickus@redhat.com>
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ingo Molnar <mingo@redhat.com>
John Hubbard <jhubbard@nvidia.com>
Jonathan Corbet <corbet@lwn.net>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Lai Jiangshan <laijs@cn.fujitsu.com>
Len Brown <len.brown@intel.com>
Luis R. Rodriguez <mcgrof@do-not-panic.com>
Mathias Krause <minipli@googlemail.com>
Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Paul Gortmaker <paul.gortmaker@windriver.com>
Pavel Machek <pavel@ucw.cz>
Peter Zijlstra <peterz@infradead.org>
Sudeep Holla <sudeep.holla@arm.com>
Thomas Gleixner <tglx@linutronix.de>
Tony Luck <tony.luck@intel.com>
Vitaly Kuznetsov <vkuznets@redhat.com>

Daniel Wagner (8):
  smpboot: Add a separate CPU state when a surviving CPU times out
  suspend: Add getter function to report if freezing is active
  x86: Use freeze_active() instead of CPU_*_FROZEN
  smpboot: Use freeze_active() instead CPU_DEAD_FROZEN state information
  sched: Use freeze_active() instead CPU_*_FROZEN state information
  cpu: Remove unused CPU_*_FROZEN states
  cpu: Do not set CPU_TASKS_FROZEN anymore
  doc: Update cpu-hotplug documents on removal of CPU_TASKS_FROZEN

Thomas Gleixner (1):
  cpu: Restructure FROZEN state handling

 Documentation/cpu-hotplug.txt                      | 12 ++--
 .../fault-injection/notifier-error-inject.txt      |  2 -
 Documentation/power/suspend-and-cpuhotplug.txt     | 13 +---
 arch/arm/kernel/hw_breakpoint.c                    |  2 +-
 arch/arm/kernel/perf_event.c                       |  2 +-
 arch/arm/kernel/smp_twd.c                          |  2 +-
 arch/arm/kvm/arm.c                                 |  1 -
 arch/arm/mm/cache-l2x0.c                           |  2 +-
 arch/arm/vfp/vfpmodule.c                           |  4 +-
 arch/arm64/kernel/armv8_deprecated.c               |  2 +-
 arch/arm64/kernel/fpsimd.c                         |  1 -
 arch/blackfin/kernel/perf_event.c                  |  2 +-
 arch/ia64/kernel/err_inject.c                      |  2 -
 arch/ia64/kernel/mca.c                             |  1 -
 arch/ia64/kernel/palinfo.c                         |  2 -
 arch/ia64/kernel/salinfo.c                         |  2 -
 arch/ia64/kernel/topology.c                        |  2 -
 arch/metag/kernel/perf/perf_event.c                |  2 +-
 arch/mips/loongson64/loongson-3/smp.c              |  3 -
 arch/mips/oprofile/op_model_loongson3.c            |  2 -
 arch/powerpc/kernel/sysfs.c                        |  2 -
 arch/powerpc/mm/mmu_context_nohash.c               |  3 -
 arch/powerpc/mm/numa.c                             |  3 -
 arch/powerpc/perf/core-book3s.c                    |  2 +-
 arch/powerpc/platforms/powermac/smp.c              |  2 -
 arch/s390/kernel/perf_cpum_cf.c                    |  2 +-
 arch/s390/kernel/perf_cpum_sf.c                    |  3 +-
 arch/s390/kernel/smp.c                             |  2 +-
 arch/s390/mm/fault.c                               |  2 +-
 arch/sh/kernel/perf_event.c                        |  2 +-
 arch/sparc/kernel/sysfs.c                          |  2 -
 arch/x86/entry/vdso/vma.c                          |  2 +-
 arch/x86/kernel/apic/x2apic_cluster.c              |  1 -
 arch/x86/kernel/cpu/mcheck/mce.c                   | 15 ++---
 arch/x86/kernel/cpu/mcheck/mce_amd.c               |  2 -
 arch/x86/kernel/cpu/mcheck/therm_throt.c           |  3 -
 arch/x86/kernel/cpu/microcode/core.c               | 12 ++--
 arch/x86/kernel/cpu/perf_event.c                   |  2 +-
 arch/x86/kernel/cpu/perf_event_amd_ibs.c           |  2 +-
 arch/x86/kernel/cpu/perf_event_amd_uncore.c        |  2 +-
 arch/x86/kernel/cpu/perf_event_intel_cqm.c         |  2 +-
 arch/x86/kernel/cpu/perf_event_intel_rapl.c        |  2 +-
 arch/x86/kernel/cpu/perf_event_intel_uncore.c      |  4 +-
 arch/x86/kernel/cpuid.c                            |  1 -
 arch/x86/kernel/kvm.c                              |  2 -
 arch/x86/kernel/msr.c                              |  1 -
 arch/x86/pci/amd_bus.c                             |  1 -
 arch/x86/xen/smp.c                                 |  2 +-
 arch/xtensa/kernel/perf_event.c                    |  2 +-
 block/blk-iopoll.c                                 |  2 +-
 block/blk-mq.c                                     |  5 +-
 block/blk-softirq.c                                |  2 +-
 drivers/acpi/processor_driver.c                    |  1 -
 drivers/base/cacheinfo.c                           |  2 +-
 drivers/base/topology.c                            |  3 -
 drivers/bus/arm-cci.c                              |  2 +-
 drivers/bus/arm-ccn.c                              |  2 +-
 drivers/bus/mips_cdmm.c                            |  2 +-
 drivers/clocksource/arm_arch_timer.c               |  2 +-
 drivers/clocksource/arm_global_timer.c             |  2 +-
 drivers/clocksource/dummy_timer.c                  |  2 +-
 drivers/clocksource/exynos_mct.c                   |  2 +-
 drivers/clocksource/metag_generic.c                |  1 -
 drivers/clocksource/mips-gic-timer.c               |  2 +-
 drivers/clocksource/qcom-timer.c                   |  2 +-
 drivers/clocksource/time-armada-370-xp.c           |  2 +-
 drivers/clocksource/timer-atlas7.c                 |  2 +-
 drivers/cpufreq/acpi-cpufreq.c                     |  2 -
 drivers/cpufreq/cpufreq.c                          |  2 +-
 drivers/cpuidle/coupled.c                          |  4 +-
 drivers/cpuidle/cpuidle-powernv.c                  |  2 -
 drivers/cpuidle/cpuidle-pseries.c                  |  2 -
 drivers/hwtracing/coresight/coresight-etm3x.c      |  2 +-
 drivers/hwtracing/coresight/coresight-etm4x.c      |  2 +-
 drivers/idle/intel_idle.c                          |  2 +-
 drivers/irqchip/irq-armada-370-xp.c                |  4 +-
 drivers/irqchip/irq-gic-v3.c                       |  2 +-
 drivers/irqchip/irq-gic.c                          |  2 +-
 drivers/irqchip/irq-hip04.c                        |  2 +-
 drivers/leds/trigger/ledtrig-cpu.c                 |  2 +-
 drivers/md/raid5.c                                 |  2 -
 drivers/net/virtio_net.c                           |  2 +-
 drivers/oprofile/timer_int.c                       |  2 -
 drivers/pci/host/pci-xgene-msi.c                   |  2 -
 drivers/powercap/intel_rapl.c                      |  3 -
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c                  |  2 -
 drivers/scsi/bnx2i/bnx2i_init.c                    |  2 -
 drivers/scsi/fcoe/fcoe.c                           |  2 -
 drivers/scsi/virtio_scsi.c                         |  2 -
 .../staging/lustre/lustre/libcfs/linux/linux-cpu.c |  4 +-
 fs/buffer.c                                        |  2 +-
 include/linux/cpu.h                                | 17 +----
 include/linux/suspend.h                            |  6 ++
 kernel/cpu.c                                       | 74 ++++++++--------------
 kernel/events/core.c                               |  2 +-
 kernel/padata.c                                    |  4 --
 kernel/profile.c                                   |  4 --
 kernel/rcu/tree.c                                  |  5 --
 kernel/relay.c                                     |  2 -
 kernel/sched/core.c                                | 59 +++++++++--------
 kernel/sched/fair.c                                |  2 +-
 kernel/smp.c                                       |  6 +-
 kernel/smpboot.c                                   | 34 +++++-----
 kernel/softirq.c                                   |  1 -
 kernel/time/hrtimer.c                              |  2 -
 kernel/time/tick-sched.c                           |  2 +-
 kernel/time/timer.c                                |  1 -
 kernel/trace/ring_buffer.c                         |  2 -
 kernel/workqueue.c                                 |  4 +-
 lib/cpu-notifier-error-inject.c                    |  2 -
 lib/percpu_counter.c                               |  2 +-
 lib/radix-tree.c                                   |  2 +-
 mm/memcontrol.c                                    |  2 +-
 mm/page-writeback.c                                |  2 +-
 mm/page_alloc.c                                    |  2 +-
 mm/slab.c                                          |  6 --
 mm/slub.c                                          |  2 -
 mm/vmscan.c                                        |  2 +-
 mm/vmstat.c                                        |  4 --
 net/core/dev.c                                     |  2 +-
 net/core/flow.c                                    |  2 -
 net/iucv/iucv.c                                    |  6 --
 virt/kvm/arm/arch_timer.c                          |  2 -
 virt/kvm/arm/vgic.c                                |  2 -
 virt/kvm/kvm_main.c                                |  1 -
 125 files changed, 172 insertions(+), 333 deletions(-)

-- 
2.4.3


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2015-09-08  8:49 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-04 13:34 [RFC v0 0/9] Remove CPU_*_FROZEN Daniel Wagner
2015-09-04 13:34 ` [RFC v0 1/9] smpboot: Add a separate CPU state when a surviving CPU times out Daniel Wagner
2015-09-04 13:34 ` Daniel Wagner
2015-09-04 13:34 ` [RFC v0 2/9] suspend: Add getter function to report if freezing is active Daniel Wagner
2015-09-05  2:11   ` Rafael J. Wysocki
2015-09-07  8:55     ` Daniel Wagner
2015-09-07  8:55       ` Daniel Wagner
2015-09-07 13:42       ` Rafael J. Wysocki
2015-09-07 21:44       ` Rafael J. Wysocki
2015-09-08  8:19         ` Daniel Wagner
2015-09-08  8:19           ` Daniel Wagner
2015-09-04 13:34 ` [RFC v0 3/9] x86: Use freeze_active() instead of CPU_*_FROZEN Daniel Wagner
2015-09-04 13:34 ` [RFC v0 4/9] smpboot: Use freeze_active() instead CPU_DEAD_FROZEN state information Daniel Wagner
2015-09-08  8:49   ` Daniel Wagner
2015-09-04 13:34 ` [RFC v0 5/9] sched: Use freeze_active() instead CPU_*_FROZEN " Daniel Wagner
2015-09-04 13:34 ` [RFC v0 6/9] cpu: Restructure FROZEN state handling Daniel Wagner
2015-09-04 13:35 ` [RFC v0 7/9] cpu: Remove unused CPU_*_FROZEN states Daniel Wagner
2015-09-04 13:35 ` [RFC v0 8/9] cpu: Do not set CPU_TASKS_FROZEN anymore Daniel Wagner
2015-09-04 13:35 ` [RFC v0 9/9] doc: Update cpu-hotplug documents on removal of CPU_TASKS_FROZEN Daniel Wagner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.