summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2018-01-21 20:28:08 +0000
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2018-01-21 20:28:08 +0000
commitacf7713baf37fba58a6afddb71e3d87ebc27bbfe (patch)
tree730b3e3caa78979e5bcdf7dcb495378dea18e173 /target
parent15cdef0dbe210f95ceb50af43dbf56b6acf5bdd8 (diff)
linux: update to 4.4.112, refresh realtime patch
Diffstat (limited to 'target')
-rw-r--r--target/config/Config.in.kernelversion2
-rw-r--r--target/linux/patches/4.4.112/coldfire-sighandler.patch (renamed from target/linux/patches/4.4.107/coldfire-sighandler.patch)0
-rw-r--r--target/linux/patches/4.4.112/crisv32.patch (renamed from target/linux/patches/4.4.107/crisv32.patch)0
-rw-r--r--target/linux/patches/4.4.112/crisv32_ethernet_driver.patch (renamed from target/linux/patches/4.4.107/crisv32_ethernet_driver.patch)0
-rw-r--r--target/linux/patches/4.4.112/h8300.patch (renamed from target/linux/patches/4.4.107/h8300.patch)0
-rw-r--r--target/linux/patches/4.4.112/initramfs-nosizelimit.patch (renamed from target/linux/patches/4.4.107/initramfs-nosizelimit.patch)0
-rw-r--r--target/linux/patches/4.4.112/ld-or1k.patch (renamed from target/linux/patches/4.4.107/ld-or1k.patch)0
-rw-r--r--target/linux/patches/4.4.112/macsonic.patch (renamed from target/linux/patches/4.4.107/macsonic.patch)0
-rw-r--r--target/linux/patches/4.4.112/mips-xz.patch (renamed from target/linux/patches/4.4.107/mips-xz.patch)0
-rw-r--r--target/linux/patches/4.4.112/patch-realtime (renamed from target/linux/patches/4.4.107/patch-realtime)1767
-rw-r--r--target/linux/patches/4.4.112/startup.patch (renamed from target/linux/patches/4.4.107/startup.patch)0
-rw-r--r--target/linux/patches/4.4.112/use-libgcc-for-sh.patch (renamed from target/linux/patches/4.4.107/use-libgcc-for-sh.patch)0
-rw-r--r--target/linux/patches/4.4.112/versatile-nommu.patch (renamed from target/linux/patches/4.4.107/versatile-nommu.patch)0
13 files changed, 1138 insertions, 631 deletions
diff --git a/target/config/Config.in.kernelversion b/target/config/Config.in.kernelversion
index 85620f5e0..4cfbf4a41 100644
--- a/target/config/Config.in.kernelversion
+++ b/target/config/Config.in.kernelversion
@@ -59,7 +59,7 @@ config ADK_TARGET_KERNEL_VERSION_4_9
depends on !ADK_TARGET_SYSTEM_ORANGE_PI0
config ADK_TARGET_KERNEL_VERSION_4_4
- bool "4.4.107"
+ bool "4.4.112"
depends on !ADK_TARGET_ARCH_CSKY
depends on !ADK_TARGET_ARCH_NDS32
depends on !ADK_TARGET_ARCH_NIOS2
diff --git a/target/linux/patches/4.4.107/coldfire-sighandler.patch b/target/linux/patches/4.4.112/coldfire-sighandler.patch
index c52a4e228..c52a4e228 100644
--- a/target/linux/patches/4.4.107/coldfire-sighandler.patch
+++ b/target/linux/patches/4.4.112/coldfire-sighandler.patch
diff --git a/target/linux/patches/4.4.107/crisv32.patch b/target/linux/patches/4.4.112/crisv32.patch
index cb9b0d028..cb9b0d028 100644
--- a/target/linux/patches/4.4.107/crisv32.patch
+++ b/target/linux/patches/4.4.112/crisv32.patch
diff --git a/target/linux/patches/4.4.107/crisv32_ethernet_driver.patch b/target/linux/patches/4.4.112/crisv32_ethernet_driver.patch
index 0cef202fc..0cef202fc 100644
--- a/target/linux/patches/4.4.107/crisv32_ethernet_driver.patch
+++ b/target/linux/patches/4.4.112/crisv32_ethernet_driver.patch
diff --git a/target/linux/patches/4.4.107/h8300.patch b/target/linux/patches/4.4.112/h8300.patch
index cf73989a6..cf73989a6 100644
--- a/target/linux/patches/4.4.107/h8300.patch
+++ b/target/linux/patches/4.4.112/h8300.patch
diff --git a/target/linux/patches/4.4.107/initramfs-nosizelimit.patch b/target/linux/patches/4.4.112/initramfs-nosizelimit.patch
index 40d2f6bd8..40d2f6bd8 100644
--- a/target/linux/patches/4.4.107/initramfs-nosizelimit.patch
+++ b/target/linux/patches/4.4.112/initramfs-nosizelimit.patch
diff --git a/target/linux/patches/4.4.107/ld-or1k.patch b/target/linux/patches/4.4.112/ld-or1k.patch
index 264f9166f..264f9166f 100644
--- a/target/linux/patches/4.4.107/ld-or1k.patch
+++ b/target/linux/patches/4.4.112/ld-or1k.patch
diff --git a/target/linux/patches/4.4.107/macsonic.patch b/target/linux/patches/4.4.112/macsonic.patch
index 75a6fcad2..75a6fcad2 100644
--- a/target/linux/patches/4.4.107/macsonic.patch
+++ b/target/linux/patches/4.4.112/macsonic.patch
diff --git a/target/linux/patches/4.4.107/mips-xz.patch b/target/linux/patches/4.4.112/mips-xz.patch
index 5cfac6254..5cfac6254 100644
--- a/target/linux/patches/4.4.107/mips-xz.patch
+++ b/target/linux/patches/4.4.112/mips-xz.patch
diff --git a/target/linux/patches/4.4.107/patch-realtime b/target/linux/patches/4.4.112/patch-realtime
index b49cd6f03..9fe252409 100644
--- a/target/linux/patches/4.4.107/patch-realtime
+++ b/target/linux/patches/4.4.112/patch-realtime
@@ -69,7 +69,7 @@ index 000000000000..cb61516483d3
+then we write to a global sample ring buffer of 8K samples, which is
+consumed by reading from the "sample" (pipe) debugfs file interface.
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index ca64ca566099..19bef799c902 100644
+index 39280b72f27a..c46295a8d55b 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1640,6 +1640,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
@@ -305,10 +305,10 @@ index 000000000000..6f2aeabf7faa
+
+These data are also reset when the wakeup histogram is reset.
diff --git a/Makefile b/Makefile
-index a5ecb29c6ed3..5521b0c3abf2 100644
+index 07070a1e6292..f04a8b6444b9 100644
--- a/Makefile
+++ b/Makefile
-@@ -785,6 +785,9 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes)
+@@ -797,6 +797,9 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes)
# Prohibit date/time macros, which would make the build non-deterministic
KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
@@ -441,7 +441,7 @@ diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 3ce377f7251f..d044cea59f54 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
-@@ -215,11 +215,18 @@ __irq_svc:
+@@ -215,11 +215,18 @@ ENDPROC(__dabt_svc)
#ifdef CONFIG_PREEMPT
get_thread_info tsk
ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
@@ -462,7 +462,7 @@ index 3ce377f7251f..d044cea59f54 100644
#endif
svc_exit r5, irq = 1 @ return from exception
-@@ -234,8 +241,14 @@ svc_preempt:
+@@ -234,8 +241,14 @@ ENDPROC(__irq_svc)
1: bl preempt_schedule_irq @ irq en/disable is done inside
ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS
tst r0, #_TIF_NEED_RESCHED
@@ -482,7 +482,7 @@ diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 30a7228eaceb..c3bd6cbfce4b 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
-@@ -36,7 +36,9 @@ ret_fast_syscall:
+@@ -36,7 +36,9 @@
UNWIND(.cantunwind )
disable_irq_notrace @ disable interrupts
ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing
@@ -493,7 +493,7 @@ index 30a7228eaceb..c3bd6cbfce4b 100644
bne fast_work_pending
/* perform architecture specific actions before user return */
-@@ -62,8 +64,11 @@ ret_fast_syscall:
+@@ -62,8 +64,11 @@ ENDPROC(ret_fast_syscall)
str r0, [sp, #S_R0 + S_OFF]! @ save returned r0
disable_irq_notrace @ disable interrupts
ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing
@@ -820,7 +820,7 @@ index b0fa7dc7286d..28ca57a2060f 100644
#endif /* _AT91_GENERIC_H */
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
-index d687f860a2da..ab53332a9637 100644
+index 84eefbc2b4f9..bff0d062bf68 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -31,10 +31,13 @@
@@ -1347,10 +1347,10 @@ index c4ad6eae67fa..e830b20b212f 100644
return pen_release != -1 ? -ENOSYS : 0;
}
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
-index c095455d496e..276ac73f8650 100644
+index 0d20cd594017..a11dc6d8ca02 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
-@@ -430,6 +430,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
+@@ -433,6 +433,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
if (addr < TASK_SIZE)
return do_page_fault(addr, fsr, regs);
@@ -1360,7 +1360,7 @@ index c095455d496e..276ac73f8650 100644
if (user_mode(regs))
goto bad_area;
-@@ -497,6 +500,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
+@@ -500,6 +503,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
static int
do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
@@ -1618,10 +1618,10 @@ index 087cf9a65359..d74475928399 100644
DEFINE(TI_TASK, offsetof(struct thread_info, task));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
-index bd14849beb73..cf92d4ee51db 100644
+index dccd0c2e9023..a8d4d065fd81 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
-@@ -376,11 +376,16 @@ el1_irq:
+@@ -378,11 +378,16 @@ ENDPROC(el1_sync)
#ifdef CONFIG_PREEMPT
get_thread_info tsk
ldr w24, [tsk, #TI_PREEMPT] // get preempt count
@@ -1641,7 +1641,7 @@ index bd14849beb73..cf92d4ee51db 100644
#endif
#ifdef CONFIG_TRACE_IRQFLAGS
bl trace_hardirqs_on
-@@ -394,6 +399,7 @@ el1_preempt:
+@@ -396,6 +401,7 @@ ENDPROC(el1_irq)
1: bl preempt_schedule_irq // irq en/disable is done inside
ldr x0, [tsk, #TI_FLAGS] // get new tasks TI_FLAGS
tbnz x0, #TIF_NEED_RESCHED, 1b // needs rescheduling?
@@ -1649,7 +1649,7 @@ index bd14849beb73..cf92d4ee51db 100644
ret x24
#endif
-@@ -638,6 +644,7 @@ ret_fast_syscall_trace:
+@@ -640,6 +646,7 @@ ENDPROC(cpu_switch_to)
*/
work_pending:
tbnz x1, #TIF_NEED_RESCHED, work_resched
@@ -1697,7 +1697,7 @@ index a017b23ee4aa..8d4d9270140f 100644
/* low level hrtimer wake routine */
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
-index db49e0d796b1..1d2be228661c 100644
+index dfb1ee8c3e06..cdc3c20ef225 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -60,10 +60,11 @@ config LOCKDEP_SUPPORT
@@ -1818,7 +1818,7 @@ diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 2405631e91a2..c21b4b42eaa0 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
-@@ -818,7 +818,14 @@ resume_kernel:
+@@ -818,7 +818,14 @@ user_exc_return: /* r10 contains MSR_KERNEL here */
cmpwi 0,r0,0 /* if non-zero, just restore regs and return */
bne restore
andi. r8,r8,_TIF_NEED_RESCHED
@@ -1833,7 +1833,7 @@ index 2405631e91a2..c21b4b42eaa0 100644
lwz r3,_MSR(r1)
andi. r0,r3,MSR_EE /* interrupts off? */
beq restore /* don't schedule if so */
-@@ -829,11 +836,11 @@ resume_kernel:
+@@ -829,11 +836,11 @@ user_exc_return: /* r10 contains MSR_KERNEL here */
*/
bl trace_hardirqs_off
#endif
@@ -1848,7 +1848,7 @@ index 2405631e91a2..c21b4b42eaa0 100644
#ifdef CONFIG_TRACE_IRQFLAGS
/* And now, to properly rebalance the above, we tell lockdep they
* are being turned back on, which will happen when we return
-@@ -1154,7 +1161,7 @@ global_dbcr0:
+@@ -1154,7 +1161,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */
do_work: /* r10 contains MSR_KERNEL here */
@@ -1857,7 +1857,7 @@ index 2405631e91a2..c21b4b42eaa0 100644
beq do_user_signal
do_resched: /* r10 contains MSR_KERNEL here */
-@@ -1175,7 +1182,7 @@ recheck:
+@@ -1175,7 +1182,7 @@ do_resched: /* r10 contains MSR_KERNEL here */
MTMSRD(r10) /* disable interrupts */
CURRENT_THREAD_INFO(r9, r1)
lwz r9,TI_FLAGS(r9)
@@ -1879,7 +1879,7 @@ index f6fd0332c3a2..96235fe0a581 100644
beq 2f
bl restore_interrupts
SCHEDULE_USER
-@@ -745,10 +745,18 @@ resume_kernel:
+@@ -745,10 +745,18 @@ _GLOBAL(ret_from_except_lite)
#ifdef CONFIG_PREEMPT
/* Check if we need to preempt */
@@ -1899,7 +1899,7 @@ index f6fd0332c3a2..96235fe0a581 100644
cmpwi cr1,r8,0
ld r0,SOFTE(r1)
cmpdi r0,0
-@@ -765,7 +773,7 @@ resume_kernel:
+@@ -765,7 +773,7 @@ _GLOBAL(ret_from_except_lite)
/* Re-test flags and eventually loop */
CURRENT_THREAD_INFO(r9, r1)
ld r4,TI_FLAGS(r9)
@@ -1981,7 +1981,7 @@ index c2024ac9d4e8..2303788da7e1 100644
select HAVE_KVM_IRQFD
select HAVE_KVM_IRQ_ROUTING
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
-index 3c3a367b6e59..2ac7a8b108ac 100644
+index 428563b195c3..4c42c3935025 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -114,11 +114,11 @@ static bool kvmppc_ipi_thread(int cpu)
@@ -2089,7 +2089,7 @@ diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 6a75352f453c..cc862c486002 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
-@@ -868,13 +868,13 @@ no_timer:
+@@ -868,13 +868,13 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu)
{
@@ -2126,7 +2126,7 @@ index 6c0378c0b8b5..abd58b4dff97 100644
static inline void handle_one_irq(unsigned int irq)
{
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
-index 56442d2d7bbc..8c9598f534c9 100644
+index 94f4ac21761b..d7c369d061cf 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -189,12 +189,10 @@ config NR_CPUS
@@ -2145,7 +2145,7 @@ index 56442d2d7bbc..8c9598f534c9 100644
config GENERIC_HWEIGHT
bool
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
-index e22416ce56ea..d359de71153a 100644
+index bfbde8c4ffb2..62e7e06013c5 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -854,6 +854,7 @@ void __irq_entry handler_irq(int pil, struct pt_regs *regs)
@@ -2165,7 +2165,7 @@ index e22416ce56ea..d359de71153a 100644
#ifdef CONFIG_HOTPLUG_CPU
void fixup_irqs(void)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
-index 436639a31624..6ee1dd0deadc 100644
+index 0ef2cdd11616..2eaae0f372fa 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -17,6 +17,7 @@ config X86_64
@@ -2176,7 +2176,7 @@ index 436639a31624..6ee1dd0deadc 100644
select ACPI_LEGACY_TABLES_LOOKUP if ACPI
select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
select ANON_INODES
-@@ -212,8 +213,11 @@ config ARCH_MAY_HAVE_PC_FDC
+@@ -213,8 +214,11 @@ config ARCH_MAY_HAVE_PC_FDC
def_bool y
depends on ISA_DMA_API
@@ -2189,7 +2189,7 @@ index 436639a31624..6ee1dd0deadc 100644
config GENERIC_CALIBRATE_DELAY
def_bool y
-@@ -848,7 +852,7 @@ config IOMMU_HELPER
+@@ -849,7 +853,7 @@ config IOMMU_HELPER
config MAXSMP
bool "Enable Maximum number of SMP Processors and NUMA Nodes"
depends on X86_64 && SMP && DEBUG_KERNEL
@@ -2328,7 +2328,7 @@ index 8648158f3916..d7699130ee36 100644
return err;
}
-@@ -227,7 +226,7 @@ done:
+@@ -227,7 +226,7 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc,
static int cbc_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
struct scatterlist *src, unsigned int nbytes)
{
@@ -2352,7 +2352,7 @@ index 8648158f3916..d7699130ee36 100644
return err;
}
-@@ -311,7 +309,7 @@ done:
+@@ -311,7 +309,7 @@ static unsigned int __ctr_crypt(struct blkcipher_desc *desc,
static int ctr_crypt(struct blkcipher_desc *desc, struct scatterlist *dst,
struct scatterlist *src, unsigned int nbytes)
{
@@ -2557,10 +2557,10 @@ index ae678ad128a9..3bcef8bdb911 100644
jz restore_all
call preempt_schedule_irq
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
-index a55697d19824..316081a2ca85 100644
+index 952b23b5d4e9..459a68cffcc2 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
-@@ -579,7 +579,23 @@ retint_kernel:
+@@ -607,7 +607,23 @@ GLOBAL(retint_user)
bt $9, EFLAGS(%rsp) /* were interrupts off? */
jnc 1f
0: cmpl $0, PER_CPU_VAR(__preempt_count)
@@ -2584,7 +2584,7 @@ index a55697d19824..316081a2ca85 100644
call preempt_schedule_irq
jmp 0b
1:
-@@ -867,6 +883,7 @@ bad_gs:
+@@ -897,6 +913,7 @@ END(native_load_gs_index)
jmp 2b
.previous
@@ -2592,7 +2592,7 @@ index a55697d19824..316081a2ca85 100644
/* Call softirq on interrupt stack. Interrupts are off. */
ENTRY(do_softirq_own_stack)
pushq %rbp
-@@ -879,6 +896,7 @@ ENTRY(do_softirq_own_stack)
+@@ -909,6 +926,7 @@ ENTRY(do_softirq_own_stack)
decl PER_CPU_VAR(irq_count)
ret
END(do_softirq_own_stack)
@@ -2794,7 +2794,7 @@ index ea7074784cc4..01ec643ce66e 100644
};
extern struct uv_blade_info *uv_blade_info;
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
-index e75907601a41..a29fc4f84fc4 100644
+index a1e4a6c3f394..86adbf86f366 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -87,7 +87,9 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
@@ -2808,7 +2808,7 @@ index e75907601a41..a29fc4f84fc4 100644
/* --------------------------------------------------------------------------
Boot-time Configuration
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
-index 1e5d2f07416b..ac0127bb155e 100644
+index fc91c98bee01..29c4f1b078a1 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1711,7 +1711,8 @@ static bool io_apic_level_ack_pending(struct mp_chip_data *data)
@@ -2922,7 +2922,7 @@ index 7e8a736d09db..430a4ec07811 100644
}
/*
-@@ -1301,7 +1289,7 @@ done:
+@@ -1301,7 +1289,7 @@ static void mce_timer_fn(unsigned long data)
*/
void mce_timer_kick(unsigned long interval)
{
@@ -3265,7 +3265,7 @@ index 38da8f29a9c8..ce71f7098f15 100644
bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
{
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
-index 47190bd399e7..807950860fb7 100644
+index 32187f8a49b4..1f456f1e06f8 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -36,6 +36,7 @@
@@ -3331,8 +3331,8 @@ index 47190bd399e7..807950860fb7 100644
if (hlist_unhashed(&n.link))
break;
-@@ -166,7 +167,7 @@ void kvm_async_pf_task_wait(u32 token)
- }
+@@ -168,7 +169,7 @@ void kvm_async_pf_task_wait(u32 token)
+ rcu_irq_enter();
}
if (!n.halted)
- finish_wait(&n.wq, &wait);
@@ -3340,7 +3340,7 @@ index 47190bd399e7..807950860fb7 100644
rcu_irq_exit();
return;
-@@ -178,8 +179,8 @@ static void apf_task_wake_one(struct kvm_task_sleep_node *n)
+@@ -180,8 +181,8 @@ static void apf_task_wake_one(struct kvm_task_sleep_node *n)
hlist_del_init(&n->link);
if (n->halted)
smp_send_reschedule(n->cpu);
@@ -3351,7 +3351,7 @@ index 47190bd399e7..807950860fb7 100644
}
static void apf_task_wake_all(void)
-@@ -189,14 +190,14 @@ static void apf_task_wake_all(void)
+@@ -191,14 +192,14 @@ static void apf_task_wake_all(void)
for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++) {
struct hlist_node *p, *next;
struct kvm_task_sleep_head *b = &async_pf_sleepers[i];
@@ -3368,7 +3368,7 @@ index 47190bd399e7..807950860fb7 100644
}
}
-@@ -212,7 +213,7 @@ void kvm_async_pf_task_wake(u32 token)
+@@ -214,7 +215,7 @@ void kvm_async_pf_task_wake(u32 token)
}
again:
@@ -3377,7 +3377,7 @@ index 47190bd399e7..807950860fb7 100644
n = _find_apf_task(b, token);
if (!n) {
/*
-@@ -225,17 +226,17 @@ again:
+@@ -227,17 +228,17 @@ void kvm_async_pf_task_wake(u32 token)
* Allocation failed! Busy wait while other cpu
* handles async PF.
*/
@@ -3398,7 +3398,7 @@ index 47190bd399e7..807950860fb7 100644
return;
}
EXPORT_SYMBOL_GPL(kvm_async_pf_task_wake);
-@@ -486,7 +487,7 @@ void __init kvm_guest_init(void)
+@@ -488,7 +489,7 @@ void __init kvm_guest_init(void)
paravirt_ops_setup();
register_reboot_notifier(&kvm_pv_reboot_nb);
for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++)
@@ -3506,10 +3506,10 @@ index 9f950917528b..4dd4beae917a 100644
* Leave lazy mode, flushing any hypercalls made here.
* This must be done before restoring TLS segments so
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
-index f660d63f40fe..8384207adde2 100644
+index 9a16932c7258..219ffb9ba3a9 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
-@@ -726,6 +726,7 @@ static int crashing_cpu;
+@@ -730,6 +730,7 @@ static int crashing_cpu;
static nmi_shootdown_cb shootdown_callback;
static atomic_t waiting_for_crash_ipi;
@@ -3517,7 +3517,7 @@ index f660d63f40fe..8384207adde2 100644
static int crash_nmi_callback(unsigned int val, struct pt_regs *regs)
{
-@@ -788,6 +789,9 @@ void nmi_shootdown_cpus(nmi_shootdown_cb callback)
+@@ -792,6 +793,9 @@ void nmi_shootdown_cpus(nmi_shootdown_cb callback)
smp_send_nmi_allbutself();
@@ -3527,7 +3527,7 @@ index f660d63f40fe..8384207adde2 100644
msecs = 1000; /* Wait at most a second for the other cpus to stop */
while ((atomic_read(&waiting_for_crash_ipi) > 0) && msecs) {
mdelay(1);
-@@ -796,6 +800,22 @@ void nmi_shootdown_cpus(nmi_shootdown_cb callback)
+@@ -800,6 +804,22 @@ void nmi_shootdown_cpus(nmi_shootdown_cb callback)
/* Leave the nmi callback set */
}
@@ -3583,10 +3583,10 @@ index 1c96f09367ae..ffb6d9859122 100644
/*
* APIC is created enabled. This will prevent kvm_lapic_set_base from
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
-index ae2b9cd358f2..50c9861d4219 100644
+index f973cfa8ff4f..b63350721623 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
-@@ -5827,6 +5827,13 @@ int kvm_arch_init(void *opaque)
+@@ -5836,6 +5836,13 @@ int kvm_arch_init(void *opaque)
goto out;
}
@@ -3685,10 +3685,10 @@ index 9c0ff045fdd4..dd25dd1671b6 100644
kmap_atomic_idx_pop();
}
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
-index b599a780a5a9..2e85c4117daf 100644
+index 79377e2a7bcd..dca36c1f1966 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
-@@ -208,7 +208,15 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,
+@@ -209,7 +209,15 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,
int in_flags, struct page **pages)
{
unsigned int i, level;
@@ -3879,7 +3879,7 @@ index 2b158a9fa1d7..5e0b122620cb 100644
/*
diff --git a/block/blk-core.c b/block/blk-core.c
-index ef083e7a37c5..7a7926b1b4b5 100644
+index f5f1a55703ae..75a76bcc7ac0 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -125,6 +125,9 @@ void blk_rq_init(struct request_queue *q, struct request *rq)
@@ -3896,8 +3896,8 @@ index ef083e7a37c5..7a7926b1b4b5 100644
**/
void blk_start_queue(struct request_queue *q)
{
-- WARN_ON(!irqs_disabled());
-+ WARN_ON_NONRT(!irqs_disabled());
+- WARN_ON(!in_interrupt() && !irqs_disabled());
++ WARN_ON_NONRT(!in_interrupt() && !irqs_disabled());
queue_flag_clear(QUEUE_FLAG_STOPPED, q);
__blk_run_queue(q);
@@ -3996,7 +3996,7 @@ index 381cb50a673c..dc8785233d94 100644
spin_lock_irqsave_nested(&ioc->lock, flags, 1);
}
}
-@@ -187,7 +188,7 @@ retry:
+@@ -187,7 +188,7 @@ void put_io_context_active(struct io_context *ioc)
spin_unlock(icq->q->queue_lock);
} else {
spin_unlock_irqrestore(&ioc->lock, flags);
@@ -4260,7 +4260,7 @@ index 53b1737e978d..81c3c0a62edf 100644
}
return NOTIFY_OK;
-@@ -150,6 +152,7 @@ do_local:
+@@ -150,6 +152,7 @@ void __blk_complete_request(struct request *req)
goto do_local;
local_irq_restore(flags);
@@ -4287,10 +4287,10 @@ index 1cb5dd3a5da1..2f1ec8a67cbe 100644
#else /* CONFIG_HIGHMEM */
diff --git a/crypto/algapi.c b/crypto/algapi.c
-index 43f5bdb6b570..b54fd9187d12 100644
+index eb58b73ca925..ee228adf2dac 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
-@@ -720,13 +720,13 @@ EXPORT_SYMBOL_GPL(crypto_spawn_tfm2);
+@@ -732,13 +732,13 @@ EXPORT_SYMBOL_GPL(crypto_spawn_tfm2);
int crypto_register_notifier(struct notifier_block *nb)
{
@@ -4433,7 +4433,7 @@ index ce406e39b669..41a75eb3ae9d 100644
/* Delete the reader/writer lock */
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
-index 7dbba387d12a..65beb7abb4e7 100644
+index 18de4c457068..dfecf14df732 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -678,9 +678,9 @@ unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev, unsigned char *buf,
@@ -4466,7 +4466,7 @@ index 7dbba387d12a..65beb7abb4e7 100644
} else {
buf = page_address(page);
ap->ops->sff_data_xfer(qc->dev, buf + offset, qc->sect_size,
-@@ -864,7 +864,7 @@ next_sg:
+@@ -864,7 +864,7 @@ static int __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
unsigned long flags;
/* FIXME: use bounce buffer */
@@ -4475,7 +4475,7 @@ index 7dbba387d12a..65beb7abb4e7 100644
buf = kmap_atomic(page);
/* do the actual data transfer */
-@@ -872,7 +872,7 @@ next_sg:
+@@ -872,7 +872,7 @@ static int __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
count, rw);
kunmap_atomic(buf);
@@ -4485,7 +4485,7 @@ index 7dbba387d12a..65beb7abb4e7 100644
buf = page_address(page);
consumed = ap->ops->sff_data_xfer(dev, buf + offset,
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
-index 62a93b685c54..5ad3c4e652a8 100644
+index 502406c9e6e1..91d909148688 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -520,6 +520,8 @@ static struct zram_meta *zram_meta_alloc(char *pool_name, u64 disksize)
@@ -4649,10 +4649,18 @@ index 8e92339686d7..9e3e953d680e 100644
+
#endif
diff --git a/drivers/char/random.c b/drivers/char/random.c
-index 491a4dce13fe..cf69b6b42208 100644
+index 1822472dffab..46c0e27cf27f 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
-@@ -799,8 +799,6 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
+@@ -260,6 +260,7 @@
+ #include <linux/irq.h>
+ #include <linux/syscalls.h>
+ #include <linux/completion.h>
++#include <linux/locallock.h>
+
+ #include <asm/processor.h>
+ #include <asm/uaccess.h>
+@@ -799,8 +800,6 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
} sample;
long delta, delta2, delta3;
@@ -4661,7 +4669,7 @@ index 491a4dce13fe..cf69b6b42208 100644
sample.jiffies = jiffies;
sample.cycles = random_get_entropy();
sample.num = num;
-@@ -841,7 +839,6 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
+@@ -841,7 +840,6 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
*/
credit_entropy_bits(r, min_t(int, fls(delta>>1), 11));
}
@@ -4669,7 +4677,7 @@ index 491a4dce13fe..cf69b6b42208 100644
}
void add_input_randomness(unsigned int type, unsigned int code,
-@@ -894,28 +891,27 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs)
+@@ -894,28 +892,27 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs)
return *(ptr + f->reg_idx++);
}
@@ -4703,6 +4711,44 @@ index 491a4dce13fe..cf69b6b42208 100644
fast_mix(fast_pool);
add_interrupt_bench(cycles);
+@@ -1800,6 +1797,7 @@ int random_int_secret_init(void)
+
+ static DEFINE_PER_CPU(__u32 [MD5_DIGEST_WORDS], get_random_int_hash)
+ __aligned(sizeof(unsigned long));
++static DEFINE_LOCAL_IRQ_LOCK(hash_entropy_int_lock);
+
+ /*
+ * Get a random word for internal kernel use only. Similar to urandom but
+@@ -1815,12 +1813,12 @@ unsigned int get_random_int(void)
+ if (arch_get_random_int(&ret))
+ return ret;
+
+- hash = get_cpu_var(get_random_int_hash);
++ hash = get_locked_var(hash_entropy_int_lock, get_random_int_hash);
+
+ hash[0] += current->pid + jiffies + random_get_entropy();
+ md5_transform(hash, random_int_secret);
+ ret = hash[0];
+- put_cpu_var(get_random_int_hash);
++ put_locked_var(hash_entropy_int_lock, get_random_int_hash);
+
+ return ret;
+ }
+@@ -1837,12 +1835,12 @@ unsigned long get_random_long(void)
+ if (arch_get_random_long(&ret))
+ return ret;
+
+- hash = get_cpu_var(get_random_int_hash);
++ hash = get_locked_var(hash_entropy_int_lock, get_random_int_hash);
+
+ hash[0] += current->pid + jiffies + random_get_entropy();
+ md5_transform(hash, random_int_secret);
+ ret = *(unsigned long *)hash;
+- put_cpu_var(get_random_int_hash);
++ put_locked_var(hash_entropy_int_lock, get_random_int_hash);
+
+ return ret;
+ }
diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c
index abc80949e1dd..4ad3298eb372 100644
--- a/drivers/clk/at91/clk-generated.c
@@ -5854,7 +5900,7 @@ index 620ea323356b..7d4a1864ea7c 100644
kfree(master);
}
-@@ -217,15 +195,15 @@ out_free_characteristics:
+@@ -217,15 +195,15 @@ of_at91_clk_master_get_characteristics(struct device_node *np)
}
static void __init
@@ -5888,7 +5934,7 @@ index 620ea323356b..7d4a1864ea7c 100644
parent_names, layout,
characteristics);
if (IS_ERR(clk))
-@@ -256,14 +234,16 @@ out_free_characteristics:
+@@ -256,14 +234,16 @@ of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc,
kfree(characteristics);
}
@@ -6449,7 +6495,7 @@ index 18b60f4895a6..fb2e0b56d4b7 100644
kfree(pll);
}
-@@ -483,12 +461,12 @@ out_free_characteristics:
+@@ -483,12 +461,12 @@ of_at91_clk_pll_get_characteristics(struct device_node *np)
}
static void __init
@@ -6485,7 +6531,7 @@ index 18b60f4895a6..fb2e0b56d4b7 100644
characteristics);
if (IS_ERR(clk))
goto out_free_characteristics;
-@@ -520,26 +498,30 @@ out_free_characteristics:
+@@ -520,26 +498,30 @@ of_at91_clk_pll_setup(struct device_node *np, struct at91_pmc *pmc,
kfree(characteristics);
}
@@ -8898,7 +8944,7 @@ index 36f76e28a0bf..394f142f90c7 100644
if (m5229_revision < 0xC2) {
/*
-@@ -325,7 +325,7 @@ out:
+@@ -325,7 +325,7 @@ static int init_chipset_ali15x3(struct pci_dev *dev)
}
pci_dev_put(north);
pci_dev_put(isa_dev);
@@ -9121,7 +9167,7 @@ index 4a2a9e370be7..e970d9afd179 100644
if (t2 - t1 < tx) tx = t2 - t1;
}
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
-index a0ef57483ebb..b08732bae11a 100644
+index 52c36394dba5..d777d0197f64 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2022,10 +2022,10 @@ static int __attach_device(struct iommu_dev_data *dev_data,
@@ -9178,7 +9224,7 @@ index 4d200883c505..98b64ed5cb81 100644
Allows a block device to be used as cache for other devices; uses
a btree for indexing and the layout is optimized for SSDs.
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
-index 320eb3c4bb6b..aba2d71149e3 100644
+index 9ec6948e3b8b..ecbc23575114 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2185,7 +2185,7 @@ static void dm_request_fn(struct request_queue *q)
@@ -9191,10 +9237,28 @@ index 320eb3c4bb6b..aba2d71149e3 100644
goto out;
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
-index 4384b46cee1a..6415f094a4eb 100644
+index 86ab6d14d782..573b9ac810da 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
-@@ -1920,8 +1920,9 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request)
+@@ -429,7 +429,7 @@ void raid5_release_stripe(struct stripe_head *sh)
+ md_wakeup_thread(conf->mddev->thread);
+ return;
+ slow_path:
+- local_irq_save(flags);
++ local_irq_save_nort(flags);
+ /* we are ok here if STRIPE_ON_RELEASE_LIST is set or not */
+ if (atomic_dec_and_lock(&sh->count, &conf->device_lock)) {
+ INIT_LIST_HEAD(&list);
+@@ -438,7 +438,7 @@ void raid5_release_stripe(struct stripe_head *sh)
+ spin_unlock(&conf->device_lock);
+ release_inactive_stripe_list(conf, &list, hash);
+ }
+- local_irq_restore(flags);
++ local_irq_restore_nort(flags);
+ }
+
+ static inline void remove_hash(struct stripe_head *sh)
+@@ -1929,8 +1929,9 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request)
struct raid5_percpu *percpu;
unsigned long cpu;
@@ -9205,7 +9269,7 @@ index 4384b46cee1a..6415f094a4eb 100644
if (test_bit(STRIPE_OP_BIOFILL, &ops_request)) {
ops_run_biofill(sh);
overlap_clear++;
-@@ -1977,7 +1978,8 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request)
+@@ -1986,7 +1987,8 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request)
if (test_and_clear_bit(R5_Overlap, &dev->flags))
wake_up(&sh->raid_conf->wait_for_overlap);
}
@@ -9215,7 +9279,7 @@ index 4384b46cee1a..6415f094a4eb 100644
}
static struct stripe_head *alloc_stripe(struct kmem_cache *sc, gfp_t gfp)
-@@ -6416,6 +6418,7 @@ static int raid5_alloc_percpu(struct r5conf *conf)
+@@ -6433,6 +6435,7 @@ static int raid5_alloc_percpu(struct r5conf *conf)
__func__, cpu);
break;
}
@@ -11027,7 +11091,7 @@ index f4424063b860..cbbbebd86c6e 100644
#else
/*
* This a non-SMP scenario where the singular Rx thread is
-@@ -1566,11 +1566,11 @@ err2:
+@@ -1566,11 +1566,11 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev,
static int fcoe_alloc_paged_crc_eof(struct sk_buff *skb, int tlen)
{
struct fcoe_percpu_s *fps;
@@ -11250,7 +11314,7 @@ index 7fc919f7da4d..e03fa17b8670 100644
spin_lock_init(&pkg_work_lock);
platform_thermal_package_notify =
pkg_temp_thermal_platform_thermal_notify;
-@@ -608,7 +651,7 @@ err_ret:
+@@ -608,7 +651,7 @@ static int __init pkg_temp_thermal_init(void)
kfree(pkg_work_scheduled);
platform_thermal_package_notify = NULL;
platform_thermal_package_rate_control = NULL;
@@ -11290,7 +11354,7 @@ index 39126460c1f5..af7701ca4d48 100644
#include <asm/serial.h>
/*
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
-index 56ccbcefdd85..a0b9e854672c 100644
+index d42d66b72d5a..c08e0724a487 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -35,6 +35,7 @@
@@ -11301,7 +11365,7 @@ index 56ccbcefdd85..a0b9e854672c 100644
#include <linux/uaccess.h>
#include <linux/pm_runtime.h>
-@@ -2843,9 +2844,9 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s,
+@@ -2846,9 +2847,9 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s,
serial8250_rpm_get(up);
@@ -11351,7 +11415,7 @@ index 899a77187bde..3ff6363b3751 100644
clk_disable(uap->clk);
}
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
-index de1c143b475f..3fef536a1844 100644
+index 21fc9b3a27cf..2e32729e6a83 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1257,13 +1257,10 @@ serial_omap_console_write(struct console *co, const char *s,
@@ -11382,7 +11446,7 @@ index de1c143b475f..3fef536a1844 100644
static int __init
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
-index c3f4f2ab7b33..ae1ffb5f7610 100644
+index 87a83d925eea..995a37bde992 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1738,9 +1738,9 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
@@ -11398,7 +11462,7 @@ index c3f4f2ab7b33..ae1ffb5f7610 100644
usb_anchor_resume_wakeups(anchor);
atomic_dec(&urb->use_count);
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
-index 9ad5145d3103..bf883695cdfb 100644
+index 39bb65265bff..49c167d150ce 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -1404,7 +1404,7 @@ static void ffs_data_put(struct ffs_data *ffs)
@@ -11411,10 +11475,10 @@ index 9ad5145d3103..bf883695cdfb 100644
kfree(ffs);
}
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
-index de014436fb22..e52700c7555e 100644
+index 81f3c9cb333c..c996bd43741a 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
-@@ -345,7 +345,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len)
+@@ -346,7 +346,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len)
spin_unlock_irq (&epdata->dev->lock);
if (likely (value == 0)) {
@@ -11423,7 +11487,7 @@ index de014436fb22..e52700c7555e 100644
if (value != 0) {
spin_lock_irq (&epdata->dev->lock);
if (likely (epdata->ep != NULL)) {
-@@ -354,7 +354,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len)
+@@ -355,7 +355,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len)
usb_ep_dequeue (epdata->ep, epdata->req);
spin_unlock_irq (&epdata->dev->lock);
@@ -11433,7 +11497,7 @@ index de014436fb22..e52700c7555e 100644
epdata->status = -EINTR;
} else {
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
-index f92f5aff0dd5..f9bba26e3655 100644
+index 585cb8734f50..1e469be2c216 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -17,7 +17,9 @@
@@ -11446,7 +11510,7 @@ index f92f5aff0dd5..f9bba26e3655 100644
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/atmel_usba_udc.h>
-@@ -1888,20 +1890,15 @@ static int atmel_usba_stop(struct usb_gadget *gadget)
+@@ -1890,20 +1892,15 @@ static int atmel_usba_stop(struct usb_gadget *gadget)
#ifdef CONFIG_OF
static void at91sam9rl_toggle_bias(struct usba_udc *udc, int is_on)
{
@@ -11472,7 +11536,7 @@ index f92f5aff0dd5..f9bba26e3655 100644
}
static const struct usba_udc_errata at91sam9rl_errata = {
-@@ -1938,6 +1935,9 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
+@@ -1940,6 +1937,9 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
return ERR_PTR(-EINVAL);
udc->errata = match->data;
@@ -11590,7 +11654,7 @@ diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index 7a5a598a2d94..d08bcdc30566 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
-@@ -150,7 +150,7 @@ again:
+@@ -150,7 +150,7 @@ static struct dentry *get_next_positive_dentry(struct dentry *prev,
parent = p->d_parent;
if (!spin_trylock(&parent->d_lock)) {
spin_unlock(&p->d_lock);
@@ -11600,7 +11664,7 @@ index 7a5a598a2d94..d08bcdc30566 100644
}
spin_unlock(&p->d_lock);
diff --git a/fs/buffer.c b/fs/buffer.c
-index 4f4cd959da7c..72b27e17b907 100644
+index 6f7d519a093b..96b943e924cc 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -305,8 +305,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
@@ -11671,7 +11735,7 @@ index 4f4cd959da7c..72b27e17b907 100644
__this_cpu_inc(bh_accounting.nr);
recalc_bh_state();
diff --git a/fs/dcache.c b/fs/dcache.c
-index 849c1c1e787b..995995130191 100644
+index 3ed642e0a0c2..1437dd042e13 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -19,6 +19,7 @@
@@ -11682,7 +11746,7 @@ index 849c1c1e787b..995995130191 100644
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/hash.h>
-@@ -747,6 +748,8 @@ static inline bool fast_dput(struct dentry *dentry)
+@@ -774,6 +775,8 @@ static inline bool fast_dput(struct dentry *dentry)
*/
void dput(struct dentry *dentry)
{
@@ -11691,7 +11755,7 @@ index 849c1c1e787b..995995130191 100644
if (unlikely(!dentry))
return;
-@@ -783,9 +786,18 @@ repeat:
+@@ -810,9 +813,18 @@ void dput(struct dentry *dentry)
return;
kill_it:
@@ -11713,7 +11777,7 @@ index 849c1c1e787b..995995130191 100644
goto repeat;
}
}
-@@ -2397,7 +2409,7 @@ again:
+@@ -2425,7 +2437,7 @@ void d_delete(struct dentry * dentry)
if (dentry->d_lockref.count == 1) {
if (!spin_trylock(&inode->i_lock)) {
spin_unlock(&dentry->d_lock);
@@ -11723,7 +11787,7 @@ index 849c1c1e787b..995995130191 100644
}
dentry->d_flags &= ~DCACHE_CANT_MOUNT;
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
-index 1e009cad8d5c..d0c12504d3b4 100644
+index 1b08556776ce..06435352045d 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -505,12 +505,12 @@ static int ep_poll_wakeup_proc(void *priv, void *cookie, int call_nests)
@@ -11742,10 +11806,10 @@ index 1e009cad8d5c..d0c12504d3b4 100644
static void ep_remove_wait_queue(struct eppoll_entry *pwq)
diff --git a/fs/exec.c b/fs/exec.c
-index 3a6de10d3891..74962ac0a738 100644
+index 9c5ee2a880aa..c12e576bb209 100644
--- a/fs/exec.c
+++ b/fs/exec.c
-@@ -866,12 +866,14 @@ static int exec_mmap(struct mm_struct *mm)
+@@ -887,12 +887,14 @@ static int exec_mmap(struct mm_struct *mm)
}
}
task_lock(tsk);
@@ -11760,6 +11824,30 @@ index 3a6de10d3891..74962ac0a738 100644
task_unlock(tsk);
if (old_mm) {
up_read(&old_mm->mmap_sem);
+diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
+index 6ca56f5f72b5..9e145fe7cae0 100644
+--- a/fs/ext4/page-io.c
++++ b/fs/ext4/page-io.c
+@@ -97,8 +97,7 @@ static void ext4_finish_bio(struct bio *bio)
+ * We check all buffers in the page under BH_Uptodate_Lock
+ * to avoid races with other end io clearing async_write flags
+ */
+- local_irq_save(flags);
+- bit_spin_lock(BH_Uptodate_Lock, &head->b_state);
++ flags = bh_uptodate_lock_irqsave(head);
+ do {
+ if (bh_offset(bh) < bio_start ||
+ bh_offset(bh) + bh->b_size > bio_end) {
+@@ -110,8 +109,7 @@ static void ext4_finish_bio(struct bio *bio)
+ if (bio->bi_error)
+ buffer_io_error(bh);
+ } while ((bh = bh->b_this_page) != head);
+- bit_spin_unlock(BH_Uptodate_Lock, &head->b_state);
+- local_irq_restore(flags);
++ bh_uptodate_unlock_irqrestore(head, flags);
+ if (!under_io) {
+ #ifdef CONFIG_EXT4_FS_ENCRYPTION
+ if (ctx)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 2871576fbca4..d1137790ea58 100644
--- a/fs/f2fs/f2fs.h
@@ -11789,21 +11877,8 @@ index 2871576fbca4..d1137790ea58 100644
}
static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi)
-diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
-index 684996c8a3a4..6e18a06aaabe 100644
---- a/fs/jbd2/checkpoint.c
-+++ b/fs/jbd2/checkpoint.c
-@@ -116,6 +116,8 @@ void __jbd2_log_wait_for_space(journal_t *journal)
- nblocks = jbd2_space_needed(journal);
- while (jbd2_log_space_left(journal) < nblocks) {
- write_unlock(&journal->j_state_lock);
-+ if (current->plug)
-+ io_schedule();
- mutex_lock(&journal->j_checkpoint_mutex);
-
- /*
diff --git a/fs/namespace.c b/fs/namespace.c
-index f26d18d69712..6e0e024715e8 100644
+index ec4078d16eb7..1780601dcbdd 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -14,6 +14,7 @@
@@ -11814,7 +11889,7 @@ index f26d18d69712..6e0e024715e8 100644
#include <linux/security.h>
#include <linux/idr.h>
#include <linux/init.h> /* init_rootfs */
-@@ -356,8 +357,11 @@ int __mnt_want_write(struct vfsmount *m)
+@@ -357,8 +358,11 @@ int __mnt_want_write(struct vfsmount *m)
* incremented count after it has set MNT_WRITE_HOLD.
*/
smp_mb();
@@ -12055,7 +12130,7 @@ index 8fdcb783197d..d07dbeec7bc1 100644
#endif /* _LINUX_BH_H */
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
-index 89d9aa9e79bf..4a201008b02d 100644
+index 6fe974dbe741..7242505af75c 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -75,8 +75,50 @@ struct buffer_head {
@@ -12190,10 +12265,10 @@ index 5d5aaae3af43..3bca1590e29f 100644
/**
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
-index 3ea9aae2387d..5de5f28a5ef3 100644
+index 7e04bcd9af8e..e7fa0f6935e6 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
-@@ -224,6 +224,8 @@ extern void get_online_cpus(void);
+@@ -231,6 +231,8 @@ extern void get_online_cpus(void);
extern void put_online_cpus(void);
extern void cpu_hotplug_disable(void);
extern void cpu_hotplug_enable(void);
@@ -12202,7 +12277,7 @@ index 3ea9aae2387d..5de5f28a5ef3 100644
#define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri)
#define __hotcpu_notifier(fn, pri) __cpu_notifier(fn, pri)
#define register_hotcpu_notifier(nb) register_cpu_notifier(nb)
-@@ -241,6 +243,8 @@ static inline void cpu_hotplug_done(void) {}
+@@ -248,6 +250,8 @@ static inline void cpu_hotplug_done(void) {}
#define put_online_cpus() do { } while (0)
#define cpu_hotplug_disable() do { } while (0)
#define cpu_hotplug_enable() do { } while (0)
@@ -12336,7 +12411,7 @@ index bb3f3297062a..a117a33ef72c 100644
}
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
-index 2ead22dd74a0..8fbcdfa5dc77 100644
+index 2ead22dd74a0..ff317006d3e8 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -87,6 +87,9 @@ enum hrtimer_restart {
@@ -12397,16 +12472,16 @@ index 2ead22dd74a0..8fbcdfa5dc77 100644
unsigned int cpu;
unsigned int active_bases;
unsigned int clock_was_set_seq;
-@@ -203,6 +210,9 @@ struct hrtimer_cpu_base {
+@@ -202,6 +209,9 @@ struct hrtimer_cpu_base {
+ unsigned int nr_retries;
unsigned int nr_hangs;
unsigned int max_hang_time;
- #endif
++#endif
+#ifdef CONFIG_PREEMPT_RT_BASE
+ wait_queue_head_t wait;
-+#endif
+ #endif
struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES];
} ____cacheline_aligned;
-
@@ -412,6 +422,13 @@ static inline void hrtimer_restart(struct hrtimer *timer)
hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
}
@@ -12421,15 +12496,24 @@ index 2ead22dd74a0..8fbcdfa5dc77 100644
/* Query timers: */
extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust);
-@@ -436,7 +453,7 @@ static inline int hrtimer_is_queued(struct hrtimer *timer)
+@@ -436,9 +453,15 @@ static inline int hrtimer_is_queued(struct hrtimer *timer)
* Helper function to check, whether the timer is running the callback
* function
*/
-static inline int hrtimer_callback_running(struct hrtimer *timer)
+static inline int hrtimer_callback_running(const struct hrtimer *timer)
{
- return timer->base->cpu_base->running == timer;
+- return timer->base->cpu_base->running == timer;
++ if (timer->base->cpu_base->running == timer)
++ return 1;
++#ifdef CONFIG_PREEMPT_RT_BASE
++ if (timer->base->cpu_base->running_soft == timer)
++ return 1;
++#endif
++ return 0;
}
+
+ /* Forward a hrtimer so it expires after now: */
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 013fd9bc4cb6..f62be0aec911 100644
--- a/include/linux/idr.h
@@ -12886,10 +12970,11 @@ index 50220cab738c..d68f639f7330 100644
extern void oops_enter(void);
extern void oops_exit(void);
void print_oops_end_marker(void);
-@@ -448,6 +453,14 @@ extern int sysctl_panic_on_stackoverflow;
+@@ -447,6 +452,14 @@ extern int sysctl_panic_on_stackoverflow;
+
extern bool crash_kexec_post_notifiers;
- /*
++/*
+ * panic_cpu is used for synchronizing panic() and crash_kexec() execution. It
+ * holds a CPU number which is executing panic() currently. A value of
+ * PANIC_CPU_INVALID means no CPU has entered panic() or crash_kexec().
@@ -12897,10 +12982,9 @@ index 50220cab738c..d68f639f7330 100644
+extern atomic_t panic_cpu;
+#define PANIC_CPU_INVALID -1
+
-+/*
+ /*
* Only to be used by arch init code. If the user over-wrote the default
* CONFIG_PANIC_TIMEOUT, honor it.
- */
@@ -475,6 +488,7 @@ extern enum system_states {
SYSTEM_HALT,
SYSTEM_POWER_OFF,
@@ -13063,10 +13147,10 @@ index 8132214e8efd..89ffaa7bd342 100644
static inline bool hlist_bl_is_locked(struct hlist_bl_head *b)
diff --git a/include/linux/locallock.h b/include/linux/locallock.h
new file mode 100644
-index 000000000000..e572a3971631
+index 000000000000..0baaf28dc4ee
--- /dev/null
+++ b/include/linux/locallock.h
-@@ -0,0 +1,276 @@
+@@ -0,0 +1,285 @@
+#ifndef _LINUX_LOCALLOCK_H
+#define _LINUX_LOCALLOCK_H
+
@@ -13146,6 +13230,9 @@ index 000000000000..e572a3971631
+ lv->owner = current;
+ lv->nestcnt = 1;
+ return 1;
++ } else if (lv->owner == current) {
++ lv->nestcnt++;
++ return 1;
+ }
+ return 0;
+}
@@ -13319,6 +13406,12 @@ index 000000000000..e572a3971631
+
+static inline void local_irq_lock_init(int lvar) { }
+
++#define local_trylock(lvar) \
++ ({ \
++ preempt_disable(); \
++ 1; \
++ })
++
+#define local_lock(lvar) preempt_disable()
+#define local_unlock(lvar) preempt_enable()
+#define local_lock_irq(lvar) local_irq_disable()
@@ -13344,7 +13437,7 @@ index 000000000000..e572a3971631
+
+#endif
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
-index 2ccccbfcd532..4b016eb6265b 100644
+index 36f4695aa604..2be9cca8be08 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -11,6 +11,7 @@
@@ -13355,8 +13448,8 @@ index 2ccccbfcd532..4b016eb6265b 100644
#include <linux/page-flags-layout.h>
#include <asm/page.h>
#include <asm/mmu.h>
-@@ -505,6 +506,9 @@ struct mm_struct {
- bool tlb_flush_pending;
+@@ -509,6 +510,9 @@ struct mm_struct {
+ bool tlb_flush_batched;
#endif
struct uprobes_state uprobes_state;
+#ifdef CONFIG_PREEMPT_RT_BASE
@@ -13530,7 +13623,7 @@ index 000000000000..e0284edec655
+
+#endif
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 4035bbe40971..81ebe70d107d 100644
+index fc54049e8286..5a5588a57cad 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -390,7 +390,19 @@ typedef enum rx_handler_result rx_handler_result_t;
@@ -13753,7 +13846,7 @@ index caebf2a758dc..4ecc057b6e27 100644
#if !defined(CONFIG_SMP) || !defined(CONFIG_HAVE_SETUP_PER_CPU_AREA)
diff --git a/include/linux/pid.h b/include/linux/pid.h
-index 23705a53abba..2cc64b779f03 100644
+index 97b745ddece5..01a5460a0c85 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -2,6 +2,7 @@
@@ -13765,7 +13858,7 @@ index 23705a53abba..2cc64b779f03 100644
enum pid_type
{
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
-index 75e4e30677f1..1cfb1cb72354 100644
+index 7eeceac52dea..f97c54265904 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -50,7 +50,11 @@
@@ -13798,15 +13891,15 @@ index 75e4e30677f1..1cfb1cb72354 100644
/*
* Are we doing bottom half or hardware interrupt processing?
-@@ -72,7 +82,6 @@
+@@ -79,7 +89,6 @@
#define in_irq() (hardirq_count())
#define in_softirq() (softirq_count())
#define in_interrupt() (irq_count())
-#define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
-
- /*
- * Are we in NMI context?
-@@ -91,7 +100,11 @@
+ #define in_nmi() (preempt_count() & NMI_MASK)
+ #define in_task() (!(preempt_count() & \
+ (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET)))
+@@ -96,7 +105,11 @@
/*
* The preempt_count offset after spin_lock()
*/
@@ -13818,7 +13911,7 @@ index 75e4e30677f1..1cfb1cb72354 100644
/*
* The preempt_count offset needed for things like:
-@@ -140,6 +153,20 @@ extern void preempt_count_sub(int val);
+@@ -145,6 +158,20 @@ extern void preempt_count_sub(int val);
#define preempt_count_inc() preempt_count_add(1)
#define preempt_count_dec() preempt_count_sub(1)
@@ -13839,7 +13932,7 @@ index 75e4e30677f1..1cfb1cb72354 100644
#ifdef CONFIG_PREEMPT_COUNT
#define preempt_disable() \
-@@ -148,13 +175,25 @@ do { \
+@@ -153,13 +180,25 @@ do { \
barrier(); \
} while (0)
@@ -13866,7 +13959,7 @@ index 75e4e30677f1..1cfb1cb72354 100644
#define preemptible() (preempt_count() == 0 && !irqs_disabled())
-@@ -179,6 +218,13 @@ do { \
+@@ -184,6 +223,13 @@ do { \
__preempt_schedule(); \
} while (0)
@@ -13880,7 +13973,7 @@ index 75e4e30677f1..1cfb1cb72354 100644
#else /* !CONFIG_PREEMPT */
#define preempt_enable() \
do { \
-@@ -224,6 +270,7 @@ do { \
+@@ -229,6 +275,7 @@ do { \
#define preempt_disable_notrace() barrier()
#define preempt_enable_no_resched_notrace() barrier()
#define preempt_enable_notrace() barrier()
@@ -13888,7 +13981,7 @@ index 75e4e30677f1..1cfb1cb72354 100644
#define preemptible() 0
#endif /* CONFIG_PREEMPT_COUNT */
-@@ -244,10 +291,31 @@ do { \
+@@ -249,10 +296,31 @@ do { \
} while (0)
#define preempt_fold_need_resched() \
do { \
@@ -13963,7 +14056,7 @@ index 5d5174b59802..327dddaf4c8f 100644
* struct radix_tree_iter - radix tree iterator state
*
diff --git a/include/linux/random.h b/include/linux/random.h
-index a75840c1aa71..1a804361670c 100644
+index 9c29122037f9..e7f2f8604918 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -20,7 +20,7 @@ struct random_ready_callback {
@@ -14575,7 +14668,7 @@ index 000000000000..f97860b2e2a4
+#endif
+#endif
diff --git a/include/linux/sched.h b/include/linux/sched.h
-index 352213b360d7..1c7aa9446684 100644
+index e887c8d6f395..f37654adf12a 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -26,6 +26,7 @@ struct sched_param {
@@ -14595,7 +14688,14 @@ index 352213b360d7..1c7aa9446684 100644
extern void dump_cpu_task(int cpu);
struct seq_file;
-@@ -242,10 +241,7 @@ extern char ___assert_task_state[1 - 2*!!(
+@@ -235,17 +234,13 @@ extern char ___assert_task_state[1 - 2*!!(
+
+ /* Convenience macros for the sake of wake_up */
+ #define TASK_NORMAL (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
+-#define TASK_ALL (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED)
+
+ /* get_task_state() */
+ #define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \
TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
__TASK_TRACED | EXIT_ZOMBIE | EXIT_DEAD)
@@ -14606,7 +14706,7 @@ index 352213b360d7..1c7aa9446684 100644
#define task_contributes_to_load(task) \
((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
(task->flags & PF_FROZEN) == 0 && \
-@@ -311,6 +307,11 @@ extern char ___assert_task_state[1 - 2*!!(
+@@ -311,6 +306,11 @@ extern char ___assert_task_state[1 - 2*!!(
#endif
@@ -14618,13 +14718,27 @@ index 352213b360d7..1c7aa9446684 100644
/* Task command name length */
#define TASK_COMM_LEN 16
-@@ -970,8 +971,18 @@ struct wake_q_head {
+@@ -979,9 +979,31 @@ struct wake_q_head {
+ #define WAKE_Q(name) \
struct wake_q_head name = { WAKE_Q_TAIL, &name.first }
- extern void wake_q_add(struct wake_q_head *head,
+-extern void wake_q_add(struct wake_q_head *head,
- struct task_struct *task);
-extern void wake_up_q(struct wake_q_head *head);
-+ struct task_struct *task);
++extern void __wake_q_add(struct wake_q_head *head,
++ struct task_struct *task, bool sleeper);
++static inline void wake_q_add(struct wake_q_head *head,
++ struct task_struct *task)
++{
++ __wake_q_add(head, task, false);
++}
++
++static inline void wake_q_add_sleeper(struct wake_q_head *head,
++ struct task_struct *task)
++{
++ __wake_q_add(head, task, true);
++}
++
+extern void __wake_up_q(struct wake_q_head *head, bool sleeper);
+
+static inline void wake_up_q(struct wake_q_head *head)
@@ -14639,7 +14753,7 @@ index 352213b360d7..1c7aa9446684 100644
/*
* sched-domains (multiprocessor balancing) declarations:
-@@ -1379,6 +1390,7 @@ struct tlbflush_unmap_batch {
+@@ -1389,6 +1411,7 @@ struct tlbflush_unmap_batch {
struct task_struct {
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
@@ -14647,12 +14761,13 @@ index 352213b360d7..1c7aa9446684 100644
void *stack;
atomic_t usage;
unsigned int flags; /* per process flags, defined below */
-@@ -1415,6 +1427,12 @@ struct task_struct {
+@@ -1425,6 +1448,13 @@ struct task_struct {
#endif
unsigned int policy;
+#ifdef CONFIG_PREEMPT_RT_FULL
+ int migrate_disable;
++ int migrate_disable_update;
+# ifdef CONFIG_SCHED_DEBUG
+ int migrate_disable_atomic;
+# endif
@@ -14660,7 +14775,7 @@ index 352213b360d7..1c7aa9446684 100644
int nr_cpus_allowed;
cpumask_t cpus_allowed;
-@@ -1526,11 +1544,14 @@ struct task_struct {
+@@ -1536,11 +1566,14 @@ struct task_struct {
cputime_t gtime;
struct prev_cputime prev_cputime;
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
@@ -14677,7 +14792,7 @@ index 352213b360d7..1c7aa9446684 100644
VTIME_SYS,
} vtime_snap_whence;
#endif
-@@ -1542,6 +1563,9 @@ struct task_struct {
+@@ -1552,6 +1585,9 @@ struct task_struct {
struct task_cputime cputime_expires;
struct list_head cpu_timers[3];
@@ -14687,7 +14802,7 @@ index 352213b360d7..1c7aa9446684 100644
/* process credentials */
const struct cred __rcu *ptracer_cred; /* Tracer's credentials at attach */
-@@ -1573,10 +1597,15 @@ struct task_struct {
+@@ -1583,10 +1619,15 @@ struct task_struct {
/* signal handlers */
struct signal_struct *signal;
struct sighand_struct *sighand;
@@ -14703,7 +14818,15 @@ index 352213b360d7..1c7aa9446684 100644
unsigned long sas_ss_sp;
size_t sas_ss_size;
-@@ -1800,6 +1829,12 @@ struct task_struct {
+@@ -1611,6 +1652,7 @@ struct task_struct {
+ raw_spinlock_t pi_lock;
+
+ struct wake_q_node wake_q;
++ struct wake_q_node wake_q_sleeper;
+
+ #ifdef CONFIG_RT_MUTEXES
+ /* PI waiters blocked on a rt_mutex held by this task */
+@@ -1810,6 +1852,12 @@ struct task_struct {
unsigned long trace;
/* bitmask and counter of trace recursion */
unsigned long trace_recursion;
@@ -14716,7 +14839,7 @@ index 352213b360d7..1c7aa9446684 100644
#endif /* CONFIG_TRACING */
#ifdef CONFIG_MEMCG
struct mem_cgroup *memcg_in_oom;
-@@ -1816,9 +1851,23 @@ struct task_struct {
+@@ -1826,8 +1874,22 @@ struct task_struct {
unsigned int sequential_io;
unsigned int sequential_io_avg;
#endif
@@ -14733,14 +14856,13 @@ index 352213b360d7..1c7aa9446684 100644
+#endif
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
unsigned long task_state_change;
- #endif
++#endif
+#ifdef CONFIG_PREEMPT_RT_FULL
+ int xmit_recursion;
-+#endif
+ #endif
int pagefault_disabled;
/* CPU-specific state of this task */
- struct thread_struct thread;
-@@ -1836,9 +1885,6 @@ extern int arch_task_struct_size __read_mostly;
+@@ -1846,9 +1908,6 @@ extern int arch_task_struct_size __read_mostly;
# define arch_task_struct_size (sizeof(struct task_struct))
#endif
@@ -14750,7 +14872,7 @@ index 352213b360d7..1c7aa9446684 100644
#define TNF_MIGRATED 0x01
#define TNF_NO_GROUP 0x02
#define TNF_SHARED 0x04
-@@ -2028,6 +2074,15 @@ extern struct pid *cad_pid;
+@@ -2042,6 +2101,15 @@ extern struct pid *cad_pid;
extern void free_task(struct task_struct *tsk);
#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
@@ -14766,7 +14888,7 @@ index 352213b360d7..1c7aa9446684 100644
extern void __put_task_struct(struct task_struct *t);
static inline void put_task_struct(struct task_struct *t)
-@@ -2035,6 +2090,7 @@ static inline void put_task_struct(struct task_struct *t)
+@@ -2049,6 +2117,7 @@ static inline void put_task_struct(struct task_struct *t)
if (atomic_dec_and_test(&t->usage))
__put_task_struct(t);
}
@@ -14774,7 +14896,7 @@ index 352213b360d7..1c7aa9446684 100644
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
extern void task_cputime(struct task_struct *t,
-@@ -2073,6 +2129,7 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut,
+@@ -2087,6 +2156,7 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut,
/*
* Per process flags
*/
@@ -14782,7 +14904,7 @@ index 352213b360d7..1c7aa9446684 100644
#define PF_EXITING 0x00000004 /* getting shut down */
#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */
#define PF_VCPU 0x00000010 /* I'm a virtual CPU */
-@@ -2237,6 +2294,10 @@ extern void do_set_cpus_allowed(struct task_struct *p,
+@@ -2251,6 +2321,10 @@ extern void do_set_cpus_allowed(struct task_struct *p,
extern int set_cpus_allowed_ptr(struct task_struct *p,
const struct cpumask *new_mask);
@@ -14793,7 +14915,7 @@ index 352213b360d7..1c7aa9446684 100644
#else
static inline void do_set_cpus_allowed(struct task_struct *p,
const struct cpumask *new_mask)
-@@ -2249,6 +2310,9 @@ static inline int set_cpus_allowed_ptr(struct task_struct *p,
+@@ -2263,6 +2337,9 @@ static inline int set_cpus_allowed_ptr(struct task_struct *p,
return -EINVAL;
return 0;
}
@@ -14803,7 +14925,7 @@ index 352213b360d7..1c7aa9446684 100644
#endif
#ifdef CONFIG_NO_HZ_COMMON
-@@ -2458,6 +2522,7 @@ extern void xtime_update(unsigned long ticks);
+@@ -2472,6 +2549,7 @@ extern void xtime_update(unsigned long ticks);
extern int wake_up_state(struct task_struct *tsk, unsigned int state);
extern int wake_up_process(struct task_struct *tsk);
@@ -14811,7 +14933,7 @@ index 352213b360d7..1c7aa9446684 100644
extern void wake_up_new_task(struct task_struct *tsk);
#ifdef CONFIG_SMP
extern void kick_process(struct task_struct *tsk);
-@@ -2581,12 +2646,24 @@ extern struct mm_struct * mm_alloc(void);
+@@ -2595,12 +2673,24 @@ extern struct mm_struct * mm_alloc(void);
/* mmdrop drops the mm and the page tables */
extern void __mmdrop(struct mm_struct *);
@@ -14836,7 +14958,7 @@ index 352213b360d7..1c7aa9446684 100644
/* mmput gets rid of the mappings and all user-space */
extern void mmput(struct mm_struct *);
/* Grab a reference to a task's mm, if it is not already going away */
-@@ -2896,6 +2973,43 @@ static inline int test_tsk_need_resched(struct task_struct *tsk)
+@@ -2910,6 +3000,43 @@ static inline int test_tsk_need_resched(struct task_struct *tsk)
return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED));
}
@@ -14880,7 +15002,7 @@ index 352213b360d7..1c7aa9446684 100644
static inline int restart_syscall(void)
{
set_tsk_thread_flag(current, TIF_SIGPENDING);
-@@ -2927,6 +3041,51 @@ static inline int signal_pending_state(long state, struct task_struct *p)
+@@ -2941,6 +3068,51 @@ static inline int signal_pending_state(long state, struct task_struct *p)
return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
}
@@ -14932,7 +15054,7 @@ index 352213b360d7..1c7aa9446684 100644
/*
* cond_resched() and cond_resched_lock(): latency reduction via
* explicit rescheduling in places that are safe. The return
-@@ -2948,12 +3107,16 @@ extern int __cond_resched_lock(spinlock_t *lock);
+@@ -2962,12 +3134,16 @@ extern int __cond_resched_lock(spinlock_t *lock);
__cond_resched_lock(lock); \
})
@@ -14949,7 +15071,7 @@ index 352213b360d7..1c7aa9446684 100644
static inline void cond_resched_rcu(void)
{
-@@ -3115,6 +3278,31 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
+@@ -3129,6 +3305,31 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
#endif /* CONFIG_SMP */
@@ -15127,7 +15249,7 @@ index d80259afb9e5..ddd1e6866a54 100644
/* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */
static inline int valid_signal(unsigned long sig)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
-index d443d9ab0236..2d1c7f9b7fd0 100644
+index b5421f6f155a..b05be76fc504 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -203,6 +203,7 @@ struct sk_buff_head {
@@ -15138,7 +15260,7 @@ index d443d9ab0236..2d1c7f9b7fd0 100644
};
struct sk_buff;
-@@ -1465,6 +1466,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list)
+@@ -1462,6 +1463,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list)
__skb_queue_head_init(list);
}
@@ -15967,7 +16089,7 @@ index 61aa61dc410c..299d2b78591f 100644
#else
# define del_timer_sync(t) del_timer(t)
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
-index 925730bc9fc1..a591f414da6f 100644
+index 311176f290b2..62d4bff5f477 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -66,6 +66,9 @@ struct trace_entry {
@@ -16049,10 +16171,10 @@ index 513b36f04dfd..981c8a840f96 100644
typedef struct __wait_queue wait_queue_t;
typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
diff --git a/include/net/dst.h b/include/net/dst.h
-index c7329dcd90cc..35c3dba16728 100644
+index e4f450617919..16cd3ef62202 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
-@@ -437,7 +437,7 @@ static inline void dst_confirm(struct dst_entry *dst)
+@@ -443,7 +443,7 @@ static inline void dst_confirm(struct dst_entry *dst)
static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n,
struct sk_buff *skb)
{
@@ -16620,17 +16742,17 @@ diff --git a/init/Makefile b/init/Makefile
index 7bc47ee31c36..88cf473554e0 100644
--- a/init/Makefile
+++ b/init/Makefile
-@@ -33,4 +33,4 @@ silent_chk_compile.h = :
+@@ -33,4 +33,4 @@ $(obj)/version.o: include/generated/compile.h
include/generated/compile.h: FORCE
@$($(quiet)chk_compile.h)
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
- "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
+ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CONFIG_PREEMPT_RT_FULL)" "$(CC) $(KBUILD_CFLAGS)"
diff --git a/init/main.c b/init/main.c
-index 9e64d7097f1a..4a76e629c137 100644
+index 49926d95442f..995cbb8d09b6 100644
--- a/init/main.c
+++ b/init/main.c
-@@ -530,6 +530,7 @@ asmlinkage __visible void __init start_kernel(void)
+@@ -532,6 +532,7 @@ asmlinkage __visible void __init start_kernel(void)
setup_command_line(command_line);
setup_nr_cpu_ids();
setup_per_cpu_areas();
@@ -16845,7 +16967,7 @@ diff --git a/ipc/sem.c b/ipc/sem.c
index 9862c3d1c26d..ef34d7376697 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
-@@ -708,6 +708,13 @@ undo:
+@@ -708,6 +708,13 @@ static int perform_atomic_semop(struct sem_array *sma, struct sem_queue *q)
static void wake_up_sem_queue_prepare(struct list_head *pt,
struct sem_queue *q, int error)
{
@@ -17377,11 +17499,126 @@ index 40d20bf5de28..0be18c1684d8 100644
return err;
}
+diff --git a/kernel/cpu_pm.c b/kernel/cpu_pm.c
+index 009cc9a17d95..10f4640f991e 100644
+--- a/kernel/cpu_pm.c
++++ b/kernel/cpu_pm.c
+@@ -22,14 +22,13 @@
+ #include <linux/spinlock.h>
+ #include <linux/syscore_ops.h>
+
+-static DEFINE_RWLOCK(cpu_pm_notifier_lock);
+-static RAW_NOTIFIER_HEAD(cpu_pm_notifier_chain);
++static ATOMIC_NOTIFIER_HEAD(cpu_pm_notifier_chain);
+
+ static int cpu_pm_notify(enum cpu_pm_event event, int nr_to_call, int *nr_calls)
+ {
+ int ret;
+
+- ret = __raw_notifier_call_chain(&cpu_pm_notifier_chain, event, NULL,
++ ret = __atomic_notifier_call_chain(&cpu_pm_notifier_chain, event, NULL,
+ nr_to_call, nr_calls);
+
+ return notifier_to_errno(ret);
+@@ -47,14 +46,7 @@ static int cpu_pm_notify(enum cpu_pm_event event, int nr_to_call, int *nr_calls)
+ */
+ int cpu_pm_register_notifier(struct notifier_block *nb)
+ {
+- unsigned long flags;
+- int ret;
+-
+- write_lock_irqsave(&cpu_pm_notifier_lock, flags);
+- ret = raw_notifier_chain_register(&cpu_pm_notifier_chain, nb);
+- write_unlock_irqrestore(&cpu_pm_notifier_lock, flags);
+-
+- return ret;
++ return atomic_notifier_chain_register(&cpu_pm_notifier_chain, nb);
+ }
+ EXPORT_SYMBOL_GPL(cpu_pm_register_notifier);
+
+@@ -69,14 +61,7 @@ EXPORT_SYMBOL_GPL(cpu_pm_register_notifier);
+ */
+ int cpu_pm_unregister_notifier(struct notifier_block *nb)
+ {
+- unsigned long flags;
+- int ret;
+-
+- write_lock_irqsave(&cpu_pm_notifier_lock, flags);
+- ret = raw_notifier_chain_unregister(&cpu_pm_notifier_chain, nb);
+- write_unlock_irqrestore(&cpu_pm_notifier_lock, flags);
+-
+- return ret;
++ return atomic_notifier_chain_unregister(&cpu_pm_notifier_chain, nb);
+ }
+ EXPORT_SYMBOL_GPL(cpu_pm_unregister_notifier);
+
+@@ -100,7 +85,6 @@ int cpu_pm_enter(void)
+ int nr_calls;
+ int ret = 0;
+
+- read_lock(&cpu_pm_notifier_lock);
+ ret = cpu_pm_notify(CPU_PM_ENTER, -1, &nr_calls);
+ if (ret)
+ /*
+@@ -108,7 +92,6 @@ int cpu_pm_enter(void)
+ * PM entry who are notified earlier to prepare for it.
+ */
+ cpu_pm_notify(CPU_PM_ENTER_FAILED, nr_calls - 1, NULL);
+- read_unlock(&cpu_pm_notifier_lock);
+
+ return ret;
+ }
+@@ -128,13 +111,7 @@ EXPORT_SYMBOL_GPL(cpu_pm_enter);
+ */
+ int cpu_pm_exit(void)
+ {
+- int ret;
+-
+- read_lock(&cpu_pm_notifier_lock);
+- ret = cpu_pm_notify(CPU_PM_EXIT, -1, NULL);
+- read_unlock(&cpu_pm_notifier_lock);
+-
+- return ret;
++ return cpu_pm_notify(CPU_PM_EXIT, -1, NULL);
+ }
+ EXPORT_SYMBOL_GPL(cpu_pm_exit);
+
+@@ -159,7 +136,6 @@ int cpu_cluster_pm_enter(void)
+ int nr_calls;
+ int ret = 0;
+
+- read_lock(&cpu_pm_notifier_lock);
+ ret = cpu_pm_notify(CPU_CLUSTER_PM_ENTER, -1, &nr_calls);
+ if (ret)
+ /*
+@@ -167,7 +143,6 @@ int cpu_cluster_pm_enter(void)
+ * PM entry who are notified earlier to prepare for it.
+ */
+ cpu_pm_notify(CPU_CLUSTER_PM_ENTER_FAILED, nr_calls - 1, NULL);
+- read_unlock(&cpu_pm_notifier_lock);
+
+ return ret;
+ }
+@@ -190,13 +165,7 @@ EXPORT_SYMBOL_GPL(cpu_cluster_pm_enter);
+ */
+ int cpu_cluster_pm_exit(void)
+ {
+- int ret;
+-
+- read_lock(&cpu_pm_notifier_lock);
+- ret = cpu_pm_notify(CPU_CLUSTER_PM_EXIT, -1, NULL);
+- read_unlock(&cpu_pm_notifier_lock);
+-
+- return ret;
++ return cpu_pm_notify(CPU_CLUSTER_PM_EXIT, -1, NULL);
+ }
+ EXPORT_SYMBOL_GPL(cpu_cluster_pm_exit);
+
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
-index b271353d5202..dd7b87b7f618 100644
+index dd3ae6ee064d..8dc21a9ac292 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
-@@ -283,7 +283,7 @@ static struct cpuset top_cpuset = {
+@@ -284,7 +284,7 @@ static struct cpuset top_cpuset = {
*/
static DEFINE_MUTEX(cpuset_mutex);
@@ -17390,7 +17627,7 @@ index b271353d5202..dd7b87b7f618 100644
static struct workqueue_struct *cpuset_migrate_mm_wq;
-@@ -906,9 +906,9 @@ static void update_cpumasks_hier(struct cpuset *cs, struct cpumask *new_cpus)
+@@ -907,9 +907,9 @@ static void update_cpumasks_hier(struct cpuset *cs, struct cpumask *new_cpus)
continue;
rcu_read_unlock();
@@ -17402,7 +17639,7 @@ index b271353d5202..dd7b87b7f618 100644
WARN_ON(!cgroup_subsys_on_dfl(cpuset_cgrp_subsys) &&
!cpumask_equal(cp->cpus_allowed, cp->effective_cpus));
-@@ -973,9 +973,9 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
+@@ -974,9 +974,9 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
if (retval < 0)
return retval;
@@ -17414,7 +17651,7 @@ index b271353d5202..dd7b87b7f618 100644
/* use trialcs->cpus_allowed as a temp variable */
update_cpumasks_hier(cs, trialcs->cpus_allowed);
-@@ -1184,9 +1184,9 @@ static void update_nodemasks_hier(struct cpuset *cs, nodemask_t *new_mems)
+@@ -1185,9 +1185,9 @@ static void update_nodemasks_hier(struct cpuset *cs, nodemask_t *new_mems)
continue;
rcu_read_unlock();
@@ -17426,7 +17663,7 @@ index b271353d5202..dd7b87b7f618 100644
WARN_ON(!cgroup_subsys_on_dfl(cpuset_cgrp_subsys) &&
!nodes_equal(cp->mems_allowed, cp->effective_mems));
-@@ -1254,9 +1254,9 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs,
+@@ -1255,9 +1255,9 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs,
if (retval < 0)
goto done;
@@ -17438,7 +17675,7 @@ index b271353d5202..dd7b87b7f618 100644
/* use trialcs->mems_allowed as a temp variable */
update_nodemasks_hier(cs, &trialcs->mems_allowed);
-@@ -1347,9 +1347,9 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs,
+@@ -1348,9 +1348,9 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs,
spread_flag_changed = ((is_spread_slab(cs) != is_spread_slab(trialcs))
|| (is_spread_page(cs) != is_spread_page(trialcs)));
@@ -17450,7 +17687,7 @@ index b271353d5202..dd7b87b7f618 100644
if (!cpumask_empty(trialcs->cpus_allowed) && balance_flag_changed)
rebuild_sched_domains_locked();
-@@ -1761,7 +1761,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v)
+@@ -1762,7 +1762,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v)
cpuset_filetype_t type = seq_cft(sf)->private;
int ret = 0;
@@ -17459,7 +17696,7 @@ index b271353d5202..dd7b87b7f618 100644
switch (type) {
case FILE_CPULIST:
-@@ -1780,7 +1780,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v)
+@@ -1781,7 +1781,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v)
ret = -EINVAL;
}
@@ -17468,7 +17705,7 @@ index b271353d5202..dd7b87b7f618 100644
return ret;
}
-@@ -1994,12 +1994,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
+@@ -1996,12 +1996,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
cpuset_inc();
@@ -17483,7 +17720,7 @@ index b271353d5202..dd7b87b7f618 100644
if (!test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags))
goto out_unlock;
-@@ -2026,12 +2026,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
+@@ -2028,12 +2028,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
}
rcu_read_unlock();
@@ -17498,7 +17735,7 @@ index b271353d5202..dd7b87b7f618 100644
out_unlock:
mutex_unlock(&cpuset_mutex);
return 0;
-@@ -2070,7 +2070,7 @@ static void cpuset_css_free(struct cgroup_subsys_state *css)
+@@ -2072,7 +2072,7 @@ static void cpuset_css_free(struct cgroup_subsys_state *css)
static void cpuset_bind(struct cgroup_subsys_state *root_css)
{
mutex_lock(&cpuset_mutex);
@@ -17507,7 +17744,7 @@ index b271353d5202..dd7b87b7f618 100644
if (cgroup_subsys_on_dfl(cpuset_cgrp_subsys)) {
cpumask_copy(top_cpuset.cpus_allowed, cpu_possible_mask);
-@@ -2081,7 +2081,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css)
+@@ -2083,7 +2083,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css)
top_cpuset.mems_allowed = top_cpuset.effective_mems;
}
@@ -17516,7 +17753,7 @@ index b271353d5202..dd7b87b7f618 100644
mutex_unlock(&cpuset_mutex);
}
-@@ -2182,12 +2182,12 @@ hotplug_update_tasks_legacy(struct cpuset *cs,
+@@ -2184,12 +2184,12 @@ hotplug_update_tasks_legacy(struct cpuset *cs,
{
bool is_empty;
@@ -17531,7 +17768,7 @@ index b271353d5202..dd7b87b7f618 100644
/*
* Don't call update_tasks_cpumask() if the cpuset becomes empty,
-@@ -2224,10 +2224,10 @@ hotplug_update_tasks(struct cpuset *cs,
+@@ -2226,10 +2226,10 @@ hotplug_update_tasks(struct cpuset *cs,
if (nodes_empty(*new_mems))
*new_mems = parent_cs(cs)->effective_mems;
@@ -17544,7 +17781,7 @@ index b271353d5202..dd7b87b7f618 100644
if (cpus_updated)
update_tasks_cpumask(cs);
-@@ -2313,21 +2313,21 @@ static void cpuset_hotplug_workfn(struct work_struct *work)
+@@ -2322,21 +2322,21 @@ static void cpuset_hotplug_workfn(struct work_struct *work)
/* synchronize cpus_allowed to cpu_active_mask */
if (cpus_updated) {
@@ -17570,7 +17807,7 @@ index b271353d5202..dd7b87b7f618 100644
update_tasks_nodemask(&top_cpuset);
}
-@@ -2425,11 +2425,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask)
+@@ -2441,11 +2441,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask)
{
unsigned long flags;
@@ -17584,7 +17821,7 @@ index b271353d5202..dd7b87b7f618 100644
}
void cpuset_cpus_allowed_fallback(struct task_struct *tsk)
-@@ -2477,11 +2477,11 @@ nodemask_t cpuset_mems_allowed(struct task_struct *tsk)
+@@ -2493,11 +2493,11 @@ nodemask_t cpuset_mems_allowed(struct task_struct *tsk)
nodemask_t mask;
unsigned long flags;
@@ -17598,7 +17835,7 @@ index b271353d5202..dd7b87b7f618 100644
return mask;
}
-@@ -2573,14 +2573,14 @@ int __cpuset_node_allowed(int node, gfp_t gfp_mask)
+@@ -2589,14 +2589,14 @@ int __cpuset_node_allowed(int node, gfp_t gfp_mask)
return 1;
/* Not hardwall and node outside mems_allowed: scan up cpusets */
@@ -17616,7 +17853,7 @@ index b271353d5202..dd7b87b7f618 100644
}
diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c
-index fc1ef736253c..83c666537a7a 100644
+index 77777d918676..3203e9dee9f8 100644
--- a/kernel/debug/kdb/kdb_io.c
+++ b/kernel/debug/kdb/kdb_io.c
@@ -554,7 +554,6 @@ int vkdb_printf(enum kdb_msgsrc src, const char *fmt, va_list ap)
@@ -17636,7 +17873,7 @@ index fc1ef736253c..83c666537a7a 100644
/* Serialize kdb_printf if multiple cpus try to write at once.
* But if any cpu goes recursive in kdb, just print the output,
-@@ -855,7 +852,6 @@ kdb_print_out:
+@@ -855,7 +852,6 @@ int vkdb_printf(enum kdb_msgsrc src, const char *fmt, va_list ap)
} else {
__release(kdb_printf_lock);
}
@@ -17657,7 +17894,7 @@ index fc1ef736253c..83c666537a7a 100644
return r;
}
diff --git a/kernel/events/core.c b/kernel/events/core.c
-index 784ab8fe8714..03166fb2364e 100644
+index 8f75386e61a7..489cf0e1ac9c 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -802,6 +802,7 @@ static void __perf_mux_hrtimer_init(struct perf_cpu_context *cpuctx, int cpu)
@@ -17668,7 +17905,7 @@ index 784ab8fe8714..03166fb2364e 100644
}
static int perf_mux_hrtimer_restart(struct perf_cpu_context *cpuctx)
-@@ -7240,6 +7241,7 @@ static void perf_swevent_init_hrtimer(struct perf_event *event)
+@@ -7241,6 +7242,7 @@ static void perf_swevent_init_hrtimer(struct perf_event *event)
hrtimer_init(&hwc->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hwc->hrtimer.function = perf_swevent_hrtimer;
@@ -17690,10 +17927,10 @@ index ffba5df4abd5..e199407f8831 100644
spin_unlock(&sighand->siglock);
diff --git a/kernel/fork.c b/kernel/fork.c
-index 0ee630f3ad4b..0fe2c188e94d 100644
+index ac00f14208b7..9859641947bd 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -108,7 +108,7 @@ int max_threads; /* tunable limit on nr_threads */
+@@ -109,7 +109,7 @@ int max_threads; /* tunable limit on nr_threads */
DEFINE_PER_CPU(unsigned long, process_counts) = 0;
@@ -17702,7 +17939,7 @@ index 0ee630f3ad4b..0fe2c188e94d 100644
#ifdef CONFIG_PROVE_RCU
int lockdep_tasklist_lock_is_held(void)
-@@ -244,7 +244,9 @@ static inline void put_signal_struct(struct signal_struct *sig)
+@@ -246,7 +246,9 @@ static inline void put_signal_struct(struct signal_struct *sig)
if (atomic_dec_and_test(&sig->sigcnt))
free_signal_struct(sig);
}
@@ -17713,7 +17950,7 @@ index 0ee630f3ad4b..0fe2c188e94d 100644
void __put_task_struct(struct task_struct *tsk)
{
WARN_ON(!tsk->exit_state);
-@@ -261,7 +263,18 @@ void __put_task_struct(struct task_struct *tsk)
+@@ -263,7 +265,18 @@ void __put_task_struct(struct task_struct *tsk)
if (!profile_handoff_task(tsk))
free_task(tsk);
}
@@ -17732,7 +17969,15 @@ index 0ee630f3ad4b..0fe2c188e94d 100644
void __init __weak arch_task_cache_init(void) { }
-@@ -693,6 +706,19 @@ void __mmdrop(struct mm_struct *mm)
+@@ -388,6 +401,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
+ tsk->splice_pipe = NULL;
+ tsk->task_frag.page = NULL;
+ tsk->wake_q.next = NULL;
++ tsk->wake_q_sleeper.next = NULL;
+
+ account_kernel_stack(ti, 1);
+
+@@ -699,6 +713,19 @@ void __mmdrop(struct mm_struct *mm)
}
EXPORT_SYMBOL_GPL(__mmdrop);
@@ -17752,7 +17997,7 @@ index 0ee630f3ad4b..0fe2c188e94d 100644
/*
* Decrement the use count and release all resources for an mm.
*/
-@@ -1243,6 +1269,9 @@ static void rt_mutex_init_task(struct task_struct *p)
+@@ -1249,6 +1276,9 @@ static void rt_mutex_init_task(struct task_struct *p)
*/
static void posix_cpu_timers_init(struct task_struct *tsk)
{
@@ -17762,7 +18007,7 @@ index 0ee630f3ad4b..0fe2c188e94d 100644
tsk->cputime_expires.prof_exp = 0;
tsk->cputime_expires.virt_exp = 0;
tsk->cputime_expires.sched_exp = 0;
-@@ -1369,15 +1398,16 @@ static struct task_struct *copy_process(unsigned long clone_flags,
+@@ -1375,15 +1405,16 @@ static struct task_struct *copy_process(unsigned long clone_flags,
spin_lock_init(&p->alloc_lock);
init_sigpending(&p->pending);
@@ -17782,7 +18027,7 @@ index 0ee630f3ad4b..0fe2c188e94d 100644
#if defined(SPLIT_RSS_COUNTING)
diff --git a/kernel/futex.c b/kernel/futex.c
-index 3057dabf726f..9604b73ada47 100644
+index fc68462801de..b577ac5dc4a0 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -815,7 +815,9 @@ void exit_pi_state_list(struct task_struct *curr)
@@ -17856,7 +18101,7 @@ index 3057dabf726f..9604b73ada47 100644
if (deboost)
rt_mutex_adjust_prio(current);
-@@ -1822,6 +1827,16 @@ retry_private:
+@@ -1822,6 +1827,16 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags,
requeue_pi_wake_futex(this, &key2, hb2);
drop_count++;
continue;
@@ -17873,7 +18118,7 @@ index 3057dabf726f..9604b73ada47 100644
} else if (ret) {
/* -EDEADLK */
this->pi_state = NULL;
-@@ -2139,11 +2154,11 @@ static int fixup_owner(u32 __user *uaddr, struct futex_q *q, int locked)
+@@ -2143,11 +2158,11 @@ static int fixup_owner(u32 __user *uaddr, struct futex_q *q, int locked)
* we returned due to timeout or signal without taking the
* rt_mutex. Too late.
*/
@@ -17887,7 +18132,7 @@ index 3057dabf726f..9604b73ada47 100644
ret = fixup_pi_state_owner(uaddr, q, owner);
goto out;
}
-@@ -2690,7 +2705,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
+@@ -2694,7 +2709,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
{
struct hrtimer_sleeper timeout, *to = NULL;
struct rt_mutex_waiter rt_waiter;
@@ -17896,7 +18141,7 @@ index 3057dabf726f..9604b73ada47 100644
union futex_key key2 = FUTEX_KEY_INIT;
struct futex_q q = futex_q_init;
int res, ret;
-@@ -2715,10 +2730,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
+@@ -2719,10 +2734,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
* The waiter is allocated on our stack, manipulated by the requeue
* code while we sleep on uaddr.
*/
@@ -17908,7 +18153,7 @@ index 3057dabf726f..9604b73ada47 100644
ret = get_futex_key(uaddr2, flags & FLAGS_SHARED, &key2, VERIFY_WRITE);
if (unlikely(ret != 0))
-@@ -2749,20 +2761,55 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
+@@ -2753,20 +2765,55 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
/* Queue the futex_q, drop the hb lock, wait for wakeup. */
futex_wait_queue_me(hb, &q, to);
@@ -17975,7 +18220,7 @@ index 3057dabf726f..9604b73ada47 100644
/* Check if the requeue code acquired the second futex for us. */
if (!q.rt_waiter) {
-@@ -2771,7 +2818,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
+@@ -2775,7 +2822,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
* did a lock-steal - fix up the PI-state in that case.
*/
if (q.pi_state && (q.pi_state->owner != current)) {
@@ -17985,7 +18230,7 @@ index 3057dabf726f..9604b73ada47 100644
ret = fixup_pi_state_owner(uaddr2, &q, current);
if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current)
rt_mutex_unlock(&q.pi_state->pi_mutex);
-@@ -2780,7 +2828,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
+@@ -2784,7 +2832,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
* the requeue_pi() code acquired for us.
*/
free_pi_state(q.pi_state);
@@ -17994,7 +18239,7 @@ index 3057dabf726f..9604b73ada47 100644
}
} else {
struct rt_mutex *pi_mutex;
-@@ -2795,7 +2843,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
+@@ -2799,7 +2847,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
ret = rt_mutex_finish_proxy_lock(pi_mutex, to, &rt_waiter);
debug_rt_mutex_free_waiter(&rt_waiter);
@@ -18065,7 +18310,7 @@ index 239e2ae2c947..0b73349a42d5 100644
#else
static void __init init_irq_default_affinity(void)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
-index 6ead200370da..8e89554aa345 100644
+index a079ed14f230..2cf55df7ad0e 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -22,6 +22,7 @@
@@ -18177,7 +18422,7 @@ index 6ead200370da..8e89554aa345 100644
struct irq_desc *desc = irq_to_desc(notify->irq);
cpumask_var_t cpumask;
unsigned long flags;
-@@ -283,6 +349,13 @@ out:
+@@ -283,6 +349,13 @@ static void irq_affinity_notify(struct work_struct *work)
kref_put(&notify->kref, notify->release);
}
@@ -18230,7 +18475,7 @@ index 6ead200370da..8e89554aa345 100644
wake_threads_waitq(desc);
}
-@@ -1315,6 +1404,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
+@@ -1317,6 +1406,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
irqd_set(&desc->irq_data, IRQD_NO_BALANCING);
}
@@ -18240,7 +18485,7 @@ index 6ead200370da..8e89554aa345 100644
/* Set default affinity mask once everything is setup */
setup_affinity(desc, mask);
-@@ -1968,7 +2060,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state);
+@@ -1970,7 +2062,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state);
* This call sets the internal irqchip state of an interrupt,
* depending on the value of @which.
*
@@ -18674,7 +18919,7 @@ index 951cfcd10b4a..57e0ea72c28a 100644
+}
+#endif
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
-index 60ace56618f6..fd54dbf686cc 100644
+index 0e2c4911ba61..aed13ffa9fd3 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -668,6 +668,7 @@ look_up_lock_class(struct lockdep_map *lock, unsigned int subclass)
@@ -18744,7 +18989,7 @@ index 60ace56618f6..fd54dbf686cc 100644
return NULL;
}
-@@ -3278,7 +3291,7 @@ static int match_held_lock(struct held_lock *hlock, struct lockdep_map *lock)
+@@ -3285,7 +3298,7 @@ static int match_held_lock(struct held_lock *hlock, struct lockdep_map *lock)
* Clearly if the lock hasn't been acquired _ever_, we're not
* holding it either, so report failure.
*/
@@ -18753,7 +18998,7 @@ index 60ace56618f6..fd54dbf686cc 100644
return 0;
/*
-@@ -3525,6 +3538,7 @@ static void check_flags(unsigned long flags)
+@@ -3532,6 +3545,7 @@ static void check_flags(unsigned long flags)
}
}
@@ -18761,7 +19006,7 @@ index 60ace56618f6..fd54dbf686cc 100644
/*
* We dont accurately track softirq state in e.g.
* hardirq contexts (such as on 4KSTACKS), so only
-@@ -3539,6 +3553,7 @@ static void check_flags(unsigned long flags)
+@@ -3546,6 +3560,7 @@ static void check_flags(unsigned long flags)
DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled);
}
}
@@ -18769,7 +19014,7 @@ index 60ace56618f6..fd54dbf686cc 100644
if (!debug_locks)
print_irqtrace_events(current);
-@@ -3977,7 +3992,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
+@@ -3984,7 +3999,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
* If the class exists we look it up and zap it:
*/
class = look_up_lock_class(lock, j);
@@ -18779,7 +19024,7 @@ index 60ace56618f6..fd54dbf686cc 100644
}
/*
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
-index 8ef1919d63b2..291fc19e28e0 100644
+index d580b7d6ee6d..4680c502b65b 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -26,7 +26,6 @@
@@ -19271,7 +19516,7 @@ index 000000000000..d4ab61c1848b
+}
+EXPORT_SYMBOL(atomic_dec_and_mutex_lock);
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
-index b066724d7a5b..0e9a6260441d 100644
+index b066724d7a5b..bb42267257ad 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -7,6 +7,11 @@
@@ -19286,15 +19531,16 @@ index b066724d7a5b..0e9a6260441d 100644
*
* See Documentation/locking/rt-mutex-design.txt for details.
*/
-@@ -16,6 +21,7 @@
+@@ -16,6 +21,8 @@
#include <linux/sched/rt.h>
#include <linux/sched/deadline.h>
#include <linux/timer.h>
+#include <linux/ww_mutex.h>
++#include <linux/blkdev.h>
#include "rtmutex_common.h"
-@@ -133,6 +139,12 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock)
+@@ -133,6 +140,12 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock)
WRITE_ONCE(*p, owner & ~RT_MUTEX_HAS_WAITERS);
}
@@ -19307,7 +19553,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* We can speed up the acquire/release, if there's no debugging state to be
* set up.
-@@ -163,13 +175,14 @@ static inline void mark_rt_mutex_waiters(struct rt_mutex *lock)
+@@ -163,13 +176,14 @@ static inline void mark_rt_mutex_waiters(struct rt_mutex *lock)
* 2) Drop lock->wait_lock
* 3) Try to unlock the lock with cmpxchg
*/
@@ -19324,7 +19570,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* If a new waiter comes in between the unlock and the cmpxchg
* we have two situations:
-@@ -211,11 +224,12 @@ static inline void mark_rt_mutex_waiters(struct rt_mutex *lock)
+@@ -211,11 +225,12 @@ static inline void mark_rt_mutex_waiters(struct rt_mutex *lock)
/*
* Simple slow path only version: lock->owner is protected by lock->wait_lock.
*/
@@ -19339,7 +19585,7 @@ index b066724d7a5b..0e9a6260441d 100644
return true;
}
#endif
-@@ -412,6 +426,14 @@ static bool rt_mutex_cond_detect_deadlock(struct rt_mutex_waiter *waiter,
+@@ -412,6 +427,14 @@ static bool rt_mutex_cond_detect_deadlock(struct rt_mutex_waiter *waiter,
return debug_rt_mutex_detect_deadlock(waiter, chwalk);
}
@@ -19354,7 +19600,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* Max number of times we'll walk the boosting chain:
*/
-@@ -419,7 +441,8 @@ int max_lock_depth = 1024;
+@@ -419,7 +442,8 @@ int max_lock_depth = 1024;
static inline struct rt_mutex *task_blocked_on_lock(struct task_struct *p)
{
@@ -19364,7 +19610,7 @@ index b066724d7a5b..0e9a6260441d 100644
}
/*
-@@ -497,7 +520,6 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -497,7 +521,6 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
int ret = 0, depth = 0;
struct rt_mutex *lock;
bool detect_deadlock;
@@ -19372,7 +19618,7 @@ index b066724d7a5b..0e9a6260441d 100644
bool requeue = true;
detect_deadlock = rt_mutex_cond_detect_deadlock(orig_waiter, chwalk);
-@@ -540,7 +562,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -540,7 +563,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
/*
* [1] Task cannot go away as we did a get_task() before !
*/
@@ -19381,7 +19627,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* [2] Get the waiter on which @task is blocked on.
-@@ -556,7 +578,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -556,7 +579,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
* reached or the state of the chain has changed while we
* dropped the locks.
*/
@@ -19390,7 +19636,7 @@ index b066724d7a5b..0e9a6260441d 100644
goto out_unlock_pi;
/*
-@@ -624,7 +646,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -624,7 +647,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
* operations.
*/
if (!raw_spin_trylock(&lock->wait_lock)) {
@@ -19399,7 +19645,7 @@ index b066724d7a5b..0e9a6260441d 100644
cpu_relax();
goto retry;
}
-@@ -655,7 +677,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -655,7 +678,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
/*
* No requeue[7] here. Just release @task [8]
*/
@@ -19408,7 +19654,7 @@ index b066724d7a5b..0e9a6260441d 100644
put_task_struct(task);
/*
-@@ -663,14 +685,14 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -663,14 +686,14 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
* If there is no owner of the lock, end of chain.
*/
if (!rt_mutex_owner(lock)) {
@@ -19425,7 +19671,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* No requeue [11] here. We just do deadlock detection.
-@@ -685,8 +707,8 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -685,8 +708,8 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
top_waiter = rt_mutex_top_waiter(lock);
/* [13] Drop locks */
@@ -19436,7 +19682,7 @@ index b066724d7a5b..0e9a6260441d 100644
/* If owner is not blocked, end of chain. */
if (!next_lock)
-@@ -707,7 +729,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -707,7 +730,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
rt_mutex_enqueue(lock, waiter);
/* [8] Release the task */
@@ -19445,7 +19691,7 @@ index b066724d7a5b..0e9a6260441d 100644
put_task_struct(task);
/*
-@@ -718,21 +740,24 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -718,21 +741,24 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
* follow here. This is the end of the chain we are walking.
*/
if (!rt_mutex_owner(lock)) {
@@ -19474,7 +19720,7 @@ index b066724d7a5b..0e9a6260441d 100644
/* [11] requeue the pi waiters if necessary */
if (waiter == rt_mutex_top_waiter(lock)) {
-@@ -786,8 +811,8 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -786,8 +812,8 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
top_waiter = rt_mutex_top_waiter(lock);
/* [13] Drop the locks */
@@ -19485,7 +19731,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* Make the actual exit decisions [12], based on the stored
-@@ -810,28 +835,46 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
+@@ -810,28 +836,46 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
goto again;
out_unlock_pi:
@@ -19538,7 +19784,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* Before testing whether we can acquire @lock, we set the
* RT_MUTEX_HAS_WAITERS bit in @lock->owner. This forces all
-@@ -867,8 +910,10 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task,
+@@ -867,8 +911,10 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task,
* If waiter is not the highest priority waiter of
* @lock, give up.
*/
@@ -19550,7 +19796,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* We can acquire the lock. Remove the waiter from the
-@@ -886,14 +931,10 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task,
+@@ -886,14 +932,10 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task,
* not need to be dequeued.
*/
if (rt_mutex_has_waiters(lock)) {
@@ -19568,7 +19814,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* The current top waiter stays enqueued. We
* don't have to change anything in the lock
-@@ -916,7 +957,7 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task,
+@@ -916,7 +958,7 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task,
* case, but conditionals are more expensive than a redundant
* store.
*/
@@ -19577,7 +19823,7 @@ index b066724d7a5b..0e9a6260441d 100644
task->pi_blocked_on = NULL;
/*
* Finish the lock acquisition. @task is the new owner. If
-@@ -925,7 +966,7 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task,
+@@ -925,7 +967,7 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task,
*/
if (rt_mutex_has_waiters(lock))
rt_mutex_enqueue_pi(task, rt_mutex_top_waiter(lock));
@@ -19586,7 +19832,7 @@ index b066724d7a5b..0e9a6260441d 100644
takeit:
/* We got the lock. */
-@@ -942,12 +983,444 @@ takeit:
+@@ -942,12 +984,444 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task,
return 1;
}
@@ -20032,7 +20278,7 @@ index b066724d7a5b..0e9a6260441d 100644
*/
static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
struct rt_mutex_waiter *waiter,
-@@ -958,7 +1431,6 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
+@@ -958,7 +1432,6 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
struct rt_mutex_waiter *top_waiter = waiter;
struct rt_mutex *next_lock;
int chain_walk = 0, res;
@@ -20040,7 +20286,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* Early deadlock detection. We really don't want the task to
-@@ -972,7 +1444,24 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
+@@ -972,7 +1445,24 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
if (owner == task)
return -EDEADLK;
@@ -20066,7 +20312,7 @@ index b066724d7a5b..0e9a6260441d 100644
__rt_mutex_adjust_prio(task);
waiter->task = task;
waiter->lock = lock;
-@@ -985,18 +1474,18 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
+@@ -985,18 +1475,18 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
task->pi_blocked_on = waiter;
@@ -20088,7 +20334,7 @@ index b066724d7a5b..0e9a6260441d 100644
chain_walk = 1;
} else if (rt_mutex_cond_detect_deadlock(waiter, chwalk)) {
chain_walk = 1;
-@@ -1005,7 +1494,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
+@@ -1005,7 +1495,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
/* Store the lock on which owner is blocked or NULL */
next_lock = task_blocked_on_lock(owner);
@@ -20097,7 +20343,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* Even if full deadlock detection is on, if the owner is not
* blocked itself, we can avoid finding this out in the chain
-@@ -1021,12 +1510,12 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
+@@ -1021,12 +1511,12 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
*/
get_task_struct(owner);
@@ -20112,7 +20358,7 @@ index b066724d7a5b..0e9a6260441d 100644
return res;
}
-@@ -1035,15 +1524,15 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
+@@ -1035,15 +1525,15 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock,
* Remove the top waiter from the current tasks pi waiter tree and
* queue it up.
*
@@ -20131,7 +20377,7 @@ index b066724d7a5b..0e9a6260441d 100644
waiter = rt_mutex_top_waiter(lock);
-@@ -1065,15 +1554,18 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q,
+@@ -1065,15 +1555,18 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q,
*/
lock->owner = (void *) RT_MUTEX_HAS_WAITERS;
@@ -20140,7 +20386,7 @@ index b066724d7a5b..0e9a6260441d 100644
- wake_q_add(wake_q, waiter->task);
+ if (waiter->savestate)
-+ wake_q_add(wake_sleeper_q, waiter->task);
++ wake_q_add_sleeper(wake_sleeper_q, waiter->task);
+ else
+ wake_q_add(wake_q, waiter->task);
}
@@ -20153,7 +20399,7 @@ index b066724d7a5b..0e9a6260441d 100644
* have just failed to try_to_take_rt_mutex().
*/
static void remove_waiter(struct rt_mutex *lock,
-@@ -1081,13 +1573,12 @@ static void remove_waiter(struct rt_mutex *lock,
+@@ -1081,13 +1574,12 @@ static void remove_waiter(struct rt_mutex *lock,
{
bool is_top_waiter = (waiter == rt_mutex_top_waiter(lock));
struct task_struct *owner = rt_mutex_owner(lock);
@@ -20170,7 +20416,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* Only update priority if the waiter was the highest priority
-@@ -1096,7 +1587,7 @@ static void remove_waiter(struct rt_mutex *lock,
+@@ -1096,7 +1588,7 @@ static void remove_waiter(struct rt_mutex *lock,
if (!owner || !is_top_waiter)
return;
@@ -20179,7 +20425,7 @@ index b066724d7a5b..0e9a6260441d 100644
rt_mutex_dequeue_pi(owner, waiter);
-@@ -1106,9 +1597,10 @@ static void remove_waiter(struct rt_mutex *lock,
+@@ -1106,9 +1598,10 @@ static void remove_waiter(struct rt_mutex *lock,
__rt_mutex_adjust_prio(owner);
/* Store the lock on which owner is blocked or NULL */
@@ -20192,7 +20438,7 @@ index b066724d7a5b..0e9a6260441d 100644
/*
* Don't walk the chain, if the owner task is not blocked
-@@ -1120,12 +1612,12 @@ static void remove_waiter(struct rt_mutex *lock,
+@@ -1120,12 +1613,12 @@ static void remove_waiter(struct rt_mutex *lock,
/* gets dropped in rt_mutex_adjust_prio_chain()! */
get_task_struct(owner);
@@ -20207,7 +20453,7 @@ index b066724d7a5b..0e9a6260441d 100644
}
/*
-@@ -1142,17 +1634,17 @@ void rt_mutex_adjust_pi(struct task_struct *task)
+@@ -1142,17 +1635,17 @@ void rt_mutex_adjust_pi(struct task_struct *task)
raw_spin_lock_irqsave(&task->pi_lock, flags);
waiter = task->pi_blocked_on;
@@ -20227,7 +20473,7 @@ index b066724d7a5b..0e9a6260441d 100644
rt_mutex_adjust_prio_chain(task, RT_MUTEX_MIN_CHAINWALK, NULL,
next_lock, NULL, task);
}
-@@ -1161,16 +1653,17 @@ void rt_mutex_adjust_pi(struct task_struct *task)
+@@ -1161,16 +1654,17 @@ void rt_mutex_adjust_pi(struct task_struct *task)
* __rt_mutex_slowlock() - Perform the wait-wake-try-to-take loop
* @lock: the rt_mutex to take
* @state: the state the task should block in (TASK_INTERRUPTIBLE
@@ -20248,17 +20494,36 @@ index b066724d7a5b..0e9a6260441d 100644
{
int ret = 0;
-@@ -1193,13 +1686,19 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state,
+@@ -1179,27 +1673,28 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state,
+ if (try_to_take_rt_mutex(lock, current, waiter))
+ break;
+
+- /*
+- * TASK_INTERRUPTIBLE checks for signals and
+- * timeout. Ignored otherwise.
+- */
+- if (unlikely(state == TASK_INTERRUPTIBLE)) {
+- /* Signal pending? */
+- if (signal_pending(current))
+- ret = -EINTR;
+- if (timeout && !timeout->task)
+- ret = -ETIMEDOUT;
++ if (timeout && !timeout->task) {
++ ret = -ETIMEDOUT;
++ break;
++ }
++ if (signal_pending_state(state, current)) {
++ ret = -EINTR;
++ break;
++ }
++
++ if (ww_ctx && ww_ctx->acquired > 0) {
++ ret = __mutex_lock_check_stamp(lock, ww_ctx);
+ if (ret)
break;
}
- raw_spin_unlock(&lock->wait_lock);
-+ if (ww_ctx && ww_ctx->acquired > 0) {
-+ ret = __mutex_lock_check_stamp(lock, ww_ctx);
-+ if (ret)
-+ break;
-+ }
-+
+ raw_spin_unlock_irq(&lock->wait_lock);
debug_rt_mutex_print_deadlock(waiter);
@@ -20270,7 +20535,7 @@ index b066724d7a5b..0e9a6260441d 100644
set_current_state(state);
}
-@@ -1227,26 +1726,112 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock,
+@@ -1227,26 +1722,112 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock,
}
}
@@ -20389,7 +20654,7 @@ index b066724d7a5b..0e9a6260441d 100644
return 0;
}
-@@ -1260,13 +1845,23 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
+@@ -1260,13 +1841,23 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
if (likely(!ret))
/* sleep on the mutex */
@@ -20415,7 +20680,7 @@ index b066724d7a5b..0e9a6260441d 100644
}
/*
-@@ -1275,7 +1870,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
+@@ -1275,7 +1866,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
*/
fixup_rt_mutex_waiters(lock);
@@ -20424,7 +20689,7 @@ index b066724d7a5b..0e9a6260441d 100644
/* Remove pending timer: */
if (unlikely(timeout))
-@@ -1291,6 +1886,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
+@@ -1291,6 +1882,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
*/
static inline int rt_mutex_slowtrylock(struct rt_mutex *lock)
{
@@ -20432,7 +20697,7 @@ index b066724d7a5b..0e9a6260441d 100644
int ret;
/*
-@@ -1302,10 +1898,10 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock)
+@@ -1302,10 +1894,10 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock)
return 0;
/*
@@ -20446,7 +20711,7 @@ index b066724d7a5b..0e9a6260441d 100644
ret = try_to_take_rt_mutex(lock, current, NULL);
-@@ -1315,7 +1911,7 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock)
+@@ -1315,7 +1907,7 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock)
*/
fixup_rt_mutex_waiters(lock);
@@ -20455,7 +20720,7 @@ index b066724d7a5b..0e9a6260441d 100644
return ret;
}
-@@ -1325,9 +1921,13 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock)
+@@ -1325,9 +1917,13 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock)
* Return whether the current task needs to undo a potential priority boosting.
*/
static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock,
@@ -20471,7 +20736,7 @@ index b066724d7a5b..0e9a6260441d 100644
debug_rt_mutex_unlock(lock);
-@@ -1366,10 +1966,10 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock,
+@@ -1366,10 +1962,10 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock,
*/
while (!rt_mutex_has_waiters(lock)) {
/* Drops lock->wait_lock ! */
@@ -20484,7 +20749,7 @@ index b066724d7a5b..0e9a6260441d 100644
}
/*
-@@ -1378,9 +1978,9 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock,
+@@ -1378,9 +1974,9 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock,
*
* Queue the next waiter for wakeup once we release the wait_lock.
*/
@@ -20496,7 +20761,7 @@ index b066724d7a5b..0e9a6260441d 100644
/* check PI boosting */
return true;
-@@ -1394,31 +1994,36 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock,
+@@ -1394,31 +1990,50 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock,
*/
static inline int
rt_mutex_fastlock(struct rt_mutex *lock, int state,
@@ -20510,10 +20775,21 @@ index b066724d7a5b..0e9a6260441d 100644
if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {
rt_mutex_deadlock_account_lock(lock, current);
return 0;
- } else
+- } else
- return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK);
-+ return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK,
-+ ww_ctx);
++ }
++
++ /*
++ * If rt_mutex blocks, the function sched_submit_work will not call
++ * blk_schedule_flush_plug (because tsk_is_pi_blocked would be true).
++ * We must call blk_schedule_flush_plug here, if we don't call it,
++ * a deadlock in device mapper may happen.
++ */
++ if (unlikely(blk_needs_flush_plug(current)))
++ blk_schedule_flush_plug(current);
++
++ return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK,
++ ww_ctx);
}
static inline int
@@ -20531,13 +20807,18 @@ index b066724d7a5b..0e9a6260441d 100644
likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {
rt_mutex_deadlock_account_lock(lock, current);
return 0;
- } else
+- } else
- return slowfn(lock, state, timeout, chwalk);
-+ return slowfn(lock, state, timeout, chwalk, ww_ctx);
++ }
++
++ if (unlikely(blk_needs_flush_plug(current)))
++ blk_schedule_flush_plug(current);
++
++ return slowfn(lock, state, timeout, chwalk, ww_ctx);
}
static inline int
-@@ -1435,17 +2040,20 @@ rt_mutex_fasttrylock(struct rt_mutex *lock,
+@@ -1435,17 +2050,20 @@ rt_mutex_fasttrylock(struct rt_mutex *lock,
static inline void
rt_mutex_fastunlock(struct rt_mutex *lock,
bool (*slowfn)(struct rt_mutex *lock,
@@ -20560,7 +20841,7 @@ index b066724d7a5b..0e9a6260441d 100644
/* Undo pi boosting if necessary: */
if (deboost)
-@@ -1462,7 +2070,7 @@ void __sched rt_mutex_lock(struct rt_mutex *lock)
+@@ -1462,7 +2080,7 @@ void __sched rt_mutex_lock(struct rt_mutex *lock)
{
might_sleep();
@@ -20569,7 +20850,7 @@ index b066724d7a5b..0e9a6260441d 100644
}
EXPORT_SYMBOL_GPL(rt_mutex_lock);
-@@ -1479,7 +2087,7 @@ int __sched rt_mutex_lock_interruptible(struct rt_mutex *lock)
+@@ -1479,7 +2097,7 @@ int __sched rt_mutex_lock_interruptible(struct rt_mutex *lock)
{
might_sleep();
@@ -20578,7 +20859,7 @@ index b066724d7a5b..0e9a6260441d 100644
}
EXPORT_SYMBOL_GPL(rt_mutex_lock_interruptible);
-@@ -1492,11 +2100,30 @@ int rt_mutex_timed_futex_lock(struct rt_mutex *lock,
+@@ -1492,10 +2110,29 @@ int rt_mutex_timed_futex_lock(struct rt_mutex *lock,
might_sleep();
return rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout,
@@ -20587,7 +20868,7 @@ index b066724d7a5b..0e9a6260441d 100644
rt_mutex_slowlock);
}
- /**
++/**
+ * rt_mutex_lock_killable - lock a rt_mutex killable
+ *
+ * @lock: the rt_mutex to be locked
@@ -20606,11 +20887,10 @@ index b066724d7a5b..0e9a6260441d 100644
+}
+EXPORT_SYMBOL_GPL(rt_mutex_lock_killable);
+
-+/**
+ /**
* rt_mutex_timed_lock - lock a rt_mutex interruptible
* the timeout structure is provided
- * by the caller
-@@ -1516,6 +2143,7 @@ rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout)
+@@ -1516,6 +2153,7 @@ rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout)
return rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout,
RT_MUTEX_MIN_CHAINWALK,
@@ -20618,7 +20898,7 @@ index b066724d7a5b..0e9a6260441d 100644
rt_mutex_slowlock);
}
EXPORT_SYMBOL_GPL(rt_mutex_timed_lock);
-@@ -1533,7 +2161,11 @@ EXPORT_SYMBOL_GPL(rt_mutex_timed_lock);
+@@ -1533,7 +2171,11 @@ EXPORT_SYMBOL_GPL(rt_mutex_timed_lock);
*/
int __sched rt_mutex_trylock(struct rt_mutex *lock)
{
@@ -20630,7 +20910,7 @@ index b066724d7a5b..0e9a6260441d 100644
return 0;
return rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock);
-@@ -1559,13 +2191,14 @@ EXPORT_SYMBOL_GPL(rt_mutex_unlock);
+@@ -1559,13 +2201,14 @@ EXPORT_SYMBOL_GPL(rt_mutex_unlock);
* required or not.
*/
bool __sched rt_mutex_futex_unlock(struct rt_mutex *lock,
@@ -20647,7 +20927,7 @@ index b066724d7a5b..0e9a6260441d 100644
}
/**
-@@ -1598,13 +2231,12 @@ EXPORT_SYMBOL_GPL(rt_mutex_destroy);
+@@ -1598,13 +2241,12 @@ EXPORT_SYMBOL_GPL(rt_mutex_destroy);
void __rt_mutex_init(struct rt_mutex *lock, const char *name)
{
lock->owner = NULL;
@@ -20662,7 +20942,7 @@ index b066724d7a5b..0e9a6260441d 100644
/**
* rt_mutex_init_proxy_locked - initialize and lock a rt_mutex on behalf of a
-@@ -1619,7 +2251,7 @@ EXPORT_SYMBOL_GPL(__rt_mutex_init);
+@@ -1619,7 +2261,7 @@ EXPORT_SYMBOL_GPL(__rt_mutex_init);
void rt_mutex_init_proxy_locked(struct rt_mutex *lock,
struct task_struct *proxy_owner)
{
@@ -20671,7 +20951,7 @@ index b066724d7a5b..0e9a6260441d 100644
debug_rt_mutex_proxy_lock(lock, proxy_owner);
rt_mutex_set_owner(lock, proxy_owner);
rt_mutex_deadlock_account_lock(lock, proxy_owner);
-@@ -1660,13 +2292,42 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
+@@ -1660,13 +2302,42 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
{
int ret;
@@ -20716,7 +20996,7 @@ index b066724d7a5b..0e9a6260441d 100644
/* We enforce deadlock detection for futexes */
ret = task_blocks_on_rt_mutex(lock, waiter, task,
RT_MUTEX_FULL_CHAINWALK);
-@@ -1681,10 +2342,10 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
+@@ -1681,10 +2352,10 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock,
ret = 0;
}
@@ -20729,7 +21009,7 @@ index b066724d7a5b..0e9a6260441d 100644
debug_rt_mutex_print_deadlock(waiter);
-@@ -1732,12 +2393,12 @@ int rt_mutex_finish_proxy_lock(struct rt_mutex *lock,
+@@ -1732,12 +2403,12 @@ int rt_mutex_finish_proxy_lock(struct rt_mutex *lock,
{
int ret;
@@ -20744,15 +21024,15 @@ index b066724d7a5b..0e9a6260441d 100644
if (unlikely(ret))
remove_waiter(lock, waiter);
-@@ -1748,7 +2409,93 @@ int rt_mutex_finish_proxy_lock(struct rt_mutex *lock,
+@@ -1748,7 +2419,93 @@ int rt_mutex_finish_proxy_lock(struct rt_mutex *lock,
*/
fixup_rt_mutex_waiters(lock);
- raw_spin_unlock(&lock->wait_lock);
+ raw_spin_unlock_irq(&lock->wait_lock);
-
- return ret;
- }
++
++ return ret;
++}
+
+static inline int
+ww_mutex_deadlock_injection(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
@@ -20812,9 +21092,9 @@ index b066724d7a5b..0e9a6260441d 100644
+ mutex_release(&lock->base.dep_map, 1, _RET_IP_);
+ else if (!ret && ww_ctx->acquired > 1)
+ return ww_mutex_deadlock_injection(lock, ww_ctx);
-+
-+ return ret;
-+}
+
+ return ret;
+ }
+EXPORT_SYMBOL_GPL(__ww_mutex_lock);
+
+void __sched ww_mutex_unlock(struct ww_mutex *lock)
@@ -20955,7 +21235,7 @@ index 0374a596cffa..94970338d518 100644
+
+#endif
diff --git a/kernel/module.c b/kernel/module.c
-index b14a4f31221f..be3f497a089d 100644
+index 0a56098d3738..33c1954b07ed 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -682,16 +682,7 @@ static void percpu_modcopy(struct module *mod,
@@ -21024,7 +21304,7 @@ index b14a4f31221f..be3f497a089d 100644
#define MODINFO_ATTR(field) \
diff --git a/kernel/panic.c b/kernel/panic.c
-index 41e2b54f36b5..3535f802953a 100644
+index 1d07cf9af849..e182564e6533 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -61,6 +61,37 @@ void __weak panic_smp_self_stop(void)
@@ -21490,7 +21770,7 @@ index 0b5613554769..99deb2617308 100644
return;
out:
raw_spin_unlock_irqrestore(&logbuf_lock, flags);
-@@ -2316,13 +2407,17 @@ skip:
+@@ -2316,13 +2407,17 @@ void console_unlock(void)
console_idx = log_next(console_idx);
console_seq++;
console_prev = msg->flags;
@@ -21522,10 +21802,10 @@ index 0b5613554769..99deb2617308 100644
* console_unblank can no longer be called in interrupt context unless
* oops_in_progress is set to 1..
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
-index c7e8ed99c953..2a19cc5001b4 100644
+index 5e2cd1030702..d4467d4eb488 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
-@@ -136,7 +136,14 @@ static bool ptrace_freeze_traced(struct task_struct *task)
+@@ -142,7 +142,14 @@ static bool ptrace_freeze_traced(struct task_struct *task)
spin_lock_irq(&task->sighand->siglock);
if (task_is_traced(task) && !__fatal_signal_pending(task)) {
@@ -21567,7 +21847,7 @@ index d89328e260df..5bb3364a6284 100644
* Don't even think about trying any of these in real life!!!
* The names includes "busted", and they really means it!
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
-index f07343b54fe5..d862a203fce0 100644
+index 8a62cbfe1f2f..f60894c6b35c 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -56,6 +56,11 @@
@@ -21658,7 +21938,7 @@ index f07343b54fe5..d862a203fce0 100644
case RCU_SCHED_FLAVOR:
rsp = &rcu_sched_state;
break;
-@@ -1590,7 +1621,6 @@ static int rcu_future_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp)
+@@ -1602,7 +1633,6 @@ static int rcu_future_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp)
int needmore;
struct rcu_data *rdp = this_cpu_ptr(rsp->rda);
@@ -21666,7 +21946,7 @@ index f07343b54fe5..d862a203fce0 100644
rnp->need_future_gp[c & 0x1] = 0;
needmore = rnp->need_future_gp[(c + 1) & 0x1];
trace_rcu_future_gp(rnp, rdp, c,
-@@ -1611,7 +1641,7 @@ static void rcu_gp_kthread_wake(struct rcu_state *rsp)
+@@ -1623,7 +1653,7 @@ static void rcu_gp_kthread_wake(struct rcu_state *rsp)
!READ_ONCE(rsp->gp_flags) ||
!rsp->gp_kthread)
return;
@@ -21675,7 +21955,7 @@ index f07343b54fe5..d862a203fce0 100644
}
/*
-@@ -1991,6 +2021,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
+@@ -2003,6 +2033,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
int nocb = 0;
struct rcu_data *rdp;
struct rcu_node *rnp = rcu_get_root(rsp);
@@ -21683,7 +21963,7 @@ index f07343b54fe5..d862a203fce0 100644
WRITE_ONCE(rsp->gp_activity, jiffies);
raw_spin_lock_irq(&rnp->lock);
-@@ -2029,7 +2060,9 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
+@@ -2041,7 +2072,9 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
needgp = __note_gp_changes(rsp, rnp, rdp) || needgp;
/* smp_mb() provided by prior unlock-lock pair. */
nocb += rcu_future_gp_cleanup(rsp, rnp);
@@ -21693,7 +21973,7 @@ index f07343b54fe5..d862a203fce0 100644
cond_resched_rcu_qs();
WRITE_ONCE(rsp->gp_activity, jiffies);
rcu_gp_slow(rsp, gp_cleanup_delay);
-@@ -2076,7 +2109,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
+@@ -2088,7 +2121,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
READ_ONCE(rsp->gpnum),
TPS("reqwait"));
rsp->gp_state = RCU_GP_WAIT_GPS;
@@ -21702,7 +21982,7 @@ index f07343b54fe5..d862a203fce0 100644
READ_ONCE(rsp->gp_flags) &
RCU_GP_FLAG_INIT);
rsp->gp_state = RCU_GP_DONE_GPS;
-@@ -2106,7 +2139,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
+@@ -2118,7 +2151,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
READ_ONCE(rsp->gpnum),
TPS("fqswait"));
rsp->gp_state = RCU_GP_WAIT_FQS;
@@ -21711,7 +21991,7 @@ index f07343b54fe5..d862a203fce0 100644
rcu_gp_fqs_check_wake(rsp, &gf), j);
rsp->gp_state = RCU_GP_DOING_FQS;
/* Locking provides needed memory barriers. */
-@@ -2230,7 +2263,7 @@ static void rcu_report_qs_rsp(struct rcu_state *rsp, unsigned long flags)
+@@ -2242,7 +2275,7 @@ static void rcu_report_qs_rsp(struct rcu_state *rsp, unsigned long flags)
WARN_ON_ONCE(!rcu_gp_in_progress(rsp));
WRITE_ONCE(rsp->gp_flags, READ_ONCE(rsp->gp_flags) | RCU_GP_FLAG_FQS);
raw_spin_unlock_irqrestore(&rcu_get_root(rsp)->lock, flags);
@@ -21720,7 +22000,7 @@ index f07343b54fe5..d862a203fce0 100644
}
/*
-@@ -2891,7 +2924,7 @@ static void force_quiescent_state(struct rcu_state *rsp)
+@@ -2903,7 +2936,7 @@ static void force_quiescent_state(struct rcu_state *rsp)
}
WRITE_ONCE(rsp->gp_flags, READ_ONCE(rsp->gp_flags) | RCU_GP_FLAG_FQS);
raw_spin_unlock_irqrestore(&rnp_old->lock, flags);
@@ -21729,7 +22009,7 @@ index f07343b54fe5..d862a203fce0 100644
}
/*
-@@ -2934,18 +2967,17 @@ __rcu_process_callbacks(struct rcu_state *rsp)
+@@ -2946,18 +2979,17 @@ __rcu_process_callbacks(struct rcu_state *rsp)
/*
* Do RCU core processing for the current CPU.
*/
@@ -21750,7 +22030,7 @@ index f07343b54fe5..d862a203fce0 100644
/*
* Schedule RCU callback invocation. If the specified type of RCU
* does not support RCU priority boosting, just do a direct call,
-@@ -2957,18 +2989,105 @@ static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp)
+@@ -2969,18 +3001,105 @@ static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp)
{
if (unlikely(!READ_ONCE(rcu_scheduler_fully_active)))
return;
@@ -21863,7 +22143,7 @@ index f07343b54fe5..d862a203fce0 100644
/*
* Handle any core-RCU processing required by a call_rcu() invocation.
-@@ -3114,6 +3233,7 @@ void call_rcu_sched(struct rcu_head *head, rcu_callback_t func)
+@@ -3126,6 +3245,7 @@ void call_rcu_sched(struct rcu_head *head, rcu_callback_t func)
}
EXPORT_SYMBOL_GPL(call_rcu_sched);
@@ -21871,7 +22151,7 @@ index f07343b54fe5..d862a203fce0 100644
/*
* Queue an RCU callback for invocation after a quicker grace period.
*/
-@@ -3122,6 +3242,7 @@ void call_rcu_bh(struct rcu_head *head, rcu_callback_t func)
+@@ -3134,6 +3254,7 @@ void call_rcu_bh(struct rcu_head *head, rcu_callback_t func)
__call_rcu(head, func, &rcu_bh_state, -1, 0);
}
EXPORT_SYMBOL_GPL(call_rcu_bh);
@@ -21879,7 +22159,7 @@ index f07343b54fe5..d862a203fce0 100644
/*
* Queue an RCU callback for lazy invocation after a grace period.
-@@ -3213,6 +3334,7 @@ void synchronize_sched(void)
+@@ -3225,6 +3346,7 @@ void synchronize_sched(void)
}
EXPORT_SYMBOL_GPL(synchronize_sched);
@@ -21887,7 +22167,7 @@ index f07343b54fe5..d862a203fce0 100644
/**
* synchronize_rcu_bh - wait until an rcu_bh grace period has elapsed.
*
-@@ -3239,6 +3361,7 @@ void synchronize_rcu_bh(void)
+@@ -3251,6 +3373,7 @@ void synchronize_rcu_bh(void)
wait_rcu_gp(call_rcu_bh);
}
EXPORT_SYMBOL_GPL(synchronize_rcu_bh);
@@ -21895,7 +22175,7 @@ index f07343b54fe5..d862a203fce0 100644
/**
* get_state_synchronize_rcu - Snapshot current RCU state
-@@ -3524,7 +3647,7 @@ static void __rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp,
+@@ -3536,7 +3659,7 @@ static void __rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp,
raw_spin_unlock_irqrestore(&rnp->lock, flags);
if (wake) {
smp_mb(); /* EGP done before wake_up(). */
@@ -21904,7 +22184,7 @@ index f07343b54fe5..d862a203fce0 100644
}
break;
}
-@@ -3781,7 +3904,7 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp)
+@@ -3793,7 +3916,7 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp)
jiffies_start = jiffies;
for (;;) {
@@ -21913,7 +22193,7 @@ index f07343b54fe5..d862a203fce0 100644
rsp->expedited_wq,
sync_rcu_preempt_exp_done(rnp_root),
jiffies_stall);
-@@ -3789,7 +3912,7 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp)
+@@ -3801,7 +3924,7 @@ static void synchronize_sched_expedited_wait(struct rcu_state *rsp)
return;
if (ret < 0) {
/* Hit a signal, disable CPU stall warnings. */
@@ -21922,7 +22202,7 @@ index f07343b54fe5..d862a203fce0 100644
sync_rcu_preempt_exp_done(rnp_root));
return;
}
-@@ -4101,6 +4224,7 @@ static void _rcu_barrier(struct rcu_state *rsp)
+@@ -4113,6 +4236,7 @@ static void _rcu_barrier(struct rcu_state *rsp)
mutex_unlock(&rsp->barrier_mutex);
}
@@ -21930,7 +22210,7 @@ index f07343b54fe5..d862a203fce0 100644
/**
* rcu_barrier_bh - Wait until all in-flight call_rcu_bh() callbacks complete.
*/
-@@ -4109,6 +4233,7 @@ void rcu_barrier_bh(void)
+@@ -4121,6 +4245,7 @@ void rcu_barrier_bh(void)
_rcu_barrier(&rcu_bh_state);
}
EXPORT_SYMBOL_GPL(rcu_barrier_bh);
@@ -21938,7 +22218,7 @@ index f07343b54fe5..d862a203fce0 100644
/**
* rcu_barrier_sched - Wait for in-flight call_rcu_sched() callbacks.
-@@ -4455,8 +4580,8 @@ static void __init rcu_init_one(struct rcu_state *rsp,
+@@ -4467,8 +4592,8 @@ static void __init rcu_init_one(struct rcu_state *rsp,
}
}
@@ -21949,7 +22229,7 @@ index f07343b54fe5..d862a203fce0 100644
rnp = rsp->level[rcu_num_lvls - 1];
for_each_possible_cpu(i) {
while (i > rnp->grphi)
-@@ -4576,12 +4701,13 @@ void __init rcu_init(void)
+@@ -4588,12 +4713,13 @@ void __init rcu_init(void)
rcu_bootup_announce();
rcu_init_geometry();
@@ -22162,10 +22442,11 @@ index 32cbe72bf545..45e3e3e02a5c 100644
/*
* Carry out RCU priority boosting on the task indicated by ->exp_tasks
* or ->boost_tasks, advancing the pointer to the next task in the
-@@ -1115,23 +1102,6 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags)
+@@ -1114,23 +1101,6 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags)
+ }
}
- /*
+-/*
- * Wake up the per-CPU kthread to invoke RCU callbacks.
- */
-static void invoke_rcu_callbacks_kthread(void)
@@ -22182,10 +22463,9 @@ index 32cbe72bf545..45e3e3e02a5c 100644
- local_irq_restore(flags);
-}
-
--/*
+ /*
* Is the current CPU running the RCU-callbacks kthread?
* Caller must have preemption disabled.
- */
@@ -1186,67 +1156,6 @@ static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp,
return 0;
}
@@ -22377,7 +22657,7 @@ index 32cbe72bf545..45e3e3e02a5c 100644
rnp->nocb_gp_wq[c & 0x1],
(d = ULONG_CMP_GE(READ_ONCE(rnp->completed), c)));
if (likely(d))
-@@ -2109,7 +2009,7 @@ wait_again:
+@@ -2109,7 +2009,7 @@ static void nocb_leader_wait(struct rcu_data *my_rdp)
/* Wait for callbacks to appear. */
if (!rcu_nocb_poll) {
trace_rcu_nocb_wake(my_rdp->rsp->name, my_rdp->cpu, "Sleep");
@@ -22386,7 +22666,7 @@ index 32cbe72bf545..45e3e3e02a5c 100644
!READ_ONCE(my_rdp->nocb_leader_sleep));
/* Memory barrier handled by smp_mb() calls below and repoll. */
} else if (firsttime) {
-@@ -2184,7 +2084,7 @@ wait_again:
+@@ -2184,7 +2084,7 @@ static void nocb_leader_wait(struct rcu_data *my_rdp)
* List was empty, wake up the follower.
* Memory barriers supplied by atomic_long_add().
*/
@@ -22601,7 +22881,7 @@ index 8d0f35debf35..b62cf6400fe0 100644
}
EXPORT_SYMBOL(completion_done);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
-index 20253dbc8610..e9b8d518202e 100644
+index 9d6b3d869592..3e2e4c3de066 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -260,7 +260,11 @@ late_initcall(sched_init_debug);
@@ -22624,7 +22904,25 @@ index 20253dbc8610..e9b8d518202e 100644
}
#else /* CONFIG_SCHED_HRTICK */
static inline void hrtick_clear(struct rq *rq)
-@@ -542,7 +547,7 @@ void wake_q_add(struct wake_q_head *head, struct task_struct *task)
+@@ -518,9 +523,15 @@ static bool set_nr_if_polling(struct task_struct *p)
+ #endif
+ #endif
+
+-void wake_q_add(struct wake_q_head *head, struct task_struct *task)
++void __wake_q_add(struct wake_q_head *head, struct task_struct *task,
++ bool sleeper)
+ {
+- struct wake_q_node *node = &task->wake_q;
++ struct wake_q_node *node;
++
++ if (sleeper)
++ node = &task->wake_q_sleeper;
++ else
++ node = &task->wake_q;
+
+ /*
+ * Atomically grab the task, if ->wake_q is !nil already it means
+@@ -542,24 +553,33 @@ void wake_q_add(struct wake_q_head *head, struct task_struct *task)
head->lastp = &node->next;
}
@@ -22633,7 +22931,24 @@ index 20253dbc8610..e9b8d518202e 100644
{
struct wake_q_node *node = head->first;
-@@ -559,7 +564,10 @@ void wake_up_q(struct wake_q_head *head)
+ while (node != WAKE_Q_TAIL) {
+ struct task_struct *task;
+
+- task = container_of(node, struct task_struct, wake_q);
++ if (sleeper)
++ task = container_of(node, struct task_struct, wake_q_sleeper);
++ else
++ task = container_of(node, struct task_struct, wake_q);
+ BUG_ON(!task);
+ /* task can safely be re-inserted now */
+ node = node->next;
+- task->wake_q.next = NULL;
++ if (sleeper)
++ task->wake_q_sleeper.next = NULL;
++ else
++ task->wake_q.next = NULL;
+
+ /*
* wake_up_process() implies a wmb() to pair with the queueing
* in wake_q_add() so as not to miss wakeups.
*/
@@ -22645,7 +22960,7 @@ index 20253dbc8610..e9b8d518202e 100644
put_task_struct(task);
}
}
-@@ -595,6 +603,38 @@ void resched_curr(struct rq *rq)
+@@ -595,6 +615,38 @@ void resched_curr(struct rq *rq)
trace_sched_wake_idle_without_ipi(cpu);
}
@@ -22684,7 +22999,7 @@ index 20253dbc8610..e9b8d518202e 100644
void resched_cpu(int cpu)
{
struct rq *rq = cpu_rq(cpu);
-@@ -618,11 +658,14 @@ void resched_cpu(int cpu)
+@@ -617,11 +669,14 @@ void resched_cpu(int cpu)
*/
int get_nohz_timer_target(void)
{
@@ -22701,7 +23016,7 @@ index 20253dbc8610..e9b8d518202e 100644
rcu_read_lock();
for_each_domain(cpu, sd) {
-@@ -641,6 +684,8 @@ int get_nohz_timer_target(void)
+@@ -640,6 +695,8 @@ int get_nohz_timer_target(void)
cpu = housekeeping_any_cpu();
unlock:
rcu_read_unlock();
@@ -22710,22 +23025,34 @@ index 20253dbc8610..e9b8d518202e 100644
return cpu;
}
/*
-@@ -1174,6 +1219,11 @@ void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
+@@ -1166,7 +1223,8 @@ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_ma
+ p->nr_cpus_allowed = cpumask_weight(new_mask);
+ }
- lockdep_assert_held(&p->pi_lock);
+-void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
++static void __do_set_cpus_allowed_tail(struct task_struct *p,
++ const struct cpumask *new_mask)
+ {
+ struct rq *rq = task_rq(p);
+ bool queued, running;
+@@ -1195,6 +1253,98 @@ void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
+ enqueue_task(rq, p, ENQUEUE_RESTORE);
+ }
++void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
++{
+ if (__migrate_disabled(p)) {
++ lockdep_assert_held(&p->pi_lock);
++
+ cpumask_copy(&p->cpus_allowed, new_mask);
++#if defined(CONFIG_PREEMPT_RT_FULL) && defined(CONFIG_SMP)
++ p->migrate_disable_update = 1;
++#endif
+ return;
+ }
++ __do_set_cpus_allowed_tail(p, new_mask);
++}
+
- queued = task_on_rq_queued(p);
- running = task_current(rq, p);
-
-@@ -1196,6 +1246,84 @@ void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
- enqueue_task(rq, p, ENQUEUE_RESTORE);
- }
-
+static DEFINE_PER_CPU(struct cpumask, sched_cpumasks);
+static DEFINE_MUTEX(sched_down_mutex);
+static cpumask_t sched_down_cpumask;
@@ -22807,7 +23134,7 @@ index 20253dbc8610..e9b8d518202e 100644
/*
* Change a given task's CPU affinity. Migrate the thread to a
* proper CPU and schedule it away if the CPU it's executing on
-@@ -1235,7 +1363,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p,
+@@ -1234,7 +1384,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p,
do_set_cpus_allowed(p, new_mask);
/* Can the task run on the task's current CPU? If so, we're done */
@@ -22816,7 +23143,7 @@ index 20253dbc8610..e9b8d518202e 100644
goto out;
dest_cpu = cpumask_any_and(cpu_active_mask, new_mask);
-@@ -1411,6 +1539,18 @@ out:
+@@ -1410,6 +1560,18 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p)
return ret;
}
@@ -22835,7 +23162,7 @@ index 20253dbc8610..e9b8d518202e 100644
/*
* wait_task_inactive - wait for a thread to unschedule.
*
-@@ -1455,7 +1595,7 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state)
+@@ -1454,7 +1616,7 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state)
* is actually now running somewhere else!
*/
while (task_running(rq, p)) {
@@ -22844,7 +23171,7 @@ index 20253dbc8610..e9b8d518202e 100644
return 0;
cpu_relax();
}
-@@ -1470,7 +1610,8 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state)
+@@ -1469,7 +1631,8 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state)
running = task_running(rq, p);
queued = task_on_rq_queued(p);
ncsw = 0;
@@ -22854,7 +23181,7 @@ index 20253dbc8610..e9b8d518202e 100644
ncsw = p->nvcsw | LONG_MIN; /* sets MSB */
task_rq_unlock(rq, p, &flags);
-@@ -1627,7 +1768,7 @@ int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags)
+@@ -1626,7 +1789,7 @@ int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags)
{
lockdep_assert_held(&p->pi_lock);
@@ -22863,7 +23190,7 @@ index 20253dbc8610..e9b8d518202e 100644
cpu = p->sched_class->select_task_rq(p, cpu, sd_flags, wake_flags);
/*
-@@ -1707,10 +1848,6 @@ static inline void ttwu_activate(struct rq *rq, struct task_struct *p, int en_fl
+@@ -1706,10 +1869,6 @@ static inline void ttwu_activate(struct rq *rq, struct task_struct *p, int en_fl
{
activate_task(rq, p, en_flags);
p->on_rq = TASK_ON_RQ_QUEUED;
@@ -22874,7 +23201,7 @@ index 20253dbc8610..e9b8d518202e 100644
}
/*
-@@ -1937,8 +2074,27 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
+@@ -1936,8 +2095,27 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
*/
smp_mb__before_spinlock();
raw_spin_lock_irqsave(&p->pi_lock, flags);
@@ -22903,10 +23230,11 @@ index 20253dbc8610..e9b8d518202e 100644
trace_sched_waking(p);
-@@ -2030,52 +2186,6 @@ out:
+@@ -2028,52 +2206,6 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
+ return success;
}
- /**
+-/**
- * try_to_wake_up_local - try to wake up a local task with rq lock held
- * @p: the thread to be awakened
- *
@@ -22952,11 +23280,10 @@ index 20253dbc8610..e9b8d518202e 100644
- raw_spin_unlock(&p->pi_lock);
-}
-
--/**
+ /**
* wake_up_process - Wake up a specific process
* @p: The process to be woken up.
- *
-@@ -2093,6 +2203,18 @@ int wake_up_process(struct task_struct *p)
+@@ -2092,6 +2224,18 @@ int wake_up_process(struct task_struct *p)
}
EXPORT_SYMBOL(wake_up_process);
@@ -22969,13 +23296,13 @@ index 20253dbc8610..e9b8d518202e 100644
+ */
+int wake_up_lock_sleeper(struct task_struct *p)
+{
-+ return try_to_wake_up(p, TASK_ALL, WF_LOCK_SLEEPER);
++ return try_to_wake_up(p, TASK_UNINTERRUPTIBLE, WF_LOCK_SLEEPER);
+}
+
int wake_up_state(struct task_struct *p, unsigned int state)
{
return try_to_wake_up(p, state, 0);
-@@ -2279,6 +2401,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p)
+@@ -2278,6 +2422,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p)
p->on_cpu = 0;
#endif
init_task_preempt_count(p);
@@ -22985,7 +23312,7 @@ index 20253dbc8610..e9b8d518202e 100644
#ifdef CONFIG_SMP
plist_node_init(&p->pushable_tasks, MAX_PRIO);
RB_CLEAR_NODE(&p->pushable_dl_tasks);
-@@ -2603,8 +2728,12 @@ static struct rq *finish_task_switch(struct task_struct *prev)
+@@ -2602,8 +2749,12 @@ static struct rq *finish_task_switch(struct task_struct *prev)
finish_arch_post_lock_switch();
fire_sched_in_preempt_notifiers(current);
@@ -22999,7 +23326,7 @@ index 20253dbc8610..e9b8d518202e 100644
if (unlikely(prev_state == TASK_DEAD)) {
if (prev->sched_class->task_dead)
prev->sched_class->task_dead(prev);
-@@ -2935,16 +3064,6 @@ u64 scheduler_tick_max_deferment(void)
+@@ -2934,16 +3085,6 @@ u64 scheduler_tick_max_deferment(void)
}
#endif
@@ -23016,7 +23343,7 @@ index 20253dbc8610..e9b8d518202e 100644
#if defined(CONFIG_PREEMPT) && (defined(CONFIG_DEBUG_PREEMPT) || \
defined(CONFIG_PREEMPT_TRACER))
-@@ -2966,7 +3085,7 @@ void preempt_count_add(int val)
+@@ -2965,7 +3106,7 @@ void preempt_count_add(int val)
PREEMPT_MASK - 10);
#endif
if (preempt_count() == val) {
@@ -23025,7 +23352,7 @@ index 20253dbc8610..e9b8d518202e 100644
#ifdef CONFIG_DEBUG_PREEMPT
current->preempt_disable_ip = ip;
#endif
-@@ -2993,7 +3112,7 @@ void preempt_count_sub(int val)
+@@ -2992,7 +3133,7 @@ void preempt_count_sub(int val)
#endif
if (preempt_count() == val)
@@ -23034,7 +23361,7 @@ index 20253dbc8610..e9b8d518202e 100644
__preempt_count_sub(val);
}
EXPORT_SYMBOL(preempt_count_sub);
-@@ -3048,6 +3167,77 @@ static inline void schedule_debug(struct task_struct *prev)
+@@ -3047,6 +3188,114 @@ static inline void schedule_debug(struct task_struct *prev)
schedstat_inc(this_rq(), sched_count);
}
@@ -23102,6 +23429,43 @@ index 20253dbc8610..e9b8d518202e 100644
+ */
+ p->migrate_disable = 0;
+
++ if (p->migrate_disable_update) {
++ unsigned long flags;
++ struct rq *rq;
++
++ rq = task_rq_lock(p, &flags);
++ update_rq_clock(rq);
++
++ __do_set_cpus_allowed_tail(p, &p->cpus_allowed);
++ task_rq_unlock(rq, p, &flags);
++
++ p->migrate_disable_update = 0;
++
++ WARN_ON(smp_processor_id() != task_cpu(p));
++ if (!cpumask_test_cpu(task_cpu(p), &p->cpus_allowed)) {
++ const struct cpumask *cpu_valid_mask = cpu_active_mask;
++ struct migration_arg arg;
++ unsigned int dest_cpu;
++
++ if (p->flags & PF_KTHREAD) {
++ /*
++ * Kernel threads are allowed on online && !active CPUs
++ */
++ cpu_valid_mask = cpu_online_mask;
++ }
++ dest_cpu = cpumask_any_and(cpu_valid_mask, &p->cpus_allowed);
++ arg.task = p;
++ arg.dest_cpu = dest_cpu;
++
++ unpin_current_cpu();
++ preempt_lazy_enable();
++ preempt_enable();
++ stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg);
++ tlb_migrate_finish(p->mm);
++ return;
++ }
++ }
++
+ unpin_current_cpu();
+ preempt_enable();
+ preempt_lazy_enable();
@@ -23112,7 +23476,7 @@ index 20253dbc8610..e9b8d518202e 100644
/*
* Pick up the highest-prio task:
*/
-@@ -3172,19 +3362,6 @@ static void __sched notrace __schedule(bool preempt)
+@@ -3171,19 +3420,6 @@ static void __sched notrace __schedule(bool preempt)
} else {
deactivate_task(rq, prev, DEQUEUE_SLEEP);
prev->on_rq = 0;
@@ -23132,7 +23496,7 @@ index 20253dbc8610..e9b8d518202e 100644
}
switch_count = &prev->nvcsw;
}
-@@ -3194,6 +3371,7 @@ static void __sched notrace __schedule(bool preempt)
+@@ -3193,6 +3429,7 @@ static void __sched notrace __schedule(bool preempt)
next = pick_next_task(rq, prev);
clear_tsk_need_resched(prev);
@@ -23140,14 +23504,14 @@ index 20253dbc8610..e9b8d518202e 100644
clear_preempt_need_resched();
rq->clock_skip_update = 0;
-@@ -3215,9 +3393,20 @@ static void __sched notrace __schedule(bool preempt)
+@@ -3214,8 +3451,19 @@ static void __sched notrace __schedule(bool preempt)
static inline void sched_submit_work(struct task_struct *tsk)
{
- if (!tsk->state || tsk_is_pi_blocked(tsk))
+ if (!tsk->state)
return;
- /*
++ /*
+ * If a worker went to sleep, notify and ask workqueue whether
+ * it wants to wake up a task to maintain concurrency.
+ */
@@ -23158,11 +23522,10 @@ index 20253dbc8610..e9b8d518202e 100644
+ if (tsk_is_pi_blocked(tsk))
+ return;
+
-+ /*
+ /*
* If we are going to sleep and we have plugged IO queued,
* make sure to submit it to avoid deadlocks.
- */
-@@ -3225,6 +3414,12 @@ static inline void sched_submit_work(struct task_struct *tsk)
+@@ -3224,6 +3472,12 @@ static inline void sched_submit_work(struct task_struct *tsk)
blk_schedule_flush_plug(tsk);
}
@@ -23175,7 +23538,7 @@ index 20253dbc8610..e9b8d518202e 100644
asmlinkage __visible void __sched schedule(void)
{
struct task_struct *tsk = current;
-@@ -3235,6 +3430,7 @@ asmlinkage __visible void __sched schedule(void)
+@@ -3234,6 +3488,7 @@ asmlinkage __visible void __sched schedule(void)
__schedule(false);
sched_preempt_enable_no_resched();
} while (need_resched());
@@ -23183,7 +23546,7 @@ index 20253dbc8610..e9b8d518202e 100644
}
EXPORT_SYMBOL(schedule);
-@@ -3283,6 +3479,30 @@ static void __sched notrace preempt_schedule_common(void)
+@@ -3282,6 +3537,30 @@ static void __sched notrace preempt_schedule_common(void)
} while (need_resched());
}
@@ -23214,7 +23577,7 @@ index 20253dbc8610..e9b8d518202e 100644
#ifdef CONFIG_PREEMPT
/*
* this is the entry point to schedule() from in-kernel preemption
-@@ -3297,6 +3517,8 @@ asmlinkage __visible void __sched notrace preempt_schedule(void)
+@@ -3296,6 +3575,8 @@ asmlinkage __visible void __sched notrace preempt_schedule(void)
*/
if (likely(!preemptible()))
return;
@@ -23223,7 +23586,7 @@ index 20253dbc8610..e9b8d518202e 100644
preempt_schedule_common();
}
-@@ -3323,6 +3545,8 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void)
+@@ -3322,6 +3603,8 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void)
if (likely(!preemptible()))
return;
@@ -23232,7 +23595,7 @@ index 20253dbc8610..e9b8d518202e 100644
do {
preempt_disable_notrace();
-@@ -3332,7 +3556,16 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void)
+@@ -3331,7 +3614,16 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void)
* an infinite recursion.
*/
prev_ctx = exception_enter();
@@ -23249,7 +23612,7 @@ index 20253dbc8610..e9b8d518202e 100644
exception_exit(prev_ctx);
preempt_enable_no_resched_notrace();
-@@ -4676,6 +4909,7 @@ int __cond_resched_lock(spinlock_t *lock)
+@@ -4675,6 +4967,7 @@ int __cond_resched_lock(spinlock_t *lock)
}
EXPORT_SYMBOL(__cond_resched_lock);
@@ -23257,7 +23620,7 @@ index 20253dbc8610..e9b8d518202e 100644
int __sched __cond_resched_softirq(void)
{
BUG_ON(!in_softirq());
-@@ -4689,6 +4923,7 @@ int __sched __cond_resched_softirq(void)
+@@ -4688,6 +4981,7 @@ int __sched __cond_resched_softirq(void)
return 0;
}
EXPORT_SYMBOL(__cond_resched_softirq);
@@ -23265,7 +23628,7 @@ index 20253dbc8610..e9b8d518202e 100644
/**
* yield - yield the current processor to other threads.
-@@ -5055,7 +5290,9 @@ void init_idle(struct task_struct *idle, int cpu)
+@@ -5054,7 +5348,9 @@ void init_idle(struct task_struct *idle, int cpu)
/* Set the preempt count _outside_ the spinlocks! */
init_idle_preempt_count(idle, cpu);
@@ -23276,7 +23639,7 @@ index 20253dbc8610..e9b8d518202e 100644
/*
* The idle tasks have their own, simple scheduling class:
*/
-@@ -5196,6 +5433,8 @@ void sched_setnuma(struct task_struct *p, int nid)
+@@ -5195,6 +5491,8 @@ void sched_setnuma(struct task_struct *p, int nid)
#endif /* CONFIG_NUMA_BALANCING */
#ifdef CONFIG_HOTPLUG_CPU
@@ -23285,7 +23648,7 @@ index 20253dbc8610..e9b8d518202e 100644
/*
* Ensures that the idle task is using init_mm right before its cpu goes
* offline.
-@@ -5210,7 +5449,11 @@ void idle_task_exit(void)
+@@ -5209,7 +5507,11 @@ void idle_task_exit(void)
switch_mm(mm, &init_mm, current);
finish_arch_post_lock_switch();
}
@@ -23298,7 +23661,7 @@ index 20253dbc8610..e9b8d518202e 100644
}
/*
-@@ -5583,6 +5826,10 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
+@@ -5581,6 +5883,10 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
case CPU_DEAD:
calc_load_migrate(rq);
@@ -23309,7 +23672,15 @@ index 20253dbc8610..e9b8d518202e 100644
break;
#endif
}
-@@ -7566,7 +7813,7 @@ void __init sched_init(void)
+@@ -5911,6 +6217,7 @@ static int init_rootdomain(struct root_domain *rd)
+ rd->rto_cpu = -1;
+ raw_spin_lock_init(&rd->rto_lock);
+ init_irq_work(&rd->rto_push_work, rto_push_irq_work_func);
++ rd->rto_push_work.flags |= IRQ_WORK_HARD_IRQ;
+ #endif
+
+ init_dl_bw(&rd->dl_bw);
+@@ -7585,7 +7892,7 @@ void __init sched_init(void)
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
static inline int preempt_count_equals(int preempt_offset)
{
@@ -23514,7 +23885,7 @@ index a1aecbedf5b1..558b98af241d 100644
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
-index e984f059e5fc..20e0c9b9ace5 100644
+index a996f7356216..645c18fe2075 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -134,7 +134,7 @@ static void inc_dl_migration(struct sched_dl_entity *dl_se, struct dl_rq *dl_rq)
@@ -23535,15 +23906,15 @@ index e984f059e5fc..20e0c9b9ace5 100644
dl_rq->dl_nr_migratory--;
update_dl_migration(dl_rq);
-@@ -697,6 +697,7 @@ void init_dl_task_timer(struct sched_dl_entity *dl_se)
+@@ -702,6 +702,7 @@ void init_dl_task_timer(struct sched_dl_entity *dl_se)
hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
timer->function = dl_task_timer;
+ timer->irqsafe = 1;
}
- static
-@@ -989,7 +990,7 @@ static void enqueue_task_dl(struct rq *rq, struct task_struct *p, int flags)
+ /*
+@@ -1039,7 +1040,7 @@ static void enqueue_task_dl(struct rq *rq, struct task_struct *p, int flags)
enqueue_dl_entity(&p->dl, pi_se, flags);
@@ -23552,7 +23923,7 @@ index e984f059e5fc..20e0c9b9ace5 100644
enqueue_pushable_dl_task(rq, p);
}
-@@ -1067,9 +1068,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
+@@ -1117,9 +1118,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
* try to make it stay here, it might be important.
*/
if (unlikely(dl_task(curr)) &&
@@ -23564,7 +23935,7 @@ index e984f059e5fc..20e0c9b9ace5 100644
int target = find_later_rq(p);
if (target != -1 &&
-@@ -1090,7 +1091,7 @@ static void check_preempt_equal_dl(struct rq *rq, struct task_struct *p)
+@@ -1140,7 +1141,7 @@ static void check_preempt_equal_dl(struct rq *rq, struct task_struct *p)
* Current can't be migrated, useless to reschedule,
* let's hope p can move out.
*/
@@ -23573,7 +23944,7 @@ index e984f059e5fc..20e0c9b9ace5 100644
cpudl_find(&rq->rd->cpudl, rq->curr, NULL) == -1)
return;
-@@ -1098,7 +1099,7 @@ static void check_preempt_equal_dl(struct rq *rq, struct task_struct *p)
+@@ -1148,7 +1149,7 @@ static void check_preempt_equal_dl(struct rq *rq, struct task_struct *p)
* p is migratable, so let's not schedule it and
* see if it is pushed or pulled somewhere else.
*/
@@ -23582,7 +23953,7 @@ index e984f059e5fc..20e0c9b9ace5 100644
cpudl_find(&rq->rd->cpudl, p, NULL) != -1)
return;
-@@ -1212,7 +1213,7 @@ static void put_prev_task_dl(struct rq *rq, struct task_struct *p)
+@@ -1262,7 +1263,7 @@ static void put_prev_task_dl(struct rq *rq, struct task_struct *p)
{
update_curr_dl(rq);
@@ -23591,7 +23962,7 @@ index e984f059e5fc..20e0c9b9ace5 100644
enqueue_pushable_dl_task(rq, p);
}
-@@ -1335,7 +1336,7 @@ static int find_later_rq(struct task_struct *task)
+@@ -1385,7 +1386,7 @@ static int find_later_rq(struct task_struct *task)
if (unlikely(!later_mask))
return -1;
@@ -23600,7 +23971,7 @@ index e984f059e5fc..20e0c9b9ace5 100644
return -1;
/*
-@@ -1441,7 +1442,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq)
+@@ -1491,7 +1492,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq)
if (double_lock_balance(rq, later_rq)) {
if (unlikely(task_rq(task) != rq ||
!cpumask_test_cpu(later_rq->cpu,
@@ -23609,7 +23980,7 @@ index e984f059e5fc..20e0c9b9ace5 100644
task_running(rq, task) ||
!task_on_rq_queued(task))) {
double_unlock_balance(rq, later_rq);
-@@ -1480,7 +1481,7 @@ static struct task_struct *pick_next_pushable_dl_task(struct rq *rq)
+@@ -1530,7 +1531,7 @@ static struct task_struct *pick_next_pushable_dl_task(struct rq *rq)
BUG_ON(rq->cpu != task_cpu(p));
BUG_ON(task_current(rq, p));
@@ -23618,7 +23989,7 @@ index e984f059e5fc..20e0c9b9ace5 100644
BUG_ON(!task_on_rq_queued(p));
BUG_ON(!dl_task(p));
-@@ -1519,7 +1520,7 @@ retry:
+@@ -1569,7 +1570,7 @@ static int push_dl_task(struct rq *rq)
*/
if (dl_task(rq->curr) &&
dl_time_before(next_task->dl.deadline, rq->curr->dl.deadline) &&
@@ -23627,7 +23998,7 @@ index e984f059e5fc..20e0c9b9ace5 100644
resched_curr(rq);
return 0;
}
-@@ -1666,9 +1667,9 @@ static void task_woken_dl(struct rq *rq, struct task_struct *p)
+@@ -1716,9 +1717,9 @@ static void task_woken_dl(struct rq *rq, struct task_struct *p)
{
if (!task_running(rq, p) &&
!test_tsk_need_resched(rq->curr) &&
@@ -23639,7 +24010,7 @@ index e984f059e5fc..20e0c9b9ace5 100644
!dl_entity_preempt(&p->dl, &rq->curr->dl))) {
push_dl_tasks(rq);
}
-@@ -1769,7 +1770,7 @@ static void switched_to_dl(struct rq *rq, struct task_struct *p)
+@@ -1819,7 +1820,7 @@ static void switched_to_dl(struct rq *rq, struct task_struct *p)
{
if (task_on_rq_queued(p) && rq->curr != p) {
#ifdef CONFIG_SMP
@@ -23774,7 +24145,7 @@ index 69631fa46c2f..6d28fcd08872 100644
#ifdef HAVE_RT_PUSH_IPI
/*
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
-index 78ae5c1d9412..4ac6937f4a65 100644
+index 95fefb364dab..14f2d740edab 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -47,6 +47,7 @@ void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime)
@@ -23785,15 +24156,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
rt_b->rt_period_timer.function = sched_rt_period_timer;
}
-@@ -93,6 +94,7 @@ void init_rt_rq(struct rt_rq *rt_rq)
- rt_rq->push_cpu = nr_cpu_ids;
- raw_spin_lock_init(&rt_rq->push_lock);
- init_irq_work(&rt_rq->push_work, push_irq_work_func);
-+ rt_rq->push_work.flags |= IRQ_WORK_HARD_IRQ;
- #endif
- #endif /* CONFIG_SMP */
- /* We start is dequeued state, because no RT tasks are queued */
-@@ -326,7 +328,7 @@ static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
+@@ -315,7 +316,7 @@ static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
rt_rq = &rq_of_rt_rq(rt_rq)->rt;
rt_rq->rt_nr_total++;
@@ -23802,7 +24165,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
rt_rq->rt_nr_migratory++;
update_rt_migration(rt_rq);
-@@ -343,7 +345,7 @@ static void dec_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
+@@ -332,7 +333,7 @@ static void dec_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
rt_rq = &rq_of_rt_rq(rt_rq)->rt;
rt_rq->rt_nr_total--;
@@ -23811,7 +24174,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
rt_rq->rt_nr_migratory--;
update_rt_migration(rt_rq);
-@@ -1262,7 +1264,7 @@ enqueue_task_rt(struct rq *rq, struct task_struct *p, int flags)
+@@ -1251,7 +1252,7 @@ enqueue_task_rt(struct rq *rq, struct task_struct *p, int flags)
enqueue_rt_entity(rt_se, flags & ENQUEUE_HEAD);
@@ -23820,7 +24183,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
enqueue_pushable_task(rq, p);
}
-@@ -1351,7 +1353,7 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags)
+@@ -1340,7 +1341,7 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags)
* will have to sort it out.
*/
if (curr && unlikely(rt_task(curr)) &&
@@ -23829,7 +24192,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
curr->prio <= p->prio)) {
int target = find_lowest_rq(p);
-@@ -1375,7 +1377,7 @@ static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p)
+@@ -1364,7 +1365,7 @@ static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p)
* Current can't be migrated, useless to reschedule,
* let's hope p can move out.
*/
@@ -23838,7 +24201,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
!cpupri_find(&rq->rd->cpupri, rq->curr, NULL))
return;
-@@ -1383,7 +1385,7 @@ static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p)
+@@ -1372,7 +1373,7 @@ static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p)
* p is migratable, so let's not schedule it and
* see if it is pushed or pulled somewhere else.
*/
@@ -23847,7 +24210,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
&& cpupri_find(&rq->rd->cpupri, p, NULL))
return;
-@@ -1517,7 +1519,7 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p)
+@@ -1506,7 +1507,7 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p)
* The previous task needs to be made eligible for pushing
* if it is still active
*/
@@ -23856,7 +24219,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
enqueue_pushable_task(rq, p);
}
-@@ -1567,7 +1569,7 @@ static int find_lowest_rq(struct task_struct *task)
+@@ -1556,7 +1557,7 @@ static int find_lowest_rq(struct task_struct *task)
if (unlikely(!lowest_mask))
return -1;
@@ -23865,7 +24228,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
return -1; /* No other targets possible */
if (!cpupri_find(&task_rq(task)->rd->cpupri, task, lowest_mask))
-@@ -1699,7 +1701,7 @@ static struct task_struct *pick_next_pushable_task(struct rq *rq)
+@@ -1688,7 +1689,7 @@ static struct task_struct *pick_next_pushable_task(struct rq *rq)
BUG_ON(rq->cpu != task_cpu(p));
BUG_ON(task_current(rq, p));
@@ -23874,7 +24237,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
BUG_ON(!task_on_rq_queued(p));
BUG_ON(!rt_task(p));
-@@ -2059,9 +2061,9 @@ static void task_woken_rt(struct rq *rq, struct task_struct *p)
+@@ -2060,9 +2061,9 @@ static void task_woken_rt(struct rq *rq, struct task_struct *p)
{
if (!task_running(rq, p) &&
!test_tsk_need_resched(rq->curr) &&
@@ -23886,7 +24249,7 @@ index 78ae5c1d9412..4ac6937f4a65 100644
rq->curr->prio <= p->prio))
push_rt_tasks(rq);
}
-@@ -2134,7 +2136,7 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p)
+@@ -2135,7 +2136,7 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p)
*/
if (task_on_rq_queued(p) && rq->curr != p) {
#ifdef CONFIG_SMP
@@ -23896,10 +24259,10 @@ index 78ae5c1d9412..4ac6937f4a65 100644
#endif /* CONFIG_SMP */
if (p->prio < rq->curr->prio)
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
-index 4e5db65d1aab..ae26df3bd63f 100644
+index 448a8266ceea..e45a90ce57f7 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
-@@ -1100,6 +1100,7 @@ static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev)
+@@ -1110,6 +1110,7 @@ static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev)
#define WF_SYNC 0x01 /* waker goes to sleep after wakeup */
#define WF_FORK 0x02 /* child wakeup after fork */
#define WF_MIGRATED 0x4 /* internal use, task got migrated */
@@ -23907,7 +24270,7 @@ index 4e5db65d1aab..ae26df3bd63f 100644
/*
* To aid in avoiding the subversion of "niceness" due to uneven distribution
-@@ -1299,6 +1300,15 @@ extern void init_sched_fair_class(void);
+@@ -1309,6 +1310,15 @@ extern void init_sched_fair_class(void);
extern void resched_curr(struct rq *rq);
extern void resched_cpu(int cpu);
@@ -24252,7 +24615,7 @@ index 000000000000..1950f40ca725
+}
+EXPORT_SYMBOL_GPL(swork_put);
diff --git a/kernel/signal.c b/kernel/signal.c
-index f3f1f7a972fd..bc2c990f3f63 100644
+index 4a548c6a4118..e870a133857b 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -14,6 +14,7 @@
@@ -24263,7 +24626,7 @@ index f3f1f7a972fd..bc2c990f3f63 100644
#include <linux/fs.h>
#include <linux/tty.h>
#include <linux/binfmts.h>
-@@ -352,13 +353,30 @@ static bool task_participate_group_stop(struct task_struct *task)
+@@ -354,13 +355,30 @@ static bool task_participate_group_stop(struct task_struct *task)
return false;
}
@@ -24295,7 +24658,7 @@ index f3f1f7a972fd..bc2c990f3f63 100644
{
struct sigqueue *q = NULL;
struct user_struct *user;
-@@ -375,7 +393,10 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi
+@@ -377,7 +395,10 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi
if (override_rlimit ||
atomic_read(&user->sigpending) <=
task_rlimit(t, RLIMIT_SIGPENDING)) {
@@ -24307,7 +24670,7 @@ index f3f1f7a972fd..bc2c990f3f63 100644
} else {
print_dropped_signal(sig);
}
-@@ -392,6 +413,13 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi
+@@ -394,6 +415,13 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi
return q;
}
@@ -24321,7 +24684,7 @@ index f3f1f7a972fd..bc2c990f3f63 100644
static void __sigqueue_free(struct sigqueue *q)
{
if (q->flags & SIGQUEUE_PREALLOC)
-@@ -401,6 +429,21 @@ static void __sigqueue_free(struct sigqueue *q)
+@@ -403,6 +431,21 @@ static void __sigqueue_free(struct sigqueue *q)
kmem_cache_free(sigqueue_cachep, q);
}
@@ -24343,10 +24706,11 @@ index f3f1f7a972fd..bc2c990f3f63 100644
void flush_sigqueue(struct sigpending *queue)
{
struct sigqueue *q;
-@@ -414,6 +457,21 @@ void flush_sigqueue(struct sigpending *queue)
+@@ -415,6 +458,21 @@ void flush_sigqueue(struct sigpending *queue)
+ }
}
- /*
++/*
+ * Called from __exit_signal. Flush tsk->pending and
+ * tsk->sigqueue_cache
+ */
@@ -24361,21 +24725,20 @@ index f3f1f7a972fd..bc2c990f3f63 100644
+ kmem_cache_free(sigqueue_cachep, q);
+}
+
-+/*
+ /*
* Flush all pending signals for this kthread.
*/
- void flush_signals(struct task_struct *t)
-@@ -525,7 +583,7 @@ static void collect_signal(int sig, struct sigpending *list, siginfo_t *info)
- still_pending:
- list_del_init(&first->list);
- copy_siginfo(info, &first->info);
+@@ -534,7 +592,7 @@ static void collect_signal(int sig, struct sigpending *list, siginfo_t *info,
+ (info->si_code == SI_TIMER) &&
+ (info->si_sys_private);
+
- __sigqueue_free(first);
+ sigqueue_free_current(first);
} else {
/*
* Ok, it wasn't in the queue. This must be
-@@ -560,6 +618,8 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
- {
+@@ -570,6 +628,8 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
+ bool resched_timer = false;
int signr;
+ WARN_ON_ONCE(tsk != current);
@@ -24383,7 +24746,7 @@ index f3f1f7a972fd..bc2c990f3f63 100644
/* We only dequeue private signals from ourselves, we don't let
* signalfd steal them
*/
-@@ -1156,8 +1216,8 @@ int do_send_sig_info(int sig, struct siginfo *info, struct task_struct *p,
+@@ -1166,8 +1226,8 @@ int do_send_sig_info(int sig, struct siginfo *info, struct task_struct *p,
* We don't want to have recursive SIGSEGV's etc, for example,
* that is why we also clear SIGNAL_UNKILLABLE.
*/
@@ -24394,7 +24757,7 @@ index f3f1f7a972fd..bc2c990f3f63 100644
{
unsigned long int flags;
int ret, blocked, ignored;
-@@ -1182,6 +1242,39 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
+@@ -1192,6 +1252,39 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
return ret;
}
@@ -24434,7 +24797,7 @@ index f3f1f7a972fd..bc2c990f3f63 100644
/*
* Nuke all other threads in the group.
*/
-@@ -1216,12 +1309,12 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
+@@ -1226,12 +1319,12 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
* Disable interrupts early to avoid deadlocks.
* See rcu_read_unlock() comment header for details.
*/
@@ -24449,7 +24812,7 @@ index f3f1f7a972fd..bc2c990f3f63 100644
break;
}
/*
-@@ -1242,7 +1335,7 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
+@@ -1252,7 +1345,7 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
}
spin_unlock(&sighand->siglock);
rcu_read_unlock();
@@ -24458,7 +24821,7 @@ index f3f1f7a972fd..bc2c990f3f63 100644
}
return sighand;
-@@ -1485,7 +1578,8 @@ EXPORT_SYMBOL(kill_pid);
+@@ -1495,7 +1588,8 @@ EXPORT_SYMBOL(kill_pid);
*/
struct sigqueue *sigqueue_alloc(void)
{
@@ -24468,7 +24831,7 @@ index f3f1f7a972fd..bc2c990f3f63 100644
if (q)
q->flags |= SIGQUEUE_PREALLOC;
-@@ -1846,15 +1940,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
+@@ -1856,15 +1950,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
if (gstop_done && ptrace_reparented(current))
do_notify_parent_cldstop(current, false, why);
@@ -24713,7 +25076,7 @@ index 479e4436f787..cb9c1d5dee10 100644
/*
* Mask out PF_MEMALLOC s current task context is borrowed for the
-@@ -254,36 +423,7 @@ restart:
+@@ -254,36 +423,7 @@ asmlinkage __visible void __do_softirq(void)
/* Reset the pending bitmask before enabling irqs */
set_softirq_pending(0);
@@ -24751,10 +25114,11 @@ index 479e4436f787..cb9c1d5dee10 100644
pending = local_softirq_pending();
if (pending) {
-@@ -320,6 +460,310 @@ asmlinkage __visible void do_softirq(void)
+@@ -319,6 +459,310 @@ asmlinkage __visible void do_softirq(void)
+ local_irq_restore(flags);
}
- /*
++/*
+ * This function must run with irqs disabled!
+ */
+void raise_softirq_irqoff(unsigned int nr)
@@ -25058,10 +25422,9 @@ index 479e4436f787..cb9c1d5dee10 100644
+}
+
+#endif /* PREEMPT_RT_FULL */
-+/*
+ /*
* Enter an interrupt context.
*/
- void irq_enter(void)
@@ -330,9 +774,9 @@ void irq_enter(void)
* Prevent raise_softirq from needlessly waking up ksoftirqd
* here, as softirq will be serviced on return from interrupt.
@@ -25594,7 +25957,7 @@ index a3bbaee77c58..f84d3b45cda7 100644
if (work) {
cpu_stop_fn_t fn = work->fn;
-@@ -450,6 +453,16 @@ repeat:
+@@ -450,6 +453,16 @@ static void cpu_stopper_thread(unsigned int cpu)
struct cpu_stop_done *done = work->done;
char ksym_buf[KSYM_NAME_LEN] __maybe_unused;
@@ -25635,7 +25998,7 @@ index a3bbaee77c58..f84d3b45cda7 100644
/* Busy wait for completion. */
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
-index 17f7bcff1e02..ba3d60144838 100644
+index 17f7bcff1e02..120fc8932165 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -48,11 +48,13 @@
@@ -25810,6 +26173,7 @@ index 17f7bcff1e02..ba3d60144838 100644
cpu_base->running = NULL;
}
+-static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now)
+#ifdef CONFIG_PREEMPT_RT_BASE
+static void hrtimer_rt_reprogram(int restart, struct hrtimer *timer,
+ struct hrtimer_clock_base *base)
@@ -25911,7 +26275,7 @@ index 17f7bcff1e02..ba3d60144838 100644
+
+static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer);
+
- static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now)
++static int __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now)
{
struct hrtimer_clock_base *base = cpu_base->clock_base;
unsigned int active = cpu_base->active_bases;
@@ -25935,7 +26299,7 @@ index 17f7bcff1e02..ba3d60144838 100644
/*
* The immediate goal for using the softexpires is
* minimizing wakeups, not running timers at the
-@@ -1314,9 +1505,14 @@ static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now)
+@@ -1314,9 +1505,13 @@ static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now)
if (basenow.tv64 < hrtimer_get_softexpires_tv64(timer))
break;
@@ -25946,12 +26310,57 @@ index 17f7bcff1e02..ba3d60144838 100644
+ raise = 1;
}
}
++ return raise;
+ }
+
+ #ifdef CONFIG_HIGH_RES_TIMERS
+@@ -1330,6 +1525,7 @@ void hrtimer_interrupt(struct clock_event_device *dev)
+ struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
+ ktime_t expires_next, now, entry_time, delta;
+ int retries = 0;
++ int raise;
+
+ BUG_ON(!cpu_base->hres_active);
+ cpu_base->nr_events++;
+@@ -1348,7 +1544,7 @@ void hrtimer_interrupt(struct clock_event_device *dev)
+ */
+ cpu_base->expires_next.tv64 = KTIME_MAX;
+
+- __hrtimer_run_queues(cpu_base, now);
++ raise = __hrtimer_run_queues(cpu_base, now);
+
+ /* Reevaluate the clock bases for the next expiry */
+ expires_next = __hrtimer_get_next_event(cpu_base);
+@@ -1359,6 +1555,8 @@ void hrtimer_interrupt(struct clock_event_device *dev)
+ cpu_base->expires_next = expires_next;
+ cpu_base->in_hrtirq = 0;
+ raw_spin_unlock(&cpu_base->lock);
++ if (raise)
++ raise_softirq_irqoff(HRTIMER_SOFTIRQ);
+
+ /* Reprogramming necessary ? */
+ if (!tick_program_event(expires_next, 0)) {
+@@ -1438,6 +1636,7 @@ void hrtimer_run_queues(void)
+ {
+ struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
+ ktime_t now;
++ int raise;
+
+ if (__hrtimer_hres_active(cpu_base))
+ return;
+@@ -1456,8 +1655,10 @@ void hrtimer_run_queues(void)
+
+ raw_spin_lock(&cpu_base->lock);
+ now = hrtimer_update_base(cpu_base);
+- __hrtimer_run_queues(cpu_base, now);
++ raise = __hrtimer_run_queues(cpu_base, now);
+ raw_spin_unlock(&cpu_base->lock);
+ if (raise)
+ raise_softirq_irqoff(HRTIMER_SOFTIRQ);
}
- #ifdef CONFIG_HIGH_RES_TIMERS
-@@ -1479,16 +1675,18 @@ static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer)
+ /*
+@@ -1479,16 +1680,18 @@ static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer)
void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, struct task_struct *task)
{
sl->timer.function = hrtimer_wakeup;
@@ -25972,7 +26381,7 @@ index 17f7bcff1e02..ba3d60144838 100644
hrtimer_start_expires(&t->timer, mode);
if (likely(t->task))
-@@ -1530,7 +1728,8 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
+@@ -1530,7 +1733,8 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
HRTIMER_MODE_ABS);
hrtimer_set_expires_tv64(&t.timer, restart->nanosleep.expires);
@@ -25982,7 +26391,7 @@ index 17f7bcff1e02..ba3d60144838 100644
goto out;
rmtp = restart->nanosleep.rmtp;
-@@ -1547,8 +1746,10 @@ out:
+@@ -1547,8 +1751,10 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
return ret;
}
@@ -25995,7 +26404,7 @@ index 17f7bcff1e02..ba3d60144838 100644
{
struct restart_block *restart;
struct hrtimer_sleeper t;
-@@ -1561,7 +1762,7 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
+@@ -1561,7 +1767,7 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
hrtimer_init_on_stack(&t.timer, clockid, mode);
hrtimer_set_expires_range_ns(&t.timer, timespec_to_ktime(*rqtp), slack);
@@ -26004,7 +26413,7 @@ index 17f7bcff1e02..ba3d60144838 100644
goto out;
/* Absolute timers do not update the rmtp value and restart: */
-@@ -1588,6 +1789,12 @@ out:
+@@ -1588,6 +1794,12 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
return ret;
}
@@ -26017,7 +26426,7 @@ index 17f7bcff1e02..ba3d60144838 100644
SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp,
struct timespec __user *, rmtp)
{
-@@ -1602,6 +1809,26 @@ SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp,
+@@ -1602,6 +1814,26 @@ SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp,
return hrtimer_nanosleep(&tu, rmtp, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
}
@@ -26044,7 +26453,7 @@ index 17f7bcff1e02..ba3d60144838 100644
/*
* Functions related to boot-time initialization:
*/
-@@ -1613,10 +1840,14 @@ static void init_hrtimers_cpu(int cpu)
+@@ -1613,15 +1845,19 @@ static void init_hrtimers_cpu(int cpu)
for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
cpu_base->clock_base[i].cpu_base = cpu_base;
timerqueue_init_head(&cpu_base->clock_base[i].active);
@@ -26059,7 +26468,55 @@ index 17f7bcff1e02..ba3d60144838 100644
}
#ifdef CONFIG_HOTPLUG_CPU
-@@ -1714,11 +1945,21 @@ static struct notifier_block hrtimers_nb = {
+
+-static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
++static int migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
+ struct hrtimer_clock_base *new_base)
+ {
+ struct hrtimer *timer;
+@@ -1649,12 +1885,21 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
+ */
+ enqueue_hrtimer(timer, new_base);
+ }
++#ifdef CONFIG_PREEMPT_RT_BASE
++ list_splice_tail(&old_base->expired, &new_base->expired);
++ /*
++ * Tell the caller to raise HRTIMER_SOFTIRQ. We can't safely
++ * acquire ktimersoftd->pi_lock while the base lock is held.
++ */
++ return !list_empty(&new_base->expired);
++#endif
++ return 0;
+ }
+
+ static void migrate_hrtimers(int scpu)
+ {
+ struct hrtimer_cpu_base *old_base, *new_base;
+- int i;
++ int i, raise = 0;
+
+ BUG_ON(cpu_online(scpu));
+ tick_cancel_sched_timer(scpu);
+@@ -1670,13 +1915,16 @@ static void migrate_hrtimers(int scpu)
+ raw_spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING);
+
+ for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
+- migrate_hrtimer_list(&old_base->clock_base[i],
+- &new_base->clock_base[i]);
++ raise |= migrate_hrtimer_list(&old_base->clock_base[i],
++ &new_base->clock_base[i]);
+ }
+
+ raw_spin_unlock(&old_base->lock);
+ raw_spin_unlock(&new_base->lock);
+
++ if (raise)
++ raise_softirq_irqoff(HRTIMER_SOFTIRQ);
++
+ /* Check, if we got expired work to do */
+ __hrtimer_peek_ahead_timers();
+ local_irq_enable();
+@@ -1714,11 +1962,21 @@ static struct notifier_block hrtimers_nb = {
.notifier_call = hrtimer_cpu_notify,
};
@@ -26085,7 +26542,7 @@ diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c
index 1d5c7204ddc9..184de6751180 100644
--- a/kernel/time/itimer.c
+++ b/kernel/time/itimer.c
-@@ -213,6 +213,7 @@ again:
+@@ -213,6 +213,7 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
/* We are sharing ->siglock with it_real_fn() */
if (hrtimer_try_to_cancel(timer) < 0) {
spin_unlock_irq(&tsk->sighand->siglock);
@@ -26464,7 +26921,7 @@ index f2826c35e918..464a98155a0e 100644
/* Set a POSIX.1b interval timer. */
/* timr->it_lock is taken. */
static int
-@@ -903,6 +919,7 @@ retry:
+@@ -903,6 +919,7 @@ SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
if (!timr)
return -EINVAL;
@@ -26472,7 +26929,7 @@ index f2826c35e918..464a98155a0e 100644
kc = clockid_to_kclock(timr->it_clock);
if (WARN_ON_ONCE(!kc || !kc->timer_set))
error = -EINVAL;
-@@ -911,9 +928,12 @@ retry:
+@@ -911,9 +928,12 @@ SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
unlock_timer(timr, flag);
if (error == TIMER_RETRY) {
@@ -26485,7 +26942,7 @@ index f2826c35e918..464a98155a0e 100644
if (old_setting && !error &&
copy_to_user(old_setting, &old_spec, sizeof (old_spec)))
-@@ -951,10 +971,15 @@ retry_delete:
+@@ -951,10 +971,15 @@ SYSCALL_DEFINE1(timer_delete, timer_t, timer_id)
if (!timer)
return -EINVAL;
@@ -26566,7 +27023,7 @@ index 4fcd99e12aa0..5a47f2e98faf 100644
clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT);
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
-index 22c57e191a23..d536824cbd36 100644
+index e5d228f7224c..45e9456da50f 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -62,7 +62,8 @@ static void tick_do_update_jiffies64(ktime_t now)
@@ -26631,7 +27088,7 @@ index 22c57e191a23..d536824cbd36 100644
};
/*
-@@ -578,10 +589,10 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
+@@ -583,10 +594,10 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
/* Read jiffies and the time when jiffies were updated last */
do {
@@ -26643,8 +27100,8 @@ index 22c57e191a23..d536824cbd36 100644
+ } while (read_seqcount_retry(&jiffies_seq, seq));
ts->last_jiffies = basejiff;
- if (rcu_needs_cpu(basemono, &next_rcu) ||
-@@ -753,14 +764,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
+ /*
+@@ -768,14 +779,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
return false;
if (unlikely(local_softirq_pending() && cpu_online(cpu))) {
@@ -26660,7 +27117,7 @@ index 22c57e191a23..d536824cbd36 100644
return false;
}
-@@ -1100,6 +1104,7 @@ void tick_setup_sched_timer(void)
+@@ -1115,6 +1119,7 @@ void tick_setup_sched_timer(void)
* Emulate tick processing via per-CPU hrtimers:
*/
hrtimer_init(&ts->sched_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
@@ -26669,10 +27126,10 @@ index 22c57e191a23..d536824cbd36 100644
/* Get the next period (per cpu) */
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
-index 738012d68117..e060b34d5603 100644
+index 6e4866834d26..6c3e5323d06b 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
-@@ -2070,8 +2070,10 @@ EXPORT_SYMBOL(hardpps);
+@@ -2091,8 +2091,10 @@ EXPORT_SYMBOL(hardpps);
*/
void xtime_update(unsigned long ticks)
{
@@ -26700,7 +27157,7 @@ index 704f595ce83f..763a3e5121ff 100644
#define CS_NAME_LEN 32
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
-index bbc5d1114583..603699ff9411 100644
+index 125407144c01..13652dafe83a 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -80,6 +80,9 @@ struct tvec_root {
@@ -28241,7 +28698,7 @@ index 000000000000..7f6ee70dea41
+
+device_initcall(latency_hist_init);
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
-index 4c21c0b7dc91..d0e52efed27a 100644
+index 8aef4e63ac57..cdb7742283e5 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1652,6 +1652,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,
@@ -28255,7 +28712,7 @@ index 4c21c0b7dc91..d0e52efed27a 100644
@@ -1661,8 +1662,11 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,
#endif
((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) |
- ((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) |
+ ((pc & SOFTIRQ_OFFSET) ? TRACE_FLAG_SOFTIRQ : 0) |
- (tif_need_resched() ? TRACE_FLAG_NEED_RESCHED : 0) |
+ (tif_need_resched_now() ? TRACE_FLAG_NEED_RESCHED : 0) |
+ (need_resched_lazy() ? TRACE_FLAG_NEED_RESCHED_LAZY : 0) |
@@ -28560,7 +29017,7 @@ index c1e0b5f429b6..fa2e079cc314 100644
/* Enable the perf event */
watchdog_nmi_enable(cpu);
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
-index 2c2f971f3e75..d5b0f4fc0eb0 100644
+index 85555eb4d3cb..79f33789f330 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -48,6 +48,8 @@
@@ -28572,7 +29029,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
#include "workqueue_internal.h"
-@@ -121,11 +123,16 @@ enum {
+@@ -122,11 +124,16 @@ enum {
* cpu or grabbing pool->lock is enough for read access. If
* POOL_DISASSOCIATED is set, it's identical to L.
*
@@ -28590,7 +29047,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
*
* PW: wq_pool_mutex and wq->mutex protected for writes. Either for reads.
*
-@@ -134,7 +141,7 @@ enum {
+@@ -135,7 +142,7 @@ enum {
*
* WQ: wq->mutex protected.
*
@@ -28617,7 +29074,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
* determined without grabbing wq->mutex.
*/
struct work_struct unbound_release_work;
-@@ -331,6 +338,8 @@ EXPORT_SYMBOL_GPL(system_power_efficient_wq);
+@@ -332,6 +339,8 @@ EXPORT_SYMBOL_GPL(system_power_efficient_wq);
struct workqueue_struct *system_freezable_power_efficient_wq __read_mostly;
EXPORT_SYMBOL_GPL(system_freezable_power_efficient_wq);
@@ -28626,7 +29083,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
static int worker_thread(void *__worker);
static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
-@@ -338,20 +347,20 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
+@@ -339,20 +348,20 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
#include <trace/events/workqueue.h>
#define assert_rcu_or_pool_mutex() \
@@ -28653,7 +29110,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
#define for_each_cpu_worker_pool(pool, cpu) \
for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; \
-@@ -363,7 +372,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
+@@ -364,7 +373,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
* @pool: iteration cursor
* @pi: integer used for iteration
*
@@ -28662,7 +29119,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
* locked. If the pool needs to be used beyond the locking in effect, the
* caller is responsible for guaranteeing that the pool stays online.
*
-@@ -395,7 +404,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
+@@ -396,7 +405,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
* @pwq: iteration cursor
* @wq: the target workqueue
*
@@ -28671,7 +29128,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
* If the pwq needs to be used beyond the locking in effect, the caller is
* responsible for guaranteeing that the pwq stays online.
*
-@@ -407,6 +416,31 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
+@@ -408,6 +417,31 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
if (({ assert_rcu_or_wq_mutex(wq); false; })) { } \
else
@@ -28703,7 +29160,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
#ifdef CONFIG_DEBUG_OBJECTS_WORK
static struct debug_obj_descr work_debug_descr;
-@@ -557,7 +591,7 @@ static int worker_pool_assign_id(struct worker_pool *pool)
+@@ -558,7 +592,7 @@ static int worker_pool_assign_id(struct worker_pool *pool)
* @wq: the target workqueue
* @node: the node ID
*
@@ -28712,7 +29169,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
* read locked.
* If the pwq needs to be used beyond the locking in effect, the caller is
* responsible for guaranteeing that the pwq stays online.
-@@ -701,8 +735,8 @@ static struct pool_workqueue *get_work_pwq(struct work_struct *work)
+@@ -702,8 +736,8 @@ static struct pool_workqueue *get_work_pwq(struct work_struct *work)
* @work: the work item of interest
*
* Pools are created and destroyed under wq_pool_mutex, and allows read
@@ -28723,7 +29180,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
*
* All fields of the returned pool are accessible as long as the above
* mentioned locking is in effect. If the returned pool needs to be used
-@@ -839,51 +873,44 @@ static struct worker *first_idle_worker(struct worker_pool *pool)
+@@ -840,51 +874,44 @@ static struct worker *first_idle_worker(struct worker_pool *pool)
*/
static void wake_up_worker(struct worker_pool *pool)
{
@@ -28794,7 +29251,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
struct worker_pool *pool;
/*
-@@ -892,29 +919,26 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu)
+@@ -893,29 +920,26 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu)
* checking NOT_RUNNING.
*/
if (worker->flags & WORKER_NOT_RUNNING)
@@ -28834,7 +29291,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
}
/**
-@@ -1108,12 +1132,14 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq)
+@@ -1109,12 +1133,14 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq)
{
if (pwq) {
/*
@@ -28852,7 +29309,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
}
}
-@@ -1215,7 +1241,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork,
+@@ -1216,7 +1242,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork,
struct worker_pool *pool;
struct pool_workqueue *pwq;
@@ -28861,7 +29318,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
/* try to steal the timer if it exists */
if (is_dwork) {
-@@ -1234,6 +1260,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork,
+@@ -1235,6 +1261,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork,
if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work)))
return 0;
@@ -28869,7 +29326,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
/*
* The queueing is in progress, or it is already queued. Try to
* steal it from ->worklist without clearing WORK_STRUCT_PENDING.
-@@ -1272,14 +1299,16 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork,
+@@ -1273,14 +1300,16 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork,
set_work_pool_and_keep_pending(work, pool->id);
spin_unlock(&pool->lock);
@@ -28888,7 +29345,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
return -EAGAIN;
}
-@@ -1348,7 +1377,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
+@@ -1349,7 +1378,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
* queued or lose PENDING. Grabbing PENDING and queueing should
* happen with IRQ disabled.
*/
@@ -28897,7 +29354,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
debug_work_activate(work);
-@@ -1356,6 +1385,8 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
+@@ -1357,6 +1386,8 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
if (unlikely(wq->flags & __WQ_DRAINING) &&
WARN_ON_ONCE(!is_chained_work(wq)))
return;
@@ -28906,7 +29363,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
retry:
if (req_cpu == WORK_CPU_UNBOUND)
cpu = raw_smp_processor_id();
-@@ -1412,10 +1443,8 @@ retry:
+@@ -1413,10 +1444,8 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
/* pwq determined, queue */
trace_workqueue_queue_work(req_cpu, pwq, work);
@@ -28919,7 +29376,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
pwq->nr_in_flight[pwq->work_color]++;
work_flags = work_color_to_flags(pwq->work_color);
-@@ -1431,7 +1460,9 @@ retry:
+@@ -1432,7 +1461,9 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
insert_work(pwq, work, worklist, work_flags);
@@ -28929,7 +29386,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
}
/**
-@@ -1451,14 +1482,14 @@ bool queue_work_on(int cpu, struct workqueue_struct *wq,
+@@ -1452,14 +1483,14 @@ bool queue_work_on(int cpu, struct workqueue_struct *wq,
bool ret = false;
unsigned long flags;
@@ -28946,7 +29403,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
return ret;
}
EXPORT_SYMBOL(queue_work_on);
-@@ -1525,14 +1556,14 @@ bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
+@@ -1527,14 +1558,14 @@ bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
unsigned long flags;
/* read the comment in __queue_work() */
@@ -28963,7 +29420,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
return ret;
}
EXPORT_SYMBOL(queue_delayed_work_on);
-@@ -1567,7 +1598,7 @@ bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq,
+@@ -1569,7 +1600,7 @@ bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq,
if (likely(ret >= 0)) {
__queue_delayed_work(cpu, wq, dwork, delay);
@@ -28972,7 +29429,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
}
/* -ENOENT from try_to_grab_pending() becomes %true */
-@@ -1600,7 +1631,9 @@ static void worker_enter_idle(struct worker *worker)
+@@ -1602,7 +1633,9 @@ static void worker_enter_idle(struct worker *worker)
worker->last_active = jiffies;
/* idle_list is LIFO */
@@ -28982,7 +29439,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
if (too_many_workers(pool) && !timer_pending(&pool->idle_timer))
mod_timer(&pool->idle_timer, jiffies + IDLE_WORKER_TIMEOUT);
-@@ -1633,7 +1666,9 @@ static void worker_leave_idle(struct worker *worker)
+@@ -1635,7 +1668,9 @@ static void worker_leave_idle(struct worker *worker)
return;
worker_clr_flags(worker, WORKER_IDLE);
pool->nr_idle--;
@@ -28992,7 +29449,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
}
static struct worker *alloc_worker(int node)
-@@ -1799,7 +1834,9 @@ static void destroy_worker(struct worker *worker)
+@@ -1801,7 +1836,9 @@ static void destroy_worker(struct worker *worker)
pool->nr_workers--;
pool->nr_idle--;
@@ -29002,7 +29459,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
worker->flags |= WORKER_DIE;
wake_up_process(worker->task);
}
-@@ -2716,14 +2753,14 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr)
+@@ -2711,14 +2748,14 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr)
might_sleep();
@@ -29020,7 +29477,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
/* see the comment in try_to_grab_pending() with the same code */
pwq = get_work_pwq(work);
if (pwq) {
-@@ -2750,10 +2787,11 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr)
+@@ -2745,10 +2782,11 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr)
else
lock_map_acquire_read(&pwq->wq->lockdep_map);
lock_map_release(&pwq->wq->lockdep_map);
@@ -29033,7 +29490,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
return false;
}
-@@ -2840,7 +2878,7 @@ static bool __cancel_work_timer(struct work_struct *work, bool is_dwork)
+@@ -2835,7 +2873,7 @@ static bool __cancel_work_timer(struct work_struct *work, bool is_dwork)
/* tell other tasks trying to grab @work to back off */
mark_work_canceling(work);
@@ -29042,7 +29499,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
flush_work(work);
clear_work_data(work);
-@@ -2895,10 +2933,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync);
+@@ -2890,10 +2928,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync);
*/
bool flush_delayed_work(struct delayed_work *dwork)
{
@@ -29055,7 +29512,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
return flush_work(&dwork->work);
}
EXPORT_SYMBOL(flush_delayed_work);
-@@ -2933,7 +2971,7 @@ bool cancel_delayed_work(struct delayed_work *dwork)
+@@ -2928,7 +2966,7 @@ bool cancel_delayed_work(struct delayed_work *dwork)
set_work_pool_and_clear_pending(&dwork->work,
get_work_pool_id(&dwork->work));
@@ -29064,7 +29521,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
return ret;
}
EXPORT_SYMBOL(cancel_delayed_work);
-@@ -3161,7 +3199,7 @@ static void rcu_free_pool(struct rcu_head *rcu)
+@@ -3155,7 +3193,7 @@ static void rcu_free_pool(struct rcu_head *rcu)
* put_unbound_pool - put a worker_pool
* @pool: worker_pool to put
*
@@ -29073,7 +29530,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
* safe manner. get_unbound_pool() calls this function on its failure path
* and this function should be able to release pools which went through,
* successfully or not, init_worker_pool().
-@@ -3215,8 +3253,8 @@ static void put_unbound_pool(struct worker_pool *pool)
+@@ -3209,8 +3247,8 @@ static void put_unbound_pool(struct worker_pool *pool)
del_timer_sync(&pool->idle_timer);
del_timer_sync(&pool->mayday_timer);
@@ -29084,7 +29541,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
}
/**
-@@ -3323,14 +3361,14 @@ static void pwq_unbound_release_workfn(struct work_struct *work)
+@@ -3317,14 +3355,14 @@ static void pwq_unbound_release_workfn(struct work_struct *work)
put_unbound_pool(pool);
mutex_unlock(&wq_pool_mutex);
@@ -29101,7 +29558,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
}
/**
-@@ -3983,7 +4021,7 @@ void destroy_workqueue(struct workqueue_struct *wq)
+@@ -3991,7 +4029,7 @@ void destroy_workqueue(struct workqueue_struct *wq)
* The base ref is never dropped on per-cpu pwqs. Directly
* schedule RCU free.
*/
@@ -29110,7 +29567,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
} else {
/*
* We're the sole accessor of @wq at this point. Directly
-@@ -4076,7 +4114,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)
+@@ -4085,7 +4123,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)
struct pool_workqueue *pwq;
bool ret;
@@ -29120,7 +29577,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
if (cpu == WORK_CPU_UNBOUND)
cpu = smp_processor_id();
-@@ -4087,7 +4126,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)
+@@ -4096,7 +4135,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)
pwq = unbound_pwq_by_node(wq, cpu_to_node(cpu));
ret = !list_empty(&pwq->delayed_works);
@@ -29130,7 +29587,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
return ret;
}
-@@ -4113,15 +4153,15 @@ unsigned int work_busy(struct work_struct *work)
+@@ -4122,15 +4162,15 @@ unsigned int work_busy(struct work_struct *work)
if (work_pending(work))
ret |= WORK_BUSY_PENDING;
@@ -29150,7 +29607,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
return ret;
}
-@@ -4310,7 +4350,7 @@ void show_workqueue_state(void)
+@@ -4319,7 +4359,7 @@ void show_workqueue_state(void)
unsigned long flags;
int pi;
@@ -29159,7 +29616,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
pr_info("Showing busy workqueues and worker pools:\n");
-@@ -4361,7 +4401,7 @@ void show_workqueue_state(void)
+@@ -4370,7 +4410,7 @@ void show_workqueue_state(void)
spin_unlock_irqrestore(&pool->lock, flags);
}
@@ -29168,7 +29625,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
}
/*
-@@ -4722,16 +4762,16 @@ bool freeze_workqueues_busy(void)
+@@ -4731,16 +4771,16 @@ bool freeze_workqueues_busy(void)
* nr_active is monotonically decreasing. It's safe
* to peek without lock.
*/
@@ -29188,7 +29645,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
}
out_unlock:
mutex_unlock(&wq_pool_mutex);
-@@ -4921,7 +4961,8 @@ static ssize_t wq_pool_ids_show(struct device *dev,
+@@ -4930,7 +4970,8 @@ static ssize_t wq_pool_ids_show(struct device *dev,
const char *delim = "";
int node, written = 0;
@@ -29198,7 +29655,7 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
for_each_node(node) {
written += scnprintf(buf + written, PAGE_SIZE - written,
"%s%d:%d", delim, node,
-@@ -4929,7 +4970,8 @@ static ssize_t wq_pool_ids_show(struct device *dev,
+@@ -4938,7 +4979,8 @@ static ssize_t wq_pool_ids_show(struct device *dev,
delim = " ";
}
written += scnprintf(buf + written, PAGE_SIZE - written, "\n");
@@ -29209,10 +29666,10 @@ index 2c2f971f3e75..d5b0f4fc0eb0 100644
return written;
}
diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h
-index 45215870ac6c..f000c4d6917e 100644
+index 3fa9c146fccb..42d1e3974554 100644
--- a/kernel/workqueue_internal.h
+++ b/kernel/workqueue_internal.h
-@@ -43,6 +43,7 @@ struct worker {
+@@ -44,6 +44,7 @@ struct worker {
unsigned long last_active; /* L: last active timestamp */
unsigned int flags; /* X: flags */
int id; /* I: worker id */
@@ -29220,7 +29677,7 @@ index 45215870ac6c..f000c4d6917e 100644
/*
* Opaque string set with work_set_desc(). Printed out with task
-@@ -68,7 +69,7 @@ static inline struct worker *current_wq_worker(void)
+@@ -69,7 +70,7 @@ static inline struct worker *current_wq_worker(void)
* Scheduler hooks for concurrency managed workqueue. Only to be used from
* sched/core.c and workqueue.c.
*/
@@ -29775,10 +30232,10 @@ index a988d4ef39da..f2c2ee1d5191 100644
}
diff --git a/mm/compaction.c b/mm/compaction.c
-index dba02dec7195..51963f58a29b 100644
+index b6f145ed7ae1..03cac7f6768a 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
-@@ -1430,10 +1430,12 @@ check_drain:
+@@ -1450,10 +1450,12 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
cc->migrate_pfn & ~((1UL << cc->order) - 1);
if (cc->last_migrated_pfn < current_block_start) {
@@ -29981,7 +30438,7 @@ index e25b93a4267d..1c619267d9da 100644
/**
diff --git a/mm/mmu_context.c b/mm/mmu_context.c
-index f802c2d216a7..b1b6f238e42d 100644
+index 6f4d27c5bb32..5cd25c745a8f 100644
--- a/mm/mmu_context.c
+++ b/mm/mmu_context.c
@@ -23,6 +23,7 @@ void use_mm(struct mm_struct *mm)
@@ -30001,7 +30458,7 @@ index f802c2d216a7..b1b6f238e42d 100644
#ifdef finish_arch_post_lock_switch
finish_arch_post_lock_switch();
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 6f9005dcca2e..e8ec72251705 100644
+index 3c70f03d91ec..e1377f157652 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -60,6 +60,7 @@
@@ -30031,7 +30488,7 @@ index 6f9005dcca2e..e8ec72251705 100644
int page_group_by_mobility_disabled __read_mostly;
#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
-@@ -786,7 +799,7 @@ static inline int free_pages_check(struct page *page)
+@@ -820,7 +833,7 @@ static inline int free_pages_check(struct page *page)
}
/*
@@ -30040,7 +30497,7 @@ index 6f9005dcca2e..e8ec72251705 100644
* Assumes all pages on list are in same zone, and of same order.
* count is the number of pages to free.
*
-@@ -797,18 +810,53 @@ static inline int free_pages_check(struct page *page)
+@@ -831,18 +844,53 @@ static inline int free_pages_check(struct page *page)
* pinned" detection logic.
*/
static void free_pcppages_bulk(struct zone *zone, int count,
@@ -30098,7 +30555,7 @@ index 6f9005dcca2e..e8ec72251705 100644
while (to_free) {
struct page *page;
struct list_head *list;
-@@ -824,7 +872,7 @@ static void free_pcppages_bulk(struct zone *zone, int count,
+@@ -858,7 +906,7 @@ static void free_pcppages_bulk(struct zone *zone, int count,
batch_free++;
if (++migratetype == MIGRATE_PCPTYPES)
migratetype = 0;
@@ -30107,7 +30564,7 @@ index 6f9005dcca2e..e8ec72251705 100644
} while (list_empty(list));
/* This is the only non-empty list. Free them all. */
-@@ -832,24 +880,12 @@ static void free_pcppages_bulk(struct zone *zone, int count,
+@@ -866,24 +914,12 @@ static void free_pcppages_bulk(struct zone *zone, int count,
batch_free = to_free;
do {
@@ -30134,7 +30591,7 @@ index 6f9005dcca2e..e8ec72251705 100644
}
static void free_one_page(struct zone *zone,
-@@ -858,7 +894,9 @@ static void free_one_page(struct zone *zone,
+@@ -892,7 +928,9 @@ static void free_one_page(struct zone *zone,
int migratetype)
{
unsigned long nr_scanned;
@@ -30145,7 +30602,7 @@ index 6f9005dcca2e..e8ec72251705 100644
nr_scanned = zone_page_state(zone, NR_PAGES_SCANNED);
if (nr_scanned)
__mod_zone_page_state(zone, NR_PAGES_SCANNED, -nr_scanned);
-@@ -868,7 +906,7 @@ static void free_one_page(struct zone *zone,
+@@ -902,7 +940,7 @@ static void free_one_page(struct zone *zone,
migratetype = get_pfnblock_migratetype(page, pfn);
}
__free_one_page(page, pfn, zone, order, migratetype);
@@ -30154,7 +30611,7 @@ index 6f9005dcca2e..e8ec72251705 100644
}
static int free_tail_pages_check(struct page *head_page, struct page *page)
-@@ -1019,10 +1057,10 @@ static void __free_pages_ok(struct page *page, unsigned int order)
+@@ -1053,10 +1091,10 @@ static void __free_pages_ok(struct page *page, unsigned int order)
return;
migratetype = get_pfnblock_migratetype(page, pfn);
@@ -30167,7 +30624,7 @@ index 6f9005dcca2e..e8ec72251705 100644
}
static void __init __free_pages_boot_core(struct page *page,
-@@ -1879,16 +1917,18 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
+@@ -1925,16 +1963,18 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp)
{
unsigned long flags;
@@ -30189,7 +30646,7 @@ index 6f9005dcca2e..e8ec72251705 100644
}
#endif
-@@ -1904,16 +1944,21 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone)
+@@ -1950,16 +1990,21 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone)
unsigned long flags;
struct per_cpu_pageset *pset;
struct per_cpu_pages *pcp;
@@ -30215,7 +30672,7 @@ index 6f9005dcca2e..e8ec72251705 100644
}
/*
-@@ -1999,8 +2044,17 @@ void drain_all_pages(struct zone *zone)
+@@ -2045,8 +2090,17 @@ void drain_all_pages(struct zone *zone)
else
cpumask_clear_cpu(cpu, &cpus_with_pcps);
}
@@ -30233,7 +30690,7 @@ index 6f9005dcca2e..e8ec72251705 100644
}
#ifdef CONFIG_HIBERNATION
-@@ -2056,7 +2110,7 @@ void free_hot_cold_page(struct page *page, bool cold)
+@@ -2102,7 +2156,7 @@ void free_hot_cold_page(struct page *page, bool cold)
migratetype = get_pfnblock_migratetype(page, pfn);
set_pcppage_migratetype(page, migratetype);
@@ -30242,7 +30699,7 @@ index 6f9005dcca2e..e8ec72251705 100644
__count_vm_event(PGFREE);
/*
-@@ -2082,12 +2136,17 @@ void free_hot_cold_page(struct page *page, bool cold)
+@@ -2128,12 +2182,17 @@ void free_hot_cold_page(struct page *page, bool cold)
pcp->count++;
if (pcp->count >= pcp->high) {
unsigned long batch = READ_ONCE(pcp->batch);
@@ -30262,7 +30719,7 @@ index 6f9005dcca2e..e8ec72251705 100644
}
/*
-@@ -2222,7 +2281,7 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
+@@ -2268,7 +2327,7 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
struct per_cpu_pages *pcp;
struct list_head *list;
@@ -30271,7 +30728,7 @@ index 6f9005dcca2e..e8ec72251705 100644
pcp = &this_cpu_ptr(zone->pageset)->pcp;
list = &pcp->lists[migratetype];
if (list_empty(list)) {
-@@ -2254,7 +2313,7 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
+@@ -2300,7 +2359,7 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
*/
WARN_ON_ONCE(order > 1);
}
@@ -30280,7 +30737,7 @@ index 6f9005dcca2e..e8ec72251705 100644
page = NULL;
if (alloc_flags & ALLOC_HARDER) {
-@@ -2264,11 +2323,13 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
+@@ -2310,11 +2369,13 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
}
if (!page)
page = __rmqueue(zone, order, migratetype, gfp_flags);
@@ -30296,7 +30753,7 @@ index 6f9005dcca2e..e8ec72251705 100644
}
__mod_zone_page_state(zone, NR_ALLOC_BATCH, -(1 << order));
-@@ -2278,13 +2339,13 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
+@@ -2324,13 +2385,13 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
__count_zone_vm_events(PGALLOC, zone, 1 << order);
zone_statistics(preferred_zone, zone, gfp_flags);
@@ -30312,7 +30769,7 @@ index 6f9005dcca2e..e8ec72251705 100644
return NULL;
}
-@@ -5953,6 +6014,7 @@ static int page_alloc_cpu_notify(struct notifier_block *self,
+@@ -5999,6 +6060,7 @@ static int page_alloc_cpu_notify(struct notifier_block *self,
void __init page_alloc_init(void)
{
hotcpu_notifier(page_alloc_cpu_notify, 0);
@@ -30320,7 +30777,7 @@ index 6f9005dcca2e..e8ec72251705 100644
}
/*
-@@ -6847,7 +6909,7 @@ void zone_pcp_reset(struct zone *zone)
+@@ -6893,7 +6955,7 @@ void zone_pcp_reset(struct zone *zone)
struct per_cpu_pageset *pset;
/* avoid races with drain_pages() */
@@ -30329,7 +30786,7 @@ index 6f9005dcca2e..e8ec72251705 100644
if (zone->pageset != &boot_pageset) {
for_each_online_cpu(cpu) {
pset = per_cpu_ptr(zone->pageset, cpu);
-@@ -6856,7 +6918,7 @@ void zone_pcp_reset(struct zone *zone)
+@@ -6902,7 +6964,7 @@ void zone_pcp_reset(struct zone *zone)
free_percpu(zone->pageset);
zone->pageset = &boot_pageset;
}
@@ -30362,7 +30819,7 @@ index ef6353f0adbd..33ccbac7cdb8 100644
{
#ifdef CONFIG_SMP
const size_t static_size = __per_cpu_end - __per_cpu_start;
-@@ -1305,16 +1294,36 @@ bool is_kernel_percpu_address(unsigned long addr)
+@@ -1305,15 +1294,35 @@ bool is_kernel_percpu_address(unsigned long addr)
for_each_possible_cpu(cpu) {
void *start = per_cpu_ptr(base, cpu);
@@ -30381,7 +30838,7 @@ index ef6353f0adbd..33ccbac7cdb8 100644
return false;
}
- /**
++/**
+ * is_kernel_percpu_address - test whether address is from static percpu area
+ * @addr: address to test
+ *
@@ -30397,10 +30854,9 @@ index ef6353f0adbd..33ccbac7cdb8 100644
+ return __is_kernel_percpu_address(addr, NULL);
+}
+
-+/**
+ /**
* per_cpu_ptr_to_phys - convert translated percpu address to physical address
* @addr: the address to be converted to physical address
- *
diff --git a/mm/slab.h b/mm/slab.h
index 7b6087197997..afdc57941179 100644
--- a/mm/slab.h
@@ -30418,7 +30874,7 @@ index 7b6087197997..afdc57941179 100644
#ifdef CONFIG_SLAB
struct list_head slabs_partial; /* partial list first, better asm code */
diff --git a/mm/slub.c b/mm/slub.c
-index 65d5f92d51d2..feb4a445a546 100644
+index 4cf3a9c768b1..b183c5271607 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1075,7 +1075,7 @@ static noinline struct kmem_cache_node *free_debug_processing(
@@ -30430,7 +30886,7 @@ index 65d5f92d51d2..feb4a445a546 100644
slab_lock(page);
if (!check_slab(s, page))
-@@ -1136,7 +1136,7 @@ out:
+@@ -1136,7 +1136,7 @@ static noinline struct kmem_cache_node *free_debug_processing(
fail:
slab_unlock(page);
@@ -30527,7 +30983,7 @@ index 65d5f92d51d2..feb4a445a546 100644
return object;
}
-@@ -1944,7 +1973,7 @@ redo:
+@@ -1944,7 +1973,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page,
* that acquire_slab() will see a slab page that
* is frozen
*/
@@ -30536,7 +30992,7 @@ index 65d5f92d51d2..feb4a445a546 100644
}
} else {
m = M_FULL;
-@@ -1955,7 +1984,7 @@ redo:
+@@ -1955,7 +1984,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page,
* slabs from diagnostic functions will not see
* any frozen slabs.
*/
@@ -30545,7 +31001,7 @@ index 65d5f92d51d2..feb4a445a546 100644
}
}
-@@ -1990,7 +2019,7 @@ redo:
+@@ -1990,7 +2019,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page,
goto redo;
if (lock)
@@ -30646,7 +31102,7 @@ index 65d5f92d51d2..feb4a445a546 100644
void *freelist;
struct page *page;
-@@ -2410,6 +2463,13 @@ load_freelist:
+@@ -2410,6 +2463,13 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
VM_BUG_ON(!c->page->frozen);
c->freelist = get_freepointer(s, freelist);
c->tid = next_tid(c->tid);
@@ -30660,7 +31116,7 @@ index 65d5f92d51d2..feb4a445a546 100644
return freelist;
new_slab:
-@@ -2441,7 +2501,7 @@ new_slab:
+@@ -2441,7 +2501,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
deactivate_slab(s, page, get_freepointer(s, freelist));
c->page = NULL;
c->freelist = NULL;
@@ -30715,7 +31171,7 @@ index 65d5f92d51d2..feb4a445a546 100644
return;
slab_empty:
-@@ -2741,7 +2803,7 @@ slab_empty:
+@@ -2741,7 +2803,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page,
remove_full(s, n, page);
}
@@ -31004,7 +31460,7 @@ index 39395fb549c0..ad16649221d7 100644
put_online_cpus();
mutex_unlock(&lock);
diff --git a/mm/truncate.c b/mm/truncate.c
-index 76e35ad97102..5f196420020c 100644
+index f4c8270f7b84..ff2d614eb91d 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -56,8 +56,11 @@ static void clear_exceptional_entry(struct address_space *mapping,
@@ -31077,7 +31533,7 @@ index 8e3c9c5a3042..68740314ad54 100644
/* Allocate new block if nothing was found */
diff --git a/mm/vmstat.c b/mm/vmstat.c
-index c54fd2924f25..64416fd7c209 100644
+index 5712cdaae964..71e04bc3fe66 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -226,6 +226,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
@@ -31237,11 +31693,58 @@ index c1ea19478119..529552c3716d 100644
unpin_tag(handle);
}
EXPORT_SYMBOL_GPL(zs_unmap_object);
+diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
+index c842f40c1173..035a5f6e3de9 100644
+--- a/net/bluetooth/hci_sock.c
++++ b/net/bluetooth/hci_sock.c
+@@ -213,15 +213,13 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
+ }
+
+ /* Send frame to sockets with specific channel */
+-void hci_send_to_channel(unsigned short channel, struct sk_buff *skb,
+- int flag, struct sock *skip_sk)
++static void __hci_send_to_channel(unsigned short channel, struct sk_buff *skb,
++ int flag, struct sock *skip_sk)
+ {
+ struct sock *sk;
+
+ BT_DBG("channel %u len %d", channel, skb->len);
+
+- read_lock(&hci_sk_list.lock);
+-
+ sk_for_each(sk, &hci_sk_list.head) {
+ struct sk_buff *nskb;
+
+@@ -247,6 +245,13 @@ void hci_send_to_channel(unsigned short channel, struct sk_buff *skb,
+ kfree_skb(nskb);
+ }
+
++}
++
++void hci_send_to_channel(unsigned short channel, struct sk_buff *skb,
++ int flag, struct sock *skip_sk)
++{
++ read_lock(&hci_sk_list.lock);
++ __hci_send_to_channel(channel, skb, flag, skip_sk);
+ read_unlock(&hci_sk_list.lock);
+ }
+
+@@ -299,8 +304,8 @@ void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb)
+ hdr->index = cpu_to_le16(hdev->id);
+ hdr->len = cpu_to_le16(skb->len);
+
+- hci_send_to_channel(HCI_CHANNEL_MONITOR, skb_copy,
+- HCI_SOCK_TRUSTED, NULL);
++ __hci_send_to_channel(HCI_CHANNEL_MONITOR, skb_copy,
++ HCI_SOCK_TRUSTED, NULL);
+ kfree_skb(skb_copy);
+ }
+
diff --git a/net/core/dev.c b/net/core/dev.c
-index 48399d8ce614..2ccc02633e97 100644
+index 3b67c1e5756f..63614e930907 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -186,6 +186,7 @@ static unsigned int napi_gen_id;
+@@ -186,6 +186,7 @@ static unsigned int napi_gen_id = NR_CPUS;
static DEFINE_HASHTABLE(napi_hash, 8);
static seqcount_t devnet_rename_seq;
@@ -31266,7 +31769,7 @@ index 48399d8ce614..2ccc02633e97 100644
#endif
}
-@@ -884,7 +885,8 @@ retry:
+@@ -884,7 +885,8 @@ int netdev_get_name(struct net *net, char *name, int ifindex)
strcpy(name, dev->name);
rcu_read_unlock();
if (read_seqcount_retry(&devnet_rename_seq, seq)) {
@@ -31303,7 +31806,7 @@ index 48399d8ce614..2ccc02633e97 100644
if (oldname[0] && !strchr(oldname, '%'))
netdev_info(dev, "renamed from %s\n", oldname);
-@@ -1179,11 +1178,12 @@ rollback:
+@@ -1179,11 +1178,12 @@ int dev_change_name(struct net_device *dev, const char *newname)
if (ret) {
memcpy(dev->name, oldname, IFNAMSIZ);
dev->name_assign_type = old_assign_type;
@@ -31319,7 +31822,7 @@ index 48399d8ce614..2ccc02633e97 100644
netdev_adjacent_rename_links(dev, oldname);
-@@ -1204,7 +1204,8 @@ rollback:
+@@ -1204,7 +1204,8 @@ int dev_change_name(struct net_device *dev, const char *newname)
/* err >= 0 after dev_alloc_name() or stores the first errno */
if (err >= 0) {
err = ret;
@@ -31329,7 +31832,7 @@ index 48399d8ce614..2ccc02633e97 100644
memcpy(dev->name, oldname, IFNAMSIZ);
memcpy(oldname, newname, IFNAMSIZ);
dev->name_assign_type = old_assign_type;
-@@ -1217,6 +1218,11 @@ rollback:
+@@ -1217,6 +1218,11 @@ int dev_change_name(struct net_device *dev, const char *newname)
}
return err;
@@ -31341,7 +31844,7 @@ index 48399d8ce614..2ccc02633e97 100644
}
/**
-@@ -2268,6 +2274,7 @@ static inline void __netif_reschedule(struct Qdisc *q)
+@@ -2270,6 +2276,7 @@ static inline void __netif_reschedule(struct Qdisc *q)
sd->output_queue_tailp = &q->next_sched;
raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_restore(flags);
@@ -31349,7 +31852,7 @@ index 48399d8ce614..2ccc02633e97 100644
}
void __netif_schedule(struct Qdisc *q)
-@@ -2349,6 +2356,7 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason)
+@@ -2354,6 +2361,7 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason)
__this_cpu_write(softnet_data.completion_queue, skb);
raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_restore(flags);
@@ -31357,7 +31860,7 @@ index 48399d8ce614..2ccc02633e97 100644
}
EXPORT_SYMBOL(__dev_kfree_skb_irq);
-@@ -2906,7 +2914,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
+@@ -2918,7 +2926,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
* This permits __QDISC___STATE_RUNNING owner to get the lock more
* often and dequeue packets faster.
*/
@@ -31369,7 +31872,7 @@ index 48399d8ce614..2ccc02633e97 100644
if (unlikely(contended))
spin_lock(&q->busylock);
-@@ -2966,9 +2978,44 @@ static void skb_update_prio(struct sk_buff *skb)
+@@ -2978,9 +2990,44 @@ static void skb_update_prio(struct sk_buff *skb)
#define skb_update_prio(skb)
#endif
@@ -31414,7 +31917,7 @@ index 48399d8ce614..2ccc02633e97 100644
#define RECURSION_LIMIT 10
/**
-@@ -3161,7 +3208,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)
+@@ -3175,7 +3222,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)
if (txq->xmit_lock_owner != cpu) {
@@ -31423,7 +31926,7 @@ index 48399d8ce614..2ccc02633e97 100644
goto recursion_alert;
skb = validate_xmit_skb(skb, dev);
-@@ -3171,9 +3218,9 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)
+@@ -3185,9 +3232,9 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)
HARD_TX_LOCK(dev, txq, cpu);
if (!netif_xmit_stopped(txq)) {
@@ -31435,7 +31938,7 @@ index 48399d8ce614..2ccc02633e97 100644
if (dev_xmit_complete(rc)) {
HARD_TX_UNLOCK(dev, txq);
goto out;
-@@ -3547,6 +3594,7 @@ drop:
+@@ -3561,6 +3608,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu,
rps_unlock(sd);
local_irq_restore(flags);
@@ -31443,7 +31946,7 @@ index 48399d8ce614..2ccc02633e97 100644
atomic_long_inc(&skb->dev->rx_dropped);
kfree_skb(skb);
-@@ -3565,7 +3613,7 @@ static int netif_rx_internal(struct sk_buff *skb)
+@@ -3579,7 +3627,7 @@ static int netif_rx_internal(struct sk_buff *skb)
struct rps_dev_flow voidflow, *rflow = &voidflow;
int cpu;
@@ -31452,7 +31955,7 @@ index 48399d8ce614..2ccc02633e97 100644
rcu_read_lock();
cpu = get_rps_cpu(skb->dev, skb, &rflow);
-@@ -3575,13 +3623,13 @@ static int netif_rx_internal(struct sk_buff *skb)
+@@ -3589,13 +3637,13 @@ static int netif_rx_internal(struct sk_buff *skb)
ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
rcu_read_unlock();
@@ -31469,7 +31972,7 @@ index 48399d8ce614..2ccc02633e97 100644
}
return ret;
}
-@@ -3615,16 +3663,44 @@ int netif_rx_ni(struct sk_buff *skb)
+@@ -3629,16 +3677,44 @@ int netif_rx_ni(struct sk_buff *skb)
trace_netif_rx_ni_entry(skb);
@@ -31518,7 +32021,7 @@ index 48399d8ce614..2ccc02633e97 100644
static void net_tx_action(struct softirq_action *h)
{
struct softnet_data *sd = this_cpu_ptr(&softnet_data);
-@@ -3666,7 +3742,7 @@ static void net_tx_action(struct softirq_action *h)
+@@ -3680,7 +3756,7 @@ static void net_tx_action(struct softirq_action *h)
head = head->next_sched;
root_lock = qdisc_lock(q);
@@ -31527,7 +32030,7 @@ index 48399d8ce614..2ccc02633e97 100644
smp_mb__before_atomic();
clear_bit(__QDISC_STATE_SCHED,
&q->state);
-@@ -4088,7 +4164,7 @@ static void flush_backlog(void *arg)
+@@ -4102,7 +4178,7 @@ static void flush_backlog(void *arg)
skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) {
if (skb->dev == dev) {
__skb_unlink(skb, &sd->input_pkt_queue);
@@ -31536,7 +32039,7 @@ index 48399d8ce614..2ccc02633e97 100644
input_queue_head_incr(sd);
}
}
-@@ -4097,10 +4173,13 @@ static void flush_backlog(void *arg)
+@@ -4111,10 +4187,13 @@ static void flush_backlog(void *arg)
skb_queue_walk_safe(&sd->process_queue, skb, tmp) {
if (skb->dev == dev) {
__skb_unlink(skb, &sd->process_queue);
@@ -31551,7 +32054,7 @@ index 48399d8ce614..2ccc02633e97 100644
}
static int napi_gro_complete(struct sk_buff *skb)
-@@ -4557,6 +4636,7 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd)
+@@ -4581,6 +4660,7 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd)
sd->rps_ipi_list = NULL;
local_irq_enable();
@@ -31559,7 +32062,7 @@ index 48399d8ce614..2ccc02633e97 100644
/* Send pending IPI's to kick RPS processing on remote cpus. */
while (remsd) {
-@@ -4570,6 +4650,7 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd)
+@@ -4594,6 +4674,7 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd)
} else
#endif
local_irq_enable();
@@ -31567,7 +32070,7 @@ index 48399d8ce614..2ccc02633e97 100644
}
static bool sd_has_rps_ipi_waiting(struct softnet_data *sd)
-@@ -4651,9 +4732,11 @@ void __napi_schedule(struct napi_struct *n)
+@@ -4675,9 +4756,11 @@ void __napi_schedule(struct napi_struct *n)
local_irq_save(flags);
____napi_schedule(this_cpu_ptr(&softnet_data), n);
local_irq_restore(flags);
@@ -31579,7 +32082,7 @@ index 48399d8ce614..2ccc02633e97 100644
/**
* __napi_schedule_irqoff - schedule for receive
* @n: entry to schedule
-@@ -4665,6 +4748,7 @@ void __napi_schedule_irqoff(struct napi_struct *n)
+@@ -4689,6 +4772,7 @@ void __napi_schedule_irqoff(struct napi_struct *n)
____napi_schedule(this_cpu_ptr(&softnet_data), n);
}
EXPORT_SYMBOL(__napi_schedule_irqoff);
@@ -31587,7 +32090,7 @@ index 48399d8ce614..2ccc02633e97 100644
void __napi_complete(struct napi_struct *n)
{
-@@ -4891,13 +4975,21 @@ static void net_rx_action(struct softirq_action *h)
+@@ -4912,13 +4996,21 @@ static void net_rx_action(struct softirq_action *h)
struct softnet_data *sd = this_cpu_ptr(&softnet_data);
unsigned long time_limit = jiffies + 2;
int budget = netdev_budget;
@@ -31609,7 +32112,7 @@ index 48399d8ce614..2ccc02633e97 100644
for (;;) {
struct napi_struct *n;
-@@ -4927,7 +5019,7 @@ static void net_rx_action(struct softirq_action *h)
+@@ -4948,7 +5040,7 @@ static void net_rx_action(struct softirq_action *h)
list_splice_tail(&repoll, &list);
list_splice(&list, &sd->poll_list);
if (!list_empty(&sd->poll_list))
@@ -31618,7 +32121,7 @@ index 48399d8ce614..2ccc02633e97 100644
net_rps_action_and_irq_enable(sd);
}
-@@ -7266,7 +7358,7 @@ EXPORT_SYMBOL(free_netdev);
+@@ -7287,7 +7379,7 @@ EXPORT_SYMBOL(free_netdev);
void synchronize_net(void)
{
might_sleep();
@@ -31627,7 +32130,7 @@ index 48399d8ce614..2ccc02633e97 100644
synchronize_rcu_expedited();
else
synchronize_rcu();
-@@ -7507,16 +7599,20 @@ static int dev_cpu_callback(struct notifier_block *nfb,
+@@ -7528,16 +7620,20 @@ static int dev_cpu_callback(struct notifier_block *nfb,
raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_enable();
@@ -31649,7 +32152,7 @@ index 48399d8ce614..2ccc02633e97 100644
return NOTIFY_OK;
}
-@@ -7818,8 +7914,9 @@ static int __init net_dev_init(void)
+@@ -7839,8 +7935,9 @@ static int __init net_dev_init(void)
for_each_possible_cpu(i) {
struct softnet_data *sd = &per_cpu(softnet_data, i);
@@ -31662,7 +32165,7 @@ index 48399d8ce614..2ccc02633e97 100644
sd->output_queue_tailp = &sd->output_queue;
#ifdef CONFIG_RPS
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
-index 73dfd7729bc9..62f62810cddd 100644
+index 86b619501350..f5c4897b52a0 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -63,6 +63,7 @@
@@ -31761,10 +32264,10 @@ index 73dfd7729bc9..62f62810cddd 100644
skb->head_frag = 1;
diff --git a/net/core/sock.c b/net/core/sock.c
-index 9c708a5fb751..823377a7e63a 100644
+index cd12cb6fe366..982a06dab369 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
-@@ -2447,12 +2447,11 @@ void lock_sock_nested(struct sock *sk, int subclass)
+@@ -2449,12 +2449,11 @@ void lock_sock_nested(struct sock *sk, int subclass)
if (sk->sk_lock.owned)
__lock_sock(sk);
sk->sk_lock.owned = 1;
@@ -31779,7 +32282,7 @@ index 9c708a5fb751..823377a7e63a 100644
EXPORT_SYMBOL(lock_sock_nested);
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
-index 36e26977c908..ff2593269089 100644
+index 36e26977c908..2c1ce3e80ee4 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -69,6 +69,7 @@
@@ -31807,11 +32310,15 @@ index 36e26977c908..ff2593269089 100644
static struct sock *icmp_sk(struct net *net)
{
return *this_cpu_ptr(net->ipv4.icmp_sk);
-@@ -215,12 +219,14 @@ static inline struct sock *icmp_xmit_lock(struct net *net)
+@@ -215,12 +219,18 @@ static inline struct sock *icmp_xmit_lock(struct net *net)
local_bh_disable();
-+ local_lock(icmp_sk_lock);
++ if (!local_trylock(icmp_sk_lock)) {
++ local_bh_enable();
++ return NULL;
++ }
++
sk = icmp_sk(net);
if (unlikely(!spin_trylock(&sk->sk_lock.slock))) {
@@ -31822,7 +32329,7 @@ index 36e26977c908..ff2593269089 100644
local_bh_enable();
return NULL;
}
-@@ -230,6 +236,7 @@ static inline struct sock *icmp_xmit_lock(struct net *net)
+@@ -230,6 +240,7 @@ static inline struct sock *icmp_xmit_lock(struct net *net)
static inline void icmp_xmit_unlock(struct sock *sk)
{
spin_unlock_bh(&sk->sk_lock.slock);
@@ -31830,7 +32337,7 @@ index 36e26977c908..ff2593269089 100644
}
int sysctl_icmp_msgs_per_sec __read_mostly = 1000;
-@@ -358,6 +365,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param,
+@@ -358,6 +369,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param,
struct sock *sk;
struct sk_buff *skb;
@@ -31838,7 +32345,7 @@ index 36e26977c908..ff2593269089 100644
sk = icmp_sk(dev_net((*rt)->dst.dev));
if (ip_append_data(sk, fl4, icmp_glue_bits, icmp_param,
icmp_param->data_len+icmp_param->head_len,
-@@ -380,6 +388,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param,
+@@ -380,6 +392,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param,
skb->ip_summed = CHECKSUM_NONE;
ip_push_pending_frames(sk, fl4);
}
@@ -31846,10 +32353,11 @@ index 36e26977c908..ff2593269089 100644
}
/*
-@@ -891,6 +900,30 @@ static bool icmp_redirect(struct sk_buff *skb)
+@@ -890,6 +903,30 @@ static bool icmp_redirect(struct sk_buff *skb)
+ return true;
}
- /*
++/*
+ * 32bit and 64bit have different timestamp length, so we check for
+ * the cookie at offset 20 and verify it is repeated at offset 50
+ */
@@ -31873,11 +32381,10 @@ index 36e26977c908..ff2593269089 100644
+ handle_sysrq(p[CO_POS0 + CO_SIZE]);
+}
+
-+/*
+ /*
* Handle ICMP_ECHO ("ping") requests.
*
- * RFC 1122: 3.2.2.6 MUST have an echo server that answers ICMP echo
-@@ -917,6 +950,11 @@ static bool icmp_echo(struct sk_buff *skb)
+@@ -917,6 +954,11 @@ static bool icmp_echo(struct sk_buff *skb)
icmp_param.data_len = skb->len;
icmp_param.head_len = sizeof(struct icmphdr);
icmp_reply(&icmp_param, skb);
@@ -31893,22 +32400,22 @@ diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 70fb352e317f..1bcd436709a4 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
-@@ -818,6 +818,13 @@ static struct ctl_table ipv4_net_table[] = {
+@@ -817,6 +817,13 @@ static struct ctl_table ipv4_net_table[] = {
+ .mode = 0644,
.proc_handler = proc_dointvec
},
- {
++ {
+ .procname = "icmp_echo_sysrq",
+ .data = &init_net.ipv4.sysctl_icmp_echo_sysrq,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec
+ },
-+ {
+ {
.procname = "icmp_ignore_bogus_error_responses",
.data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses,
- .maxlen = sizeof(int),
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
-index 198fc2314c82..6d84e7c8c8a9 100644
+index 61c93a93f228..4df48ae72abc 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -62,6 +62,7 @@
@@ -31955,10 +32462,10 @@ index 198fc2314c82..6d84e7c8c8a9 100644
TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
}
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
-index 9f0915f72702..28d234c03cb5 100644
+index 3bcabc2ba4a6..c3c798388ab8 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
-@@ -3601,7 +3601,7 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
+@@ -3605,7 +3605,7 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ieee80211_supported_band *sband;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
@@ -31990,7 +32497,7 @@ index f39276d1c2d7..10880c89d62f 100644
const struct nf_afinfo __rcu *nf_afinfo[NFPROTO_NUMPROTO] __read_mostly;
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
-index f8d6a0ca9c03..f6be45510cf6 100644
+index 92ca3e106c2b..ddb4970c3e27 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -63,6 +63,7 @@
@@ -32066,7 +32573,7 @@ index a6cbb2104667..5b69bb580617 100644
pool = svc_pool_for_cpu(xprt->xpt_server, cpu);
atomic_long_inc(&pool->sp_stats.packets);
-@@ -376,7 +376,7 @@ redo_search:
+@@ -376,7 +376,7 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt)
atomic_long_inc(&pool->sp_stats.threads_woken);
wake_up_process(rqstp->rq_task);
@@ -32075,7 +32582,7 @@ index a6cbb2104667..5b69bb580617 100644
goto out;
}
rcu_read_unlock();
-@@ -397,7 +397,7 @@ redo_search:
+@@ -397,7 +397,7 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt)
goto redo_search;
}
rqstp = NULL;
@@ -32162,7 +32669,7 @@ index 4f70d12e392d..9378d0919ed8 100644
mmput(mm);
kvm_put_kvm(vcpu->kvm);
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
-index cb092bd9965b..133e7fa2ec8b 100644
+index d080f06fd8d9..a8d8150fd398 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -228,8 +228,7 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
diff --git a/target/linux/patches/4.4.107/startup.patch b/target/linux/patches/4.4.112/startup.patch
index e54ac19a6..e54ac19a6 100644
--- a/target/linux/patches/4.4.107/startup.patch
+++ b/target/linux/patches/4.4.112/startup.patch
diff --git a/target/linux/patches/4.4.107/use-libgcc-for-sh.patch b/target/linux/patches/4.4.112/use-libgcc-for-sh.patch
index 6420219b0..6420219b0 100644
--- a/target/linux/patches/4.4.107/use-libgcc-for-sh.patch
+++ b/target/linux/patches/4.4.112/use-libgcc-for-sh.patch
diff --git a/target/linux/patches/4.4.107/versatile-nommu.patch b/target/linux/patches/4.4.112/versatile-nommu.patch
index 96140b30c..96140b30c 100644
--- a/target/linux/patches/4.4.107/versatile-nommu.patch
+++ b/target/linux/patches/4.4.112/versatile-nommu.patch