Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 28 Jan 2020 18:07:09 +0000 (10:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 28 Jan 2020 18:07:09 +0000 (10:07 -0800)
Pull scheduler updates from Ingo Molnar:
 "These were the main changes in this cycle:

   - More -rt motivated separation of CONFIG_PREEMPT and
     CONFIG_PREEMPTION.

   - Add more low level scheduling topology sanity checks and warnings
     to filter out nonsensical topologies that break scheduling.

   - Extend uclamp constraints to influence wakeup CPU placement

   - Make the RT scheduler more aware of asymmetric topologies and CPU
     capacities, via uclamp metrics, if CONFIG_UCLAMP_TASK=y

   - Make idle CPU selection more consistent

   - Various fixes, smaller cleanups, updates and enhancements - please
     see the git log for details"

* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (58 commits)
  sched/fair: Define sched_idle_cpu() only for SMP configurations
  sched/topology: Assert non-NUMA topology masks don't (partially) overlap
  idle: fix spelling mistake "iterrupts" -> "interrupts"
  sched/fair: Remove redundant call to cpufreq_update_util()
  sched/psi: create /proc/pressure and /proc/pressure/{io|memory|cpu} only when psi enabled
  sched/fair: Fix sgc->{min,max}_capacity calculation for SD_OVERLAP
  sched/fair: calculate delta runnable load only when it's needed
  sched/cputime: move rq parameter in irqtime_account_process_tick
  stop_machine: Make stop_cpus() static
  sched/debug: Reset watchdog on all CPUs while processing sysrq-t
  sched/core: Fix size of rq::uclamp initialization
  sched/uclamp: Fix a bug in propagating uclamp value in new cgroups
  sched/fair: Load balance aggressively for SCHED_IDLE CPUs
  sched/fair : Improve update_sd_pick_busiest for spare capacity case
  watchdog: Remove soft_lockup_hrtimer_cnt and related code
  sched/rt: Make RT capacity-aware
  sched/fair: Make EAS wakeup placement consider uclamp restrictions
  sched/fair: Make task_fits_capacity() consider uclamp restrictions
  sched/uclamp: Rename uclamp_util_with() into uclamp_rq_util_with()
  sched/uclamp: Make uclamp util helpers use and return UL values
  ...

13 files changed:
1  2 
arch/arm64/Kconfig
arch/arm64/include/asm/assembler.h
arch/arm64/kernel/entry.S
arch/hexagon/kernel/vm_entry.S
arch/parisc/Kconfig
arch/powerpc/Kconfig
arch/riscv/kernel/entry.S
arch/s390/Kconfig
include/linux/genhd.h
kernel/cpu.c
kernel/workqueue.c
mm/slub.c
net/core/dev.c

diff --combined arch/arm64/Kconfig
@@@ -34,32 -34,32 +34,32 @@@ config ARM6
        select ARCH_HAS_TEARDOWN_DMA_OPS if IOMMU_SUPPORT
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
-       select ARCH_INLINE_READ_LOCK if !PREEMPT
-       select ARCH_INLINE_READ_LOCK_BH if !PREEMPT
-       select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPT
-       select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPT
-       select ARCH_INLINE_READ_UNLOCK if !PREEMPT
-       select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPT
-       select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPT
-       select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPT
-       select ARCH_INLINE_WRITE_LOCK if !PREEMPT
-       select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPT
-       select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPT
-       select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPT
-       select ARCH_INLINE_WRITE_UNLOCK if !PREEMPT
-       select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPT
-       select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPT
-       select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPT
-       select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPT
-       select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPT
-       select ARCH_INLINE_SPIN_LOCK if !PREEMPT
-       select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPT
-       select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPT
-       select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPT
-       select ARCH_INLINE_SPIN_UNLOCK if !PREEMPT
-       select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPT
-       select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPT
-       select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPT
+       select ARCH_INLINE_READ_LOCK if !PREEMPTION
+       select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION
+       select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPTION
+       select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPTION
+       select ARCH_INLINE_READ_UNLOCK if !PREEMPTION
+       select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPTION
+       select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPTION
+       select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPTION
+       select ARCH_INLINE_WRITE_LOCK if !PREEMPTION
+       select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPTION
+       select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPTION
+       select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPTION
+       select ARCH_INLINE_WRITE_UNLOCK if !PREEMPTION
+       select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPTION
+       select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPTION
+       select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPTION
+       select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPTION
+       select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPTION
+       select ARCH_INLINE_SPIN_LOCK if !PREEMPTION
+       select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPTION
+       select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPTION
+       select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPTION
+       select ARCH_INLINE_SPIN_UNLOCK if !PREEMPTION
+       select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION
+       select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION
+       select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION
        select ARCH_KEEP_MEMBLOCK
        select ARCH_USE_CMPXCHG_LOCKREF
        select ARCH_USE_QUEUED_RWLOCKS
@@@ -81,7 -81,7 +81,7 @@@
        select ARM_GIC_V3
        select ARM_GIC_V3_ITS if PCI
        select ARM_PSCI_FW
 -      select BUILDTIME_EXTABLE_SORT
 +      select BUILDTIME_TABLE_SORT
        select CLONE_BACKWARDS
        select COMMON_CLK
        select CPU_PM if (SUSPEND || CPU_IDLE)
        select HAVE_CMPXCHG_DOUBLE
        select HAVE_CMPXCHG_LOCAL
        select HAVE_CONTEXT_TRACKING
 +      select HAVE_COPY_THREAD_TLS
        select HAVE_DEBUG_BUGVERBOSE
        select HAVE_DEBUG_KMEMLEAK
        select HAVE_DMA_CONTIGUOUS
        select HAVE_PERF_USER_STACK_DUMP
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_FUNCTION_ARG_ACCESS_API
 +      select HAVE_FUTEX_CMPXCHG if FUTEX
        select HAVE_RCU_TABLE_FREE
        select HAVE_RSEQ
        select HAVE_STACKPROTECTOR
@@@ -303,9 -301,6 +303,9 @@@ config ARCH_SUPPORTS_UPROBE
  config ARCH_PROC_KCORE_TEXT
        def_bool y
  
 +config BROKEN_GAS_INST
 +      def_bool !$(as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n)
 +
  config KASAN_SHADOW_OFFSET
        hex
        depends on KASAN
@@@ -519,13 -514,9 +519,13 @@@ config ARM64_ERRATUM_141804
  
          If unsure, say Y.
  
 +config ARM64_WORKAROUND_SPECULATIVE_AT_VHE
 +      bool
 +
  config ARM64_ERRATUM_1165522
        bool "Cortex-A76: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
        default y
 +      select ARM64_WORKAROUND_SPECULATIVE_AT_VHE
        help
          This option adds a workaround for ARM Cortex-A76 erratum 1165522.
  
  
          If unsure, say Y.
  
 +config ARM64_ERRATUM_1530923
 +      bool "Cortex-A55: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
 +      default y
 +      select ARM64_WORKAROUND_SPECULATIVE_AT_VHE
 +      help
 +        This option adds a workaround for ARM Cortex-A55 erratum 1530923.
 +
 +        Affected Cortex-A55 cores (r0p0, r0p1, r1p0, r2p0) could end-up with
 +        corrupted TLBs by speculating an AT instruction during a guest
 +        context switch.
 +
 +        If unsure, say Y.
 +
  config ARM64_ERRATUM_1286807
        bool "Cortex-A76: Modification of the translation table for a virtual address might lead to read-after-read ordering violation"
        default y
          invalidated has been observed by other observers. The
          workaround repeats the TLBI+DSB operation.
  
 +config ARM64_WORKAROUND_SPECULATIVE_AT_NVHE
 +      bool
 +
  config ARM64_ERRATUM_1319367
        bool "Cortex-A57/A72: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
        default y
 +      select ARM64_WORKAROUND_SPECULATIVE_AT_NVHE
        help
          This option adds work arounds for ARM Cortex-A57 erratum 1319537
          and A72 erratum 1319367
@@@ -1389,11 -1363,6 +1389,11 @@@ config ARM64_PA
         instruction if the cpu does not implement the feature.
  
  config ARM64_LSE_ATOMICS
 +      bool
 +      default ARM64_USE_LSE_ATOMICS
 +      depends on $(as-instr,.arch_extension lse)
 +
 +config ARM64_USE_LSE_ATOMICS
        bool "Atomic instructions"
        depends on JUMP_LABEL
        default y
@@@ -1515,30 -1484,6 +1515,30 @@@ config ARM64_PTR_AUT
  
  endmenu
  
 +menu "ARMv8.5 architectural features"
 +
 +config ARM64_E0PD
 +      bool "Enable support for E0PD"
 +      default y
 +      help
 +        E0PD (part of the ARMv8.5 extensions) allows us to ensure
 +        that EL0 accesses made via TTBR1 always fault in constant time,
 +        providing similar benefits to KASLR as those provided by KPTI, but
 +        with lower overhead and without disrupting legitimate access to
 +        kernel memory such as SPE.
 +
 +        This option enables E0PD for TTBR1 where available.
 +
 +config ARCH_RANDOM
 +      bool "Enable support for random number generation"
 +      default y
 +      help
 +        Random number generation (part of the ARMv8.5 Extensions)
 +        provides a high bandwidth, cryptographically secure
 +        hardware random number generator.
 +
 +endmenu
 +
  config ARM64_SVE
        bool "ARM Scalable Vector Extension support"
        default y
@@@ -1599,7 -1544,7 +1599,7 @@@ config ARM64_MODULE_PLT
  
  config ARM64_PSEUDO_NMI
        bool "Support for NMI-like interrupts"
 -      select CONFIG_ARM_GIC_V3
 +      select ARM_GIC_V3
        help
          Adds support for mimicking Non-Maskable Interrupts through the use of
          GIC interrupt priority. This support requires version 3 or later of
        msr     daif, \flags
        .endm
  
 -      /* Only on aarch64 pstate, PSR_D_BIT is different for aarch32 */
 -      .macro  inherit_daif, pstate:req, tmp:req
 -      and     \tmp, \pstate, #(PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT)
 -      msr     daif, \tmp
 -      .endm
 -
        /* IRQ is the lowest priority flag, unconditionally unmask the rest. */
        .macro enable_da_f
        msr     daifclr, #(8 | 4 | 1)
  9990:
        .endm
  
 -/*
 - * SMP data memory barrier
 - */
 -      .macro  smp_dmb, opt
 -      dmb     \opt
 -      .endm
 -
  /*
   * RAS Error Synchronization barrier
   */
@@@ -448,6 -461,17 +448,6 @@@ USER(\label, ic   ivau, \tmp2)                    // inval
        b.ne    9998b
        .endm
  
 -/*
 - * Annotate a function as position independent, i.e., safe to be called before
 - * the kernel virtual mapping is activated.
 - */
 -#define ENDPIPROC(x)                  \
 -      .globl  __pi_##x;               \
 -      .type   __pi_##x, %function;    \
 -      .set    __pi_##x, x;            \
 -      .size   __pi_##x, . - x;        \
 -      ENDPROC(x)
 -
  /*
   * Annotate a function as being unsuitable for kprobes.
   */
   * where <label> is optional, and marks the point where execution will resume
   * after a yield has been performed. If omitted, execution resumes right after
   * the endif_yield_neon invocation. Note that the entire sequence, including
-  * the provided patchup code, will be omitted from the image if CONFIG_PREEMPT
-  * is not defined.
+  * the provided patchup code, will be omitted from the image if
+  * CONFIG_PREEMPTION is not defined.
   *
   * As a convenience, in the case where no patchup code is required, the above
   * sequence may be abbreviated to
        .endm
  
        .macro          if_will_cond_yield_neon
- #ifdef CONFIG_PREEMPT
+ #ifdef CONFIG_PREEMPTION
        get_current_task        x0
        ldr             x0, [x0, #TSK_TI_PREEMPT]
        sub             x0, x0, #PREEMPT_DISABLE_OFFSET
        .macro kernel_ventry, el, label, regsize = 64
        .align 7
  #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
 -alternative_if ARM64_UNMAP_KERNEL_AT_EL0
        .if     \el == 0
 +alternative_if ARM64_UNMAP_KERNEL_AT_EL0
        .if     \regsize == 64
        mrs     x30, tpidrro_el0
        msr     tpidrro_el0, xzr
        .else
        mov     x30, xzr
        .endif
 -      .endif
  alternative_else_nop_endif
 +      .endif
  #endif
  
        sub     sp, sp, #S_FRAME_SIZE
@@@ -167,13 -167,9 +167,13 @@@ alternative_cb_en
        .if     \el == 0
        clear_gp_regs
        mrs     x21, sp_el0
 -      ldr_this_cpu    tsk, __entry_task, x20  // Ensure MDSCR_EL1.SS is clear,
 -      ldr     x19, [tsk, #TSK_TI_FLAGS]       // since we can unmask debug
 -      disable_step_tsk x19, x20               // exceptions when scheduling.
 +      ldr_this_cpu    tsk, __entry_task, x20
 +      msr     sp_el0, tsk
 +
 +      // Ensure MDSCR_EL1.SS is clear, since we can unmask debug exceptions
 +      // when scheduling.
 +      ldr     x19, [tsk, #TSK_TI_FLAGS]
 +      disable_step_tsk x19, x20
  
        apply_ssbd 1, x22, x23
  
@@@ -236,6 -232,13 +236,6 @@@ alternative_else_nop_endi
        str     w21, [sp, #S_SYSCALLNO]
        .endif
  
 -      /*
 -       * Set sp_el0 to current thread_info.
 -       */
 -      .if     \el == 0
 -      msr     sp_el0, tsk
 -      .endif
 -
        /* Save pmr */
  alternative_if ARM64_HAS_IRQ_PRIO_MASKING
        mrs_s   x20, SYS_ICC_PMR_EL1
@@@ -602,7 -605,7 +602,7 @@@ el1_irq
  
        irq_handler
  
- #ifdef CONFIG_PREEMPT
+ #ifdef CONFIG_PREEMPTION
        ldr     x24, [tsk, #TSK_TI_PREEMPT]     // get preempt count
  alternative_if ARM64_HAS_IRQ_PRIO_MASKING
        /*
@@@ -650,7 -653,6 +650,7 @@@ el0_sync
        mov     x0, sp
        bl      el0_sync_handler
        b       ret_to_user
 +ENDPROC(el0_sync)
  
  #ifdef CONFIG_COMPAT
        .align  6
@@@ -659,18 -661,16 +659,18 @@@ el0_sync_compat
        mov     x0, sp
        bl      el0_sync_compat_handler
        b       ret_to_user
 -ENDPROC(el0_sync)
 +ENDPROC(el0_sync_compat)
  
        .align  6
  el0_irq_compat:
        kernel_entry 0, 32
        b       el0_irq_naked
 +ENDPROC(el0_irq_compat)
  
  el0_error_compat:
        kernel_entry 0, 32
        b       el0_error_naked
 +ENDPROC(el0_error_compat)
  #endif
  
        .align  6
@@@ -265,12 -265,12 +265,12 @@@ event_dispatch
         * should be in the designated register (usually R19)
         *
         * If we were in kernel mode, we don't need to check scheduler
-        * or signals if CONFIG_PREEMPT is not set.  If set, then it has
+        * or signals if CONFIG_PREEMPTION is not set.  If set, then it has
         * to jump to a need_resched kind of block.
-        * BTW, CONFIG_PREEMPT is not supported yet.
+        * BTW, CONFIG_PREEMPTION is not supported yet.
         */
  
- #ifdef CONFIG_PREEMPT
+ #ifdef CONFIG_PREEMPTION
        R0 = #VM_INT_DISABLE
        trap1(#HVM_TRAP1_VMSETIE)
  #endif
@@@ -369,7 -369,7 +369,7 @@@ ret_from_fork
                R26.L = #LO(do_work_pending);
                R0 = #VM_INT_DISABLE;
        }
 -      if P0 jump check_work_pending
 +      if (P0) jump check_work_pending
        {
                R0 = R25;
                callr R24
diff --combined arch/parisc/Kconfig
@@@ -18,7 -18,7 +18,7 @@@ config PARIS
        select RTC_DRV_GENERIC
        select INIT_ALL_POSSIBLE
        select BUG
 -      select BUILDTIME_EXTABLE_SORT
 +      select BUILDTIME_TABLE_SORT
        select HAVE_PCI
        select HAVE_PERF_EVENTS
        select HAVE_KERNEL_BZIP2
@@@ -62,7 -62,6 +62,7 @@@
        select HAVE_FTRACE_MCOUNT_RECORD if HAVE_DYNAMIC_FTRACE
        select HAVE_KPROBES_ON_FTRACE
        select HAVE_DYNAMIC_FTRACE_WITH_REGS
 +      select HAVE_COPY_THREAD_TLS
  
        help
          The PA-RISC microprocessor is designed by Hewlett-Packard and used
@@@ -82,7 -81,7 +82,7 @@@ config STACK_GROWSU
  config GENERIC_LOCKBREAK
        bool
        default y
-       depends on SMP && PREEMPT
+       depends on SMP && PREEMPTION
  
  config ARCH_HAS_ILOG2_U32
        bool
diff --combined arch/powerpc/Kconfig
@@@ -106,7 -106,7 +106,7 @@@ config LOCKDEP_SUPPOR
  config GENERIC_LOCKBREAK
        bool
        default y
-       depends on SMP && PREEMPT
+       depends on SMP && PREEMPTION
  
  config GENERIC_HWEIGHT
        bool
@@@ -149,7 -149,7 +149,7 @@@ config PP
        select ARCH_WANT_IPC_PARSE_VERSION
        select ARCH_WEAK_RELEASE_ACQUIRE
        select BINFMT_ELF
 -      select BUILDTIME_EXTABLE_SORT
 +      select BUILDTIME_TABLE_SORT
        select CLONE_BACKWARDS
        select DCACHE_WORD_ACCESS               if PPC64 && CPU_LITTLE_ENDIAN
        select DYNAMIC_FTRACE                   if FUNCTION_TRACER
@@@ -455,7 -455,11 +455,7 @@@ config PPC_TRANSACTIONAL_ME
  config PPC_UV
        bool "Ultravisor support"
        depends on KVM_BOOK3S_HV_POSSIBLE
 -      select ZONE_DEVICE
 -      select DEV_PAGEMAP_OPS
 -      select DEVICE_PRIVATE
 -      select MEMORY_HOTPLUG
 -      select MEMORY_HOTREMOVE
 +      depends on DEVICE_PRIVATE
        default n
        help
          This option paravirtualizes the kernel to run in POWER platforms that
@@@ -155,7 -155,7 +155,7 @@@ _save_context
        REG_L x2,  PT_SP(sp)
        .endm
  
- #if !IS_ENABLED(CONFIG_PREEMPT)
+ #if !IS_ENABLED(CONFIG_PREEMPTION)
  .set resume_kernel, restore_all
  #endif
  
@@@ -246,7 -246,6 +246,7 @@@ check_syscall_nr
         */
        li t1, -1
        beq a7, t1, ret_from_syscall_rejected
 +      blt a7, t1, 1f
        /* Call syscall */
        la s0, sys_call_table
        slli t0, a7, RISCV_LGPTR
@@@ -305,7 -304,7 +305,7 @@@ restore_all
        sret
  #endif
  
- #if IS_ENABLED(CONFIG_PREEMPT)
+ #if IS_ENABLED(CONFIG_PREEMPTION)
  resume_kernel:
        REG_L s0, TASK_TI_PREEMPT_COUNT(tp)
        bnez s0, restore_all
diff --combined arch/s390/Kconfig
@@@ -30,7 -30,7 +30,7 @@@ config GENERIC_BUG_RELATIVE_POINTER
        def_bool y
  
  config GENERIC_LOCKBREAK
-       def_bool y if PREEMPT
+       def_bool y if PREEMPTTION
  
  config PGSTE
        def_bool y if KVM
@@@ -110,7 -110,7 +110,7 @@@ config S39
        select ARCH_USE_CMPXCHG_LOCKREF
        select ARCH_WANTS_DYNAMIC_TASK_STRUCT
        select ARCH_WANT_IPC_PARSE_VERSION
 -      select BUILDTIME_EXTABLE_SORT
 +      select BUILDTIME_TABLE_SORT
        select CLONE_BACKWARDS2
        select DYNAMIC_FTRACE if FUNCTION_TRACER
        select GENERIC_CLOCKEVENTS
diff --combined include/linux/genhd.h
@@@ -245,18 -245,6 +245,18 @@@ static inline bool disk_part_scan_enabl
                !(disk->flags & GENHD_FL_NO_PART_SCAN);
  }
  
 +static inline bool disk_has_partitions(struct gendisk *disk)
 +{
 +      bool ret = false;
 +
 +      rcu_read_lock();
 +      if (rcu_dereference(disk->part_tbl)->len > 1)
 +              ret = true;
 +      rcu_read_unlock();
 +
 +      return ret;
 +}
 +
  static inline dev_t disk_devt(struct gendisk *disk)
  {
        return MKDEV(disk->major, disk->first_minor);
@@@ -730,7 -718,7 +730,7 @@@ static inline void hd_free_part(struct 
   * accessor function.
   *
   * Code written along the lines of i_size_read() and i_size_write().
-  * CONFIG_PREEMPT case optimizes the case of UP kernel with preemption
+  * CONFIG_PREEMPTION case optimizes the case of UP kernel with preemption
   * on.
   */
  static inline sector_t part_nr_sects_read(struct hd_struct *part)
                nr_sects = part->nr_sects;
        } while (read_seqcount_retry(&part->nr_sects_seq, seq));
        return nr_sects;
- #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT)
+ #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPTION)
        sector_t nr_sects;
  
        preempt_disable();
@@@ -766,7 -754,7 +766,7 @@@ static inline void part_nr_sects_write(
        write_seqcount_begin(&part->nr_sects_seq);
        part->nr_sects = size;
        write_seqcount_end(&part->nr_sects_seq);
- #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT)
+ #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPTION)
        preempt_disable();
        part->nr_sects = size;
        preempt_enable();
diff --combined kernel/cpu.c
@@@ -525,8 -525,7 +525,7 @@@ static int bringup_wait_for_ap(unsigne
        if (WARN_ON_ONCE((!cpu_online(cpu))))
                return -ECANCELED;
  
-       /* Unpark the stopper thread and the hotplug thread of the target cpu */
-       stop_machine_unpark(cpu);
+       /* Unpark the hotplug thread of the target cpu */
        kthread_unpark(st->thread);
  
        /*
@@@ -1089,8 -1088,8 +1088,8 @@@ void notify_cpu_starting(unsigned int c
  
  /*
   * Called from the idle task. Wake up the controlling task which brings the
-  * stopper and the hotplug thread of the upcoming CPU up and then delegates
-  * the rest of the online bringup to the hotplug thread.
+  * hotplug thread of the upcoming CPU up and then delegates the rest of the
+  * online bringup to the hotplug thread.
   */
  void cpuhp_online_idle(enum cpuhp_state state)
  {
        if (state != CPUHP_AP_ONLINE_IDLE)
                return;
  
+       /*
+        * Unpart the stopper thread before we start the idle loop (and start
+        * scheduling); this ensures the stopper task is always available.
+        */
+       stop_machine_unpark(smp_processor_id());
        st->state = CPUHP_AP_ONLINE_IDLE;
        complete_ap_thread(st, true);
  }
@@@ -1909,78 -1914,6 +1914,78 @@@ void __cpuhp_remove_state(enum cpuhp_st
  }
  EXPORT_SYMBOL(__cpuhp_remove_state);
  
 +#ifdef CONFIG_HOTPLUG_SMT
 +static void cpuhp_offline_cpu_device(unsigned int cpu)
 +{
 +      struct device *dev = get_cpu_device(cpu);
 +
 +      dev->offline = true;
 +      /* Tell user space about the state change */
 +      kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
 +}
 +
 +static void cpuhp_online_cpu_device(unsigned int cpu)
 +{
 +      struct device *dev = get_cpu_device(cpu);
 +
 +      dev->offline = false;
 +      /* Tell user space about the state change */
 +      kobject_uevent(&dev->kobj, KOBJ_ONLINE);
 +}
 +
 +int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
 +{
 +      int cpu, ret = 0;
 +
 +      cpu_maps_update_begin();
 +      for_each_online_cpu(cpu) {
 +              if (topology_is_primary_thread(cpu))
 +                      continue;
 +              ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE);
 +              if (ret)
 +                      break;
 +              /*
 +               * As this needs to hold the cpu maps lock it's impossible
 +               * to call device_offline() because that ends up calling
 +               * cpu_down() which takes cpu maps lock. cpu maps lock
 +               * needs to be held as this might race against in kernel
 +               * abusers of the hotplug machinery (thermal management).
 +               *
 +               * So nothing would update device:offline state. That would
 +               * leave the sysfs entry stale and prevent onlining after
 +               * smt control has been changed to 'off' again. This is
 +               * called under the sysfs hotplug lock, so it is properly
 +               * serialized against the regular offline usage.
 +               */
 +              cpuhp_offline_cpu_device(cpu);
 +      }
 +      if (!ret)
 +              cpu_smt_control = ctrlval;
 +      cpu_maps_update_done();
 +      return ret;
 +}
 +
 +int cpuhp_smt_enable(void)
 +{
 +      int cpu, ret = 0;
 +
 +      cpu_maps_update_begin();
 +      cpu_smt_control = CPU_SMT_ENABLED;
 +      for_each_present_cpu(cpu) {
 +              /* Skip online CPUs and CPUs on offline nodes */
 +              if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))
 +                      continue;
 +              ret = _cpu_up(cpu, 0, CPUHP_ONLINE);
 +              if (ret)
 +                      break;
 +              /* See comment in cpuhp_smt_disable() */
 +              cpuhp_online_cpu_device(cpu);
 +      }
 +      cpu_maps_update_done();
 +      return ret;
 +}
 +#endif
 +
  #if defined(CONFIG_SYSFS) && defined(CONFIG_HOTPLUG_CPU)
  static ssize_t show_cpuhp_state(struct device *dev,
                                struct device_attribute *attr, char *buf)
@@@ -2135,6 -2068,77 +2140,6 @@@ static const struct attribute_group cpu
  
  #ifdef CONFIG_HOTPLUG_SMT
  
 -static void cpuhp_offline_cpu_device(unsigned int cpu)
 -{
 -      struct device *dev = get_cpu_device(cpu);
 -
 -      dev->offline = true;
 -      /* Tell user space about the state change */
 -      kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
 -}
 -
 -static void cpuhp_online_cpu_device(unsigned int cpu)
 -{
 -      struct device *dev = get_cpu_device(cpu);
 -
 -      dev->offline = false;
 -      /* Tell user space about the state change */
 -      kobject_uevent(&dev->kobj, KOBJ_ONLINE);
 -}
 -
 -int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
 -{
 -      int cpu, ret = 0;
 -
 -      cpu_maps_update_begin();
 -      for_each_online_cpu(cpu) {
 -              if (topology_is_primary_thread(cpu))
 -                      continue;
 -              ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE);
 -              if (ret)
 -                      break;
 -              /*
 -               * As this needs to hold the cpu maps lock it's impossible
 -               * to call device_offline() because that ends up calling
 -               * cpu_down() which takes cpu maps lock. cpu maps lock
 -               * needs to be held as this might race against in kernel
 -               * abusers of the hotplug machinery (thermal management).
 -               *
 -               * So nothing would update device:offline state. That would
 -               * leave the sysfs entry stale and prevent onlining after
 -               * smt control has been changed to 'off' again. This is
 -               * called under the sysfs hotplug lock, so it is properly
 -               * serialized against the regular offline usage.
 -               */
 -              cpuhp_offline_cpu_device(cpu);
 -      }
 -      if (!ret)
 -              cpu_smt_control = ctrlval;
 -      cpu_maps_update_done();
 -      return ret;
 -}
 -
 -int cpuhp_smt_enable(void)
 -{
 -      int cpu, ret = 0;
 -
 -      cpu_maps_update_begin();
 -      cpu_smt_control = CPU_SMT_ENABLED;
 -      for_each_present_cpu(cpu) {
 -              /* Skip online CPUs and CPUs on offline nodes */
 -              if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))
 -                      continue;
 -              ret = _cpu_up(cpu, 0, CPUHP_ONLINE);
 -              if (ret)
 -                      break;
 -              /* See comment in cpuhp_smt_disable() */
 -              cpuhp_online_cpu_device(cpu);
 -      }
 -      cpu_maps_update_done();
 -      return ret;
 -}
 -
 -
  static ssize_t
  __store_smt_control(struct device *dev, struct device_attribute *attr,
                    const char *buf, size_t count)
diff --combined kernel/workqueue.c
@@@ -2266,7 -2266,7 +2266,7 @@@ __acquires(&pool->lock
         * While we must be careful to not use "work" after this, the trace
         * point will only record its address.
         */
 -      trace_workqueue_execute_end(work);
 +      trace_workqueue_execute_end(work, worker->current_func);
        lock_map_release(&lockdep_map);
        lock_map_release(&pwq->wq->lockdep_map);
  
        }
  
        /*
-        * The following prevents a kworker from hogging CPU on !PREEMPT
+        * The following prevents a kworker from hogging CPU on !PREEMPTION
         * kernels, where a requeueing work item waiting for something to
         * happen could deadlock with stop_machine as such work item could
         * indefinitely requeue itself while all other CPUs are trapped in
diff --combined mm/slub.c
+++ b/mm/slub.c
@@@ -288,7 -288,7 +288,7 @@@ static inline void *get_freepointer_saf
        unsigned long freepointer_addr;
        void *p;
  
 -      if (!debug_pagealloc_enabled())
 +      if (!debug_pagealloc_enabled_static())
                return get_freepointer(s, object);
  
        freepointer_addr = (unsigned long)object + s->offset;
@@@ -1964,7 -1964,7 +1964,7 @@@ static void *get_partial(struct kmem_ca
        return get_any_partial(s, flags, c);
  }
  
- #ifdef CONFIG_PREEMPT
+ #ifdef CONFIG_PREEMPTION
  /*
   * Calculate the next globally unique transaction for disambiguiation
   * during cmpxchg. The transactions start with the cpu number and are then
@@@ -2009,7 -2009,7 +2009,7 @@@ static inline void note_cmpxchg_failure
  
        pr_info("%s %s: cmpxchg redo ", n, s->name);
  
- #ifdef CONFIG_PREEMPT
+ #ifdef CONFIG_PREEMPTION
        if (tid_to_cpu(tid) != tid_to_cpu(actual_tid))
                pr_warn("due to cpu change %d -> %d\n",
                        tid_to_cpu(tid), tid_to_cpu(actual_tid));
@@@ -2341,7 -2341,7 +2341,7 @@@ static bool has_cpu_slab(int cpu, void 
  
  static void flush_all(struct kmem_cache *s)
  {
 -      on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1, GFP_ATOMIC);
 +      on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1);
  }
  
  /*
@@@ -2637,7 -2637,7 +2637,7 @@@ static void *__slab_alloc(struct kmem_c
        unsigned long flags;
  
        local_irq_save(flags);
- #ifdef CONFIG_PREEMPT
+ #ifdef CONFIG_PREEMPTION
        /*
         * We may have been preempted and rescheduled on a different
         * cpu before disabling interrupts. Need to reload cpu area
@@@ -2691,13 -2691,13 +2691,13 @@@ redo
         * as we end up on the original cpu again when doing the cmpxchg.
         *
         * We should guarantee that tid and kmem_cache are retrieved on
-        * the same cpu. It could be different if CONFIG_PREEMPT so we need
+        * the same cpu. It could be different if CONFIG_PREEMPTION so we need
         * to check if it is matched or not.
         */
        do {
                tid = this_cpu_read(s->cpu_slab->tid);
                c = raw_cpu_ptr(s->cpu_slab);
-       } while (IS_ENABLED(CONFIG_PREEMPT) &&
+       } while (IS_ENABLED(CONFIG_PREEMPTION) &&
                 unlikely(tid != READ_ONCE(c->tid)));
  
        /*
@@@ -2971,7 -2971,7 +2971,7 @@@ redo
        do {
                tid = this_cpu_read(s->cpu_slab->tid);
                c = raw_cpu_ptr(s->cpu_slab);
-       } while (IS_ENABLED(CONFIG_PREEMPT) &&
+       } while (IS_ENABLED(CONFIG_PREEMPTION) &&
                 unlikely(tid != READ_ONCE(c->tid)));
  
        /* Same with comment on barrier() in slab_alloc_node() */
diff --combined net/core/dev.c
@@@ -928,7 -928,7 +928,7 @@@ EXPORT_SYMBOL(dev_get_by_napi_id)
   *
   *    The use of raw_seqcount_begin() and cond_resched() before
   *    retrying is required as we want to give the writers a chance
-  *    to complete when CONFIG_PREEMPT is not set.
+  *    to complete when CONFIG_PREEMPTION is not set.
   */
  int netdev_get_name(struct net *net, char *name, int ifindex)
  {
@@@ -5491,29 -5491,9 +5491,29 @@@ static void flush_all_backlogs(void
        put_online_cpus();
  }
  
 +/* Pass the currently batched GRO_NORMAL SKBs up to the stack. */
 +static void gro_normal_list(struct napi_struct *napi)
 +{
 +      if (!napi->rx_count)
 +              return;
 +      netif_receive_skb_list_internal(&napi->rx_list);
 +      INIT_LIST_HEAD(&napi->rx_list);
 +      napi->rx_count = 0;
 +}
 +
 +/* Queue one GRO_NORMAL SKB up for list processing. If batch size exceeded,
 + * pass the whole batch up to the stack.
 + */
 +static void gro_normal_one(struct napi_struct *napi, struct sk_buff *skb)
 +{
 +      list_add_tail(&skb->list, &napi->rx_list);
 +      if (++napi->rx_count >= gro_normal_batch)
 +              gro_normal_list(napi);
 +}
 +
  INDIRECT_CALLABLE_DECLARE(int inet_gro_complete(struct sk_buff *, int));
  INDIRECT_CALLABLE_DECLARE(int ipv6_gro_complete(struct sk_buff *, int));
 -static int napi_gro_complete(struct sk_buff *skb)
 +static int napi_gro_complete(struct napi_struct *napi, struct sk_buff *skb)
  {
        struct packet_offload *ptype;
        __be16 type = skb->protocol;
        }
  
  out:
 -      return netif_receive_skb_internal(skb);
 +      gro_normal_one(napi, skb);
 +      return NET_RX_SUCCESS;
  }
  
  static void __napi_gro_flush_chain(struct napi_struct *napi, u32 index,
                if (flush_old && NAPI_GRO_CB(skb)->age == jiffies)
                        return;
                skb_list_del_init(skb);
 -              napi_gro_complete(skb);
 +              napi_gro_complete(napi, skb);
                napi->gro_hash[index].count--;
        }
  
@@@ -5662,7 -5641,7 +5662,7 @@@ static void gro_pull_from_frag0(struct 
        }
  }
  
 -static void gro_flush_oldest(struct list_head *head)
 +static void gro_flush_oldest(struct napi_struct *napi, struct list_head *head)
  {
        struct sk_buff *oldest;
  
         * SKB to the chain.
         */
        skb_list_del_init(oldest);
 -      napi_gro_complete(oldest);
 +      napi_gro_complete(napi, oldest);
  }
  
  INDIRECT_CALLABLE_DECLARE(struct sk_buff *inet_gro_receive(struct list_head *,
@@@ -5754,7 -5733,7 +5754,7 @@@ static enum gro_result dev_gro_receive(
  
        if (pp) {
                skb_list_del_init(pp);
 -              napi_gro_complete(pp);
 +              napi_gro_complete(napi, pp);
                napi->gro_hash[hash].count--;
        }
  
                goto normal;
  
        if (unlikely(napi->gro_hash[hash].count >= MAX_GRO_SKBS)) {
 -              gro_flush_oldest(gro_head);
 +              gro_flush_oldest(napi, gro_head);
        } else {
                napi->gro_hash[hash].count++;
        }
@@@ -5823,6 -5802,26 +5823,6 @@@ struct packet_offload *gro_find_complet
  }
  EXPORT_SYMBOL(gro_find_complete_by_type);
  
 -/* Pass the currently batched GRO_NORMAL SKBs up to the stack. */
 -static void gro_normal_list(struct napi_struct *napi)
 -{
 -      if (!napi->rx_count)
 -              return;
 -      netif_receive_skb_list_internal(&napi->rx_list);
 -      INIT_LIST_HEAD(&napi->rx_list);
 -      napi->rx_count = 0;
 -}
 -
 -/* Queue one GRO_NORMAL SKB up for list processing. If batch size exceeded,
 - * pass the whole batch up to the stack.
 - */
 -static void gro_normal_one(struct napi_struct *napi, struct sk_buff *skb)
 -{
 -      list_add_tail(&skb->list, &napi->rx_list);
 -      if (++napi->rx_count >= gro_normal_batch)
 -              gro_normal_list(napi);
 -}
 -
  static void napi_skb_free_stolen_head(struct sk_buff *skb)
  {
        skb_dst_drop(skb);
@@@ -6201,6 -6200,8 +6201,6 @@@ bool napi_complete_done(struct napi_str
                                 NAPIF_STATE_IN_BUSY_POLL)))
                return false;
  
 -      gro_normal_list(n);
 -
        if (n->gro_bitmask) {
                unsigned long timeout = 0;
  
                        hrtimer_start(&n->timer, ns_to_ktime(timeout),
                                      HRTIMER_MODE_REL_PINNED);
        }
 +
 +      gro_normal_list(n);
 +
        if (unlikely(!list_empty(&n->poll_list))) {
                /* If n->poll_list is not empty, we need to mask irqs */
                local_irq_save(flags);
@@@ -6550,6 -6548,8 +6550,6 @@@ static int napi_poll(struct napi_struc
                goto out_unlock;
        }
  
 -      gro_normal_list(n);
 -
        if (n->gro_bitmask) {
                /* flush too old packets
                 * If HZ < 1000, flush all packets.
                napi_gro_flush(n, HZ >= 1000);
        }
  
 +      gro_normal_list(n);
 +
        /* Some drivers may have called napi_schedule
         * prior to exhausting their budget.
         */
@@@ -8196,22 -8194,6 +8196,22 @@@ int __dev_set_mtu(struct net_device *de
  }
  EXPORT_SYMBOL(__dev_set_mtu);
  
 +int dev_validate_mtu(struct net_device *dev, int new_mtu,
 +                   struct netlink_ext_ack *extack)
 +{
 +      /* MTU must be positive, and in range */
 +      if (new_mtu < 0 || new_mtu < dev->min_mtu) {
 +              NL_SET_ERR_MSG(extack, "mtu less than device minimum");
 +              return -EINVAL;
 +      }
 +
 +      if (dev->max_mtu > 0 && new_mtu > dev->max_mtu) {
 +              NL_SET_ERR_MSG(extack, "mtu greater than device maximum");
 +              return -EINVAL;
 +      }
 +      return 0;
 +}
 +
  /**
   *    dev_set_mtu_ext - Change maximum transfer unit
   *    @dev: device
@@@ -8228,9 -8210,16 +8228,9 @@@ int dev_set_mtu_ext(struct net_device *
        if (new_mtu == dev->mtu)
                return 0;
  
 -      /* MTU must be positive, and in range */
 -      if (new_mtu < 0 || new_mtu < dev->min_mtu) {
 -              NL_SET_ERR_MSG(extack, "mtu less than device minimum");
 -              return -EINVAL;
 -      }
 -
 -      if (dev->max_mtu > 0 && new_mtu > dev->max_mtu) {
 -              NL_SET_ERR_MSG(extack, "mtu greater than device maximum");
 -              return -EINVAL;
 -      }
 +      err = dev_validate_mtu(dev, new_mtu, extack);
 +      if (err)
 +              return err;
  
        if (!netif_device_present(dev))
                return -ENODEV;
@@@ -9188,10 -9177,22 +9188,10 @@@ static void netdev_unregister_lockdep_k
  
  void netdev_update_lockdep_key(struct net_device *dev)
  {
 -      struct netdev_queue *queue;
 -      int i;
 -
 -      lockdep_unregister_key(&dev->qdisc_xmit_lock_key);
        lockdep_unregister_key(&dev->addr_list_lock_key);
 -
 -      lockdep_register_key(&dev->qdisc_xmit_lock_key);
        lockdep_register_key(&dev->addr_list_lock_key);
  
        lockdep_set_class(&dev->addr_list_lock, &dev->addr_list_lock_key);
 -      for (i = 0; i < dev->num_tx_queues; i++) {
 -              queue = netdev_get_tx_queue(dev, i);
 -
 -              lockdep_set_class(&queue->_xmit_lock,
 -                                &dev->qdisc_xmit_lock_key);
 -      }
  }
  EXPORT_SYMBOL(netdev_update_lockdep_key);
  
@@@ -9313,10 -9314,8 +9313,10 @@@ int register_netdevice(struct net_devic
                goto err_uninit;
  
        ret = netdev_register_kobject(dev);
 -      if (ret)
 +      if (ret) {
 +              dev->reg_state = NETREG_UNREGISTERED;
                goto err_uninit;
 +      }
        dev->reg_state = NETREG_REGISTERED;
  
        __netdev_update_features(dev);