From 45efbd1e2dc67ddfedde58a4229f4e60907368e6 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 3 Nov 2023 09:56:59 +0800 Subject: [PATCH] kernel-rt:update 4.19.90-2310.4.0.142 --- kernel-rt.spec | 36 +- patch-4.19.90-2203.3.0-rt103.patch | 1791 ++++++++++++++++++---------- 2 files changed, 1216 insertions(+), 611 deletions(-) diff --git a/kernel-rt.spec b/kernel-rt.spec index eea400c..ef3c65c 100644 --- a/kernel-rt.spec +++ b/kernel-rt.spec @@ -12,9 +12,9 @@ %global KernelVer %{version}-%{release}.%{_target_cpu} -%global hulkrelease 2203.3.0 +%global hulkrelease 2310.4.0 -%define with_patch 0 +%define with_patch 1 %define debuginfodir /usr/lib/debug @@ -32,7 +32,7 @@ Name: kernel-rt Version: 4.19.90 -Release: %{hulkrelease}.rt103.0141 +Release: %{hulkrelease}.rt103.0142 Summary: Linux Kernel License: GPLv2 URL: http://www.kernel.org/ @@ -61,7 +61,7 @@ Source9998: patches.tar.bz2 %endif Patch0: patch-4.19.90-2203.3.0-rt103.patch -Patch1: patch-4.19.90-2203.3.0-rt103-openeuler_defconfig.patch +#Patch1: patch-4.19.90-2203.3.0-rt103-openeuler_defconfig.patch #BuildRequires: BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, tar @@ -223,7 +223,6 @@ package or when debugging this package.\ %prep %setup -q -n kernel-%{version} -c - %if 0%{?with_patch} tar -xjf %{SOURCE9998} %endif @@ -236,10 +235,33 @@ cp %{SOURCE9000} . cp %{SOURCE9001} . cp %{SOURCE9002} . + if [ ! -d patches ];then mv ../patches . fi +ignores_for_main="CONFIG_DESCRIPTION,FILE_PATH_CHANGES,GERRIT_CHANGE_ID,GIT_COMMIT_ID,UNKNOWN_COMMIT_ID,FROM_SIGN_OFF_MISMATCH,REPEATED_WORD,COMMIT_COMMENT_SYMBOL,BLOCK_COMMENT_STYLE,AVOID_EXTERNS,AVOID_BUG" + +Checkpatches() { + local SERIESCONF=$1 + local PATCH_DIR=$2 + sed -i '/^#/d' $SERIESCONF + sed -i '/^[\s]*$/d' $SERIESCONF + + set +e + while IFS= read -r patch; do + output=$(scripts/checkpatch.pl --ignore $ignores_for_main $PATCH_DIR/$patch) + if echo "$output" | grep -q "ERROR:"; then + echo "checkpatch $patch failed" + set -e + return 1 + fi + done < "$SERIESCONF" + + set -e + return 0 +} + Applypatches() { set -e @@ -256,11 +278,11 @@ Applypatches() ) | sh } +Checkpatches series.conf %{_builddir}/kernel-%{version}/linux-%{KernelVer} Applypatches series.conf %{_builddir}/kernel-%{version}/linux-%{KernelVer} %endif %patch0 -p1 -%patch1 -p1 touch .scmversion @@ -814,6 +836,8 @@ fi %endif %changelog +* Tue Nov 1 2023 zhangyu4 - 4.19.90-2310.4.0.142 +- update preempt-rt patch for openEuler Raspberry 4.19.90-2310.4.0 * Tue Mar 15 2022 Laibin Qiu - 4.19.90-2203.3.0.0141 - crypto: pcrypt - Fix user-after-free on module unload diff --git a/patch-4.19.90-2203.3.0-rt103.patch b/patch-4.19.90-2203.3.0-rt103.patch index 4062efe..563516b 100644 --- a/patch-4.19.90-2203.3.0-rt103.patch +++ b/patch-4.19.90-2203.3.0-rt103.patch @@ -1,3 +1,432 @@ +From 1ef781fd83faa590bceb482cb7d4e31a00ed7eb1 Mon Sep 17 00:00:00 2001 +From: zhangyu +Date: Fri, 3 Nov 2023 09:43:53 +0800 +Subject: [PATCH] patch-4.19.90-2203.3.0-rt103 + +--- + arch/Kconfig | 1 + + arch/alpha/include/asm/spinlock_types.h | 4 - + arch/arm/Kconfig | 5 +- + arch/arm/configs/at91_dt_defconfig | 2 +- + arch/arm/configs/sama5_defconfig | 2 +- + arch/arm/include/asm/irq.h | 2 + + arch/arm/include/asm/spinlock_types.h | 4 - + arch/arm/include/asm/switch_to.h | 8 + + arch/arm/include/asm/thread_info.h | 8 +- + arch/arm/kernel/asm-offsets.c | 1 + + arch/arm/kernel/entry-armv.S | 19 +- + arch/arm/kernel/entry-common.S | 9 +- + arch/arm/kernel/signal.c | 3 +- + arch/arm/mach-at91/Kconfig | 25 + + arch/arm/mach-exynos/platsmp.c | 12 +- + arch/arm/mach-hisi/platmcpm.c | 22 +- + arch/arm/mach-imx/cpuidle-imx6q.c | 10 +- + arch/arm/mach-omap2/omap-smp.c | 10 +- + arch/arm/mach-prima2/platsmp.c | 10 +- + arch/arm/mach-qcom/platsmp.c | 10 +- + arch/arm/mach-spear/platsmp.c | 10 +- + arch/arm/mach-sti/platsmp.c | 10 +- + arch/arm/mm/fault.c | 6 + + arch/arm/mm/highmem.c | 58 +- + arch/arm/plat-versatile/platsmp.c | 10 +- + arch/arm64/Kconfig | 1 + + arch/arm64/configs/openeuler_defconfig | 5 +- + arch/arm64/crypto/Kconfig | 28 +- + arch/arm64/include/asm/alternative.h | 6 + + arch/arm64/include/asm/spinlock_types.h | 4 - + arch/arm64/include/asm/thread_info.h | 17 +- + arch/arm64/kernel/alternative.c | 1 + + arch/arm64/kernel/asm-offsets.c | 1 + + arch/arm64/kernel/entry.S | 12 +- + arch/arm64/kernel/fpsimd.c | 31 +- + arch/arm64/kernel/signal.c | 2 +- + arch/arm64/kvm/va_layout.c | 7 +- + arch/hexagon/include/asm/spinlock_types.h | 4 - + arch/ia64/include/asm/spinlock_types.h | 4 - + arch/ia64/kernel/mca.c | 2 +- + arch/mips/Kconfig | 2 +- + arch/mips/include/asm/switch_to.h | 4 +- + arch/mips/kernel/mips-mt-fpaff.c | 2 +- + arch/mips/kernel/traps.c | 6 +- + arch/powerpc/Kconfig | 6 +- + arch/powerpc/include/asm/spinlock_types.h | 4 - + arch/powerpc/include/asm/thread_info.h | 18 +- + arch/powerpc/kernel/asm-offsets.c | 1 + + arch/powerpc/kernel/entry_32.S | 29 +- + arch/powerpc/kernel/entry_64.S | 28 +- + arch/powerpc/kernel/irq.c | 2 + + arch/powerpc/kernel/misc_32.S | 2 + + arch/powerpc/kernel/misc_64.S | 2 + + arch/powerpc/kvm/Kconfig | 1 + + arch/powerpc/platforms/cell/spufs/sched.c | 2 +- + arch/powerpc/platforms/ps3/device-init.c | 4 +- + arch/powerpc/platforms/pseries/iommu.c | 16 +- + arch/s390/include/asm/spinlock_types.h | 4 - + arch/sh/include/asm/spinlock_types.h | 4 - + arch/sh/kernel/irq.c | 2 + + arch/sparc/kernel/irq_64.c | 2 + + arch/x86/Kconfig | 8 +- + arch/x86/configs/openeuler_defconfig | 3 +- + arch/x86/crypto/aesni-intel_glue.c | 22 +- + arch/x86/crypto/cast5_avx_glue.c | 21 +- + arch/x86/crypto/chacha20_glue.c | 9 +- + arch/x86/crypto/glue_helper.c | 31 +- + arch/x86/entry/common.c | 11 +- + arch/x86/entry/entry_32.S | 17 + + arch/x86/entry/entry_64.S | 18 + + arch/x86/include/asm/fpu/api.h | 1 + + arch/x86/include/asm/preempt.h | 33 +- + arch/x86/include/asm/signal.h | 13 + + arch/x86/include/asm/stackprotector.h | 8 +- + arch/x86/include/asm/thread_info.h | 11 + + arch/x86/kernel/apic/io_apic.c | 16 +- + arch/x86/kernel/asm-offsets.c | 2 + + arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c | 2 +- + arch/x86/kernel/fpu/core.c | 12 + + arch/x86/kernel/fpu/signal.c | 2 + + arch/x86/kernel/irq_32.c | 2 + + arch/x86/kernel/process_32.c | 32 + + arch/x86/kvm/lapic.c | 2 +- + arch/x86/kvm/x86.c | 7 + + arch/x86/mm/highmem_32.c | 13 +- + arch/x86/mm/iomap_32.c | 11 +- + arch/x86/mm/pageattr.c | 8 + + arch/x86/platform/efi/efi_64.c | 10 +- + arch/xtensa/include/asm/spinlock_types.h | 4 - + block/blk-core.c | 15 +- + block/blk-ioc.c | 5 +- + block/blk-mq.c | 36 +- + block/blk-mq.h | 4 +- + block/blk-softirq.c | 3 + + crypto/cryptd.c | 10 +- + crypto/scompress.c | 6 +- + drivers/block/zram/zcomp.c | 13 +- + drivers/block/zram/zcomp.h | 1 + + drivers/block/zram/zram_drv.c | 43 +- + drivers/block/zram/zram_drv.h | 3 + + drivers/char/random.c | 11 +- + drivers/char/tpm/tpm_tis.c | 29 +- + drivers/clocksource/Kconfig | 13 +- + drivers/clocksource/Makefile | 3 +- + drivers/clocksource/tcb_clksrc.c | 69 +- + drivers/clocksource/timer-atmel-tcb.c | 617 ++++++++++++ + drivers/connector/cn_proc.c | 6 +- + drivers/cpufreq/Kconfig.x86 | 2 +- + drivers/crypto/caam/qi.c | 43 +- + drivers/crypto/caam/qi.h | 2 +- + drivers/dma-buf/dma-buf.c | 8 +- + drivers/dma-buf/reservation.c | 43 +- + drivers/firmware/efi/efi.c | 5 +- + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 +- + drivers/gpu/drm/i915/i915_gem.c | 10 +- + drivers/gpu/drm/i915/i915_irq.c | 2 + + drivers/gpu/drm/i915/i915_request.c | 8 +- + drivers/gpu/drm/i915/i915_trace.h | 6 +- + drivers/gpu/drm/i915/intel_sprite.c | 13 +- + drivers/gpu/drm/radeon/radeon_display.c | 2 + + drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 - + drivers/hv/hv.c | 4 +- + drivers/hv/hyperv_vmbus.h | 1 + + drivers/hv/vmbus_drv.c | 4 +- + drivers/i2c/busses/i2c-exynos5.c | 4 +- + drivers/i2c/busses/i2c-hix5hd2.c | 3 +- + drivers/infiniband/hw/hfi1/affinity.c | 6 +- + drivers/infiniband/hw/hfi1/sdma.c | 3 +- + drivers/infiniband/hw/qib/qib_file_ops.c | 7 +- + drivers/leds/trigger/Kconfig | 1 + + drivers/md/bcache/Kconfig | 1 + + drivers/md/dm-rq.c | 1 - + drivers/md/raid5.c | 8 +- + drivers/md/raid5.h | 1 + + drivers/misc/Kconfig | 12 +- + drivers/net/phy/fixed_phy.c | 25 +- + .../wireless/intersil/orinoco/orinoco_usb.c | 4 +- + drivers/of/base.c | 19 +- + drivers/pci/switch/switchtec.c | 24 +- + drivers/scsi/fcoe/fcoe.c | 16 +- + drivers/scsi/fcoe/fcoe_ctlr.c | 4 +- + drivers/scsi/libfc/fc_exch.c | 4 +- + drivers/staging/android/vsoc.c | 6 +- + drivers/thermal/x86_pkg_temp_thermal.c | 24 +- + drivers/tty/serial/8250/8250_core.c | 11 +- + drivers/tty/serial/8250/8250_port.c | 5 +- + drivers/tty/serial/amba-pl011.c | 17 +- + drivers/tty/serial/omap-serial.c | 12 +- + drivers/tty/sysrq.c | 6 +- + drivers/usb/core/hcd.c | 3 - + drivers/usb/gadget/function/f_fs.c | 2 +- + drivers/usb/gadget/legacy/inode.c | 4 +- + drivers/watchdog/watchdog_dev.c | 8 +- + fs/aio.c | 13 +- + fs/autofs/expire.c | 3 +- + fs/buffer.c | 21 +- + fs/cifs/readdir.c | 2 +- + fs/dcache.c | 50 +- + fs/eventpoll.c | 4 +- + fs/exec.c | 2 + + fs/ext4/page-io.c | 6 +- + fs/fscache/cookie.c | 8 + + fs/fscache/main.c | 1 + + fs/fuse/dir.c | 2 +- + fs/inode.c | 2 +- + fs/locks.c | 32 +- + fs/namei.c | 4 +- + fs/namespace.c | 8 +- + fs/nfs/delegation.c | 4 +- + fs/nfs/dir.c | 12 +- + fs/nfs/inode.c | 4 + + fs/nfs/nfs4_fs.h | 2 +- + fs/nfs/nfs4proc.c | 4 +- + fs/nfs/nfs4state.c | 22 +- + fs/nfs/unlink.c | 35 +- + fs/ntfs/aops.c | 10 +- + fs/proc/array.c | 4 +- + fs/proc/base.c | 3 +- + fs/proc/proc_sysctl.c | 2 +- + fs/squashfs/decompressor_multi_percpu.c | 16 +- + fs/timerfd.c | 6 +- + fs/userfaultfd.c | 12 +- + include/asm-generic/percpu.h | 1 + + include/linux/blk-cgroup.h | 2 +- + include/linux/blk-mq.h | 1 + + include/linux/blkdev.h | 5 + + include/linux/bottom_half.h | 34 + + include/linux/buffer_head.h | 42 + + include/linux/cgroup-defs.h | 2 + + include/linux/completion.h | 8 +- + include/linux/cpu.h | 1 + + include/linux/dcache.h | 4 +- + include/linux/delay.h | 6 + + include/linux/fs.h | 2 +- + include/linux/fscache.h | 1 + + include/linux/highmem.h | 32 +- + include/linux/hrtimer.h | 29 +- + include/linux/idr.h | 5 +- + include/linux/interrupt.h | 63 +- + include/linux/irq.h | 4 +- + include/linux/irq_work.h | 8 + + include/linux/irqdesc.h | 1 + + include/linux/irqflags.h | 23 +- + include/linux/jbd2.h | 24 + + include/linux/kdb.h | 2 + + include/linux/kernel.h | 4 + + include/linux/kthread.h | 4 +- + include/linux/list_bl.h | 30 +- + include/linux/locallock.h | 282 ++++++ + include/linux/mm_types.h | 4 + + include/linux/mutex.h | 20 +- + include/linux/mutex_rt.h | 130 +++ + include/linux/netdevice.h | 101 +- + include/linux/netfilter/x_tables.h | 7 + + include/linux/nfs_fs.h | 4 + + include/linux/nfs_xdr.h | 2 +- + include/linux/percpu-rwsem.h | 24 +- + include/linux/percpu.h | 29 + + include/linux/pid.h | 1 + + include/linux/posix-timers.h | 3 +- + include/linux/preempt.h | 107 +- + include/linux/printk.h | 2 + + include/linux/radix-tree.h | 7 +- + include/linux/random.h | 2 +- + include/linux/rbtree.h | 2 +- + include/linux/rcu_assign_pointer.h | 54 + + include/linux/rcupdate.h | 91 +- + include/linux/rcutree.h | 8 + + include/linux/reservation.h | 4 +- + include/linux/rtmutex.h | 22 +- + include/linux/rwlock_rt.h | 119 +++ + include/linux/rwlock_types.h | 4 + + include/linux/rwlock_types_rt.h | 55 + + include/linux/rwsem.h | 11 + + include/linux/rwsem_rt.h | 69 ++ + include/linux/sched.h | 163 ++- + include/linux/sched/mm.h | 11 + + include/linux/sched/task.h | 16 + + include/linux/sched/wake_q.h | 27 +- + include/linux/seqlock.h | 66 +- + include/linux/signal.h | 1 + + include/linux/skbuff.h | 7 + + include/linux/smp.h | 3 + + include/linux/spinlock.h | 12 +- + include/linux/spinlock_api_smp.h | 4 +- + include/linux/spinlock_rt.h | 156 +++ + include/linux/spinlock_types.h | 76 +- + include/linux/spinlock_types_nort.h | 33 + + include/linux/spinlock_types_raw.h | 55 + + include/linux/spinlock_types_rt.h | 48 + + include/linux/spinlock_types_up.h | 4 - + include/linux/stop_machine.h | 2 + + include/linux/suspend.h | 6 + + include/linux/swait.h | 16 + + include/linux/swap.h | 2 + + include/linux/swork.h | 24 + + include/linux/thread_info.h | 12 +- + include/linux/timer.h | 2 +- + include/linux/trace_events.h | 2 + + include/linux/uaccess.h | 2 + + include/linux/vmstat.h | 4 + + include/linux/wait.h | 5 +- + include/linux/workqueue.h | 4 - + include/net/gen_stats.h | 9 +- + include/net/neighbour.h | 6 +- + include/net/net_seq_lock.h | 15 + + include/net/sch_generic.h | 19 +- + include/soc/at91/atmel_tcb.h | 183 ++++ + init/Kconfig | 5 +- + init/Makefile | 2 +- + init/init_task.c | 14 +- + init/main.c | 1 + + kernel/Kconfig.locks | 4 +- + kernel/Kconfig.preempt | 39 +- + kernel/cgroup/cgroup.c | 9 +- + kernel/cgroup/cpuset.c | 72 +- + kernel/cgroup/rstat.c | 5 +- + kernel/cpu.c | 44 + + kernel/debug/kdb/kdb_io.c | 2 + + kernel/events/core.c | 4 +- + kernel/exit.c | 2 +- + kernel/fork.c | 45 +- + kernel/futex.c | 126 ++- + kernel/irq/handle.c | 8 +- + kernel/irq/manage.c | 13 +- + kernel/irq/settings.h | 12 + + kernel/irq/spurious.c | 8 + + kernel/irq_work.c | 76 +- + kernel/ksysfs.c | 12 + + kernel/kthread.c | 44 +- + kernel/locking/Makefile | 9 +- + kernel/locking/lockdep.c | 2 + + kernel/locking/locktorture.c | 1 - + kernel/locking/mutex-rt.c | 223 +++++ + kernel/locking/rtmutex.c | 944 ++++++++++++++++-- + kernel/locking/rtmutex_common.h | 31 +- + kernel/locking/rwlock-rt.c | 384 +++++++ + kernel/locking/rwsem-rt.c | 312 ++++++ + kernel/locking/spinlock.c | 7 + + kernel/locking/spinlock_debug.c | 5 + + kernel/panic.c | 2 + + kernel/power/hibernate.c | 7 + + kernel/power/suspend.c | 4 + + kernel/printk/printk.c | 160 ++- + kernel/printk/printk.c.rej | 23 + + kernel/ptrace.c | 32 +- + kernel/rcu/Kconfig | 6 +- + kernel/rcu/rcu.h | 11 +- + kernel/rcu/rcutorture.c | 7 + + kernel/rcu/srcutree.c | 36 +- + kernel/rcu/tree.c | 153 ++- + kernel/rcu/tree.h | 6 +- + kernel/rcu/tree_exp.h | 9 +- + kernel/rcu/tree_plugin.h | 156 +-- + kernel/rcu/update.c | 6 +- + kernel/sched/Makefile | 2 +- + kernel/sched/completion.c | 34 +- + kernel/sched/core.c | 431 +++++++- + kernel/sched/cpudeadline.c | 4 +- + kernel/sched/cpupri.c | 4 +- + kernel/sched/deadline.c | 12 +- + kernel/sched/debug.c | 4 + + kernel/sched/fair.c | 62 +- + kernel/sched/features.h | 8 + + kernel/sched/rt.c | 8 +- + kernel/sched/sched.h | 13 + + kernel/sched/swait.c | 22 +- + kernel/sched/swork.c | 173 ++++ + kernel/sched/topology.c | 1 + + kernel/signal.c | 114 ++- + kernel/softirq.c | 744 ++++++++++++-- + kernel/stop_machine.c | 7 +- + kernel/time/alarmtimer.c | 2 +- + kernel/time/hrtimer.c | 126 ++- + kernel/time/itimer.c | 1 + + kernel/time/jiffies.c | 7 +- + kernel/time/posix-cpu-timers.c | 181 +++- + kernel/time/posix-timers.c | 42 +- + kernel/time/posix-timers.h | 2 + + kernel/time/tick-broadcast-hrtimer.c | 2 +- + kernel/time/tick-common.c | 10 +- + kernel/time/tick-sched.c | 31 +- + kernel/time/timekeeping.c | 6 +- + kernel/time/timekeeping.h | 3 +- + kernel/time/timer.c | 86 +- + kernel/trace/trace.c | 37 +- + kernel/trace/trace.h | 2 + + kernel/trace/trace_events.c | 2 + + kernel/trace/trace_hwlat.c | 2 +- + kernel/trace/trace_output.c | 19 +- + kernel/watchdog.c | 2 +- + kernel/watchdog_hld.c | 9 + + kernel/workqueue.c | 293 +++--- + lib/Kconfig | 1 + + lib/Kconfig.debug | 2 +- + lib/debugobjects.c | 5 +- + lib/irq_poll.c | 5 + + lib/locking-selftest.c | 50 + + lib/radix-tree.c | 32 +- + lib/scatterlist.c | 2 +- + lib/smp_processor_id.c | 7 +- + lib/ubsan.c | 69 +- + localversion-rt | 1 + + mm/Kconfig | 2 +- + mm/compaction.c | 6 +- + mm/highmem.c | 6 +- + mm/kasan/quarantine.c | 18 +- + mm/kmemleak.c | 92 +- + mm/memcontrol.c | 28 +- + mm/mmu_context.c | 2 + + mm/page_alloc.c | 196 ++-- + mm/slab.c | 94 +- + mm/slab.h | 2 +- + mm/slub.c | 139 ++- + mm/swap.c | 74 +- + mm/vmalloc.c | 13 +- + mm/vmstat.c | 12 + + mm/zsmalloc.c | 80 +- + mm/zswap.c | 12 +- + net/Kconfig | 2 +- + net/bluetooth/rfcomm/sock.c | 7 +- + net/core/dev.c | 61 +- + net/core/gen_estimator.c | 6 +- + net/core/gen_stats.c | 8 +- + net/core/pktgen.c | 4 +- + net/core/skbuff.c | 33 +- + net/ipv4/icmp.c | 8 + + net/ipv4/tcp_ipv4.c | 6 + + net/netfilter/core.c | 6 + + net/packet/af_packet.c | 5 +- + net/rds/ib_rdma.c | 3 +- + net/sched/sch_api.c | 2 +- + net/sched/sch_generic.c | 14 +- + net/sunrpc/svc_xprt.c | 4 +- + net/xfrm/xfrm_ipcomp.c | 21 +- + samples/trace_events/trace-events-sample.c | 2 +- + scripts/mkcompile_h | 4 +- + security/apparmor/include/path.h | 19 +- + security/apparmor/lsm.c | 2 +- + virt/kvm/arm/arch_timer.c | 6 +- + virt/kvm/arm/arm.c | 6 +- + 401 files changed, 9515 insertions(+), 2191 deletions(-) + create mode 100644 drivers/clocksource/timer-atmel-tcb.c + create mode 100644 include/linux/locallock.h + create mode 100644 include/linux/mutex_rt.h + create mode 100644 include/linux/rcu_assign_pointer.h + create mode 100644 include/linux/rwlock_rt.h + create mode 100644 include/linux/rwlock_types_rt.h + create mode 100644 include/linux/rwsem_rt.h + create mode 100644 include/linux/spinlock_rt.h + create mode 100644 include/linux/spinlock_types_nort.h + create mode 100644 include/linux/spinlock_types_raw.h + create mode 100644 include/linux/spinlock_types_rt.h + create mode 100644 include/linux/swork.h + create mode 100644 include/net/net_seq_lock.h + create mode 100644 include/soc/at91/atmel_tcb.h + create mode 100644 kernel/locking/mutex-rt.c + create mode 100644 kernel/locking/rwlock-rt.c + create mode 100644 kernel/locking/rwsem-rt.c + create mode 100644 kernel/printk/printk.c.rej + create mode 100644 kernel/sched/swork.c + create mode 100644 localversion-rt + diff --git a/arch/Kconfig b/arch/Kconfig index 00f55932b..9fdf4a803 100644 --- a/arch/Kconfig @@ -202,7 +631,7 @@ index 3968d6c22..b35d373fc 100644 DEFINE(TI_TASK, offsetof(struct thread_info, task)); DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S -index e85a3af9d..cc67c0a3a 100644 +index 8de1e1da9..796c667c4 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -216,11 +216,18 @@ __irq_svc: @@ -243,7 +672,7 @@ index e85a3af9d..cc67c0a3a 100644 __und_fault: diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S -index 0465d65d2..47675830e 100644 +index e27fc2df5..bc326519f 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -56,7 +56,9 @@ __ret_fast_syscall: @@ -903,7 +1332,7 @@ index c23665101..6b60f582b 100644 return pen_release != -1 ? -ENOSYS : 0; } diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 02c2f528c..fbcb3496f 100644 +index fa89f762c..70adc74a8 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -143,6 +143,7 @@ config ARM64 @@ -914,6 +1343,30 @@ index 02c2f528c..fbcb3496f 100644 select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_FUTEX_CMPXCHG if FUTEX select HAVE_RCU_TABLE_FREE +diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig +index b4d263c1f..222b1e19e 100644 +--- a/arch/arm64/configs/openeuler_defconfig ++++ b/arch/arm64/configs/openeuler_defconfig +@@ -73,8 +73,9 @@ CONFIG_NO_HZ_FULL=y + CONFIG_NO_HZ=y + CONFIG_HIGH_RES_TIMERS=y + # CONFIG_PREEMPT_NONE is not set +-CONFIG_PREEMPT_VOLUNTARY=y ++# CONFIG_PREEMPT_VOLUNTARY is not set + # CONFIG_PREEMPT is not set ++CONFIG_PREEMPT_RT_FULL=y + + # + # CPU/Task time and stats accounting +@@ -991,7 +992,7 @@ CONFIG_FRAME_VECTOR=y + # CONFIG_PERCPU_STATS is not set + # CONFIG_GUP_BENCHMARK is not set + CONFIG_ARCH_HAS_PTE_SPECIAL=y +-CONFIG_PIN_MEMORY=y ++# CONFIG_PIN_MEMORY is not set + CONFIG_PID_RESERVE=y + CONFIG_NET=y + CONFIG_COMPAT_NETLINK_MESSAGES=y diff --git a/arch/arm64/crypto/Kconfig b/arch/arm64/crypto/Kconfig index a5606823e..1c2da1535 100644 --- a/arch/arm64/crypto/Kconfig @@ -1111,10 +1564,10 @@ index 6bc5fe80f..c45726e21 100644 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \ _TIF_NOHZ) diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c -index 8511fc3b9..cb621dd49 100644 +index ce5a26080..ddc263dee 100644 --- a/arch/arm64/kernel/alternative.c +++ b/arch/arm64/kernel/alternative.c -@@ -237,6 +237,7 @@ static int __apply_alternatives_multi_stop(void *unused) +@@ -242,6 +242,7 @@ static int __apply_alternatives_multi_stop(void *unused) void __init apply_alternatives_all(void) { /* better not try code patching on a live SMP system */ @@ -1135,10 +1588,10 @@ index 6e1847fb4..975b0f41e 100644 #ifdef CONFIG_ARM64_SW_TTBR0_PAN DEFINE(TSK_TI_TTBR0, offsetof(struct task_struct, thread_info.ttbr0)); diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S -index 9a044d425..7b44df229 100644 +index 7c231eb21..409c913aa 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S -@@ -690,11 +690,16 @@ alternative_if ARM64_HAS_IRQ_PRIO_MASKING +@@ -701,11 +701,16 @@ alternative_if ARM64_HAS_IRQ_PRIO_MASKING mrs x0, daif orr w24, w24, w0 alternative_else_nop_endif @@ -1158,7 +1611,7 @@ index 9a044d425..7b44df229 100644 #endif #ifdef CONFIG_ARM64_PSEUDO_NMI -@@ -727,6 +732,7 @@ el1_preempt: +@@ -738,6 +743,7 @@ el1_preempt: 1: bl preempt_schedule_irq // irq en/disable is done inside ldr x0, [tsk, #TSK_TI_FLAGS] // get new tasks TI_FLAGS tbnz x0, #TIF_NEED_RESCHED, 1b // needs rescheduling? @@ -2028,7 +2481,7 @@ index 713670e6d..5dfc71534 100644 #ifdef CONFIG_HOTPLUG_CPU void fixup_irqs(void) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 4ba057494..2dfb2ceeb 100644 +index 7c28f4b18..5728c3883 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -182,6 +182,7 @@ config X86 @@ -2061,6 +2514,21 @@ index 4ba057494..2dfb2ceeb 100644 ---help--- Enable maximum number of CPUS and NUMA Nodes for this architecture. If unsure, say N. +diff --git a/arch/x86/configs/openeuler_defconfig b/arch/x86/configs/openeuler_defconfig +index 59baeb297..794f6b551 100644 +--- a/arch/x86/configs/openeuler_defconfig ++++ b/arch/x86/configs/openeuler_defconfig +@@ -78,8 +78,9 @@ CONFIG_NO_HZ_FULL=y + CONFIG_NO_HZ=y + CONFIG_HIGH_RES_TIMERS=y + # CONFIG_PREEMPT_NONE is not set +-CONFIG_PREEMPT_VOLUNTARY=y ++# CONFIG_PREEMPT_VOLUNTARY is not set + # CONFIG_PREEMPT is not set ++CONFIG_PREEMPT_RT_FULL=y + + # + # CPU/Task time and stats accounting diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c index 917f25e4d..58d8c03fc 100644 --- a/arch/x86/crypto/aesni-intel_glue.c @@ -2405,7 +2873,7 @@ index a78ef99a9..dac489a1c 100644 } EXPORT_SYMBOL_GPL(glue_xts_req_128bit); diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c -index c66c9d141..dd5072a69 100644 +index d3944912c..8940c802f 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c @@ -134,7 +134,7 @@ static long syscall_trace_enter(struct pt_regs *regs) @@ -2436,10 +2904,10 @@ index c66c9d141..dd5072a69 100644 uprobe_notify_resume(regs); diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S -index 8059d4fd9..d880352e4 100644 +index a009e317f..a1d2029f5 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S -@@ -766,8 +766,25 @@ END(ret_from_exception) +@@ -764,8 +764,25 @@ END(ret_from_exception) ENTRY(resume_kernel) DISABLE_INTERRUPTS(CLBR_ANY) .Lneed_resched: @@ -2466,10 +2934,10 @@ index 8059d4fd9..d880352e4 100644 jz restore_all_kernel call preempt_schedule_irq diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S -index ccb5e3486..663a99f63 100644 +index 994e3ea4c..44176c08f 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -732,7 +732,23 @@ retint_kernel: +@@ -736,7 +736,23 @@ retint_kernel: btl $9, EFLAGS(%rsp) /* were interrupts off? */ jnc 1f 0: cmpl $0, PER_CPU_VAR(__preempt_count) @@ -2493,7 +2961,7 @@ index ccb5e3486..663a99f63 100644 call preempt_schedule_irq jmp 0b 1: -@@ -1083,6 +1099,7 @@ bad_gs: +@@ -1087,6 +1103,7 @@ bad_gs: jmp 2b .previous @@ -2501,7 +2969,7 @@ index ccb5e3486..663a99f63 100644 /* Call softirq on interrupt stack. Interrupts are off. */ ENTRY(do_softirq_own_stack) pushq %rbp -@@ -1093,6 +1110,7 @@ ENTRY(do_softirq_own_stack) +@@ -1097,6 +1114,7 @@ ENTRY(do_softirq_own_stack) leaveq ret ENDPROC(do_softirq_own_stack) @@ -2600,10 +3068,10 @@ index 33d3c88a7..c00e27af2 100644 typedef sigset_t compat_sigset_t; #endif diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h -index 8ec97a62c..7bc85841f 100644 +index 9c556ea2e..b136992be 100644 --- a/arch/x86/include/asm/stackprotector.h +++ b/arch/x86/include/asm/stackprotector.h -@@ -60,7 +60,7 @@ +@@ -65,7 +65,7 @@ */ static __always_inline void boot_init_stack_canary(void) { @@ -2612,7 +3080,7 @@ index 8ec97a62c..7bc85841f 100644 u64 tsc; #ifdef CONFIG_X86_64 -@@ -71,8 +71,14 @@ static __always_inline void boot_init_stack_canary(void) +@@ -76,8 +76,14 @@ static __always_inline void boot_init_stack_canary(void) * of randomness. The TSC only matters for very early init, * there it already has some randomness on most systems. Later * on during the bootup the random pool has true entropy too. @@ -2907,10 +3375,10 @@ index 262e49301..c2f51b6e8 100644 /* diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 06df5c232..b4fd0e202 100644 +index 53564a109..efb2ae6bd 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -6878,6 +6878,13 @@ int kvm_arch_init(void *opaque) +@@ -6939,6 +6939,13 @@ int kvm_arch_init(void *opaque) goto out; } @@ -3090,10 +3558,10 @@ index bb1fe6c18..8a22f1e7b 100644 volatile unsigned int slock; } arch_spinlock_t; diff --git a/block/blk-core.c b/block/blk-core.c -index a5d80ab91..6a57dc63d 100644 +index acf5585b0..8a6cc213c 100644 --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -203,6 +203,9 @@ void __blk_rq_init(struct request_queue *q, struct request *rq) +@@ -447,6 +447,9 @@ void __blk_rq_init(struct request_queue *q, struct request *rq) INIT_LIST_HEAD(&rq->queuelist); INIT_LIST_HEAD(&rq->timeout_list); @@ -3103,7 +3571,7 @@ index a5d80ab91..6a57dc63d 100644 rq->cpu = -1; rq->q = q; rq->__sector = (sector_t) -1; -@@ -997,12 +1000,21 @@ void blk_queue_exit(struct request_queue *q) +@@ -1243,12 +1246,21 @@ void blk_queue_exit(struct request_queue *q) percpu_ref_put(&q->q_usage_counter); } @@ -3126,7 +3594,7 @@ index a5d80ab91..6a57dc63d 100644 } static void blk_rq_timed_out_timer(struct timer_list *t) -@@ -1102,6 +1114,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id, +@@ -1352,6 +1364,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id, queue_flag_set_unlocked(QUEUE_FLAG_BYPASS, q); init_waitqueue_head(&q->mq_freeze_wq); @@ -3165,7 +3633,7 @@ index 281b7a93e..d6ae26a5e 100644 } } diff --git a/block/blk-mq.c b/block/blk-mq.c -index 0732bcc65..afb9c567d 100644 +index 96debbe63..3e97db215 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -377,6 +377,9 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, @@ -3250,8 +3718,8 @@ index 0732bcc65..afb9c567d 100644 + put_cpu_light(); } - kblockd_mod_delayed_work_on(blk_mq_hctx_next_cpu(hctx), &hctx->run_work, -@@ -3408,10 +3431,9 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, + /* +@@ -3437,10 +3460,9 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, kt = nsecs; mode = HRTIMER_MODE_REL; @@ -3264,10 +3732,10 @@ index 0732bcc65..afb9c567d 100644 if (blk_mq_rq_state(rq) == MQ_RQ_COMPLETE) break; diff --git a/block/blk-mq.h b/block/blk-mq.h -index b3540d62c..9666c337c 100644 +index c6ec9aa12..83315e369 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h -@@ -123,12 +123,12 @@ static inline struct blk_mq_ctx *__blk_mq_get_ctx(struct request_queue *q, +@@ -125,12 +125,12 @@ static inline struct blk_mq_ctx *__blk_mq_get_ctx(struct request_queue *q, */ static inline struct blk_mq_ctx *blk_mq_get_ctx(struct request_queue *q) { @@ -3311,7 +3779,7 @@ index e47a2f751..7726f48d7 100644 EXPORT_SYMBOL(__blk_complete_request); diff --git a/crypto/cryptd.c b/crypto/cryptd.c -index e0c8e907b..e079f9a70 100644 +index 3feebeec1..7130fb86e 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -39,6 +39,7 @@ MODULE_PARM_DESC(cryptd_max_cpu_qlen, "Set cryptd Max queue depth"); @@ -3322,7 +3790,7 @@ index e0c8e907b..e079f9a70 100644 }; struct cryptd_queue { -@@ -117,6 +118,7 @@ static int cryptd_init_queue(struct cryptd_queue *queue, +@@ -121,6 +122,7 @@ static int cryptd_init_queue(struct cryptd_queue *queue, cpu_queue = per_cpu_ptr(queue->cpu_queue, cpu); crypto_init_queue(&cpu_queue->queue, max_cpu_qlen); INIT_WORK(&cpu_queue->work, cryptd_queue_worker); @@ -3330,42 +3798,32 @@ index e0c8e907b..e079f9a70 100644 } pr_info("cryptd: max_cpu_qlen set to %d\n", max_cpu_qlen); return 0; -@@ -141,8 +143,10 @@ static int cryptd_enqueue_request(struct cryptd_queue *queue, +@@ -145,7 +147,7 @@ static int cryptd_enqueue_request(struct cryptd_queue *queue, struct cryptd_cpu_queue *cpu_queue; atomic_t *refcnt; -- cpu = get_cpu(); -- cpu_queue = this_cpu_ptr(queue->cpu_queue); -+ cpu_queue = raw_cpu_ptr(queue->cpu_queue); +- local_bh_disable(); + spin_lock_bh(&cpu_queue->qlock); -+ cpu = smp_processor_id(); -+ + cpu_queue = this_cpu_ptr(queue->cpu_queue); err = crypto_enqueue_request(&cpu_queue->queue, request); - refcnt = crypto_tfm_ctx(request->tfm); -@@ -158,7 +162,7 @@ static int cryptd_enqueue_request(struct cryptd_queue *queue, - atomic_inc(refcnt); +@@ -159,7 +161,7 @@ static int cryptd_enqueue_request(struct cryptd_queue *queue, + if (!atomic_read(refcnt)) + goto out; - out_put_cpu: -- put_cpu(); +- atomic_inc(refcnt); + spin_unlock_bh(&cpu_queue->qlock); - return err; - } -@@ -174,16 +178,11 @@ static void cryptd_queue_worker(struct work_struct *work) - cpu_queue = container_of(work, struct cryptd_cpu_queue, work); + out: + local_bh_enable(); +@@ -179,10 +181,10 @@ static void cryptd_queue_worker(struct work_struct *work) /* * Only handle one request at a time to avoid hogging crypto workqueue. -- * preempt_disable/enable is used to prevent being preempted by -- * cryptd_enqueue_request(). local_bh_disable/enable is used to prevent -- * cryptd_enqueue_request() being accessed from software interrupts. */ - local_bh_disable(); -- preempt_disable(); + spin_lock_bh(&cpu_queue->qlock); backlog = crypto_get_backlog(&cpu_queue->queue); req = crypto_dequeue_request(&cpu_queue->queue); -- preempt_enable(); - local_bh_enable(); + spin_unlock_bh(&cpu_queue->qlock); @@ -3573,10 +4031,10 @@ index d1095dfdf..144e91061 100644 ktime_t ac_time; #endif diff --git a/drivers/char/random.c b/drivers/char/random.c -index 05daadfbf..257bbb664 100644 +index a008d816c..068660401 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c -@@ -1237,28 +1237,27 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs) +@@ -1239,28 +1239,27 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs) return *ptr; } @@ -5266,7 +5724,7 @@ index f6e0a8b3a..18c03d79a 100644 help Allows a block device to be used as cache for other devices; uses diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c -index 3bd805f7c..4e7c61d08 100644 +index 288064e94..23cd88a14 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -692,7 +692,6 @@ static void dm_old_request_fn(struct request_queue *q) @@ -5822,7 +6280,7 @@ index 1ef937d79..540becb78 100644 /* Final cleanup if this is the last cpu */ if (lastcpu) diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c -index 373f34bb4..7ce7ae3e9 100644 +index 66e0d5d71..0739026f7 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -54,7 +54,16 @@ static struct uart_driver serial8250_reg; @@ -5844,7 +6302,7 @@ index 373f34bb4..7ce7ae3e9 100644 #include /* diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 1867c2546..4ca464082 100644 +index f920bfa16..7abd80912 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -31,6 +31,7 @@ @@ -5855,7 +6313,7 @@ index 1867c2546..4ca464082 100644 #include #include #include -@@ -3262,9 +3263,9 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, +@@ -3290,9 +3291,9 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, serial8250_rpm_get(up); @@ -5868,10 +6326,10 @@ index 1867c2546..4ca464082 100644 else spin_lock_irqsave(&port->lock, flags); diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c -index aae97acd1..9af2b415d 100644 +index c987db507..7d57b8ea2 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2257,18 +2257,24 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) +@@ -2288,18 +2288,24 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) { struct uart_amba_port *uap = amba_ports[co->index]; unsigned int old_cr = 0, new_cr; @@ -5900,7 +6358,7 @@ index aae97acd1..9af2b415d 100644 /* * First save the CR then disable the interrupts -@@ -2294,8 +2300,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) +@@ -2325,8 +2331,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) pl011_write(old_cr, uap, REG_CR); if (locked) @@ -5968,7 +6426,7 @@ index 72a8c7009..d0b366955 100644 static void sysrq_showregs_othercpus(struct work_struct *dummy) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c -index b82a7d787..2f3015356 100644 +index 62e6c526e..3e8c40cc1 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1738,7 +1738,6 @@ static void __usb_hcd_giveback_urb(struct urb *urb) @@ -6065,7 +6523,7 @@ index 2b652df44..3737ab178 100644 pr_info("watchdog%d running and kernel based pre-userspace handler disabled\n", wdd->id); diff --git a/fs/aio.c b/fs/aio.c -index d221260b8..1b16d4e18 100644 +index b77f0959f..38dc460c0 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -121,6 +121,7 @@ struct kioctx { @@ -6076,7 +6534,7 @@ index d221260b8..1b16d4e18 100644 /* * signals when all in-flight requests are done -@@ -608,9 +609,9 @@ static void free_ioctx_reqs(struct percpu_ref *ref) +@@ -612,9 +613,9 @@ static void free_ioctx_reqs(struct percpu_ref *ref) * and ctx->users has dropped to 0, so we know no more kiocbs can be submitted - * now it's safe to cancel any that need to be. */ @@ -6088,7 +6546,7 @@ index d221260b8..1b16d4e18 100644 struct aio_kiocb *req; spin_lock_irq(&ctx->ctx_lock); -@@ -628,6 +629,14 @@ static void free_ioctx_users(struct percpu_ref *ref) +@@ -632,6 +633,14 @@ static void free_ioctx_users(struct percpu_ref *ref) percpu_ref_put(&ctx->reqs); } @@ -6125,7 +6583,7 @@ index 70e9afe58..1a6b88ad4 100644 } spin_unlock(&p->d_lock); diff --git a/fs/buffer.c b/fs/buffer.c -index 2a213e8bb..b6ac68803 100644 +index af88734d1..8d6ca620a 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -274,8 +274,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) @@ -6187,7 +6645,7 @@ index 2a213e8bb..b6ac68803 100644 } EXPORT_SYMBOL(end_buffer_async_write); -@@ -3373,6 +3365,7 @@ struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) +@@ -3353,6 +3345,7 @@ struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags); if (ret) { INIT_LIST_HEAD(&ret->b_assoc_buffers); @@ -6352,7 +6810,7 @@ index d46007154..626baf547 100644 #else diff --git a/fs/exec.c b/fs/exec.c -index 426842c38..e9e848b37 100644 +index da6cca9bd..e7ca83a34 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1028,6 +1028,7 @@ static int exec_mmap(struct mm_struct *mm) @@ -6372,7 +6830,7 @@ index 426842c38..e9e848b37 100644 if (old_mm) { up_read(&old_mm->mmap_sem); diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c -index 9cc79b7b0..3f4ba2011 100644 +index decae80ae..288c32a48 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -95,8 +95,7 @@ static void ext4_finish_bio(struct bio *bio) @@ -6385,9 +6843,9 @@ index 9cc79b7b0..3f4ba2011 100644 do { if (bh_offset(bh) < bio_start || bh_offset(bh) + bh->b_size > bio_end) { -@@ -108,8 +107,7 @@ static void ext4_finish_bio(struct bio *bio) - if (bio->bi_status) +@@ -110,8 +109,7 @@ static void ext4_finish_bio(struct bio *bio) buffer_io_error(bh); + } } while ((bh = bh->b_this_page) != head); - bit_spin_unlock(BH_Uptodate_Lock, &head->b_state); - local_irq_restore(flags); @@ -6424,7 +6882,7 @@ index 30ad89db1..1d5f1d679 100644 fscache_root = kobject_create_and_add("fscache", kernel_kobj); if (!fscache_root) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c -index b468ccb29..8dcacd08e 100644 +index 606895599..bb774a390 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1234,7 +1234,7 @@ static int fuse_direntplus_link(struct file *file, @@ -6437,7 +6895,7 @@ index b468ccb29..8dcacd08e 100644 if (!o->nodeid) { /* diff --git a/fs/inode.c b/fs/inode.c -index c9eb5041f..e1fb0b743 100644 +index 5df2e8ee2..9cdec5f41 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -156,7 +156,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) @@ -6594,7 +7052,7 @@ index 9dc72fda5..bfdb9d238 100644 locks_dispose_list(&dispose); } diff --git a/fs/namei.c b/fs/namei.c -index eeb2c064d..70d406ff7 100644 +index 6144c6434..e19ee0da8 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1653,7 +1653,7 @@ static struct dentry *__lookup_slow(const struct qstr *name, @@ -6616,7 +7074,7 @@ index eeb2c064d..70d406ff7 100644 if (unlikely(IS_DEADDIR(dir_inode))) return -ENOENT; diff --git a/fs/namespace.c b/fs/namespace.c -index f47d4850b..ca764475c 100644 +index 68e3777b9..f01e1ca39 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -14,6 +14,7 @@ @@ -6660,7 +7118,7 @@ index 98811a077..ec6ccb228 100644 mutex_unlock(&sp->so_delegreturn_mutex); put_nfs_open_context(ctx); diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c -index 67ece39c7..86e5c60b5 100644 +index 12d4c7686..87a105915 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -457,7 +457,7 @@ static @@ -6672,7 +7130,7 @@ index 67ece39c7..86e5c60b5 100644 struct dentry *dentry; struct dentry *alias; struct inode *dir = d_inode(parent); -@@ -1530,7 +1530,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, +@@ -1520,7 +1520,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) { @@ -6681,7 +7139,7 @@ index 67ece39c7..86e5c60b5 100644 struct nfs_open_context *ctx; struct dentry *res; struct iattr attr = { .ia_valid = ATTR_OPEN }; -@@ -1876,7 +1876,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) +@@ -1866,7 +1866,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) trace_nfs_rmdir_enter(dir, dentry); if (d_really_is_positive(dentry)) { @@ -6693,7 +7151,7 @@ index 67ece39c7..86e5c60b5 100644 error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); /* Ensure the VFS deletes this inode */ switch (error) { -@@ -1886,7 +1890,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) +@@ -1876,7 +1880,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) case -ENOENT: nfs_dentry_handle_enoent(dentry); } @@ -6706,10 +7164,10 @@ index 67ece39c7..86e5c60b5 100644 error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); trace_nfs_rmdir_exit(dir, dentry, error); diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c -index 6d5fedcd3..621e9bef1 100644 +index 053e78d77..0441a63c7 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c -@@ -2116,7 +2116,11 @@ static void init_once(void *foo) +@@ -2112,7 +2112,11 @@ static void init_once(void *foo) atomic_long_set(&nfsi->nrequests, 0); atomic_long_set(&nfsi->commit_info.ncommit, 0); atomic_set(&nfsi->commit_info.rpcs_out, 0); @@ -6722,7 +7180,7 @@ index 6d5fedcd3..621e9bef1 100644 nfs4_init_once(nfsi); } diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h -index 4f3b5add0..96aea0e44 100644 +index d22176d87..594cf289c 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h @@ -114,7 +114,7 @@ struct nfs4_state_owner { @@ -6735,7 +7193,7 @@ index 4f3b5add0..96aea0e44 100644 }; diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c -index 24df1c068..2f09c476c 100644 +index ef9e80928..2767dcc0c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2918,7 +2918,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, @@ -6757,10 +7215,10 @@ index 24df1c068..2f09c476c 100644 } diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c -index 5ff516104..db44815d2 100644 +index c843917f8..707e2e06f 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c -@@ -513,7 +513,7 @@ nfs4_alloc_state_owner(struct nfs_server *server, +@@ -514,7 +514,7 @@ nfs4_alloc_state_owner(struct nfs_server *server, nfs4_init_seqid_counter(&sp->so_seqid); atomic_set(&sp->so_count, 1); INIT_LIST_HEAD(&sp->so_lru); @@ -6769,7 +7227,7 @@ index 5ff516104..db44815d2 100644 mutex_init(&sp->so_delegreturn_mutex); return sp; } -@@ -1581,8 +1581,12 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs +@@ -1582,8 +1582,12 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs * recovering after a network partition or a reboot from a * server that doesn't support a grace period. */ @@ -6783,7 +7241,7 @@ index 5ff516104..db44815d2 100644 restart: list_for_each_entry(state, &sp->so_states, open_states) { if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) -@@ -1669,14 +1673,20 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs +@@ -1670,14 +1674,20 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs spin_lock(&sp->so_lock); goto restart; } @@ -6927,7 +7385,7 @@ index 8946130c8..71d0b3ba7 100644 /** diff --git a/fs/proc/array.c b/fs/proc/array.c -index 9eb99a43f..e4d0cfeba 100644 +index fd56e15b3..01a617652 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -381,9 +381,9 @@ static inline void task_context_switch_counts(struct seq_file *m, @@ -6935,15 +7393,15 @@ index 9eb99a43f..e4d0cfeba 100644 { seq_printf(m, "Cpus_allowed:\t%*pb\n", - cpumask_pr_args(&task->cpus_allowed)); -+ cpumask_pr_args(task->cpus_ptr)); ++ cpumask_pr_args(task->cpus_ptr)); seq_printf(m, "Cpus_allowed_list:\t%*pbl\n", - cpumask_pr_args(&task->cpus_allowed)); + cpumask_pr_args(task->cpus_ptr)); } - static inline void task_core_dumping(struct seq_file *m, struct mm_struct *mm) + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY diff --git a/fs/proc/base.c b/fs/proc/base.c -index d7e94f7b5..9cc73c7a7 100644 +index dc9841826..e7458e0aa 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -96,6 +96,7 @@ @@ -6954,7 +7412,7 @@ index d7e94f7b5..9cc73c7a7 100644 #include "internal.h" #include "fd.h" -@@ -1980,7 +1981,7 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, +@@ -1979,7 +1980,7 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, child = d_hash_and_lookup(dir, &qname); if (!child) { @@ -7126,7 +7584,7 @@ index 3695a43eb..c4dfc638a 100644 int blk_mq_request_completed(struct request *rq); void blk_mq_start_request(struct request *rq); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h -index 1deaf36eb..850dab661 100644 +index c848f4205..12f11feea 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -13,6 +13,7 @@ @@ -7322,10 +7780,10 @@ index 519e94915..bf8e77001 100644 /** diff --git a/include/linux/cpu.h b/include/linux/cpu.h -index aab427381..87347ccbb 100644 +index 9af7ab2c2..5ac53b297 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h -@@ -129,6 +129,7 @@ static inline int cpus_read_trylock(void) { return true; } +@@ -137,6 +137,7 @@ static inline int cpus_read_trylock(void) { return true; } static inline void lockdep_assert_cpus_held(void) { } static inline void cpu_hotplug_disable(void) { } static inline void cpu_hotplug_enable(void) { } @@ -7371,10 +7829,10 @@ index b78bab439..7c4bc414a 100644 + #endif /* defined(_LINUX_DELAY_H) */ diff --git a/include/linux/fs.h b/include/linux/fs.h -index bcd2131ca..01414b979 100644 +index 7dc4508d1..30fcf55c2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h -@@ -705,7 +705,7 @@ struct inode { +@@ -714,7 +714,7 @@ struct inode { struct block_device *i_bdev; struct cdev *i_cdev; char *i_link; @@ -7744,7 +8202,7 @@ index 97de36a38..d05ef847f 100644 struct hrtimer timer; struct tasklet_struct tasklet; diff --git a/include/linux/irq.h b/include/linux/irq.h -index 536f1abc9..32f9bd593 100644 +index ff291f273..ea25f5c14 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -69,6 +69,7 @@ enum irqchip_irq_state; @@ -7849,7 +8307,7 @@ index 21619c92c..b20eeb25e 100644 defined(CONFIG_PREEMPT_TRACER) extern void stop_critical_timings(void); diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h -index 2192a10e9..a10b1f090 100644 +index 7d1bfa4cf..ccef2e110 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -349,32 +349,56 @@ static inline struct journal_head *bh2jh(struct buffer_head *bh) @@ -8529,7 +8987,7 @@ index 000000000..3fcb5edb1 + +#endif diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 9a7d7e630..1600f4dc5 100644 +index 5f110d6a0..8761c728c 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -435,7 +435,19 @@ typedef enum rx_handler_result rx_handler_result_t; @@ -8564,7 +9022,7 @@ index 9a7d7e630..1600f4dc5 100644 /* * Time (in jiffies) of last Tx */ -@@ -3110,6 +3126,7 @@ struct softnet_data { +@@ -3109,6 +3125,7 @@ struct softnet_data { unsigned int dropped; struct sk_buff_head input_pkt_queue; struct napi_struct backlog; @@ -8572,7 +9030,7 @@ index 9a7d7e630..1600f4dc5 100644 }; -@@ -3128,14 +3145,38 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd, +@@ -3127,14 +3144,38 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd, #endif } @@ -8612,7 +9070,7 @@ index 9a7d7e630..1600f4dc5 100644 static inline bool dev_xmit_recursion(void) { return unlikely(__this_cpu_read(softnet_data.xmit.recursion) > -@@ -3151,6 +3192,7 @@ static inline void dev_xmit_recursion_dec(void) +@@ -3150,6 +3191,7 @@ static inline void dev_xmit_recursion_dec(void) { __this_cpu_dec(softnet_data.xmit.recursion); } @@ -8620,7 +9078,7 @@ index 9a7d7e630..1600f4dc5 100644 void __netif_schedule(struct Qdisc *q); void netif_schedule_queue(struct netdev_queue *txq); -@@ -3954,13 +3996,52 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) +@@ -3955,13 +3997,52 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) return (1U << debug_value) - 1; } @@ -8675,7 +9133,7 @@ index 9a7d7e630..1600f4dc5 100644 static inline bool __netif_tx_acquire(struct netdev_queue *txq) { __acquire(&txq->_xmit_lock); -@@ -3975,8 +4056,7 @@ static inline void __netif_tx_release(struct netdev_queue *txq) +@@ -3976,8 +4057,7 @@ static inline void __netif_tx_release(struct netdev_queue *txq) static inline void __netif_tx_lock_bh(struct netdev_queue *txq) { spin_lock_bh(&txq->_xmit_lock); @@ -8685,7 +9143,7 @@ index 9a7d7e630..1600f4dc5 100644 } static inline bool __netif_tx_trylock(struct netdev_queue *txq) -@@ -3984,29 +4064,26 @@ static inline bool __netif_tx_trylock(struct netdev_queue *txq) +@@ -3985,29 +4065,26 @@ static inline bool __netif_tx_trylock(struct netdev_queue *txq) bool ok = spin_trylock(&txq->_xmit_lock); if (likely(ok)) { @@ -8759,7 +9217,7 @@ index 0ade4d1e4..3e21ce64c 100644 /* diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h -index 798dee258..5a337a14b 100644 +index 22e4ce639..c3de24074 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -164,7 +164,11 @@ struct nfs_inode { @@ -9120,7 +9578,7 @@ index f10333a2b..d71f2111b 100644 struct preempt_notifier; diff --git a/include/linux/printk.h b/include/linux/printk.h -index 895a46da8..6541a4909 100644 +index c2e583c0b..8ba1d7e2e 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -140,9 +140,11 @@ struct va_format { @@ -9161,10 +9619,10 @@ index 34149e8b5..affb0fc4c 100644 int radix_tree_split(struct radix_tree_root *, unsigned long index, unsigned new_order); diff --git a/include/linux/random.h b/include/linux/random.h -index 37209b3b2..c4342f765 100644 +index d05e70d56..7b74d6935 100644 --- a/include/linux/random.h +++ b/include/linux/random.h -@@ -32,7 +32,7 @@ static inline void add_latent_entropy(void) {} +@@ -32,7 +32,7 @@ static inline void add_latent_entropy(void) extern void add_input_randomness(unsigned int type, unsigned int code, unsigned int value) __latent_entropy; @@ -9247,7 +9705,7 @@ index 000000000..7066962a4 + +#endif diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h -index 68cbe1114..08d64e571 100644 +index 7ecef0b5c..e4b4f47e9 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -42,6 +42,7 @@ @@ -9306,7 +9764,7 @@ index 68cbe1114..08d64e571 100644 int rcu_read_lock_sched_held(void); #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ -@@ -362,54 +381,6 @@ static inline void rcu_preempt_sleep_check(void) { } +@@ -362,71 +381,7 @@ static inline void rcu_preempt_sleep_check(void) { } ((typeof(*p) __force __kernel *)(________p1)); \ }) @@ -9315,7 +9773,7 @@ index 68cbe1114..08d64e571 100644 - * @v: The value to statically initialize with. - */ -#define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v) -- + -/** - * rcu_assign_pointer() - assign to RCU-protected pointer - * @p: pointer to assign to @@ -9358,10 +9816,27 @@ index 68cbe1114..08d64e571 100644 - _r_a_p__v; \ -}) - +-/** +- * rcu_replace_pointer() - replace an RCU pointer, returning its old value +- * @rcu_ptr: RCU pointer, whose old value is returned +- * @ptr: regular pointer +- * @c: the lockdep conditions under which the dereference will take place +- * +- * Perform a replacement, where @rcu_ptr is an RCU-annotated +- * pointer and @c is the lockdep argument that is passed to the +- * rcu_dereference_protected() call used to read that pointer. The old +- * value of @rcu_ptr is returned, and @rcu_ptr is set to @ptr. +- */ +-#define rcu_replace_pointer(rcu_ptr, ptr, c) \ +-({ \ +- typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c)); \ +- rcu_assign_pointer((rcu_ptr), (ptr)); \ +- __tmp; \ +-}) + /** * rcu_swap_protected() - swap an RCU and a regular pointer - * @rcu_ptr: RCU pointer -@@ -701,10 +672,14 @@ static inline void rcu_read_unlock(void) +@@ -719,10 +674,14 @@ static inline void rcu_read_unlock(void) static inline void rcu_read_lock_bh(void) { local_bh_disable(); @@ -9376,7 +9851,7 @@ index 68cbe1114..08d64e571 100644 } /* -@@ -714,10 +689,14 @@ static inline void rcu_read_lock_bh(void) +@@ -732,10 +691,14 @@ static inline void rcu_read_lock_bh(void) */ static inline void rcu_read_unlock_bh(void) { @@ -9813,7 +10288,7 @@ index 000000000..3fb092b7b + +#endif diff --git a/include/linux/sched.h b/include/linux/sched.h -index 0202fe007..b11ac5d80 100644 +index 8fd8c5b7c..481b58e8d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -29,6 +29,7 @@ @@ -9874,7 +10349,7 @@ index 0202fe007..b11ac5d80 100644 /** * struct prev_cputime - snapshot of system and user cputime * @utime: time spent in user mode -@@ -613,6 +619,8 @@ struct task_struct { +@@ -630,6 +636,8 @@ struct task_struct { #endif /* -1 unrunnable, 0 runnable, >0 stopped: */ volatile long state; @@ -9883,7 +10358,7 @@ index 0202fe007..b11ac5d80 100644 /* * This begins the randomizable portion of task_struct. Only -@@ -673,7 +681,22 @@ struct task_struct { +@@ -690,7 +698,22 @@ struct task_struct { unsigned int policy; int nr_cpus_allowed; @@ -9907,7 +10382,7 @@ index 0202fe007..b11ac5d80 100644 #ifdef CONFIG_PREEMPT_RCU int rcu_read_lock_nesting; -@@ -837,6 +860,9 @@ struct task_struct { +@@ -854,6 +877,9 @@ struct task_struct { #ifdef CONFIG_POSIX_TIMERS struct task_cputime cputime_expires; struct list_head cpu_timers[3]; @@ -9917,7 +10392,7 @@ index 0202fe007..b11ac5d80 100644 #endif /* Process credentials: */ -@@ -881,11 +907,17 @@ struct task_struct { +@@ -898,11 +924,17 @@ struct task_struct { /* Signal handlers: */ struct signal_struct *signal; struct sighand_struct *sighand; @@ -9935,7 +10410,7 @@ index 0202fe007..b11ac5d80 100644 unsigned long sas_ss_sp; size_t sas_ss_size; unsigned int sas_ss_flags; -@@ -910,6 +942,7 @@ struct task_struct { +@@ -927,6 +959,7 @@ struct task_struct { raw_spinlock_t pi_lock; struct wake_q_node wake_q; @@ -9943,7 +10418,7 @@ index 0202fe007..b11ac5d80 100644 #ifdef CONFIG_RT_MUTEXES /* PI waiters blocked on a rt_mutex held by this task: */ -@@ -1199,8 +1232,22 @@ struct task_struct { +@@ -1216,8 +1249,22 @@ struct task_struct { unsigned int sequential_io; unsigned int sequential_io_avg; #endif @@ -9966,7 +10441,7 @@ index 0202fe007..b11ac5d80 100644 #endif int pagefault_disabled; #ifdef CONFIG_MMU -@@ -1419,6 +1466,7 @@ extern struct pid *cad_pid; +@@ -1456,6 +1503,7 @@ extern struct pid *cad_pid; /* * Per process flags */ @@ -9974,16 +10449,16 @@ index 0202fe007..b11ac5d80 100644 #define PF_IDLE 0x00000002 /* I am an IDLE thread */ #define PF_EXITING 0x00000004 /* Getting shut down */ #define PF_RELIABLE 0x00000008 /* Allocate from reliable memory */ -@@ -1443,7 +1491,7 @@ extern struct pid *cad_pid; - #define PF_RANDOMIZE 0x00400000 /* Randomize virtual address space */ +@@ -1480,7 +1528,7 @@ extern struct pid *cad_pid; #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ + #define PF_UCE_KERNEL_COREDUMP 0x01000000 /* Task in coredump process which is used in uce kernel recovery */ #define PF_UCE_KERNEL_RECOVERY 0x02000000 /* Task in uce kernel recovery state */ -#define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_allowed */ +#define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_mask */ #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ #define PF_IO_WORKER 0x20000000 /* Task is an IO worker */ #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ -@@ -1648,6 +1696,7 @@ extern struct task_struct *find_get_task_by_vpid(pid_t nr); +@@ -1685,6 +1733,7 @@ extern struct task_struct *find_get_task_by_vpid(pid_t nr); extern int wake_up_state(struct task_struct *tsk, unsigned int state); extern int wake_up_process(struct task_struct *tsk); @@ -9991,7 +10466,7 @@ index 0202fe007..b11ac5d80 100644 extern void wake_up_new_task(struct task_struct *tsk); #ifdef CONFIG_SMP -@@ -1730,6 +1779,89 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) +@@ -1767,6 +1816,89 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); } @@ -10081,7 +10556,7 @@ index 0202fe007..b11ac5d80 100644 /* * cond_resched() and cond_resched_lock(): latency reduction via * explicit rescheduling in places that are safe. The return -@@ -1782,6 +1914,23 @@ static __always_inline bool need_resched(void) +@@ -1819,6 +1951,23 @@ static __always_inline bool need_resched(void) return unlikely(tif_need_resched()); } @@ -10105,7 +10580,7 @@ index 0202fe007..b11ac5d80 100644 /* * Wrappers for p->thread_info->cpu access. No-op on UP. */ -@@ -1953,6 +2102,8 @@ static inline void rseq_syscall(struct pt_regs *regs) +@@ -1990,6 +2139,8 @@ static inline void rseq_syscall(struct pt_regs *regs) #endif @@ -10137,10 +10612,10 @@ index bd762e7a2..c671d19ff 100644 /* diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h -index c8b52b3ec..9c9832404 100644 +index 8b02ee423..756ba93f2 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h -@@ -91,6 +91,21 @@ extern void sched_exec(void); +@@ -90,6 +90,21 @@ extern void sched_exec(void); #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) @@ -10162,7 +10637,7 @@ index c8b52b3ec..9c9832404 100644 extern void __put_task_struct(struct task_struct *t); static inline void put_task_struct(struct task_struct *t) -@@ -104,6 +119,7 @@ static inline void put_task_struct_many(struct task_struct *t, int nr) +@@ -103,6 +118,7 @@ static inline void put_task_struct_many(struct task_struct *t, int nr) if (atomic_sub_and_test(nr, &t->usage)) __put_task_struct(t); } @@ -10363,7 +10838,7 @@ index 0be5ce237..6495fda18 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 e9f100bd7..1423c8487 100644 +index b67d42871..ed4b509e1 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -287,6 +287,7 @@ struct sk_buff_head { @@ -10374,7 +10849,7 @@ index e9f100bd7..1423c8487 100644 }; struct sk_buff; -@@ -1735,6 +1736,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) +@@ -1740,6 +1741,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) __skb_queue_head_init(list); } @@ -11102,7 +11577,7 @@ index 60a62d3ad..6f33ccf6b 100644 hrtimer_start_range_ns(&__t.timer, timeout, \ current->timer_slack_ns, \ diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h -index 6f2b042fc..f0e786dc7 100644 +index 3ac0fa0c8..c0a6055da 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -473,10 +473,6 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, @@ -11211,7 +11686,7 @@ index 000000000..a7034298a + +#endif diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h -index c9cd5086b..b6328680d 100644 +index a8dcb16c2..251059dca 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -10,6 +10,7 @@ @@ -11222,7 +11697,7 @@ index c9cd5086b..b6328680d 100644 #include #include #include -@@ -100,7 +101,7 @@ struct Qdisc { +@@ -106,7 +107,7 @@ struct Qdisc { struct sk_buff_head gso_skb ____cacheline_aligned_in_smp; struct qdisc_skb_head q; struct gnet_stats_basic_packed bstats; @@ -11231,7 +11706,7 @@ index c9cd5086b..b6328680d 100644 struct gnet_stats_queue qstats; unsigned long state; struct Qdisc *next_sched; -@@ -121,7 +122,11 @@ static inline bool qdisc_is_running(struct Qdisc *qdisc) +@@ -140,7 +141,11 @@ static inline bool qdisc_is_running(struct Qdisc *qdisc) { if (qdisc->flags & TCQ_F_NOLOCK) return spin_is_locked(&qdisc->seqlock); @@ -11243,7 +11718,7 @@ index c9cd5086b..b6328680d 100644 } static inline bool qdisc_run_begin(struct Qdisc *qdisc) -@@ -132,17 +137,27 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc) +@@ -151,17 +156,27 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc) } else if (qdisc_is_running(qdisc)) { return false; } @@ -11271,7 +11746,7 @@ index c9cd5086b..b6328680d 100644 if (qdisc->flags & TCQ_F_NOLOCK) spin_unlock(&qdisc->seqlock); } -@@ -458,7 +473,7 @@ static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc) +@@ -477,7 +492,7 @@ static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc) return qdisc_lock(root); } @@ -11470,7 +11945,7 @@ index 000000000..657e234b1 + +#endif /* __SOC_ATMEL_TCB_H */ diff --git a/init/Kconfig b/init/Kconfig -index 1a0b15c5a..abac5e8b0 100644 +index ef1768d36..1c433fc50 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -814,6 +814,7 @@ config CFS_BANDWIDTH @@ -11481,7 +11956,7 @@ index 1a0b15c5a..abac5e8b0 100644 default n help This feature lets you explicitly allocate real CPU bandwidth -@@ -1702,6 +1703,7 @@ choice +@@ -1735,6 +1736,7 @@ choice config SLAB bool "SLAB" @@ -11489,7 +11964,7 @@ index 1a0b15c5a..abac5e8b0 100644 select HAVE_HARDENED_USERCOPY_ALLOCATOR help The regular slab allocator that is established and known to work -@@ -1722,6 +1724,7 @@ config SLUB +@@ -1755,6 +1757,7 @@ config SLUB config SLOB depends on EXPERT bool "SLOB (Simple Allocator)" @@ -11497,7 +11972,7 @@ index 1a0b15c5a..abac5e8b0 100644 help SLOB replaces the stock allocator with a drastically simpler allocator. SLOB is generally more space efficient but -@@ -1763,7 +1766,7 @@ config SLAB_FREELIST_HARDENED +@@ -1796,7 +1799,7 @@ config SLAB_FREELIST_HARDENED config SLUB_CPU_PARTIAL default y @@ -11517,7 +11992,7 @@ index a3e5ce2bc..777923256 100644 - "$(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/init_task.c b/init/init_task.c -index 57ff82ab9..593bbeff8 100644 +index b312a045f..788784cd7 100644 --- a/init/init_task.c +++ b/init/init_task.c @@ -50,6 +50,12 @@ static struct sighand_struct init_sighand = { @@ -11557,7 +12032,7 @@ index 57ff82ab9..593bbeff8 100644 .thread_group = LIST_HEAD_INIT(init_task.thread_group), .thread_node = LIST_HEAD_INIT(init_signals.thread_head), diff --git a/init/main.c b/init/main.c -index 4e041fc2a..a705b0e41 100644 +index 50af60ff0..04710896e 100644 --- a/init/main.c +++ b/init/main.c @@ -560,6 +560,7 @@ asmlinkage __visible void __init start_kernel(void) @@ -11651,10 +12126,10 @@ index cd1655122..fd924c0bc 100644 \ No newline at end of file + bool diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c -index 7456882e1..1c13e5d37 100644 +index 1339b93f7..81dee3a6a 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -4766,10 +4766,10 @@ static void css_free_rwork_fn(struct work_struct *work) +@@ -4821,10 +4821,10 @@ static void css_free_rwork_fn(struct work_struct *work) } } @@ -11667,7 +12142,7 @@ index 7456882e1..1c13e5d37 100644 struct cgroup_subsys *ss = css->ss; struct cgroup *cgrp = css->cgroup; -@@ -4831,8 +4831,8 @@ static void css_release(struct percpu_ref *ref) +@@ -4886,8 +4886,8 @@ static void css_release(struct percpu_ref *ref) struct cgroup_subsys_state *css = container_of(ref, struct cgroup_subsys_state, refcnt); @@ -11678,7 +12153,7 @@ index 7456882e1..1c13e5d37 100644 } static void init_and_link_css(struct cgroup_subsys_state *css, -@@ -5552,6 +5552,7 @@ static int __init cgroup_wq_init(void) +@@ -5612,6 +5612,7 @@ static int __init cgroup_wq_init(void) */ cgroup_destroy_wq = alloc_workqueue("cgroup_destroy", 0, 1); BUG_ON(!cgroup_destroy_wq); @@ -11687,10 +12162,10 @@ index 7456882e1..1c13e5d37 100644 } core_initcall(cgroup_wq_init); diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c -index feb911772..b6f84c024 100644 +index ae2b1ad23..1afc006a3 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c -@@ -288,7 +288,7 @@ static struct cpuset top_cpuset = { +@@ -291,7 +291,7 @@ static struct cpuset top_cpuset = { */ static DEFINE_MUTEX(cpuset_mutex); @@ -11699,7 +12174,19 @@ index feb911772..b6f84c024 100644 static struct workqueue_struct *cpuset_migrate_mm_wq; -@@ -924,9 +924,9 @@ static void update_cpumasks_hier(struct cpuset *cs, struct cpumask *new_cpus) +@@ -628,9 +628,9 @@ static int update_prefer_cpumask(struct cpuset *cs, struct cpuset *trialcs, + if (!cpumask_empty(trialcs->prefer_cpus)) + dynamic_affinity_enable(); + +- spin_lock_irq(&callback_lock); ++ raw_spin_lock_irq(&callback_lock); + cpumask_copy(cs->prefer_cpus, trialcs->prefer_cpus); +- spin_unlock_irq(&callback_lock); ++ raw_spin_unlock_irq(&callback_lock); + + return 0; + } +@@ -1009,9 +1009,9 @@ static void update_cpumasks_hier(struct cpuset *cs, struct cpumask *new_cpus) continue; rcu_read_unlock(); @@ -11711,7 +12198,7 @@ index feb911772..b6f84c024 100644 WARN_ON(!is_in_v2_mode() && !cpumask_equal(cp->cpus_allowed, cp->effective_cpus)); -@@ -991,9 +991,9 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, +@@ -1076,9 +1076,9 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, if (retval < 0) return retval; @@ -11723,7 +12210,7 @@ index feb911772..b6f84c024 100644 /* use trialcs->cpus_allowed as a temp variable */ update_cpumasks_hier(cs, trialcs->cpus_allowed); -@@ -1177,9 +1177,9 @@ static void update_nodemasks_hier(struct cpuset *cs, nodemask_t *new_mems) +@@ -1262,9 +1262,9 @@ static void update_nodemasks_hier(struct cpuset *cs, nodemask_t *new_mems) continue; rcu_read_unlock(); @@ -11735,7 +12222,7 @@ index feb911772..b6f84c024 100644 WARN_ON(!is_in_v2_mode() && !nodes_equal(cp->mems_allowed, cp->effective_mems)); -@@ -1247,9 +1247,9 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, +@@ -1332,9 +1332,9 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, if (retval < 0) goto done; @@ -11747,7 +12234,7 @@ index feb911772..b6f84c024 100644 /* use trialcs->mems_allowed as a temp variable */ update_nodemasks_hier(cs, &trialcs->mems_allowed); -@@ -1340,9 +1340,9 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs, +@@ -1425,9 +1425,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))); @@ -11759,7 +12246,7 @@ index feb911772..b6f84c024 100644 if (!cpumask_empty(trialcs->cpus_allowed) && balance_flag_changed) rebuild_sched_domains_locked(); -@@ -1757,7 +1757,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v) +@@ -1866,7 +1866,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v) cpuset_filetype_t type = seq_cft(sf)->private; int ret = 0; @@ -11768,7 +12255,7 @@ index feb911772..b6f84c024 100644 switch (type) { case FILE_CPULIST: -@@ -1776,7 +1776,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v) +@@ -1890,7 +1890,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v) ret = -EINVAL; } @@ -11777,7 +12264,7 @@ index feb911772..b6f84c024 100644 return ret; } -@@ -1991,12 +1991,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) +@@ -2125,12 +2125,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) cpuset_inc(); @@ -11792,7 +12279,7 @@ index feb911772..b6f84c024 100644 if (!test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags)) goto out_unlock; -@@ -2023,12 +2023,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) +@@ -2157,7 +2157,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) } rcu_read_unlock(); @@ -11801,13 +12288,16 @@ index feb911772..b6f84c024 100644 cs->mems_allowed = parent->mems_allowed; cs->effective_mems = parent->mems_allowed; cpumask_copy(cs->cpus_allowed, parent->cpus_allowed); - cpumask_copy(cs->effective_cpus, parent->cpus_allowed); +@@ -2165,7 +2165,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + cpumask_copy(cs->prefer_cpus, parent->prefer_cpus); + #endif - spin_unlock_irq(&callback_lock); + raw_spin_unlock_irq(&callback_lock); out_unlock: mutex_unlock(&cpuset_mutex); - return 0; -@@ -2067,7 +2067,7 @@ static void cpuset_css_free(struct cgroup_subsys_state *css) + put_online_cpus(); +@@ -2210,7 +2210,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); @@ -11816,7 +12306,7 @@ index feb911772..b6f84c024 100644 if (is_in_v2_mode()) { cpumask_copy(top_cpuset.cpus_allowed, cpu_possible_mask); -@@ -2078,7 +2078,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) +@@ -2221,7 +2221,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) top_cpuset.mems_allowed = top_cpuset.effective_mems; } @@ -11825,17 +12315,17 @@ index feb911772..b6f84c024 100644 mutex_unlock(&cpuset_mutex); } -@@ -2092,7 +2092,7 @@ static void cpuset_fork(struct task_struct *task) +@@ -2235,7 +2235,7 @@ static void cpuset_fork(struct task_struct *task) if (task_css_is_root(task, cpuset_cgrp_id)) return; - set_cpus_allowed_ptr(task, ¤t->cpus_allowed); + set_cpus_allowed_ptr(task, current->cpus_ptr); - task->mems_allowed = current->mems_allowed; - } - -@@ -2176,12 +2176,12 @@ hotplug_update_tasks_legacy(struct cpuset *cs, - { + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + set_prefer_cpus_ptr(task, current->prefer_cpus); + #endif +@@ -2334,12 +2334,12 @@ hotplug_update_tasks_legacy(struct cpuset *cs, + #endif bool is_empty; - spin_lock_irq(&callback_lock); @@ -11849,7 +12339,7 @@ index feb911772..b6f84c024 100644 /* * Don't call update_tasks_cpumask() if the cpuset becomes empty, -@@ -2218,10 +2218,10 @@ hotplug_update_tasks(struct cpuset *cs, +@@ -2383,10 +2383,10 @@ hotplug_update_tasks(struct cpuset *cs, if (nodes_empty(*new_mems)) *new_mems = parent_cs(cs)->effective_mems; @@ -11862,7 +12352,7 @@ index feb911772..b6f84c024 100644 if (cpus_updated) update_tasks_cpumask(cs); -@@ -2314,21 +2314,21 @@ static void cpuset_hotplug_workfn(struct work_struct *work) +@@ -2479,21 +2479,21 @@ static void cpuset_hotplug_workfn(struct work_struct *work) /* synchronize cpus_allowed to cpu_active_mask */ if (cpus_updated) { @@ -11888,7 +12378,7 @@ index feb911772..b6f84c024 100644 update_tasks_nodemask(&top_cpuset); } -@@ -2427,11 +2427,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) +@@ -2592,11 +2592,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) { unsigned long flags; @@ -11902,7 +12392,7 @@ index feb911772..b6f84c024 100644 } /** -@@ -2492,11 +2492,11 @@ nodemask_t cpuset_mems_allowed(struct task_struct *tsk) +@@ -2657,11 +2657,11 @@ nodemask_t cpuset_mems_allowed(struct task_struct *tsk) nodemask_t mask; unsigned long flags; @@ -11916,7 +12406,7 @@ index feb911772..b6f84c024 100644 return mask; } -@@ -2588,14 +2588,14 @@ bool __cpuset_node_allowed(int node, gfp_t gfp_mask) +@@ -2753,14 +2753,14 @@ bool __cpuset_node_allowed(int node, gfp_t gfp_mask) return true; /* Not hardwall and node outside mems_allowed: scan up cpusets */ @@ -11958,10 +12448,10 @@ index d0ed410b4..3c949c46c 100644 /* if @may_sleep, play nice and yield if necessary */ if (may_sleep && (need_resched() || diff --git a/kernel/cpu.c b/kernel/cpu.c -index 80c85406e..3a11a7fea 100644 +index c943454b7..460126cdd 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c -@@ -825,6 +825,15 @@ static int take_cpu_down(void *_param) +@@ -832,6 +832,15 @@ static int take_cpu_down(void *_param) int err, cpu = smp_processor_id(); int ret; @@ -11977,7 +12467,7 @@ index 80c85406e..3a11a7fea 100644 /* Ensure this CPU doesn't handle any more interrupts. */ err = __cpu_disable(); if (err < 0) -@@ -854,6 +863,10 @@ static int take_cpu_down(void *_param) +@@ -861,6 +870,10 @@ static int take_cpu_down(void *_param) return 0; } @@ -11988,7 +12478,7 @@ index 80c85406e..3a11a7fea 100644 static int takedown_cpu(unsigned int cpu) { struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); -@@ -868,11 +881,39 @@ static int takedown_cpu(unsigned int cpu) +@@ -875,11 +888,39 @@ static int takedown_cpu(unsigned int cpu) */ irq_lock_sparse(); @@ -12028,7 +12518,7 @@ index 80c85406e..3a11a7fea 100644 /* CPU refused to die */ irq_unlock_sparse(); /* Unpark the hotplug thread so we can rollback there */ -@@ -891,6 +932,9 @@ static int takedown_cpu(unsigned int cpu) +@@ -898,6 +939,9 @@ static int takedown_cpu(unsigned int cpu) wait_for_ap_thread(st, false); BUG_ON(st->state != CPUHP_AP_IDLE_DEAD); @@ -12055,7 +12545,7 @@ index 6a4b41484..197cb422f 100644 return r; } diff --git a/kernel/events/core.c b/kernel/events/core.c -index 00b22c820..5f6b9db8c 100644 +index a49860879..2e28519ea 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -1108,7 +1108,7 @@ static void __perf_mux_hrtimer_init(struct perf_cpu_context *cpuctx, int cpu) @@ -12067,7 +12557,7 @@ index 00b22c820..5f6b9db8c 100644 timer->function = perf_mux_hrtimer_handler; } -@@ -9338,7 +9338,7 @@ static void perf_swevent_init_hrtimer(struct perf_event *event) +@@ -9368,7 +9368,7 @@ static void perf_swevent_init_hrtimer(struct perf_event *event) if (!is_sampling_event(event)) return; @@ -12090,10 +12580,10 @@ index 2a32d32bd..6b38a0490 100644 spin_unlock(&sighand->siglock); diff --git a/kernel/fork.c b/kernel/fork.c -index 88463fd56..97cd89df1 100644 +index bfc4534ff..0f8b3e146 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -40,6 +40,7 @@ +@@ -41,6 +41,7 @@ #include #include #include @@ -12101,7 +12591,7 @@ index 88463fd56..97cd89df1 100644 #include #include #include -@@ -683,6 +684,19 @@ void __mmdrop(struct mm_struct *mm) +@@ -690,6 +691,19 @@ void __mmdrop(struct mm_struct *mm) } EXPORT_SYMBOL_GPL(__mmdrop); @@ -12121,7 +12611,7 @@ index 88463fd56..97cd89df1 100644 static void mmdrop_async_fn(struct work_struct *work) { struct mm_struct *mm; -@@ -717,13 +731,24 @@ static inline void put_signal_struct(struct signal_struct *sig) +@@ -724,13 +738,24 @@ static inline void put_signal_struct(struct signal_struct *sig) if (atomic_dec_and_test(&sig->sigcnt)) free_signal_struct(sig); } @@ -12147,7 +12637,7 @@ index 88463fd56..97cd89df1 100644 cgroup_free(tsk); task_numa_free(tsk, true); security_task_free(tsk); -@@ -736,7 +761,18 @@ void __put_task_struct(struct task_struct *tsk) +@@ -743,7 +768,18 @@ void __put_task_struct(struct task_struct *tsk) if (!profile_handoff_task(tsk)) free_task(tsk); } @@ -12166,7 +12656,7 @@ index 88463fd56..97cd89df1 100644 void __init __weak arch_task_cache_init(void) { } -@@ -896,6 +932,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) +@@ -908,6 +944,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) #ifdef CONFIG_STACKPROTECTOR tsk->stack_canary = get_random_canary(); #endif @@ -12175,7 +12665,7 @@ index 88463fd56..97cd89df1 100644 /* * One for the user space visible state that goes away when reaped. -@@ -910,6 +948,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) +@@ -922,6 +960,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; @@ -12183,7 +12673,7 @@ index 88463fd56..97cd89df1 100644 account_kernel_stack(tsk, 1); -@@ -1657,6 +1696,9 @@ static void rt_mutex_init_task(struct task_struct *p) +@@ -1670,6 +1709,9 @@ static void rt_mutex_init_task(struct task_struct *p) */ static void posix_cpu_timers_init(struct task_struct *tsk) { @@ -12193,7 +12683,7 @@ index 88463fd56..97cd89df1 100644 tsk->cputime_expires.prof_exp = 0; tsk->cputime_expires.virt_exp = 0; tsk->cputime_expires.sched_exp = 0; -@@ -1881,6 +1923,7 @@ static __latent_entropy struct task_struct *copy_process( +@@ -1905,6 +1947,7 @@ static __latent_entropy struct task_struct *copy_process( spin_lock_init(&p->alloc_lock); init_sigpending(&p->pending); @@ -12486,7 +12976,7 @@ index 38554bc35..06a80bbf7 100644 if (!noirqdebug) note_interrupt(desc, retval); diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index a8c66acee..ba63896ae 100644 +index 163712c76..e2353e775 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -24,6 +24,7 @@ @@ -12505,7 +12995,7 @@ index a8c66acee..ba63896ae 100644 #endif static void __synchronize_hardirq(struct irq_desc *desc, bool sync_chip) -@@ -1127,6 +1129,12 @@ static int irq_thread(void *data) +@@ -1158,6 +1160,12 @@ static int irq_thread(void *data) if (action_ret == IRQ_WAKE_THREAD) irq_wake_secondary(desc, action); @@ -12518,7 +13008,7 @@ index a8c66acee..ba63896ae 100644 wake_threads_waitq(desc); } -@@ -1580,6 +1588,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) +@@ -1609,6 +1617,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) irqd_set(&desc->irq_data, IRQD_NO_BALANCING); } @@ -12528,7 +13018,7 @@ index a8c66acee..ba63896ae 100644 if (irq_settings_can_autoenable(desc)) { irq_startup(desc, IRQ_RESEND, IRQ_START_COND); } else { -@@ -2710,7 +2721,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); +@@ -2733,7 +2744,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); * This call sets the internal irqchip state of an interrupt, * depending on the value of @which. * @@ -15532,10 +16022,10 @@ index 07a32e99a..5b28b0ac8 100644 } EXPORT_SYMBOL(pm_suspend); diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 0fe45941b..4c90438fc 100644 +index f52eceb3c..903fa8f2e 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -405,6 +405,65 @@ DEFINE_RAW_SPINLOCK(logbuf_lock); +@@ -418,6 +418,65 @@ DEFINE_RAW_SPINLOCK(logbuf_lock); printk_safe_exit_irqrestore(flags); \ } while (0) @@ -15601,7 +16091,7 @@ index 0fe45941b..4c90438fc 100644 #ifdef CONFIG_PRINTK DECLARE_WAIT_QUEUE_HEAD(log_wait); /* the next printk record to read by syslog(READ) or /proc/kmsg */ -@@ -1405,6 +1464,8 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -1418,6 +1477,8 @@ static int syslog_print_all(char __user *buf, int size, bool clear) u64 next_seq; u64 seq; u32 idx; @@ -15610,7 +16100,7 @@ index 0fe45941b..4c90438fc 100644 bool time; text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL); -@@ -1413,6 +1474,15 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -1426,6 +1487,15 @@ static int syslog_print_all(char __user *buf, int size, bool clear) time = printk_time; logbuf_lock_irq(); @@ -15626,7 +16116,7 @@ index 0fe45941b..4c90438fc 100644 /* * Find first record that fits, including all following records, * into the user-provided buffer for this dump. -@@ -1425,6 +1495,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -1438,6 +1508,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) len += msg_print_text(msg, true, time, NULL, 0); idx = log_next(idx); seq++; @@ -15641,7 +16131,7 @@ index 0fe45941b..4c90438fc 100644 } /* move first record forward until length fits into the buffer */ -@@ -1436,6 +1514,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -1449,6 +1527,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) len -= msg_print_text(msg, true, time, NULL, 0); idx = log_next(idx); seq++; @@ -15656,7 +16146,7 @@ index 0fe45941b..4c90438fc 100644 } /* last message fitting into this dump */ -@@ -1468,6 +1554,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) +@@ -1481,6 +1567,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) clear_seq = log_next_seq; clear_idx = log_next_idx; } @@ -15664,7 +16154,7 @@ index 0fe45941b..4c90438fc 100644 logbuf_unlock_irq(); kfree(text); -@@ -1602,6 +1689,7 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) +@@ -1615,6 +1702,7 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) return do_syslog(type, buf, len, SYSLOG_FROM_READER); } @@ -15672,12 +16162,14 @@ index 0fe45941b..4c90438fc 100644 /* * Special console_lock variants that help to reduce the risk of soft-lockups. * They allow to pass console_lock to another printk() call using a busy wait. -@@ -1756,6 +1844,15 @@ static int console_trylock_spinning(void) +@@ -1779,6 +1867,17 @@ static int console_trylock_spinning(void) return 1; } +#else + ++void zap_locks(void) {} ++ +static int console_trylock_spinning(void) +{ + return console_trylock(); @@ -15688,7 +16180,7 @@ index 0fe45941b..4c90438fc 100644 /* * Call the console drivers, asking them to write out * log_buf[start] to log_buf[end - 1]. -@@ -1771,6 +1868,12 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, +@@ -1794,6 +1893,12 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, if (!console_drivers) return; @@ -15701,7 +16193,7 @@ index 0fe45941b..4c90438fc 100644 for_each_console(con) { if (exclusive_console && con != exclusive_console) continue; -@@ -1786,6 +1889,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, +@@ -1809,6 +1914,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, else con->write(con, text, len); } @@ -15709,21 +16201,21 @@ index 0fe45941b..4c90438fc 100644 } int printk_delay_msec __read_mostly; -@@ -1956,6 +2060,13 @@ asmlinkage int vprintk_emit(int facility, int level, +@@ -1978,7 +2084,12 @@ asmlinkage int vprintk_emit(int facility, int level, + bool in_sched = false, pending_output; unsigned long flags; u64 curr_log_seq; - +- + /* + * Fall back to early_printk if a debugging subsystem has + * killed printk output + */ + if (unlikely(forced_early_printk(fmt, args))) + return 1; -+ - if (level == LOGLEVEL_SCHED) { - level = LOGLEVEL_DEFAULT; - in_sched = true; -@@ -1973,20 +2084,30 @@ asmlinkage int vprintk_emit(int facility, int level, + if (unlikely(suppress_panic_printk) && + atomic_read(&panic_cpu) != raw_smp_processor_id()) + return 0; +@@ -2000,20 +2111,30 @@ asmlinkage int vprintk_emit(int facility, int level, /* If called from the scheduler, we can not call up(). */ if (!in_sched && pending_output) { @@ -15757,7 +16249,7 @@ index 0fe45941b..4c90438fc 100644 } if (pending_output) -@@ -2101,26 +2222,6 @@ static bool suppress_message_printing(int level) { return false; } +@@ -2128,26 +2249,6 @@ static bool suppress_message_printing(int level) { return false; } #endif /* CONFIG_PRINTK */ @@ -15784,7 +16276,7 @@ index 0fe45941b..4c90438fc 100644 static int __add_preferred_console(char *name, int idx, char *options, char *brl_options) { -@@ -2471,6 +2572,10 @@ void console_unlock(void) +@@ -2522,6 +2623,10 @@ void console_unlock(void) console_seq++; raw_spin_unlock(&logbuf_lock); @@ -15795,15 +16287,16 @@ index 0fe45941b..4c90438fc 100644 /* * While actively printing out messages, if another printk() * were to occur on another CPU, it may wait for this one to -@@ -2489,6 +2594,7 @@ void console_unlock(void) +@@ -2540,7 +2645,7 @@ void console_unlock(void) } printk_safe_exit_irqrestore(flags); +- +#endif - - if (do_cond_resched) - cond_resched(); -@@ -2536,6 +2642,11 @@ void console_unblank(void) + /* Allow panic_cpu to take over the consoles safely */ + if (abandon_console_lock_in_panic()) + break; +@@ -2591,6 +2696,11 @@ void console_unblank(void) { struct console *c; @@ -15815,8 +16308,37 @@ index 0fe45941b..4c90438fc 100644 /* * console_unblank can no longer be called in interrupt context unless * oops_in_progress is set to 1.. +diff --git a/kernel/printk/printk.c.rej b/kernel/printk/printk.c.rej +new file mode 100644 +index 000000000..5b6a53cda +--- /dev/null ++++ b/kernel/printk/printk.c.rej +@@ -0,0 +1,23 @@ ++diff a/kernel/printk/printk.c b/kernel/printk/printk.c (rejected hunks) ++@@ -1958,6 +2064,13 @@ asmlinkage int vprintk_emit(int facility, int level, ++ unsigned long flags; ++ u64 curr_log_seq; ++ +++ /* +++ * Fall back to early_printk if a debugging subsystem has +++ * killed printk output +++ */ +++ if (unlikely(forced_early_printk(fmt, args))) +++ return 1; +++ ++ if (level == LOGLEVEL_SCHED) { ++ level = LOGLEVEL_DEFAULT; ++ in_sched = true; ++@@ -2491,6 +2598,7 @@ void console_unlock(void) ++ } ++ ++ printk_safe_exit_irqrestore(flags); +++#endif ++ ++ if (do_cond_resched) ++ cond_resched(); diff --git a/kernel/ptrace.c b/kernel/ptrace.c -index f32095d7a..36ffe1417 100644 +index 424a04cdd..7378cf3ad 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -190,7 +190,14 @@ static bool ptrace_freeze_traced(struct task_struct *task) @@ -16050,7 +16572,7 @@ index a276bbe90..73ec7635b 100644 srcu_funnel_gp_start(sp, sdp, s, do_norm); else if (needexp) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c -index 594d6ea99..12704e7d3 100644 +index a0dc5385b..b176b9d03 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -61,6 +61,13 @@ @@ -16095,7 +16617,7 @@ index 594d6ea99..12704e7d3 100644 /* * Steal a bit from the bottom of ->dynticks for idle entry/exit -@@ -568,6 +589,7 @@ unsigned long rcu_sched_get_gp_seq(void) +@@ -569,6 +590,7 @@ unsigned long rcu_sched_get_gp_seq(void) } EXPORT_SYMBOL_GPL(rcu_sched_get_gp_seq); @@ -16103,7 +16625,7 @@ index 594d6ea99..12704e7d3 100644 /* * Return the number of RCU-bh GPs completed thus far for debug & stats. */ -@@ -576,6 +598,7 @@ unsigned long rcu_bh_get_gp_seq(void) +@@ -577,6 +599,7 @@ unsigned long rcu_bh_get_gp_seq(void) return READ_ONCE(rcu_bh_state.gp_seq); } EXPORT_SYMBOL_GPL(rcu_bh_get_gp_seq); @@ -16111,7 +16633,7 @@ index 594d6ea99..12704e7d3 100644 /* * Return the number of RCU expedited batches completed thus far for -@@ -599,6 +622,7 @@ unsigned long rcu_exp_batches_completed_sched(void) +@@ -600,6 +623,7 @@ unsigned long rcu_exp_batches_completed_sched(void) } EXPORT_SYMBOL_GPL(rcu_exp_batches_completed_sched); @@ -16119,7 +16641,7 @@ index 594d6ea99..12704e7d3 100644 /* * Force a quiescent state. */ -@@ -617,6 +641,13 @@ void rcu_bh_force_quiescent_state(void) +@@ -618,6 +642,13 @@ void rcu_bh_force_quiescent_state(void) } EXPORT_SYMBOL_GPL(rcu_bh_force_quiescent_state); @@ -16133,7 +16655,7 @@ index 594d6ea99..12704e7d3 100644 /* * Force a quiescent state for RCU-sched. */ -@@ -674,9 +705,11 @@ void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, +@@ -675,9 +706,11 @@ void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, case RCU_FLAVOR: rsp = rcu_state_p; break; @@ -16145,7 +16667,7 @@ index 594d6ea99..12704e7d3 100644 case RCU_SCHED_FLAVOR: rsp = &rcu_sched_state; break; -@@ -1263,6 +1296,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) +@@ -1264,6 +1297,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp) !rdp->rcu_iw_pending && rdp->rcu_iw_gp_seq != rnp->gp_seq && (rnp->ffmask & rdp->grpmask)) { init_irq_work(&rdp->rcu_iw, rcu_iw_handler); @@ -16153,7 +16675,7 @@ index 594d6ea99..12704e7d3 100644 rdp->rcu_iw_pending = true; rdp->rcu_iw_gp_seq = rnp->gp_seq; irq_work_queue_on(&rdp->rcu_iw, rdp->cpu); -@@ -2869,18 +2903,17 @@ __rcu_process_callbacks(struct rcu_state *rsp) +@@ -2870,18 +2904,17 @@ __rcu_process_callbacks(struct rcu_state *rsp) /* * Do RCU core processing for the current CPU. */ @@ -16174,7 +16696,7 @@ index 594d6ea99..12704e7d3 100644 /* * Schedule RCU callback invocation. If the specified type of RCU * does not support RCU priority boosting, just do a direct call, -@@ -2892,19 +2925,106 @@ static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp) +@@ -2893,19 +2926,106 @@ static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp) { if (unlikely(!READ_ONCE(rcu_scheduler_fully_active))) return; @@ -16288,7 +16810,7 @@ index 594d6ea99..12704e7d3 100644 /* * Handle any core-RCU processing required by a call_rcu() invocation. */ -@@ -3056,6 +3176,7 @@ void call_rcu_sched(struct rcu_head *head, rcu_callback_t func) +@@ -3057,6 +3177,7 @@ void call_rcu_sched(struct rcu_head *head, rcu_callback_t func) } EXPORT_SYMBOL_GPL(call_rcu_sched); @@ -16296,7 +16818,7 @@ index 594d6ea99..12704e7d3 100644 /** * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period. * @head: structure to be used for queueing the RCU updates. -@@ -3083,6 +3204,7 @@ void call_rcu_bh(struct rcu_head *head, rcu_callback_t func) +@@ -3084,6 +3205,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); @@ -16304,7 +16826,7 @@ index 594d6ea99..12704e7d3 100644 /* * Queue an RCU callback for lazy invocation after a grace period. -@@ -3168,6 +3290,7 @@ void synchronize_sched(void) +@@ -3169,6 +3291,7 @@ void synchronize_sched(void) } EXPORT_SYMBOL_GPL(synchronize_sched); @@ -16312,7 +16834,7 @@ index 594d6ea99..12704e7d3 100644 /** * synchronize_rcu_bh - wait until an rcu_bh grace period has elapsed. * -@@ -3194,6 +3317,7 @@ void synchronize_rcu_bh(void) +@@ -3195,6 +3318,7 @@ void synchronize_rcu_bh(void) wait_rcu_gp(call_rcu_bh); } EXPORT_SYMBOL_GPL(synchronize_rcu_bh); @@ -16320,7 +16842,7 @@ index 594d6ea99..12704e7d3 100644 /** * get_state_synchronize_rcu - Snapshot current RCU state -@@ -3501,6 +3625,7 @@ static void _rcu_barrier(struct rcu_state *rsp) +@@ -3502,6 +3626,7 @@ static void _rcu_barrier(struct rcu_state *rsp) mutex_unlock(&rsp->barrier_mutex); } @@ -16328,7 +16850,7 @@ index 594d6ea99..12704e7d3 100644 /** * rcu_barrier_bh - Wait until all in-flight call_rcu_bh() callbacks complete. */ -@@ -3509,6 +3634,7 @@ void rcu_barrier_bh(void) +@@ -3510,6 +3635,7 @@ void rcu_barrier_bh(void) _rcu_barrier(&rcu_bh_state); } EXPORT_SYMBOL_GPL(rcu_barrier_bh); @@ -16336,7 +16858,7 @@ index 594d6ea99..12704e7d3 100644 /** * rcu_barrier_sched - Wait for in-flight call_rcu_sched() callbacks. -@@ -3658,8 +3784,6 @@ int rcutree_online_cpu(unsigned int cpu) +@@ -3659,8 +3785,6 @@ int rcutree_online_cpu(unsigned int cpu) rnp->ffmask |= rdp->grpmask; raw_spin_unlock_irqrestore_rcu_node(rnp, flags); } @@ -16345,7 +16867,7 @@ index 594d6ea99..12704e7d3 100644 if (rcu_scheduler_active == RCU_SCHEDULER_INACTIVE) return 0; /* Too early in boot for scheduler work. */ sync_sched_exp_online_cleanup(cpu); -@@ -3687,8 +3811,6 @@ int rcutree_offline_cpu(unsigned int cpu) +@@ -3688,8 +3812,6 @@ int rcutree_offline_cpu(unsigned int cpu) } rcutree_affinity_setting(cpu, cpu); @@ -16354,7 +16876,7 @@ index 594d6ea99..12704e7d3 100644 return 0; } -@@ -4157,12 +4279,13 @@ void __init rcu_init(void) +@@ -4158,12 +4280,13 @@ void __init rcu_init(void) rcu_bootup_announce(); rcu_init_geometry(); @@ -16407,10 +16929,10 @@ index 4e74df768..98257d20f 100644 static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, struct rcu_node *rnp); diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h -index 72770a551..ac6d6fdf5 100644 +index 7f8cb91aa..59745ada4 100644 --- a/kernel/rcu/tree_exp.h +++ b/kernel/rcu/tree_exp.h -@@ -472,7 +472,6 @@ static void sync_rcu_exp_select_node_cpus(struct work_struct *wp) +@@ -470,7 +470,6 @@ static void sync_rcu_exp_select_node_cpus(struct work_struct *wp) static void sync_rcu_exp_select_cpus(struct rcu_state *rsp, smp_call_func_t func) { @@ -16418,7 +16940,7 @@ index 72770a551..ac6d6fdf5 100644 struct rcu_node *rnp; trace_rcu_exp_grace_period(rsp->name, rcu_exp_gp_seq_endval(rsp), TPS("reset")); -@@ -494,13 +493,7 @@ static void sync_rcu_exp_select_cpus(struct rcu_state *rsp, +@@ -492,13 +491,7 @@ static void sync_rcu_exp_select_cpus(struct rcu_state *rsp, continue; } INIT_WORK(&rnp->rew.rew_work, sync_rcu_exp_select_node_cpus); @@ -16434,7 +16956,7 @@ index 72770a551..ac6d6fdf5 100644 } diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h -index 5f6de49dc..56639c8ed 100644 +index 568818bef..a9fdfa392 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -24,41 +24,16 @@ @@ -16733,7 +17255,7 @@ index 759ea6881..b5ba34afd 100644 #endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile -index 7fe183404..2b765aa4e 100644 +index 0612af002..9150fc850 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile @@ -18,7 +18,7 @@ endif @@ -16844,7 +17366,7 @@ index a1ad5b7d5..49c141379 100644 } EXPORT_SYMBOL(completion_done); diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 496ce71f9..c6dd1cf96 100644 +index 7825ceaae..3ae20bb64 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -45,7 +45,11 @@ const_debug unsigned int sysctl_sched_features = @@ -16974,7 +17496,7 @@ index 496ce71f9..c6dd1cf96 100644 void resched_cpu(int cpu) { struct rq *rq = cpu_rq(cpu); -@@ -904,10 +965,10 @@ static inline bool is_per_cpu_kthread(struct task_struct *p) +@@ -907,10 +968,10 @@ static inline bool is_per_cpu_kthread(struct task_struct *p) */ static inline bool is_cpu_allowed(struct task_struct *p, int cpu) { @@ -16987,7 +17509,7 @@ index 496ce71f9..c6dd1cf96 100644 return cpu_online(cpu); return cpu_active(cpu); -@@ -956,6 +1017,7 @@ static struct rq *move_queued_task(struct rq *rq, struct rq_flags *rf, +@@ -959,6 +1020,7 @@ static struct rq *move_queued_task(struct rq *rq, struct rq_flags *rf, struct migration_arg { struct task_struct *task; int dest_cpu; @@ -16995,7 +17517,7 @@ index 496ce71f9..c6dd1cf96 100644 }; /* -@@ -991,6 +1053,11 @@ static int migration_cpu_stop(void *data) +@@ -994,6 +1056,11 @@ static int migration_cpu_stop(void *data) struct task_struct *p = arg->task; struct rq *rq = this_rq(); struct rq_flags rf; @@ -17007,7 +17529,7 @@ index 496ce71f9..c6dd1cf96 100644 /* * The original target CPU might have gone down and we might -@@ -999,7 +1066,7 @@ static int migration_cpu_stop(void *data) +@@ -1002,7 +1069,7 @@ static int migration_cpu_stop(void *data) local_irq_disable(); /* * We need to explicitly wake pending tasks before running @@ -17016,7 +17538,7 @@ index 496ce71f9..c6dd1cf96 100644 * during wakeups, see set_cpus_allowed_ptr()'s TASK_WAKING test. */ sched_ttwu_pending(); -@@ -1013,9 +1080,9 @@ static int migration_cpu_stop(void *data) +@@ -1016,9 +1083,9 @@ static int migration_cpu_stop(void *data) */ if (task_rq(p) == rq) { if (task_on_rq_queued(p)) @@ -17028,7 +17550,7 @@ index 496ce71f9..c6dd1cf96 100644 } rq_unlock(rq, &rf); raw_spin_unlock(&p->pi_lock); -@@ -1030,9 +1097,18 @@ static int migration_cpu_stop(void *data) +@@ -1033,9 +1100,18 @@ static int migration_cpu_stop(void *data) */ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_mask) { @@ -17049,7 +17571,7 @@ index 496ce71f9..c6dd1cf96 100644 void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) { -@@ -1100,7 +1176,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, +@@ -1103,7 +1179,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, goto out; } @@ -17058,7 +17580,7 @@ index 496ce71f9..c6dd1cf96 100644 goto out; dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask); -@@ -1122,7 +1198,8 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, +@@ -1125,7 +1201,8 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, } /* Can the task run on the task's current CPU? If so, we're done */ @@ -17068,7 +17590,7 @@ index 496ce71f9..c6dd1cf96 100644 goto out; if (task_running(rq, p) || p->state == TASK_WAKING) { -@@ -1263,10 +1340,10 @@ static int migrate_swap_stop(void *data) +@@ -1266,10 +1343,10 @@ static int migrate_swap_stop(void *data) if (task_cpu(arg->src_task) != arg->src_cpu) goto unlock; @@ -17081,7 +17603,7 @@ index 496ce71f9..c6dd1cf96 100644 goto unlock; __migrate_swap_task(arg->src_task, arg->dst_cpu); -@@ -1308,10 +1385,10 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p, +@@ -1311,10 +1388,10 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p, if (!cpu_active(arg.src_cpu) || !cpu_active(arg.dst_cpu)) goto out; @@ -17094,7 +17616,7 @@ index 496ce71f9..c6dd1cf96 100644 goto out; trace_sched_swap_numa(cur, arg.src_cpu, p, arg.dst_cpu); -@@ -1322,6 +1399,18 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p, +@@ -1325,6 +1402,18 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p, } #endif /* CONFIG_NUMA_BALANCING */ @@ -17113,7 +17635,7 @@ index 496ce71f9..c6dd1cf96 100644 /* * wait_task_inactive - wait for a thread to unschedule. * -@@ -1366,7 +1455,7 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state) +@@ -1369,7 +1458,7 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state) * is actually now running somewhere else! */ while (task_running(rq, p)) { @@ -17122,7 +17644,7 @@ index 496ce71f9..c6dd1cf96 100644 return 0; cpu_relax(); } -@@ -1381,7 +1470,8 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state) +@@ -1384,7 +1473,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; @@ -17132,7 +17654,7 @@ index 496ce71f9..c6dd1cf96 100644 ncsw = p->nvcsw | LONG_MIN; /* sets MSB */ task_rq_unlock(rq, p, &rf); -@@ -1456,7 +1546,7 @@ void kick_process(struct task_struct *p) +@@ -1459,7 +1549,7 @@ void kick_process(struct task_struct *p) EXPORT_SYMBOL_GPL(kick_process); /* @@ -17141,7 +17663,7 @@ index 496ce71f9..c6dd1cf96 100644 * * A few notes on cpu_active vs cpu_online: * -@@ -1496,14 +1586,14 @@ static int select_fallback_rq(int cpu, struct task_struct *p) +@@ -1499,14 +1589,14 @@ static int select_fallback_rq(int cpu, struct task_struct *p) for_each_cpu(dest_cpu, nodemask) { if (!cpu_active(dest_cpu)) continue; @@ -17158,7 +17680,7 @@ index 496ce71f9..c6dd1cf96 100644 if (!is_cpu_allowed(p, dest_cpu)) continue; -@@ -1547,7 +1637,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p) +@@ -1550,7 +1640,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p) } /* @@ -17167,7 +17689,7 @@ index 496ce71f9..c6dd1cf96 100644 */ static inline int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) -@@ -1557,11 +1647,11 @@ int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) +@@ -1560,11 +1650,11 @@ int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) if (p->nr_cpus_allowed > 1) cpu = p->sched_class->select_task_rq(p, cpu, sd_flags, wake_flags); else @@ -17181,7 +17703,7 @@ index 496ce71f9..c6dd1cf96 100644 * CPU. * * Since this is common to all placement strategies, this lives here. -@@ -1985,8 +2075,27 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) +@@ -1988,8 +2078,27 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) */ raw_spin_lock_irqsave(&p->pi_lock, flags); smp_mb__after_spinlock(); @@ -17210,7 +17732,7 @@ index 496ce71f9..c6dd1cf96 100644 trace_sched_waking(p); -@@ -2100,6 +2209,18 @@ int wake_up_process(struct task_struct *p) +@@ -2103,6 +2212,18 @@ int wake_up_process(struct task_struct *p) } EXPORT_SYMBOL(wake_up_process); @@ -17229,7 +17751,7 @@ index 496ce71f9..c6dd1cf96 100644 int wake_up_state(struct task_struct *p, unsigned int state) { return try_to_wake_up(p, state, 0); -@@ -2349,6 +2470,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) +@@ -2372,6 +2493,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) p->on_cpu = 0; #endif init_task_preempt_count(p); @@ -17239,7 +17761,7 @@ index 496ce71f9..c6dd1cf96 100644 #ifdef CONFIG_SMP plist_node_init(&p->pushable_tasks, MAX_PRIO); RB_CLEAR_NODE(&p->pushable_dl_tasks); -@@ -2413,7 +2537,7 @@ void wake_up_new_task(struct task_struct *p) +@@ -2412,7 +2536,7 @@ void wake_up_new_task(struct task_struct *p) #ifdef CONFIG_SMP /* * Fork balancing, do it here and not earlier because: @@ -17248,7 +17770,7 @@ index 496ce71f9..c6dd1cf96 100644 * - any previously selected CPU might disappear through hotplug * * Use __set_task_cpu() to avoid calling sched_class::migrate_task_rq, -@@ -2702,23 +2826,18 @@ static struct rq *finish_task_switch(struct task_struct *prev) +@@ -2701,23 +2825,18 @@ static struct rq *finish_task_switch(struct task_struct *prev) * provided by mmdrop(), * - a sync_core for SYNC_CORE. */ @@ -17277,7 +17799,7 @@ index 496ce71f9..c6dd1cf96 100644 put_task_struct_rcu_user(prev); } -@@ -3406,6 +3525,8 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) +@@ -3405,6 +3524,8 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) BUG(); } @@ -17286,7 +17808,7 @@ index 496ce71f9..c6dd1cf96 100644 /* * __schedule() is the main scheduler function. * -@@ -3476,6 +3597,9 @@ static void __sched notrace __schedule(bool preempt) +@@ -3475,6 +3596,9 @@ static void __sched notrace __schedule(bool preempt) rq_lock(rq, &rf); smp_mb__after_spinlock(); @@ -17296,7 +17818,7 @@ index 496ce71f9..c6dd1cf96 100644 /* Promote REQ to ACT */ rq->clock_update_flags <<= 1; update_rq_clock(rq); -@@ -3498,6 +3622,7 @@ static void __sched notrace __schedule(bool preempt) +@@ -3497,6 +3621,7 @@ static void __sched notrace __schedule(bool preempt) next = pick_next_task(rq, prev, &rf); clear_tsk_need_resched(prev); @@ -17304,7 +17826,7 @@ index 496ce71f9..c6dd1cf96 100644 clear_preempt_need_resched(); if (likely(prev != next)) { -@@ -3553,7 +3678,7 @@ void __noreturn do_task_dead(void) +@@ -3552,7 +3677,7 @@ void __noreturn do_task_dead(void) static inline void sched_submit_work(struct task_struct *tsk) { @@ -17313,7 +17835,7 @@ index 496ce71f9..c6dd1cf96 100644 return; /* -@@ -3572,6 +3697,9 @@ static inline void sched_submit_work(struct task_struct *tsk) +@@ -3571,6 +3696,9 @@ static inline void sched_submit_work(struct task_struct *tsk) preempt_enable_no_resched(); } @@ -17323,7 +17845,7 @@ index 496ce71f9..c6dd1cf96 100644 /* * If we are going to sleep and we have plugged IO queued, * make sure to submit it to avoid deadlocks. -@@ -3689,6 +3817,30 @@ static void __sched notrace preempt_schedule_common(void) +@@ -3688,6 +3816,30 @@ static void __sched notrace preempt_schedule_common(void) } while (need_resched()); } @@ -17354,7 +17876,7 @@ index 496ce71f9..c6dd1cf96 100644 #ifdef CONFIG_PREEMPT /* * this is the entry point to schedule() from in-kernel preemption -@@ -3703,7 +3855,8 @@ asmlinkage __visible void __sched notrace preempt_schedule(void) +@@ -3702,7 +3854,8 @@ asmlinkage __visible void __sched notrace preempt_schedule(void) */ if (likely(!preemptible())) return; @@ -17364,7 +17886,7 @@ index 496ce71f9..c6dd1cf96 100644 preempt_schedule_common(); } NOKPROBE_SYMBOL(preempt_schedule); -@@ -3730,6 +3883,9 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) +@@ -3729,6 +3882,9 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) if (likely(!preemptible())) return; @@ -17374,7 +17896,7 @@ index 496ce71f9..c6dd1cf96 100644 do { /* * Because the function tracer can trace preempt_count_sub() -@@ -4371,7 +4527,7 @@ static int __sched_setscheduler(struct task_struct *p, +@@ -4370,7 +4526,7 @@ static int __sched_setscheduler(struct task_struct *p, * the entire root_domain to become SCHED_DEADLINE. We * will also fail if there's no bandwidth available. */ @@ -17383,7 +17905,7 @@ index 496ce71f9..c6dd1cf96 100644 rq->rd->dl_bw.bw == 0) { task_rq_unlock(rq, p, &rf); return -EPERM; -@@ -4970,7 +5126,7 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask) +@@ -4969,7 +5125,7 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask) goto out_unlock; raw_spin_lock_irqsave(&p->pi_lock, flags); @@ -17392,7 +17914,7 @@ index 496ce71f9..c6dd1cf96 100644 raw_spin_unlock_irqrestore(&p->pi_lock, flags); out_unlock: -@@ -5509,7 +5665,9 @@ void init_idle(struct task_struct *idle, int cpu) +@@ -5508,7 +5664,9 @@ void init_idle(struct task_struct *idle, int cpu) /* Set the preempt count _outside_ the spinlocks! */ init_idle_preempt_count(idle, cpu); @@ -17403,7 +17925,7 @@ index 496ce71f9..c6dd1cf96 100644 /* * The idle tasks have their own, simple scheduling class: */ -@@ -5548,7 +5706,7 @@ int task_can_attach(struct task_struct *p, +@@ -5547,7 +5705,7 @@ int task_can_attach(struct task_struct *p, * allowed nodes is unnecessary. Thus, cpusets are not * applicable for such threads. This prevents checking for * success of set_cpus_allowed_ptr() on all attached tasks @@ -17412,7 +17934,7 @@ index 496ce71f9..c6dd1cf96 100644 */ if (p->flags & PF_NO_SETAFFINITY) { ret = -EINVAL; -@@ -5575,7 +5733,7 @@ int migrate_task_to(struct task_struct *p, int target_cpu) +@@ -5574,7 +5732,7 @@ int migrate_task_to(struct task_struct *p, int target_cpu) if (curr_cpu == target_cpu) return 0; @@ -17421,7 +17943,7 @@ index 496ce71f9..c6dd1cf96 100644 return -EINVAL; /* TODO: This is not properly updating schedstats */ -@@ -5614,6 +5772,7 @@ void sched_setnuma(struct task_struct *p, int nid) +@@ -5613,6 +5771,7 @@ void sched_setnuma(struct task_struct *p, int nid) #endif /* CONFIG_NUMA_BALANCING */ #ifdef CONFIG_HOTPLUG_CPU @@ -17429,7 +17951,7 @@ index 496ce71f9..c6dd1cf96 100644 /* * Ensure that the idle task is using init_mm right before its CPU goes * offline. -@@ -5713,8 +5872,10 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf) +@@ -5712,8 +5871,10 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf) BUG_ON(!next); put_prev_task(rq, next); @@ -17441,7 +17963,7 @@ index 496ce71f9..c6dd1cf96 100644 * both pi_lock and rq->lock, such that holding either * stabilizes the mask. * -@@ -6193,7 +6354,7 @@ void __init sched_init(void) +@@ -6200,7 +6361,7 @@ void __init sched_init(void) #ifdef CONFIG_DEBUG_ATOMIC_SLEEP static inline int preempt_count_equals(int preempt_offset) { @@ -17450,7 +17972,16 @@ index 496ce71f9..c6dd1cf96 100644 return (nested == preempt_offset); } -@@ -7310,3 +7471,171 @@ const u32 sched_prio_to_wmult[40] = { +@@ -7433,7 +7594,7 @@ static int __set_prefer_cpus_ptr(struct task_struct *p, + if (cpumask_equal(p->prefer_cpus, new_mask)) + goto out; + +- if (!cpumask_subset(new_mask, &p->cpus_allowed)) { ++ if (!cpumask_subset(new_mask,p->cpus_ptr)) { + ret = -EINVAL; + goto out; + } +@@ -7569,3 +7730,171 @@ const u32 sched_prio_to_wmult[40] = { }; #undef CREATE_TRACE_POINTS @@ -17720,10 +18251,10 @@ index 6c4f93af1..a074b84ed 100644 later_rq = NULL; break; diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c -index fcf2a07ec..f5c76fabb 100644 +index bcdfdaae3..589f451f8 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c -@@ -1027,6 +1027,10 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, +@@ -1034,6 +1034,10 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, P(dl.runtime); P(dl.deadline); } @@ -17735,10 +18266,10 @@ index fcf2a07ec..f5c76fabb 100644 #undef PN #undef __PN diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index 52029f3a7..2fd091c24 100644 +index 1c78e2f29..0d5f153e3 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -1705,7 +1705,7 @@ static void task_numa_compare(struct task_numa_env *env, +@@ -1714,7 +1714,7 @@ static void task_numa_compare(struct task_numa_env *env, * be incurred if the tasks were swapped. */ /* Skip this swap candidate if cannot move to the source cpu */ @@ -17747,7 +18278,16 @@ index 52029f3a7..2fd091c24 100644 goto unlock; /* -@@ -1803,7 +1803,7 @@ static void task_numa_find_cpu(struct task_numa_env *env, +@@ -1784,7 +1784,7 @@ static void task_numa_compare(struct task_numa_env *env, + */ + local_irq_disable(); + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY +- env->p->select_cpus = &env->p->cpus_allowed; ++ env->p->select_cpus = env->p->cpus_ptr; + #endif + env->dst_cpu = select_idle_sibling(env->p, env->src_cpu, + env->dst_cpu); +@@ -1815,7 +1815,7 @@ static void task_numa_find_cpu(struct task_numa_env *env, for_each_cpu(cpu, cpumask_of_node(env->dst_nid)) { /* Skip this CPU if the source task cannot migrate */ @@ -17756,7 +18296,7 @@ index 52029f3a7..2fd091c24 100644 continue; env->dst_cpu = cpu; -@@ -4188,7 +4188,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) +@@ -4254,7 +4254,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) ideal_runtime = sched_slice(cfs_rq, curr); delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; if (delta_exec > ideal_runtime) { @@ -17765,7 +18305,7 @@ index 52029f3a7..2fd091c24 100644 /* * The current task ran long enough, ensure it doesn't get * re-elected due to buddy favours. -@@ -4212,7 +4212,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) +@@ -4278,7 +4278,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) return; if (delta > ideal_runtime) @@ -17774,7 +18314,7 @@ index 52029f3a7..2fd091c24 100644 } static void -@@ -4354,7 +4354,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) +@@ -4420,7 +4420,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) * validating it and just reschedule. */ if (queued) { @@ -17783,7 +18323,7 @@ index 52029f3a7..2fd091c24 100644 return; } /* -@@ -4488,7 +4488,7 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) +@@ -4554,7 +4554,7 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) * hierarchy can be throttled */ if (!assign_cfs_rq_runtime(cfs_rq) && likely(cfs_rq->curr)) @@ -17792,7 +18332,16 @@ index 52029f3a7..2fd091c24 100644 } static __always_inline -@@ -5213,7 +5213,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) +@@ -5330,7 +5330,7 @@ static inline struct cpumask *task_prefer_cpus(struct task_struct *p) + return p->prefer_cpus; + + if (task_group(p)->auto_affinity->mode == 0) +- return &p->cpus_allowed; ++ return p->cpus_ptr; + + ad = &task_group(p)->auto_affinity->ad; + return ad->domains[ad->curr_level]; +@@ -5764,7 +5764,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) if (delta < 0) { if (rq->curr == p) @@ -17801,79 +18350,99 @@ index 52029f3a7..2fd091c24 100644 return; } hrtick_start(rq, delta); -@@ -5927,7 +5927,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, - - /* Skip over this group if it has no CPUs allowed */ +@@ -6489,7 +6489,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, + p->select_cpus)) + #else if (!cpumask_intersects(sched_group_span(group), - &p->cpus_allowed)) + p->cpus_ptr)) + #endif continue; - local_group = cpumask_test_cpu(this_cpu, -@@ -6059,7 +6059,7 @@ find_idlest_group_cpu(struct sched_group *group, struct task_struct *p, int this - return cpumask_first(sched_group_span(group)); - - /* Traverse only the allowed CPUs */ +@@ -6625,7 +6625,7 @@ find_idlest_group_cpu(struct sched_group *group, struct task_struct *p, int this + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + for_each_cpu_and(i, sched_group_span(group), p->select_cpus) { + #else - for_each_cpu_and(i, sched_group_span(group), &p->cpus_allowed) { + for_each_cpu_and(i, sched_group_span(group), p->cpus_ptr) { + #endif if (sched_idle_cpu(i)) return i; - -@@ -6102,7 +6102,7 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p - { - int new_cpu = cpu; - +@@ -6672,7 +6672,7 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + if (!cpumask_intersects(sched_domain_span(sd), p->select_cpus)) + #else - if (!cpumask_intersects(sched_domain_span(sd), &p->cpus_allowed)) -+ if (!cpumask_intersects(sched_domain_span(sd), p->cpus_ptr)) ++ if (!cpumask_intersects(sched_domain_span(sd),p->cpus_ptr)) + #endif return prev_cpu; - /* -@@ -6219,7 +6219,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int - if (!test_idle_cores(target, false)) - return -1; - +@@ -6793,7 +6793,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + cpumask_and(cpus, sched_domain_span(sd), p->select_cpus); + #else - cpumask_and(cpus, sched_domain_span(sd), &p->cpus_allowed); + cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); + #endif for_each_cpu_wrap(core, cpus, target) { - bool idle = true; -@@ -6253,7 +6253,7 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int t - return -1; - - for_each_cpu(cpu, cpu_smt_mask(target)) { -- if (!cpumask_test_cpu(cpu, &p->cpus_allowed)) -+ if (!cpumask_test_cpu(cpu, p->cpus_ptr)) +@@ -6832,7 +6832,7 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int t + if (!cpumask_test_cpu(cpu, p->select_cpus) || + !cpumask_test_cpu(cpu, sched_domain_span(sd))) + #else +- if (!cpumask_test_cpu(cpu, &p->cpus_allowed) || ++ if (!cpumask_test_cpu(cpu, p->cpus_ptr) || + !cpumask_test_cpu(cpu, sched_domain_span(sd))) + #endif continue; - if (available_idle_cpu(cpu) || sched_idle_cpu(cpu)) - return cpu; -@@ -6314,7 +6314,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t - - time = local_clock(); - +@@ -6898,7 +6898,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + cpumask_and(cpus, sched_domain_span(sd), p->select_cpus); + #else - cpumask_and(cpus, sched_domain_span(sd), &p->cpus_allowed); + cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); + #endif for_each_cpu_wrap(cpu, cpus, target) { - if (!--nr) -@@ -6373,7 +6373,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) - recent_used_cpu != target && - cpus_share_cache(recent_used_cpu, target) && - (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) && +@@ -6972,7 +6972,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + cpumask_test_cpu(p->recent_used_cpu, p->select_cpus)) { + #else - cpumask_test_cpu(p->recent_used_cpu, &p->cpus_allowed)) { + cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr)) { + #endif /* * Replace recent_used_cpu with prev as it is a potential - * candidate for the next wake: -@@ -6604,7 +6604,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f - if (sd_flag & SD_BALANCE_WAKE) { - record_wakee(p); - want_affine = !wake_wide(p) && !wake_cap(p, cpu, prev_cpu) +@@ -7214,8 +7214,8 @@ static inline bool prefer_cpus_valid(struct task_struct *p) + struct cpumask *prefer_cpus = task_prefer_cpus(p); + + return !cpumask_empty(prefer_cpus) && +- !cpumask_equal(prefer_cpus, &p->cpus_allowed) && +- cpumask_subset(prefer_cpus, &p->cpus_allowed); ++ !cpumask_equal(prefer_cpus, p->cpus_ptr) && ++ cpumask_subset(prefer_cpus, p->cpus_ptr); + } + + /* +@@ -7321,7 +7321,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f + time = schedstat_start_time(); + + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY +- p->select_cpus = &p->cpus_allowed; ++ p->select_cpus =p->cpus_ptr; + if (dynamic_affinity_used() || smart_grid_used()) + set_task_select_cpus(p, &idlest_cpu, sd_flag); + #endif +@@ -7332,7 +7332,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + && cpumask_test_cpu(cpu, p->select_cpus); + #else - && cpumask_test_cpu(cpu, &p->cpus_allowed); + && cpumask_test_cpu(cpu, p->cpus_ptr); + #endif } - rcu_read_lock(); -@@ -6866,7 +6866,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ +@@ -7605,7 +7605,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ return; preempt: @@ -17882,7 +18451,7 @@ index 52029f3a7..2fd091c24 100644 /* * Only set the backward buddy when the current task is still * on the rq. This can happen when a wakeup gets interleaved -@@ -7569,14 +7569,14 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) +@@ -8345,7 +8345,7 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) /* * We do not migrate tasks that are: * 1) throttled_lb_pair, or @@ -17891,24 +18460,32 @@ index 52029f3a7..2fd091c24 100644 * 3) running (obviously), or * 4) are cache-hot on their current CPU. */ - if (throttled_lb_pair(task_group(p), env->src_cpu, env->dst_cpu)) +@@ -8353,13 +8353,13 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) return 0; + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY +- p->select_cpus = &p->cpus_allowed; ++ p->select_cpus = p->cpus_ptr; + if (dynamic_affinity_used() || smart_grid_used()) + set_task_select_cpus(p, NULL, 0); + + if (!cpumask_test_cpu(env->dst_cpu, p->select_cpus)) { + #else - if (!cpumask_test_cpu(env->dst_cpu, &p->cpus_allowed)) { -+ if (!cpumask_test_cpu(env->dst_cpu, p->cpus_ptr)) { ++ if (!cpumask_test_cpu(env->dst_cpu, p->cpus_ptr)) { + #endif int cpu; - schedstat_inc(p->se.statistics.nr_failed_migrations_affine); -@@ -7596,7 +7596,7 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) - - /* Prevent to re-select dst_cpu via env's CPUs: */ - for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) { +@@ -8383,7 +8383,7 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + if (cpumask_test_cpu(cpu, p->select_cpus)) { + #else - if (cpumask_test_cpu(cpu, &p->cpus_allowed)) { + if (cpumask_test_cpu(cpu, p->cpus_ptr)) { + #endif env->flags |= LBF_DST_PINNED; env->new_dst_cpu = cpu; - break; -@@ -7653,7 +7653,7 @@ can_migrate_task_llc(struct task_struct *p, struct rq *rq, struct rq *dst_rq) +@@ -8441,7 +8441,7 @@ can_migrate_task_llc(struct task_struct *p, struct rq *rq, struct rq *dst_rq) if (throttled_lb_pair(task_group(p), cpu_of(rq), dst_cpu)) return false; @@ -17917,7 +18494,7 @@ index 52029f3a7..2fd091c24 100644 schedstat_inc(p->se.statistics.nr_failed_migrations_affine); return false; } -@@ -8251,7 +8251,7 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) +@@ -9039,7 +9039,7 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) /* * Group imbalance indicates (and tries to solve) the problem where balancing @@ -17926,7 +18503,7 @@ index 52029f3a7..2fd091c24 100644 * * Imagine a situation of two groups of 4 CPUs each and 4 tasks each with a * cpumask covering 1 CPU of the first group and 3 CPUs of the second group. -@@ -8866,7 +8866,7 @@ static struct sched_group *find_busiest_group(struct lb_env *env) +@@ -9654,7 +9654,7 @@ static struct sched_group *find_busiest_group(struct lb_env *env) /* * If the busiest group is imbalanced the below checks don't * work because they assume all things are equal, which typically @@ -17935,7 +18512,7 @@ index 52029f3a7..2fd091c24 100644 */ if (busiest->group_type == group_imbalanced) goto force_balance; -@@ -9262,7 +9262,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, +@@ -10050,7 +10050,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, * if the curr task on busiest CPU can't be * moved to this_cpu: */ @@ -17944,7 +18521,7 @@ index 52029f3a7..2fd091c24 100644 raw_spin_unlock_irqrestore(&busiest->lock, flags); env.flags |= LBF_ALL_PINNED; -@@ -10397,7 +10397,7 @@ static void task_fork_fair(struct task_struct *p) +@@ -11185,7 +11185,7 @@ static void task_fork_fair(struct task_struct *p) * 'current' within the tree based on its new key value. */ swap(curr->vruntime, se->vruntime); @@ -17953,7 +18530,7 @@ index 52029f3a7..2fd091c24 100644 } se->vruntime -= cfs_rq->min_vruntime; -@@ -10421,7 +10421,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) +@@ -11209,7 +11209,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) */ if (rq->curr == p) { if (p->prio > oldprio) @@ -17987,7 +18564,7 @@ index 515bfbcc6..550e236f4 100644 /* * When doing wakeups, attempt to limit superfluous scans of the LLC domain. diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c -index 301ba04d9..cefd42d6d 100644 +index 5dff9a6fe..9caa6e1c5 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -45,8 +45,8 @@ void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime) @@ -18001,7 +18578,7 @@ index 301ba04d9..cefd42d6d 100644 rt_b->rt_period_timer.function = sched_rt_period_timer; } -@@ -1619,7 +1619,7 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p) +@@ -1622,7 +1622,7 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p) static int pick_rt_task(struct rq *rq, struct task_struct *p, int cpu) { if (!task_running(rq, p) && @@ -18010,7 +18587,7 @@ index 301ba04d9..cefd42d6d 100644 return 1; return 0; -@@ -1779,7 +1779,7 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq) +@@ -1782,7 +1782,7 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq) struct task_struct *next_task = pick_next_pushable_task(rq); if (unlikely(next_task != task || !rt_task(task) || @@ -18020,10 +18597,10 @@ index 301ba04d9..cefd42d6d 100644 double_unlock_balance(rq, lowest_rq); lowest_rq = NULL; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h -index 1aaff1aa8..17195d82e 100644 +index 1d882a2b8..2c94e9a24 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h -@@ -966,6 +966,9 @@ struct rq { +@@ -1019,6 +1019,9 @@ struct rq { struct cpuidle_state *idle_state; #endif @@ -18033,7 +18610,7 @@ index 1aaff1aa8..17195d82e 100644 KABI_RESERVE(1) KABI_RESERVE(2) }; -@@ -1518,6 +1521,7 @@ static inline int task_on_rq_migrating(struct task_struct *p) +@@ -1571,6 +1574,7 @@ static inline int task_on_rq_migrating(struct task_struct *p) #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 */ @@ -18041,7 +18618,7 @@ index 1aaff1aa8..17195d82e 100644 /* * To aid in avoiding the subversion of "niceness" due to uneven distribution -@@ -1715,6 +1719,15 @@ extern void reweight_task(struct task_struct *p, int prio); +@@ -1768,6 +1772,15 @@ extern void reweight_task(struct task_struct *p, int prio); extern void resched_curr(struct rq *rq); extern void resched_cpu(int cpu); @@ -18296,7 +18873,7 @@ index ad5591520..1952bc9c0 100644 init_dl_bw(&rd->dl_bw); diff --git a/kernel/signal.c b/kernel/signal.c -index bc558abbf..b6a06b562 100644 +index 69b9d8bff..8f0407c3a 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -19,6 +19,7 @@ @@ -18427,7 +19004,7 @@ index bc558abbf..b6a06b562 100644 /* We only dequeue private signals from ourselves, we don't let * signalfd steal them */ -@@ -1288,8 +1348,8 @@ int do_send_sig_info(int sig, struct siginfo *info, struct task_struct *p, +@@ -1289,8 +1349,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. */ @@ -18438,7 +19015,7 @@ index bc558abbf..b6a06b562 100644 { unsigned long int flags; int ret, blocked, ignored; -@@ -1318,6 +1378,39 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) +@@ -1319,6 +1379,39 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) return ret; } @@ -18478,7 +19055,7 @@ index bc558abbf..b6a06b562 100644 /* * Nuke all other threads in the group. */ -@@ -1734,7 +1827,8 @@ EXPORT_SYMBOL(kill_pid); +@@ -1735,7 +1828,8 @@ EXPORT_SYMBOL(kill_pid); */ struct sigqueue *sigqueue_alloc(void) { @@ -18488,7 +19065,7 @@ index bc558abbf..b6a06b562 100644 if (q) q->flags |= SIGQUEUE_PREALLOC; -@@ -2104,15 +2198,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info) +@@ -2105,15 +2199,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); @@ -18505,7 +19082,7 @@ index bc558abbf..b6a06b562 100644 } else { /* diff --git a/kernel/softirq.c b/kernel/softirq.c -index 6f584861d..9bad7a16d 100644 +index 99a047f70..9ee6a8ab7 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -21,11 +21,14 @@ @@ -19106,7 +19683,7 @@ index 6f584861d..9bad7a16d 100644 /* * Enter an interrupt context. */ -@@ -349,9 +821,9 @@ void irq_enter(void) +@@ -350,9 +822,9 @@ void irq_enter(void) * Prevent raise_softirq from needlessly waking up ksoftirqd * here, as softirq will be serviced on return from interrupt. */ @@ -19118,7 +19695,7 @@ index 6f584861d..9bad7a16d 100644 } __irq_enter(); -@@ -359,6 +831,7 @@ void irq_enter(void) +@@ -360,6 +832,7 @@ void irq_enter(void) static inline void invoke_softirq(void) { @@ -19126,7 +19703,7 @@ index 6f584861d..9bad7a16d 100644 if (ksoftirqd_running(local_softirq_pending())) return; -@@ -381,6 +854,18 @@ static inline void invoke_softirq(void) +@@ -382,6 +855,18 @@ static inline void invoke_softirq(void) } else { wakeup_softirqd(); } @@ -19145,7 +19722,7 @@ index 6f584861d..9bad7a16d 100644 } static inline void tick_irq_exit(void) -@@ -416,26 +901,6 @@ void irq_exit(void) +@@ -417,26 +902,6 @@ void irq_exit(void) trace_hardirq_exit(); /* must be last! */ } @@ -19172,7 +19749,7 @@ index 6f584861d..9bad7a16d 100644 void raise_softirq(unsigned int nr) { unsigned long flags; -@@ -445,12 +910,6 @@ void raise_softirq(unsigned int nr) +@@ -446,12 +911,6 @@ void raise_softirq(unsigned int nr) local_irq_restore(flags); } @@ -19185,7 +19762,7 @@ index 6f584861d..9bad7a16d 100644 void open_softirq(int nr, void (*action)(struct softirq_action *)) { softirq_vec[nr].action = action; -@@ -475,11 +934,44 @@ static void __tasklet_schedule_common(struct tasklet_struct *t, +@@ -476,11 +935,44 @@ static void __tasklet_schedule_common(struct tasklet_struct *t, unsigned long flags; local_irq_save(flags); @@ -19234,7 +19811,7 @@ index 6f584861d..9bad7a16d 100644 local_irq_restore(flags); } -@@ -497,11 +989,21 @@ void __tasklet_hi_schedule(struct tasklet_struct *t) +@@ -498,11 +990,21 @@ void __tasklet_hi_schedule(struct tasklet_struct *t) } EXPORT_SYMBOL(__tasklet_hi_schedule); @@ -19256,7 +19833,7 @@ index 6f584861d..9bad7a16d 100644 local_irq_disable(); list = tl_head->head; -@@ -513,25 +1015,60 @@ static void tasklet_action_common(struct softirq_action *a, +@@ -514,25 +1016,60 @@ static void tasklet_action_common(struct softirq_action *a, struct tasklet_struct *t = list; list = list->next; @@ -19332,7 +19909,7 @@ index 6f584861d..9bad7a16d 100644 } } -@@ -563,7 +1100,7 @@ void tasklet_kill(struct tasklet_struct *t) +@@ -564,7 +1101,7 @@ void tasklet_kill(struct tasklet_struct *t) while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { do { @@ -19341,7 +19918,7 @@ index 6f584861d..9bad7a16d 100644 } while (test_bit(TASKLET_STATE_SCHED, &t->state)); } tasklet_unlock_wait(t); -@@ -637,25 +1174,26 @@ void __init softirq_init(void) +@@ -638,25 +1175,26 @@ void __init softirq_init(void) open_softirq(HI_SOFTIRQ, tasklet_hi_action); } @@ -19383,7 +19960,7 @@ index 6f584861d..9bad7a16d 100644 } #ifdef CONFIG_HOTPLUG_CPU -@@ -722,17 +1260,31 @@ static int takeover_tasklets(unsigned int cpu) +@@ -723,17 +1261,31 @@ static int takeover_tasklets(unsigned int cpu) static struct smp_hotplug_thread softirq_threads = { .store = &ksoftirqd, @@ -19435,7 +20012,7 @@ index 7e103738f..a2b1319a1 100644 wake_up_q(&wakeq); diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c -index 6a2ba3988..e7b983df6 100644 +index 56af8a97c..85c7f4a6b 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -438,7 +438,7 @@ int alarm_cancel(struct alarm *alarm) @@ -19448,7 +20025,7 @@ index 6a2ba3988..e7b983df6 100644 } EXPORT_SYMBOL_GPL(alarm_cancel); diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index 32ee24f51..a84673149 100644 +index 8512f06f0..a522cebda 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -150,6 +150,11 @@ static struct hrtimer_cpu_base migration_cpu_base = { @@ -19646,7 +20223,7 @@ index 32ee24f51..a84673149 100644 hrtimer_set_expires_range_ns(&t.timer, timespec64_to_ktime(*rqtp), slack); ret = do_nanosleep(&t, mode); if (ret != -ERESTART_RESTARTBLOCK) -@@ -1864,6 +1931,38 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, +@@ -1866,6 +1933,38 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, } #endif @@ -19685,7 +20262,7 @@ index 32ee24f51..a84673149 100644 /* * Functions related to boot-time initialization: */ -@@ -1885,6 +1984,7 @@ int hrtimers_prepare_cpu(unsigned int cpu) +@@ -1887,6 +1986,7 @@ int hrtimers_prepare_cpu(unsigned int cpu) cpu_base->softirq_next_timer = NULL; cpu_base->expires_next = KTIME_MAX; cpu_base->softirq_expires_next = KTIME_MAX; @@ -19693,7 +20270,7 @@ index 32ee24f51..a84673149 100644 return 0; } -@@ -2003,11 +2103,9 @@ schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, +@@ -2005,11 +2105,9 @@ schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, return -EINTR; } @@ -19745,7 +20322,7 @@ index 497719127..62acb8914 100644 } EXPORT_SYMBOL(get_jiffies_64); diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c -index bfaa44a80..b9e4ccbb6 100644 +index 5ea7ccfb6..8af8cedaa 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -3,8 +3,10 @@ @@ -19767,7 +20344,7 @@ index bfaa44a80..b9e4ccbb6 100644 #include "posix-timers.h" -@@ -789,6 +792,7 @@ check_timers_list(struct list_head *timers, +@@ -785,6 +788,7 @@ check_timers_list(struct list_head *timers, return t->expires; t->firing = 1; @@ -19775,7 +20352,7 @@ index bfaa44a80..b9e4ccbb6 100644 list_move_tail(&t->entry, firing); } -@@ -1135,18 +1139,31 @@ static inline int fastpath_timer_check(struct task_struct *tsk) +@@ -1131,18 +1135,31 @@ static inline int fastpath_timer_check(struct task_struct *tsk) return 0; } @@ -19810,7 +20387,7 @@ index bfaa44a80..b9e4ccbb6 100644 /* * The fast path checks that there are no expired thread or thread -@@ -1155,8 +1172,13 @@ void run_posix_cpu_timers(struct task_struct *tsk) +@@ -1151,8 +1168,13 @@ void run_posix_cpu_timers(struct task_struct *tsk) if (!fastpath_timer_check(tsk)) return; @@ -19825,7 +20402,7 @@ index bfaa44a80..b9e4ccbb6 100644 /* * Here we take off tsk->signal->cpu_timers[N] and * tsk->cpu_timers[N] all the timers that are firing, and -@@ -1189,6 +1211,7 @@ void run_posix_cpu_timers(struct task_struct *tsk) +@@ -1185,6 +1207,7 @@ void run_posix_cpu_timers(struct task_struct *tsk) list_del_init(&timer->it.cpu.entry); cpu_firing = timer->it.cpu.firing; timer->it.cpu.firing = 0; @@ -19833,7 +20410,7 @@ index bfaa44a80..b9e4ccbb6 100644 /* * The firing flag is -1 if we collided with a reset * of the timer, which already reported this -@@ -1198,8 +1221,156 @@ void run_posix_cpu_timers(struct task_struct *tsk) +@@ -1194,8 +1217,156 @@ void run_posix_cpu_timers(struct task_struct *tsk) cpu_timer_fire(timer); spin_unlock(&timer->it_lock); } @@ -19990,7 +20567,7 @@ index bfaa44a80..b9e4ccbb6 100644 /* * Set one of the process-wide special case CPU timers or RLIMIT_CPU. * The tsk->sighand->siglock must be held by the caller. -@@ -1318,6 +1489,8 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags, +@@ -1314,6 +1485,8 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags, spin_unlock_irq(&timer.it_lock); while (error == TIMER_RETRY) { @@ -20000,7 +20577,7 @@ index bfaa44a80..b9e4ccbb6 100644 * We need to handle case when timer was or is in the * middle of firing. In other cases we already freed diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c -index 12c4048c5..88efe799f 100644 +index d86fdabc5..2fe47ec39 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -463,7 +463,7 @@ static struct k_itimer * alloc_posix_timer(void) @@ -20166,7 +20743,7 @@ index 0a3cc37e4..7bd136b64 100644 clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT); diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c -index 5b33e2f5c..da4a3f8fe 100644 +index 59c28d912..ee40a2c26 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -67,7 +67,8 @@ static void tick_do_update_jiffies64(ktime_t now) @@ -20211,7 +20788,7 @@ index 5b33e2f5c..da4a3f8fe 100644 return period; } -@@ -227,6 +232,7 @@ static void nohz_full_kick_func(struct irq_work *work) +@@ -232,6 +237,7 @@ static void nohz_full_kick_func(struct irq_work *work) static DEFINE_PER_CPU(struct irq_work, nohz_full_kick_work) = { .func = nohz_full_kick_func, @@ -20219,7 +20796,7 @@ index 5b33e2f5c..da4a3f8fe 100644 }; /* -@@ -652,10 +658,10 @@ static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu) +@@ -659,10 +665,10 @@ static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu) /* Read jiffies and the time when jiffies were updated last */ do { @@ -20232,7 +20809,7 @@ index 5b33e2f5c..da4a3f8fe 100644 ts->last_jiffies = basejiff; ts->timer_expires_base = basemono; -@@ -886,14 +892,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) +@@ -893,14 +899,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) return false; if (unlikely(local_softirq_pending() && cpu_online(cpu))) { @@ -20248,7 +20825,7 @@ index 5b33e2f5c..da4a3f8fe 100644 return false; } -@@ -1305,7 +1304,7 @@ void tick_setup_sched_timer(void) +@@ -1319,7 +1318,7 @@ void tick_setup_sched_timer(void) /* * Emulate tick processing via per-CPU hrtimers: */ @@ -20258,10 +20835,10 @@ index 5b33e2f5c..da4a3f8fe 100644 /* Get the next period (per-CPU) */ diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c -index f246818e3..2cc8a1e8e 100644 +index 0ebfe476b..f25a19919 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c -@@ -2392,8 +2392,10 @@ EXPORT_SYMBOL(hardpps); +@@ -2399,8 +2399,10 @@ EXPORT_SYMBOL(hardpps); */ void xtime_update(unsigned long ticks) { @@ -20481,10 +21058,10 @@ index 8b6b33b81..4b8d3c37f 100644 } diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index 119dd5fd5..dd12bf89a 100644 +index 64fd3c3f8..13d9e885d 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -2121,6 +2121,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, +@@ -2125,6 +2125,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, struct task_struct *tsk = current; entry->preempt_count = pc & 0xff; @@ -20492,7 +21069,7 @@ index 119dd5fd5..dd12bf89a 100644 entry->pid = (tsk) ? tsk->pid : 0; entry->flags = #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT -@@ -2131,8 +2132,11 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, +@@ -2135,8 +2136,11 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, ((pc & NMI_MASK ) ? TRACE_FLAG_NMI : 0) | ((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) | ((pc & SOFTIRQ_OFFSET) ? TRACE_FLAG_SOFTIRQ : 0) | @@ -20505,7 +21082,7 @@ index 119dd5fd5..dd12bf89a 100644 } EXPORT_SYMBOL_GPL(tracing_generic_entry_update); -@@ -3327,14 +3331,17 @@ get_total_entries(struct trace_buffer *buf, +@@ -3338,14 +3342,17 @@ get_total_entries(struct trace_buffer *buf, static void print_lat_help_header(struct seq_file *m) { @@ -20531,7 +21108,7 @@ index 119dd5fd5..dd12bf89a 100644 } static void print_event_info(struct trace_buffer *buf, struct seq_file *m) -@@ -3372,15 +3379,17 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file +@@ -3383,15 +3390,17 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file tgid ? tgid_space : space); seq_printf(m, "# %s / _----=> need-resched\n", tgid ? tgid_space : space); @@ -20575,7 +21152,7 @@ index d05230d21..08841925d 100644 #define TRACE_BUF_SIZE 1024 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c -index 531e6e8f7..664c9738f 100644 +index a000adbbe..1c3dc788a 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -188,6 +188,8 @@ static int trace_define_common_fields(void) @@ -20698,7 +21275,7 @@ index 43832b102..e07b84dab 100644 nmi_panic(regs, "Hard LOCKUP"); diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index 04b558a26..59be58862 100644 +index 3ce68188a..bdbd8a35f 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -129,7 +129,7 @@ enum { @@ -20737,7 +21314,7 @@ index 04b558a26..59be58862 100644 * from get_work_pool(). */ struct rcu_head rcu; -@@ -214,7 +214,7 @@ struct pool_workqueue { +@@ -231,7 +231,7 @@ struct pool_workqueue { /* * Release of unbound pwq is punted to system_wq. See put_pwq() * and pwq_unbound_release_workfn() for details. pool_workqueue @@ -20746,7 +21323,7 @@ index 04b558a26..59be58862 100644 * determined without grabbing wq->mutex. */ struct work_struct unbound_release_work; -@@ -299,8 +299,8 @@ static struct workqueue_attrs *wq_update_unbound_numa_attrs_buf; +@@ -316,8 +316,8 @@ static struct workqueue_attrs *wq_update_unbound_numa_attrs_buf; static DEFINE_MUTEX(wq_pool_mutex); /* protects pools and workqueues list */ static DEFINE_MUTEX(wq_pool_attach_mutex); /* protects worker attach/detach */ @@ -20757,7 +21334,7 @@ index 04b558a26..59be58862 100644 static LIST_HEAD(workqueues); /* PR: list of all workqueues */ static bool workqueue_freezing; /* PL: have wqs started freezing? */ -@@ -359,20 +359,20 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); +@@ -376,20 +376,20 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); #include #define assert_rcu_or_pool_mutex() \ @@ -20784,7 +21361,7 @@ index 04b558a26..59be58862 100644 #define for_each_cpu_worker_pool(pool, cpu) \ for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; \ -@@ -384,7 +384,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); +@@ -401,7 +401,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); * @pool: iteration cursor * @pi: integer used for iteration * @@ -20793,7 +21370,7 @@ index 04b558a26..59be58862 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. * -@@ -416,7 +416,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); +@@ -433,7 +433,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); * @pwq: iteration cursor * @wq: the target workqueue * @@ -20802,7 +21379,7 @@ index 04b558a26..59be58862 100644 * If the pwq needs to be used beyond the locking in effect, the caller is * responsible for guaranteeing that the pwq stays online. * -@@ -552,7 +552,7 @@ static int worker_pool_assign_id(struct worker_pool *pool) +@@ -569,7 +569,7 @@ static int worker_pool_assign_id(struct worker_pool *pool) * @wq: the target workqueue * @node: the node ID * @@ -20811,7 +21388,7 @@ index 04b558a26..59be58862 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. -@@ -696,8 +696,8 @@ static struct pool_workqueue *get_work_pwq(struct work_struct *work) +@@ -713,8 +713,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 @@ -20822,7 +21399,7 @@ index 04b558a26..59be58862 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 -@@ -830,7 +830,7 @@ static struct worker *first_idle_worker(struct worker_pool *pool) +@@ -847,7 +847,7 @@ static struct worker *first_idle_worker(struct worker_pool *pool) * Wake up the first idle worker of @pool. * * CONTEXT: @@ -20831,7 +21408,7 @@ index 04b558a26..59be58862 100644 */ static void wake_up_worker(struct worker_pool *pool) { -@@ -883,7 +883,7 @@ void wq_worker_sleeping(struct task_struct *task) +@@ -900,7 +900,7 @@ void wq_worker_sleeping(struct task_struct *task) return; worker->sleeping = 1; @@ -20840,7 +21417,7 @@ index 04b558a26..59be58862 100644 /* * The counterpart of the following dec_and_test, implied mb, -@@ -902,7 +902,7 @@ void wq_worker_sleeping(struct task_struct *task) +@@ -919,7 +919,7 @@ void wq_worker_sleeping(struct task_struct *task) if (next) wake_up_process(next->task); } @@ -20849,7 +21426,7 @@ index 04b558a26..59be58862 100644 } /** -@@ -913,7 +913,7 @@ void wq_worker_sleeping(struct task_struct *task) +@@ -930,7 +930,7 @@ void wq_worker_sleeping(struct task_struct *task) * Set @flags in @worker->flags and adjust nr_running accordingly. * * CONTEXT: @@ -20858,7 +21435,7 @@ index 04b558a26..59be58862 100644 */ static inline void worker_set_flags(struct worker *worker, unsigned int flags) { -@@ -938,7 +938,7 @@ static inline void worker_set_flags(struct worker *worker, unsigned int flags) +@@ -955,7 +955,7 @@ static inline void worker_set_flags(struct worker *worker, unsigned int flags) * Clear @flags in @worker->flags and adjust nr_running accordingly. * * CONTEXT: @@ -20867,7 +21444,7 @@ index 04b558a26..59be58862 100644 */ static inline void worker_clr_flags(struct worker *worker, unsigned int flags) { -@@ -986,7 +986,7 @@ static inline void worker_clr_flags(struct worker *worker, unsigned int flags) +@@ -1003,7 +1003,7 @@ static inline void worker_clr_flags(struct worker *worker, unsigned int flags) * actually occurs, it should be easy to locate the culprit work function. * * CONTEXT: @@ -20876,7 +21453,7 @@ index 04b558a26..59be58862 100644 * * Return: * Pointer to worker which is executing @work if found, %NULL -@@ -1021,7 +1021,7 @@ static struct worker *find_worker_executing_work(struct worker_pool *pool, +@@ -1038,7 +1038,7 @@ static struct worker *find_worker_executing_work(struct worker_pool *pool, * nested inside outer list_for_each_entry_safe(). * * CONTEXT: @@ -20885,7 +21462,7 @@ index 04b558a26..59be58862 100644 */ static void move_linked_works(struct work_struct *work, struct list_head *head, struct work_struct **nextp) -@@ -1096,12 +1096,12 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq) +@@ -1113,12 +1113,12 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq) { if (pwq) { /* @@ -20901,16 +21478,16 @@ index 04b558a26..59be58862 100644 } } -@@ -1134,7 +1134,7 @@ static void pwq_activate_first_delayed(struct pool_workqueue *pwq) +@@ -1151,7 +1151,7 @@ static void pwq_activate_first_inactive(struct pool_workqueue *pwq) * decrement nr_in_flight of its pwq and handle workqueue flushing. * * CONTEXT: - * spin_lock_irq(pool->lock). + * raw_spin_lock_irq(pool->lock). */ - static void pwq_dec_nr_in_flight(struct pool_workqueue *pwq, int color) + static void pwq_dec_nr_in_flight(struct pool_workqueue *pwq, unsigned long work_data) { -@@ -1224,6 +1224,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, +@@ -1241,6 +1241,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; @@ -20918,7 +21495,7 @@ index 04b558a26..59be58862 100644 /* * The queueing is in progress, or it is already queued. Try to * steal it from ->worklist without clearing WORK_STRUCT_PENDING. -@@ -1232,7 +1233,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, +@@ -1249,7 +1250,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, if (!pool) goto fail; @@ -20927,7 +21504,7 @@ index 04b558a26..59be58862 100644 /* * work->data is guaranteed to point to pwq only while the work * item is queued on pwq->wq, and both updating work->data to point -@@ -1261,11 +1262,13 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, +@@ -1282,11 +1283,13 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, /* work->data points to pwq iff queued, point to pool */ set_work_pool_and_keep_pending(work, pool->id); @@ -20943,7 +21520,7 @@ index 04b558a26..59be58862 100644 local_irq_restore(*flags); if (work_is_canceling(work)) return -ENOENT; -@@ -1284,7 +1287,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, +@@ -1305,7 +1308,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, * work_struct flags. * * CONTEXT: @@ -20952,7 +21529,7 @@ index 04b558a26..59be58862 100644 */ static void insert_work(struct pool_workqueue *pwq, struct work_struct *work, struct list_head *head, unsigned int extra_flags) -@@ -1378,6 +1381,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, +@@ -1399,6 +1402,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, if (unlikely(wq->flags & __WQ_DRAINING) && WARN_ON_ONCE(!is_chained_work(wq))) return; @@ -20960,7 +21537,7 @@ index 04b558a26..59be58862 100644 retry: /* pwq which will be used unless @work is executing elsewhere */ if (wq->flags & WQ_UNBOUND) { -@@ -1399,7 +1403,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, +@@ -1420,7 +1424,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, if (last_pool && last_pool != pwq->pool) { struct worker *worker; @@ -20969,7 +21546,7 @@ index 04b558a26..59be58862 100644 worker = find_worker_executing_work(last_pool, work); -@@ -1407,11 +1411,11 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, +@@ -1428,11 +1432,11 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, pwq = worker->current_pwq; } else { /* meh... not running there, queue here */ @@ -20984,7 +21561,7 @@ index 04b558a26..59be58862 100644 } /* -@@ -1424,7 +1428,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, +@@ -1445,7 +1449,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, */ if (unlikely(!pwq->refcnt)) { if (wq->flags & WQ_UNBOUND) { @@ -20993,7 +21570,7 @@ index 04b558a26..59be58862 100644 cpu_relax(); goto retry; } -@@ -1436,10 +1440,8 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, +@@ -1457,10 +1461,8 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, /* pwq determined, queue */ trace_workqueue_queue_work(req_cpu, pwq, work); @@ -21006,7 +21583,7 @@ index 04b558a26..59be58862 100644 pwq->nr_in_flight[pwq->work_color]++; work_flags = work_color_to_flags(pwq->work_color); -@@ -1458,7 +1460,9 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, +@@ -1479,7 +1481,9 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, debug_work_activate(work); insert_work(pwq, work, worklist, work_flags); @@ -21017,7 +21594,7 @@ index 04b558a26..59be58862 100644 } /** -@@ -1577,9 +1581,11 @@ EXPORT_SYMBOL_GPL(queue_work_node); +@@ -1598,9 +1602,11 @@ EXPORT_SYMBOL_GPL(queue_work_node); void delayed_work_timer_fn(struct timer_list *t) { struct delayed_work *dwork = from_timer(dwork, t, timer); @@ -21030,7 +21607,7 @@ index 04b558a26..59be58862 100644 } EXPORT_SYMBOL(delayed_work_timer_fn); -@@ -1726,7 +1732,7 @@ EXPORT_SYMBOL(queue_rcu_work); +@@ -1747,7 +1753,7 @@ EXPORT_SYMBOL(queue_rcu_work); * necessary. * * LOCKING: @@ -21039,7 +21616,7 @@ index 04b558a26..59be58862 100644 */ static void worker_enter_idle(struct worker *worker) { -@@ -1766,7 +1772,7 @@ static void worker_enter_idle(struct worker *worker) +@@ -1787,7 +1793,7 @@ static void worker_enter_idle(struct worker *worker) * @worker is leaving idle state. Update stats. * * LOCKING: @@ -21048,7 +21625,7 @@ index 04b558a26..59be58862 100644 */ static void worker_leave_idle(struct worker *worker) { -@@ -1901,11 +1907,11 @@ static struct worker *create_worker(struct worker_pool *pool) +@@ -1922,11 +1928,11 @@ static struct worker *create_worker(struct worker_pool *pool) worker_attach_to_pool(worker, pool); /* start the newly created worker */ @@ -21062,7 +21639,7 @@ index 04b558a26..59be58862 100644 return worker; -@@ -1924,7 +1930,7 @@ static struct worker *create_worker(struct worker_pool *pool) +@@ -1945,7 +1951,7 @@ static struct worker *create_worker(struct worker_pool *pool) * be idle. * * CONTEXT: @@ -21071,7 +21648,7 @@ index 04b558a26..59be58862 100644 */ static void destroy_worker(struct worker *worker) { -@@ -1950,7 +1956,7 @@ static void idle_worker_timeout(struct timer_list *t) +@@ -1971,7 +1977,7 @@ static void idle_worker_timeout(struct timer_list *t) { struct worker_pool *pool = from_timer(pool, t, idle_timer); @@ -21080,7 +21657,7 @@ index 04b558a26..59be58862 100644 while (too_many_workers(pool)) { struct worker *worker; -@@ -1968,7 +1974,7 @@ static void idle_worker_timeout(struct timer_list *t) +@@ -1989,7 +1995,7 @@ static void idle_worker_timeout(struct timer_list *t) destroy_worker(worker); } @@ -21089,7 +21666,7 @@ index 04b558a26..59be58862 100644 } static void send_mayday(struct work_struct *work) -@@ -1999,8 +2005,8 @@ static void pool_mayday_timeout(struct timer_list *t) +@@ -2020,8 +2026,8 @@ static void pool_mayday_timeout(struct timer_list *t) struct worker_pool *pool = from_timer(pool, t, mayday_timer); struct work_struct *work; @@ -21100,7 +21677,7 @@ index 04b558a26..59be58862 100644 if (need_to_create_worker(pool)) { /* -@@ -2013,8 +2019,8 @@ static void pool_mayday_timeout(struct timer_list *t) +@@ -2034,8 +2040,8 @@ static void pool_mayday_timeout(struct timer_list *t) send_mayday(work); } @@ -21111,7 +21688,7 @@ index 04b558a26..59be58862 100644 mod_timer(&pool->mayday_timer, jiffies + MAYDAY_INTERVAL); } -@@ -2033,7 +2039,7 @@ static void pool_mayday_timeout(struct timer_list *t) +@@ -2054,7 +2060,7 @@ static void pool_mayday_timeout(struct timer_list *t) * may_start_working() %true. * * LOCKING: @@ -21120,7 +21697,7 @@ index 04b558a26..59be58862 100644 * multiple times. Does GFP_KERNEL allocations. Called only from * manager. */ -@@ -2042,7 +2048,7 @@ __releases(&pool->lock) +@@ -2063,7 +2069,7 @@ __releases(&pool->lock) __acquires(&pool->lock) { restart: @@ -21129,7 +21706,7 @@ index 04b558a26..59be58862 100644 /* if we don't make progress in MAYDAY_INITIAL_TIMEOUT, call for help */ mod_timer(&pool->mayday_timer, jiffies + MAYDAY_INITIAL_TIMEOUT); -@@ -2058,7 +2064,7 @@ __acquires(&pool->lock) +@@ -2079,7 +2085,7 @@ __acquires(&pool->lock) } del_timer_sync(&pool->mayday_timer); @@ -21138,7 +21715,7 @@ index 04b558a26..59be58862 100644 /* * This is necessary even after a new worker was just successfully * created as @pool->lock was dropped and the new worker might have -@@ -2081,7 +2087,7 @@ __acquires(&pool->lock) +@@ -2102,7 +2108,7 @@ __acquires(&pool->lock) * and may_start_working() is true. * * CONTEXT: @@ -21147,7 +21724,7 @@ index 04b558a26..59be58862 100644 * multiple times. Does GFP_KERNEL allocations. * * Return: -@@ -2104,7 +2110,7 @@ static bool manage_workers(struct worker *worker) +@@ -2125,7 +2131,7 @@ static bool manage_workers(struct worker *worker) pool->manager = NULL; pool->flags &= ~POOL_MANAGER_ACTIVE; @@ -21156,7 +21733,7 @@ index 04b558a26..59be58862 100644 return true; } -@@ -2120,7 +2126,7 @@ static bool manage_workers(struct worker *worker) +@@ -2141,7 +2147,7 @@ static bool manage_workers(struct worker *worker) * call this function to process a work. * * CONTEXT: @@ -21165,7 +21742,7 @@ index 04b558a26..59be58862 100644 */ static void process_one_work(struct worker *worker, struct work_struct *work) __releases(&pool->lock) -@@ -2202,7 +2208,7 @@ __acquires(&pool->lock) +@@ -2224,7 +2230,7 @@ __acquires(&pool->lock) */ set_work_pool_and_clear_pending(work, pool->id); @@ -21174,7 +21751,7 @@ index 04b558a26..59be58862 100644 lock_map_acquire(&pwq->wq->lockdep_map); lock_map_acquire(&lockdep_map); -@@ -2257,7 +2263,7 @@ __acquires(&pool->lock) +@@ -2279,7 +2285,7 @@ __acquires(&pool->lock) */ cond_resched(); @@ -21183,7 +21760,7 @@ index 04b558a26..59be58862 100644 /* clear cpu intensive status */ if (unlikely(cpu_intensive)) -@@ -2292,7 +2298,7 @@ __acquires(&pool->lock) +@@ -2315,7 +2321,7 @@ __acquires(&pool->lock) * fetches a work from the top and executes it. * * CONTEXT: @@ -21192,7 +21769,7 @@ index 04b558a26..59be58862 100644 * multiple times. */ static void process_scheduled_works(struct worker *worker) -@@ -2334,11 +2340,11 @@ static int worker_thread(void *__worker) +@@ -2357,11 +2363,11 @@ static int worker_thread(void *__worker) /* tell the scheduler that this is a workqueue worker */ set_pf_worker(true); woke_up: @@ -21206,7 +21783,7 @@ index 04b558a26..59be58862 100644 WARN_ON_ONCE(!list_empty(&worker->entry)); set_pf_worker(false); -@@ -2404,7 +2410,7 @@ static int worker_thread(void *__worker) +@@ -2427,7 +2433,7 @@ static int worker_thread(void *__worker) */ worker_enter_idle(worker); __set_current_state(TASK_IDLE); @@ -21215,7 +21792,7 @@ index 04b558a26..59be58862 100644 schedule(); goto woke_up; } -@@ -2458,7 +2464,7 @@ static int rescuer_thread(void *__rescuer) +@@ -2481,7 +2487,7 @@ static int rescuer_thread(void *__rescuer) should_stop = kthread_should_stop(); /* see whether any pwq is asking for help */ @@ -21224,7 +21801,7 @@ index 04b558a26..59be58862 100644 while (!list_empty(&wq->maydays)) { struct pool_workqueue *pwq = list_first_entry(&wq->maydays, -@@ -2470,11 +2476,11 @@ static int rescuer_thread(void *__rescuer) +@@ -2493,11 +2499,11 @@ static int rescuer_thread(void *__rescuer) __set_current_state(TASK_RUNNING); list_del_init(&pwq->mayday_node); @@ -21238,7 +21815,7 @@ index 04b558a26..59be58862 100644 /* * Slurp in all works issued via this workqueue and -@@ -2503,7 +2509,7 @@ static int rescuer_thread(void *__rescuer) +@@ -2526,7 +2532,7 @@ static int rescuer_thread(void *__rescuer) * incur MAYDAY_INTERVAL delay inbetween. */ if (need_to_create_worker(pool)) { @@ -21247,7 +21824,7 @@ index 04b558a26..59be58862 100644 /* * Queue iff we aren't racing destruction * and somebody else hasn't queued it already. -@@ -2512,7 +2518,7 @@ static int rescuer_thread(void *__rescuer) +@@ -2535,7 +2541,7 @@ static int rescuer_thread(void *__rescuer) get_pwq(pwq); list_add_tail(&pwq->mayday_node, &wq->maydays); } @@ -21256,7 +21833,7 @@ index 04b558a26..59be58862 100644 } } -@@ -2530,14 +2536,14 @@ static int rescuer_thread(void *__rescuer) +@@ -2553,14 +2559,14 @@ static int rescuer_thread(void *__rescuer) if (need_more_worker(pool)) wake_up_worker(pool); @@ -21274,7 +21851,7 @@ index 04b558a26..59be58862 100644 if (should_stop) { __set_current_state(TASK_RUNNING); -@@ -2617,7 +2623,7 @@ static void wq_barrier_func(struct work_struct *work) +@@ -2640,7 +2646,7 @@ static void wq_barrier_func(struct work_struct *work) * underneath us, so we can't reliably determine pwq from @target. * * CONTEXT: @@ -21283,7 +21860,7 @@ index 04b558a26..59be58862 100644 */ static void insert_wq_barrier(struct pool_workqueue *pwq, struct wq_barrier *barr, -@@ -2704,7 +2710,7 @@ static bool flush_workqueue_prep_pwqs(struct workqueue_struct *wq, +@@ -2735,7 +2741,7 @@ static bool flush_workqueue_prep_pwqs(struct workqueue_struct *wq, for_each_pwq(pwq, wq) { struct worker_pool *pool = pwq->pool; @@ -21292,7 +21869,7 @@ index 04b558a26..59be58862 100644 if (flush_color >= 0) { WARN_ON_ONCE(pwq->flush_color != -1); -@@ -2721,7 +2727,7 @@ static bool flush_workqueue_prep_pwqs(struct workqueue_struct *wq, +@@ -2752,7 +2758,7 @@ static bool flush_workqueue_prep_pwqs(struct workqueue_struct *wq, pwq->work_color = work_color; } @@ -21301,19 +21878,19 @@ index 04b558a26..59be58862 100644 } if (flush_color >= 0 && atomic_dec_and_test(&wq->nr_pwqs_to_flush)) -@@ -2921,9 +2927,9 @@ void drain_workqueue(struct workqueue_struct *wq) +@@ -2952,9 +2958,9 @@ void drain_workqueue(struct workqueue_struct *wq) for_each_pwq(pwq, wq) { bool drained; - spin_lock_irq(&pwq->pool->lock); -+ raw_spin_lock_irq(&pwq->pool->lock); - drained = !pwq->nr_active && list_empty(&pwq->delayed_works); ++ raw_spin_lock_irq(&pwq->pool->lock); + drained = !pwq->nr_active && list_empty(&pwq->inactive_works); - spin_unlock_irq(&pwq->pool->lock); + raw_spin_unlock_irq(&pwq->pool->lock); if (drained) continue; -@@ -2997,14 +3003,14 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, +@@ -3028,14 +3034,14 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, might_sleep(); @@ -21331,7 +21908,7 @@ index 04b558a26..59be58862 100644 /* see the comment in try_to_grab_pending() with the same code */ pwq = get_work_pwq(work); if (pwq) { -@@ -3028,7 +3034,7 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, +@@ -3059,7 +3065,7 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, check_flush_dependency(pwq->wq, work); insert_wq_barrier(pwq, barr, work, worker); @@ -21340,7 +21917,7 @@ index 04b558a26..59be58862 100644 /* * Force a lock recursion deadlock when using flush_work() inside a -@@ -3044,10 +3050,11 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, +@@ -3075,10 +3081,11 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, lock_map_acquire(&pwq->wq->lockdep_map); lock_map_release(&pwq->wq->lockdep_map); } @@ -21354,7 +21931,7 @@ index 04b558a26..59be58862 100644 return false; } -@@ -3385,7 +3392,7 @@ EXPORT_SYMBOL_GPL(execute_in_process_context); +@@ -3416,7 +3423,7 @@ EXPORT_SYMBOL_GPL(execute_in_process_context); * * Undo alloc_workqueue_attrs(). */ @@ -21363,7 +21940,7 @@ index 04b558a26..59be58862 100644 { if (attrs) { free_cpumask_var(attrs->cpumask); -@@ -3395,21 +3402,20 @@ void free_workqueue_attrs(struct workqueue_attrs *attrs) +@@ -3426,21 +3433,20 @@ void free_workqueue_attrs(struct workqueue_attrs *attrs) /** * alloc_workqueue_attrs - allocate a workqueue_attrs @@ -21388,7 +21965,7 @@ index 04b558a26..59be58862 100644 goto fail; cpumask_copy(attrs->cpumask, cpu_possible_mask); -@@ -3466,7 +3472,7 @@ static bool wqattrs_equal(const struct workqueue_attrs *a, +@@ -3497,7 +3503,7 @@ static bool wqattrs_equal(const struct workqueue_attrs *a, */ static int init_worker_pool(struct worker_pool *pool) { @@ -21397,7 +21974,7 @@ index 04b558a26..59be58862 100644 pool->id = -1; pool->cpu = -1; pool->node = NUMA_NO_NODE; -@@ -3487,7 +3493,7 @@ static int init_worker_pool(struct worker_pool *pool) +@@ -3518,7 +3524,7 @@ static int init_worker_pool(struct worker_pool *pool) pool->refcnt = 1; /* shouldn't fail above this point */ @@ -21406,7 +21983,7 @@ index 04b558a26..59be58862 100644 if (!pool->attrs) return -ENOMEM; return 0; -@@ -3520,7 +3526,7 @@ static void rcu_free_pool(struct rcu_head *rcu) +@@ -3551,7 +3557,7 @@ static void rcu_free_pool(struct rcu_head *rcu) * put_unbound_pool - put a worker_pool * @pool: worker_pool to put * @@ -21415,7 +21992,7 @@ index 04b558a26..59be58862 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(). -@@ -3552,15 +3558,15 @@ static void put_unbound_pool(struct worker_pool *pool) +@@ -3583,15 +3589,15 @@ static void put_unbound_pool(struct worker_pool *pool) * @pool's workers from blocking on attach_mutex. We're the last * manager and @pool gets freed with the flag set. */ @@ -21434,7 +22011,7 @@ index 04b558a26..59be58862 100644 mutex_lock(&wq_pool_attach_mutex); if (!list_empty(&pool->workers)) -@@ -3574,8 +3580,8 @@ static void put_unbound_pool(struct worker_pool *pool) +@@ -3605,8 +3611,8 @@ static void put_unbound_pool(struct worker_pool *pool) del_timer_sync(&pool->idle_timer); del_timer_sync(&pool->mayday_timer); @@ -21445,7 +22022,7 @@ index 04b558a26..59be58862 100644 } /** -@@ -3688,14 +3694,14 @@ static void pwq_unbound_release_workfn(struct work_struct *work) +@@ -3719,14 +3725,14 @@ static void pwq_unbound_release_workfn(struct work_struct *work) put_unbound_pool(pool); mutex_unlock(&wq_pool_mutex); @@ -21462,7 +22039,7 @@ index 04b558a26..59be58862 100644 } /** -@@ -3720,7 +3726,7 @@ static void pwq_adjust_max_active(struct pool_workqueue *pwq) +@@ -3751,7 +3757,7 @@ static void pwq_adjust_max_active(struct pool_workqueue *pwq) return; /* this function can be called during early boot w/ irq disabled */ @@ -21471,7 +22048,7 @@ index 04b558a26..59be58862 100644 /* * During [un]freezing, the caller is responsible for ensuring that -@@ -3750,7 +3756,7 @@ static void pwq_adjust_max_active(struct pool_workqueue *pwq) +@@ -3781,7 +3787,7 @@ static void pwq_adjust_max_active(struct pool_workqueue *pwq) pwq->max_active = 0; } @@ -21480,7 +22057,7 @@ index 04b558a26..59be58862 100644 } /* initialize newly alloced @pwq which is associated with @wq and @pool */ -@@ -3923,8 +3929,8 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, +@@ -3954,8 +3960,8 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, ctx = kzalloc(struct_size(ctx, pwq_tbl, nr_node_ids), GFP_KERNEL); @@ -21491,7 +22068,7 @@ index 04b558a26..59be58862 100644 if (!ctx || !new_attrs || !tmp_attrs) goto out_free; -@@ -4063,7 +4069,7 @@ static int apply_workqueue_attrs_locked(struct workqueue_struct *wq, +@@ -4094,7 +4100,7 @@ static int apply_workqueue_attrs_locked(struct workqueue_struct *wq, * * Return: 0 on success and -errno on failure. */ @@ -21500,7 +22077,7 @@ index 04b558a26..59be58862 100644 const struct workqueue_attrs *attrs) { int ret; -@@ -4074,7 +4080,6 @@ int apply_workqueue_attrs(struct workqueue_struct *wq, +@@ -4105,7 +4111,6 @@ int apply_workqueue_attrs(struct workqueue_struct *wq, return ret; } @@ -21508,7 +22085,7 @@ index 04b558a26..59be58862 100644 /** * wq_update_unbound_numa - update NUMA affinity of a wq for CPU hot[un]plug -@@ -4152,9 +4157,9 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu, +@@ -4183,9 +4188,9 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu, use_dfl_pwq: mutex_lock(&wq->mutex); @@ -21520,7 +22097,7 @@ index 04b558a26..59be58862 100644 old_pwq = numa_pwq_tbl_install(wq, node, wq->dfl_pwq); out_unlock: mutex_unlock(&wq->mutex); -@@ -4275,7 +4280,7 @@ struct workqueue_struct *__alloc_workqueue_key(const char *fmt, +@@ -4306,7 +4311,7 @@ struct workqueue_struct *__alloc_workqueue_key(const char *fmt, return NULL; if (flags & WQ_UNBOUND) { @@ -21529,7 +22106,7 @@ index 04b558a26..59be58862 100644 if (!wq->unbound_attrs) goto err_free_wq; } -@@ -4362,9 +4367,9 @@ void destroy_workqueue(struct workqueue_struct *wq) +@@ -4393,9 +4398,9 @@ void destroy_workqueue(struct workqueue_struct *wq) struct worker *rescuer = wq->rescuer; /* this prevents new queueing */ @@ -21541,7 +22118,7 @@ index 04b558a26..59be58862 100644 /* rescuer will empty maydays list before exiting */ kthread_stop(rescuer->task); -@@ -4407,7 +4412,7 @@ void destroy_workqueue(struct workqueue_struct *wq) +@@ -4438,7 +4443,7 @@ void destroy_workqueue(struct workqueue_struct *wq) * The base ref is never dropped on per-cpu pwqs. Directly * schedule RCU free. */ @@ -21550,7 +22127,7 @@ index 04b558a26..59be58862 100644 } else { /* * We're the sole accessor of @wq at this point. Directly -@@ -4517,7 +4522,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) +@@ -4548,7 +4553,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) struct pool_workqueue *pwq; bool ret; @@ -21560,17 +22137,17 @@ index 04b558a26..59be58862 100644 if (cpu == WORK_CPU_UNBOUND) cpu = smp_processor_id(); -@@ -4528,7 +4534,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) +@@ -4559,7 +4565,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); + ret = !list_empty(&pwq->inactive_works); - rcu_read_unlock_sched(); + preempt_enable(); + rcu_read_unlock(); return ret; } -@@ -4554,15 +4561,15 @@ unsigned int work_busy(struct work_struct *work) +@@ -4585,15 +4592,15 @@ unsigned int work_busy(struct work_struct *work) if (work_pending(work)) ret |= WORK_BUSY_PENDING; @@ -21590,7 +22167,7 @@ index 04b558a26..59be58862 100644 return ret; } -@@ -4747,7 +4754,7 @@ void show_workqueue_state(void) +@@ -4778,7 +4785,7 @@ void show_workqueue_state(void) unsigned long flags; int pi; @@ -21599,20 +22176,20 @@ index 04b558a26..59be58862 100644 pr_info("Showing busy workqueues and worker pools:\n"); -@@ -4767,10 +4774,10 @@ void show_workqueue_state(void) +@@ -4798,10 +4805,10 @@ void show_workqueue_state(void) pr_info("workqueue %s: flags=0x%x\n", wq->name, wq->flags); for_each_pwq(pwq, wq) { - spin_lock_irqsave(&pwq->pool->lock, flags); + raw_spin_lock_irqsave(&pwq->pool->lock, flags); - if (pwq->nr_active || !list_empty(&pwq->delayed_works)) + if (pwq->nr_active || !list_empty(&pwq->inactive_works)) show_pwq(pwq); - spin_unlock_irqrestore(&pwq->pool->lock, flags); + raw_spin_unlock_irqrestore(&pwq->pool->lock, flags); /* * We could be printing a lot from atomic context, e.g. * sysrq-t -> show_workqueue_state(). Avoid triggering -@@ -4784,7 +4791,7 @@ void show_workqueue_state(void) +@@ -4815,7 +4822,7 @@ void show_workqueue_state(void) struct worker *worker; bool first = true; @@ -21621,7 +22198,7 @@ index 04b558a26..59be58862 100644 if (pool->nr_workers == pool->nr_idle) goto next_pool; -@@ -4803,7 +4810,7 @@ void show_workqueue_state(void) +@@ -4834,7 +4841,7 @@ void show_workqueue_state(void) } pr_cont("\n"); next_pool: @@ -21630,7 +22207,7 @@ index 04b558a26..59be58862 100644 /* * We could be printing a lot from atomic context, e.g. * sysrq-t -> show_workqueue_state(). Avoid triggering -@@ -4812,7 +4819,7 @@ void show_workqueue_state(void) +@@ -4843,7 +4850,7 @@ void show_workqueue_state(void) touch_nmi_watchdog(); } @@ -21639,7 +22216,7 @@ index 04b558a26..59be58862 100644 } /* used to show worker information through /proc/PID/{comm,stat,status} */ -@@ -4833,7 +4840,7 @@ void wq_worker_comm(char *buf, size_t size, struct task_struct *task) +@@ -4864,7 +4871,7 @@ void wq_worker_comm(char *buf, size_t size, struct task_struct *task) struct worker_pool *pool = worker->pool; if (pool) { @@ -21648,7 +22225,7 @@ index 04b558a26..59be58862 100644 /* * ->desc tracks information (wq name or * set_worker_desc()) for the latest execution. If -@@ -4847,7 +4854,7 @@ void wq_worker_comm(char *buf, size_t size, struct task_struct *task) +@@ -4878,7 +4885,7 @@ void wq_worker_comm(char *buf, size_t size, struct task_struct *task) scnprintf(buf + off, size - off, "-%s", worker->desc); } @@ -21657,7 +22234,7 @@ index 04b558a26..59be58862 100644 } } -@@ -4878,7 +4885,7 @@ static void unbind_workers(int cpu) +@@ -4909,7 +4916,7 @@ static void unbind_workers(int cpu) for_each_cpu_worker_pool(pool, cpu) { mutex_lock(&wq_pool_attach_mutex); @@ -21666,7 +22243,7 @@ index 04b558a26..59be58862 100644 /* * We've blocked all attach/detach operations. Make all workers -@@ -4892,7 +4899,7 @@ static void unbind_workers(int cpu) +@@ -4923,7 +4930,7 @@ static void unbind_workers(int cpu) pool->flags |= POOL_DISASSOCIATED; @@ -21675,7 +22252,7 @@ index 04b558a26..59be58862 100644 mutex_unlock(&wq_pool_attach_mutex); /* -@@ -4918,9 +4925,9 @@ static void unbind_workers(int cpu) +@@ -4949,9 +4956,9 @@ static void unbind_workers(int cpu) * worker blocking could lead to lengthy stalls. Kick off * unbound chain execution of currently pending work items. */ @@ -21687,7 +22264,7 @@ index 04b558a26..59be58862 100644 } } -@@ -4947,7 +4954,7 @@ static void rebind_workers(struct worker_pool *pool) +@@ -4978,7 +4985,7 @@ static void rebind_workers(struct worker_pool *pool) WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask) < 0); @@ -21696,7 +22273,7 @@ index 04b558a26..59be58862 100644 pool->flags &= ~POOL_DISASSOCIATED; -@@ -4986,7 +4993,7 @@ static void rebind_workers(struct worker_pool *pool) +@@ -5017,7 +5024,7 @@ static void rebind_workers(struct worker_pool *pool) WRITE_ONCE(worker->flags, worker_flags); } @@ -21705,7 +22282,7 @@ index 04b558a26..59be58862 100644 } /** -@@ -5199,16 +5206,16 @@ bool freeze_workqueues_busy(void) +@@ -5230,16 +5237,16 @@ bool freeze_workqueues_busy(void) * nr_active is monotonically decreasing. It's safe * to peek without lock. */ @@ -21725,7 +22302,7 @@ index 04b558a26..59be58862 100644 } out_unlock: mutex_unlock(&wq_pool_mutex); -@@ -5403,7 +5410,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, +@@ -5434,7 +5441,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, const char *delim = ""; int node, written = 0; @@ -21735,7 +22312,7 @@ index 04b558a26..59be58862 100644 for_each_node(node) { written += scnprintf(buf + written, PAGE_SIZE - written, "%s%d:%d", delim, node, -@@ -5411,7 +5419,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, +@@ -5442,7 +5450,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, delim = " "; } written += scnprintf(buf + written, PAGE_SIZE - written, "\n"); @@ -21745,7 +22322,7 @@ index 04b558a26..59be58862 100644 return written; } -@@ -5436,7 +5445,7 @@ static struct workqueue_attrs *wq_sysfs_prep_attrs(struct workqueue_struct *wq) +@@ -5467,7 +5476,7 @@ static struct workqueue_attrs *wq_sysfs_prep_attrs(struct workqueue_struct *wq) lockdep_assert_held(&wq_pool_mutex); @@ -21754,7 +22331,7 @@ index 04b558a26..59be58862 100644 if (!attrs) return NULL; -@@ -5865,7 +5874,7 @@ static void __init wq_numa_init(void) +@@ -5896,7 +5905,7 @@ static void __init wq_numa_init(void) return; } @@ -21763,7 +22340,7 @@ index 04b558a26..59be58862 100644 BUG_ON(!wq_update_unbound_numa_attrs_buf); /* -@@ -5940,7 +5949,7 @@ int __init workqueue_init_early(void) +@@ -5971,7 +5980,7 @@ int __init workqueue_init_early(void) for (i = 0; i < NR_STD_WORKER_POOLS; i++) { struct workqueue_attrs *attrs; @@ -21772,7 +22349,7 @@ index 04b558a26..59be58862 100644 attrs->nice = std_nice[i]; unbound_std_wq_attrs[i] = attrs; -@@ -5949,7 +5958,7 @@ int __init workqueue_init_early(void) +@@ -5980,7 +5989,7 @@ int __init workqueue_init_early(void) * guaranteed by max_active which is enforced by pwqs. * Turn off NUMA so that dfl_pwq is used for all nodes. */ @@ -21794,10 +22371,10 @@ index edb7d40d1..5bf23108d 100644 Use dynamic allocation for cpumask_var_t, instead of putting them on the stack. This is a bit more expensive, but avoids diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug -index 4a78bacd4..58d68b6cd 100644 +index 5bf4ad9f9..7b9187caa 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug -@@ -1233,7 +1233,7 @@ config DEBUG_ATOMIC_SLEEP +@@ -1245,7 +1245,7 @@ config DEBUG_ATOMIC_SLEEP config DEBUG_LOCKING_API_SELFTESTS bool "Locking API boot-time self-tests" @@ -22903,7 +23480,7 @@ index f54734abf..e8a7eebc2 100644 rcu_read_unlock(); diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index 18b5660dc..6ded3d9c7 100644 +index 29d430885..8dd6dabf8 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -71,6 +71,7 @@ @@ -22923,7 +23500,7 @@ index 18b5660dc..6ded3d9c7 100644 /* Whether legacy memory+swap accounting is active */ static bool do_memsw_account(void) { -@@ -2210,7 +2213,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) +@@ -2224,7 +2227,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) * as well as workers from this path always operate on the local * per-cpu data. CPU up doesn't touch memcg_stock at all. */ @@ -22932,16 +23509,16 @@ index 18b5660dc..6ded3d9c7 100644 for_each_online_cpu(cpu) { struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu); struct mem_cgroup *memcg; -@@ -2230,7 +2233,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) +@@ -2244,7 +2247,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) + schedule_work_on(cpu, &stock->work); } - css_put(&memcg->css); } - put_cpu(); + put_cpu_light(); mutex_unlock(&percpu_charge_mutex); } -@@ -5386,12 +5389,12 @@ static int mem_cgroup_move_account(struct page *page, +@@ -5773,12 +5776,12 @@ static int mem_cgroup_move_account(struct page *page, ret = 0; @@ -22956,7 +23533,7 @@ index 18b5660dc..6ded3d9c7 100644 out_unlock: unlock_page(page); out: -@@ -6530,10 +6533,10 @@ void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, +@@ -6925,10 +6928,10 @@ void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, commit_charge(page, memcg, lrucare); @@ -22969,7 +23546,7 @@ index 18b5660dc..6ded3d9c7 100644 if (do_memsw_account() && PageSwapCache(page)) { swp_entry_t entry = { .val = page_private(page) }; -@@ -6602,7 +6605,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) +@@ -6997,7 +7000,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) memcg_oom_recover(ug->memcg); } @@ -22978,7 +23555,7 @@ index 18b5660dc..6ded3d9c7 100644 __mod_memcg_state(ug->memcg, MEMCG_RSS, -ug->nr_anon); __mod_memcg_state(ug->memcg, MEMCG_CACHE, -ug->nr_file); __mod_memcg_state(ug->memcg, MEMCG_RSS_HUGE, -ug->nr_huge); -@@ -6610,7 +6613,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) +@@ -7005,7 +7008,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) __count_memcg_events(ug->memcg, PGPGOUT, ug->pgpgout); __this_cpu_add(ug->memcg->stat_cpu->nr_page_events, nr_pages); memcg_check_events(ug->memcg, ug->dummy_page); @@ -22987,7 +23564,7 @@ index 18b5660dc..6ded3d9c7 100644 if (!mem_cgroup_is_root(ug->memcg)) css_put_many(&ug->memcg->css, nr_pages); -@@ -6773,10 +6776,10 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage) +@@ -7168,10 +7171,10 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage) commit_charge(newpage, memcg, false); @@ -23000,7 +23577,7 @@ index 18b5660dc..6ded3d9c7 100644 } DEFINE_STATIC_KEY_FALSE(memcg_sockets_enabled_key); -@@ -6962,6 +6965,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) +@@ -7357,6 +7360,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) struct mem_cgroup *memcg, *swap_memcg; unsigned int nr_entries; unsigned short oldid; @@ -23008,7 +23585,7 @@ index 18b5660dc..6ded3d9c7 100644 VM_BUG_ON_PAGE(PageLRU(page), page); VM_BUG_ON_PAGE(page_count(page), page); -@@ -7007,10 +7011,14 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) +@@ -7402,10 +7406,14 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) * important here to have the interrupts disabled because it is the * only synchronisation we have for updating the per-CPU variables. */ @@ -23044,7 +23621,7 @@ index 3e612ae74..d0ccc0709 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 f4d4716b9..5ef3490be 100644 +index fc8be4b00..84f01e7fb 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -60,6 +60,7 @@ @@ -23182,14 +23759,13 @@ index f4d4716b9..5ef3490be 100644 } static void free_one_page(struct zone *zone, -@@ -1338,12 +1373,12 @@ static void __free_pages_ok(struct page *page, unsigned int order, +@@ -1338,11 +1373,11 @@ static void __free_pages_ok(struct page *page, unsigned int order, return; migratetype = get_pfnblock_migratetype(page, pfn); - local_irq_save(flags); + local_lock_irqsave(pa_lock, flags); __count_vm_events(PGFREE, 1 << order); - mem_reliable_buddy_counter(page, 1 << order); free_one_page(page_zone(page), page, pfn, order, migratetype, fpi_flags); - local_irq_restore(flags); @@ -23197,7 +23773,7 @@ index f4d4716b9..5ef3490be 100644 } void __free_pages_core(struct page *page, unsigned int order) -@@ -2690,13 +2725,18 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) +@@ -2689,13 +2724,18 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) { unsigned long flags; int to_drain, batch; @@ -23219,7 +23795,7 @@ index f4d4716b9..5ef3490be 100644 } #endif -@@ -2712,14 +2752,21 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) +@@ -2711,14 +2751,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; @@ -23245,7 +23821,7 @@ index f4d4716b9..5ef3490be 100644 } /* -@@ -2754,6 +2801,7 @@ void drain_local_pages(struct zone *zone) +@@ -2753,6 +2800,7 @@ void drain_local_pages(struct zone *zone) drain_pages(cpu); } @@ -23253,7 +23829,7 @@ index f4d4716b9..5ef3490be 100644 static void drain_local_pages_wq(struct work_struct *work) { /* -@@ -2767,6 +2815,7 @@ static void drain_local_pages_wq(struct work_struct *work) +@@ -2766,6 +2814,7 @@ static void drain_local_pages_wq(struct work_struct *work) drain_local_pages(NULL); preempt_enable(); } @@ -23261,7 +23837,7 @@ index f4d4716b9..5ef3490be 100644 /* * Spill all the per-cpu pages from all CPUs back into the buddy allocator. -@@ -2833,7 +2882,14 @@ void drain_all_pages(struct zone *zone) +@@ -2832,7 +2881,14 @@ void drain_all_pages(struct zone *zone) else cpumask_clear_cpu(cpu, &cpus_with_pcps); } @@ -23277,7 +23853,7 @@ index f4d4716b9..5ef3490be 100644 for_each_cpu(cpu, &cpus_with_pcps) { struct work_struct *work = per_cpu_ptr(&pcpu_drain, cpu); INIT_WORK(work, drain_local_pages_wq); -@@ -2841,6 +2897,7 @@ void drain_all_pages(struct zone *zone) +@@ -2840,6 +2896,7 @@ void drain_all_pages(struct zone *zone) } for_each_cpu(cpu, &cpus_with_pcps) flush_work(per_cpu_ptr(&pcpu_drain, cpu)); @@ -23285,7 +23861,7 @@ index f4d4716b9..5ef3490be 100644 mutex_unlock(&pcpu_drain_mutex); } -@@ -2912,7 +2969,8 @@ static bool free_unref_page_prepare(struct page *page, unsigned long pfn) +@@ -2911,7 +2968,8 @@ static bool free_unref_page_prepare(struct page *page, unsigned long pfn) return true; } @@ -23295,7 +23871,7 @@ index f4d4716b9..5ef3490be 100644 { struct zone *zone = page_zone(page); struct per_cpu_pages *pcp; -@@ -2943,7 +3001,8 @@ static void free_unref_page_commit(struct page *page, unsigned long pfn) +@@ -2941,7 +2999,8 @@ static void free_unref_page_commit(struct page *page, unsigned long pfn) pcp->count++; if (pcp->count >= pcp->high) { unsigned long batch = READ_ONCE(pcp->batch); @@ -23305,20 +23881,24 @@ index f4d4716b9..5ef3490be 100644 } } -@@ -2954,13 +3013,17 @@ void free_unref_page(struct page *page) +@@ -2952,7 +3011,8 @@ void free_unref_page(struct page *page) { unsigned long flags; unsigned long pfn = page_to_pfn(page); -+ struct zone *zone = page_zone(page); +- ++ struct zone *zone = page_zone(page); + LIST_HEAD(dst); - + /* Free dynamic hugetlb page */ + if (dhugetlb_enabled && PagePool(page)) { + free_page_to_dhugetlb_pool(page); +@@ -2962,9 +3022,11 @@ void free_unref_page(struct page *page) if (!free_unref_page_prepare(page, pfn)) return; - local_irq_save(flags); - free_unref_page_commit(page, pfn); - local_irq_restore(flags); -+ local_lock_irqsave(pa_lock, flags); ++ local_lock_irqsave(pa_lock, flags); + free_unref_page_commit(page, pfn, &dst); + local_unlock_irqrestore(pa_lock, flags); + if (!list_empty(&dst)) @@ -23326,19 +23906,19 @@ index f4d4716b9..5ef3490be 100644 } /* -@@ -2971,6 +3034,11 @@ void free_unref_page_list(struct list_head *list) +@@ -2975,7 +3037,11 @@ void free_unref_page_list(struct list_head *list) struct page *page, *next; unsigned long flags, pfn; int batch_count = 0; + struct list_head dsts[__MAX_NR_ZONES]; + int i; -+ + + for (i = 0; i < __MAX_NR_ZONES; i++) + INIT_LIST_HEAD(&dsts[i]); - - /* Prepare pages for freeing */ - list_for_each_entry_safe(page, next, list, lru) { -@@ -2980,25 +3048,42 @@ void free_unref_page_list(struct list_head *list) + /* Free dynamic hugetlb pages */ + if (dhugetlb_enabled) { + list_for_each_entry_safe(page, next, list, lru) { +@@ -2994,25 +3060,42 @@ void free_unref_page_list(struct list_head *list) set_page_private(page, pfn); } @@ -23386,7 +23966,7 @@ index f4d4716b9..5ef3490be 100644 } /* -@@ -3152,7 +3237,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, +@@ -3166,7 +3249,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, struct page *page; unsigned long flags; @@ -23395,8 +23975,8 @@ index f4d4716b9..5ef3490be 100644 pcp = &this_cpu_ptr(zone->pageset)->pcp; list = &pcp->lists[migratetype]; page = __rmqueue_pcplist(zone, migratetype, pcp, list); -@@ -3161,7 +3246,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, - mem_reliable_buddy_counter(page, -(1 << order)); +@@ -3174,7 +3257,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, + __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); zone_statistics(preferred_zone, zone); } - local_irq_restore(flags); @@ -23404,7 +23984,7 @@ index f4d4716b9..5ef3490be 100644 return page; } -@@ -3188,7 +3273,7 @@ struct page *rmqueue(struct zone *preferred_zone, +@@ -3201,7 +3284,7 @@ struct page *rmqueue(struct zone *preferred_zone, * allocate greater than order-1 page units with __GFP_NOFAIL. */ WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1)); @@ -23413,9 +23993,9 @@ index f4d4716b9..5ef3490be 100644 do { page = NULL; -@@ -3209,14 +3294,14 @@ struct page *rmqueue(struct zone *preferred_zone, +@@ -3221,14 +3304,14 @@ struct page *rmqueue(struct zone *preferred_zone, + __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); - mem_reliable_buddy_counter(page, -(1 << order)); zone_statistics(preferred_zone, zone); - local_irq_restore(flags); + local_unlock_irqrestore(pa_lock, flags); @@ -23430,7 +24010,7 @@ index f4d4716b9..5ef3490be 100644 return NULL; } -@@ -7564,8 +7649,9 @@ void __init free_area_init(unsigned long *zones_size) +@@ -7666,8 +7749,9 @@ void __init free_area_init(unsigned long *zones_size) static int page_alloc_cpu_dead(unsigned int cpu) { @@ -23441,7 +24021,7 @@ index f4d4716b9..5ef3490be 100644 drain_pages(cpu); /* -@@ -8482,7 +8568,7 @@ void zone_pcp_reset(struct zone *zone) +@@ -8585,7 +8669,7 @@ void zone_pcp_reset(struct zone *zone) struct per_cpu_pageset *pset; /* avoid races with drain_pages() */ @@ -23450,7 +24030,7 @@ index f4d4716b9..5ef3490be 100644 if (zone->pageset != &boot_pageset) { for_each_online_cpu(cpu) { pset = per_cpu_ptr(zone->pageset, cpu); -@@ -8491,7 +8577,7 @@ void zone_pcp_reset(struct zone *zone) +@@ -8594,7 +8678,7 @@ void zone_pcp_reset(struct zone *zone) free_percpu(zone->pageset); zone->pageset = &boot_pageset; } @@ -23840,7 +24420,7 @@ index c683b07ff..e45fc3a81 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 7b5630ca9..8c9ba6a1a 100644 +index 150362a66..bed971223 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1188,7 +1188,7 @@ static noinline int free_debug_processing( @@ -23976,7 +24556,7 @@ index 7b5630ca9..8c9ba6a1a 100644 if (m == M_FREE) { stat(s, DEACTIVATE_EMPTY); -@@ -2193,10 +2222,10 @@ static void unfreeze_partials(struct kmem_cache *s, +@@ -2194,10 +2223,10 @@ static void unfreeze_partials(struct kmem_cache *s, n2 = get_node(s, page_to_nid(page)); if (n != n2) { if (n) @@ -23989,7 +24569,7 @@ index 7b5630ca9..8c9ba6a1a 100644 } do { -@@ -2225,7 +2254,7 @@ static void unfreeze_partials(struct kmem_cache *s, +@@ -2226,7 +2255,7 @@ static void unfreeze_partials(struct kmem_cache *s, } if (n) @@ -23998,7 +24578,7 @@ index 7b5630ca9..8c9ba6a1a 100644 while (discard_page) { page = discard_page; -@@ -2262,14 +2291,21 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) +@@ -2263,14 +2292,21 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) pobjects = oldpage->pobjects; pages = oldpage->pages; if (drain && pobjects > s->cpu_partial) { @@ -24020,7 +24600,7 @@ index 7b5630ca9..8c9ba6a1a 100644 oldpage = NULL; pobjects = 0; pages = 0; -@@ -2339,7 +2375,19 @@ static bool has_cpu_slab(int cpu, void *info) +@@ -2338,7 +2374,19 @@ static bool has_cpu_slab(int cpu, void *info) static void flush_all(struct kmem_cache *s) { @@ -24040,7 +24620,7 @@ index 7b5630ca9..8c9ba6a1a 100644 } /* -@@ -2394,10 +2442,10 @@ static unsigned long count_partial(struct kmem_cache_node *n, +@@ -2393,10 +2441,10 @@ static unsigned long count_partial(struct kmem_cache_node *n, unsigned long x = 0; struct page *page; @@ -24053,7 +24633,7 @@ index 7b5630ca9..8c9ba6a1a 100644 return x; } #endif /* CONFIG_SLUB_DEBUG || CONFIG_SYSFS */ -@@ -2537,8 +2585,10 @@ static inline void *get_freelist(struct kmem_cache *s, struct page *page) +@@ -2536,8 +2584,10 @@ static inline void *get_freelist(struct kmem_cache *s, struct page *page) * already disabled (which is the case for bulk allocation). */ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, @@ -24661,7 +25241,7 @@ index 96028cc96..f2f7d9345 100644 void __dec_zone_page_state(struct page *page, enum zone_stat_item item) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c -index 05d3d5872..ccac527c7 100644 +index e0ac8b80a..8bd784dc1 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -56,6 +56,7 @@ @@ -24896,10 +25476,10 @@ index 6c686888d..ed79b94fa 100644 freepage: zswap_entry_cache_free(entry); diff --git a/net/Kconfig b/net/Kconfig -index 228dfa382..bc8d01996 100644 +index 4bef62b4c..490db7aef 100644 --- a/net/Kconfig +++ b/net/Kconfig -@@ -275,7 +275,7 @@ config CGROUP_NET_CLASSID +@@ -273,7 +273,7 @@ config CGROUP_NET_CLASSID config NET_RX_BUSY_POLL bool @@ -24940,7 +25520,7 @@ index c044ff2f7..75bc8102c 100644 if (parent && sock_flag(sk, SOCK_ZAPPED)) { /* We have to drop DLC lock here, otherwise diff --git a/net/core/dev.c b/net/core/dev.c -index 5bc0e5621..01e8d2453 100644 +index 9e258466d..4a6e03e5b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -219,14 +219,14 @@ static inline struct hlist_head *dev_index_hash(struct net *net, int ifindex) @@ -24960,7 +25540,7 @@ index 5bc0e5621..01e8d2453 100644 #endif } -@@ -2723,6 +2723,7 @@ static void __netif_reschedule(struct Qdisc *q) +@@ -2725,6 +2725,7 @@ static void __netif_reschedule(struct Qdisc *q) sd->output_queue_tailp = &q->next_sched; raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_restore(flags); @@ -24968,7 +25548,7 @@ index 5bc0e5621..01e8d2453 100644 } void __netif_schedule(struct Qdisc *q) -@@ -2785,6 +2786,7 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason) +@@ -2787,6 +2788,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); @@ -24976,7 +25556,7 @@ index 5bc0e5621..01e8d2453 100644 } EXPORT_SYMBOL(__dev_kfree_skb_irq); -@@ -3468,7 +3470,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, +@@ -3470,7 +3472,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, * This permits qdisc->running owner to get the lock more * often and dequeue packets faster. */ @@ -24988,7 +25568,7 @@ index 5bc0e5621..01e8d2453 100644 if (unlikely(contended)) spin_lock(&q->busylock); -@@ -3829,10 +3835,14 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) +@@ -3832,10 +3838,14 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) if (dev->flags & IFF_UP) { int cpu = smp_processor_id(); /* ok because BHs are off */ @@ -25003,7 +25583,7 @@ index 5bc0e5621..01e8d2453 100644 if (dev_xmit_recursion()) goto recursion_alert; -@@ -4267,6 +4277,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, +@@ -4272,6 +4282,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, rps_unlock(sd); local_irq_restore(flags); @@ -25011,7 +25591,7 @@ index 5bc0e5621..01e8d2453 100644 atomic_long_inc(&skb->dev->rx_dropped); kfree_skb(skb); -@@ -4481,7 +4492,7 @@ static int netif_rx_internal(struct sk_buff *skb) +@@ -4486,7 +4497,7 @@ static int netif_rx_internal(struct sk_buff *skb) struct rps_dev_flow voidflow, *rflow = &voidflow; int cpu; @@ -25020,7 +25600,7 @@ index 5bc0e5621..01e8d2453 100644 rcu_read_lock(); cpu = get_rps_cpu(skb->dev, skb, &rflow); -@@ -4491,14 +4502,14 @@ static int netif_rx_internal(struct sk_buff *skb) +@@ -4496,14 +4507,14 @@ static int netif_rx_internal(struct sk_buff *skb) ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); @@ -25038,7 +25618,7 @@ index 5bc0e5621..01e8d2453 100644 } return ret; } -@@ -4532,11 +4543,9 @@ int netif_rx_ni(struct sk_buff *skb) +@@ -4537,11 +4548,9 @@ int netif_rx_ni(struct sk_buff *skb) trace_netif_rx_ni_entry(skb); @@ -25052,7 +25632,7 @@ index 5bc0e5621..01e8d2453 100644 return err; } -@@ -5817,12 +5826,14 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd) +@@ -5820,12 +5829,14 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd) sd->rps_ipi_list = NULL; local_irq_enable(); @@ -25067,7 +25647,7 @@ index 5bc0e5621..01e8d2453 100644 } static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) -@@ -5852,7 +5863,9 @@ static int process_backlog(struct napi_struct *napi, int quota) +@@ -5855,7 +5866,9 @@ static int process_backlog(struct napi_struct *napi, int quota) while (again) { struct sk_buff *skb; @@ -25077,7 +25657,7 @@ index 5bc0e5621..01e8d2453 100644 rcu_read_lock(); __netif_receive_skb(skb); rcu_read_unlock(); -@@ -5860,9 +5873,9 @@ static int process_backlog(struct napi_struct *napi, int quota) +@@ -5863,9 +5876,9 @@ static int process_backlog(struct napi_struct *napi, int quota) if (++work >= quota) return work; @@ -25088,7 +25668,7 @@ index 5bc0e5621..01e8d2453 100644 rps_lock(sd); if (skb_queue_empty(&sd->input_pkt_queue)) { /* -@@ -5900,6 +5913,7 @@ void __napi_schedule(struct napi_struct *n) +@@ -5903,6 +5916,7 @@ void __napi_schedule(struct napi_struct *n) local_irq_save(flags); ____napi_schedule(this_cpu_ptr(&softnet_data), n); local_irq_restore(flags); @@ -25096,7 +25676,7 @@ index 5bc0e5621..01e8d2453 100644 } EXPORT_SYMBOL(__napi_schedule); -@@ -5936,6 +5950,7 @@ bool napi_schedule_prep(struct napi_struct *n) +@@ -5939,6 +5953,7 @@ bool napi_schedule_prep(struct napi_struct *n) } EXPORT_SYMBOL(napi_schedule_prep); @@ -25104,7 +25684,7 @@ index 5bc0e5621..01e8d2453 100644 /** * __napi_schedule_irqoff - schedule for receive * @n: entry to schedule -@@ -5947,6 +5962,7 @@ void __napi_schedule_irqoff(struct napi_struct *n) +@@ -5950,6 +5965,7 @@ void __napi_schedule_irqoff(struct napi_struct *n) ____napi_schedule(this_cpu_ptr(&softnet_data), n); } EXPORT_SYMBOL(__napi_schedule_irqoff); @@ -25112,29 +25692,27 @@ index 5bc0e5621..01e8d2453 100644 bool napi_complete_done(struct napi_struct *n, int work_done) { -@@ -6327,13 +6343,21 @@ static __latent_entropy void net_rx_action(struct softirq_action *h) +@@ -6330,13 +6346,17 @@ static __latent_entropy void net_rx_action(struct softirq_action *h) unsigned long time_limit = jiffies + - usecs_to_jiffies(netdev_budget_usecs); - int budget = netdev_budget; -+ struct sk_buff_head tofree_q; + usecs_to_jiffies(READ_ONCE(netdev_budget_usecs)); + int budget = READ_ONCE(netdev_budget); ++ struct sk_buff_head tofree_q; + struct sk_buff *skb; LIST_HEAD(list); LIST_HEAD(repoll); - -+ __skb_queue_head_init(&tofree_q); -+ +- ++ __skb_queue_head_init(&tofree_q); local_irq_disable(); -+ skb_queue_splice_init(&sd->tofree_queue, &tofree_q); ++ skb_queue_splice_init(&sd->tofree_queue, &tofree_q); list_splice_init(&sd->poll_list, &list); local_irq_enable(); - -+ while ((skb = __skb_dequeue(&tofree_q))) +- ++ while ((skb = __skb_dequeue(&tofree_q))) + kfree_skb(skb); -+ for (;;) { struct napi_struct *n; -@@ -6363,7 +6387,7 @@ static __latent_entropy void net_rx_action(struct softirq_action *h) +@@ -6366,7 +6386,7 @@ static __latent_entropy 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)) @@ -25143,7 +25721,7 @@ index 5bc0e5621..01e8d2453 100644 net_rps_action_and_irq_enable(sd); out: -@@ -8570,7 +8594,7 @@ static void netdev_init_one_queue(struct net_device *dev, +@@ -8573,7 +8593,7 @@ static void netdev_init_one_queue(struct net_device *dev, /* Initialize queue lock */ spin_lock_init(&queue->_xmit_lock); netdev_set_xmit_lockdep_class(&queue->_xmit_lock, dev->type); @@ -25152,7 +25730,7 @@ index 5bc0e5621..01e8d2453 100644 netdev_queue_numa_node_write(queue, NUMA_NO_NODE); queue->dev = dev; #ifdef CONFIG_BQL -@@ -9517,6 +9541,7 @@ static int dev_cpu_dead(unsigned int oldcpu) +@@ -9518,6 +9538,7 @@ static int dev_cpu_dead(unsigned int oldcpu) raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); @@ -25160,7 +25738,7 @@ index 5bc0e5621..01e8d2453 100644 #ifdef CONFIG_RPS remsd = oldsd->rps_ipi_list; -@@ -9530,10 +9555,13 @@ static int dev_cpu_dead(unsigned int oldcpu) +@@ -9531,10 +9552,13 @@ static int dev_cpu_dead(unsigned int oldcpu) netif_rx_ni(skb); input_queue_head_incr(oldsd); } @@ -25175,7 +25753,7 @@ index 5bc0e5621..01e8d2453 100644 return 0; } -@@ -9844,8 +9872,9 @@ static int __init net_dev_init(void) +@@ -9845,8 +9869,9 @@ static int __init net_dev_init(void) INIT_WORK(flush, flush_backlog); @@ -25276,7 +25854,7 @@ index 092fa3d75..9d472d626 100644 set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS); diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index e1daab49b..dc637cefc 100644 +index b7314a6cf..d3706fa45 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -63,6 +63,7 @@ @@ -25407,7 +25985,7 @@ index e1daab49b..dc637cefc 100644 void __kfree_skb_defer(struct sk_buff *skb) { diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c -index 8d68298b0..f1b82db62 100644 +index a4f838ec7..d6da6f7af 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -77,6 +77,7 @@ @@ -25453,7 +26031,7 @@ index 8d68298b0..f1b82db62 100644 int sysctl_icmp_msgs_per_sec __read_mostly = 1000; diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c -index f1ad62ad5..11ec432ed 100644 +index dc59bd34e..c63275a1c 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -62,6 +62,7 @@ @@ -25505,7 +26083,7 @@ index f1ad62ad5..11ec432ed 100644 } diff --git a/net/netfilter/core.c b/net/netfilter/core.c -index 3f0bdc728..2c6978d88 100644 +index b6ea30116..d399282b0 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c @@ -20,6 +20,7 @@ @@ -25529,7 +26107,7 @@ index 3f0bdc728..2c6978d88 100644 EXPORT_SYMBOL_GPL(nf_ipv6_ops); diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c -index fbf7d5ef8..b22fc95e0 100644 +index 4e3766a72..a2e3010a6 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -63,6 +63,7 @@ @@ -25540,7 +26118,7 @@ index fbf7d5ef8..b22fc95e0 100644 #include #include #include -@@ -668,7 +669,7 @@ static void prb_retire_rx_blk_timer_expired(struct timer_list *t) +@@ -672,7 +673,7 @@ static void prb_retire_rx_blk_timer_expired(struct timer_list *t) if (BLOCK_NUM_PKTS(pbd)) { while (atomic_read(&pkc->blk_fill_in_prog)) { /* Waiting for skb_copy_bits to finish... */ @@ -25549,7 +26127,7 @@ index fbf7d5ef8..b22fc95e0 100644 } } -@@ -930,7 +931,7 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc, +@@ -934,7 +935,7 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc, if (!(status & TP_STATUS_BLK_TMO)) { while (atomic_read(&pkc->blk_fill_in_prog)) { /* Waiting for skb_copy_bits to finish... */ @@ -25580,10 +26158,10 @@ index 0b347f46b..f395f0603 100644 } diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c -index 2c9aa5507..0e6f03129 100644 +index 27166a482..6c347a64b 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -1173,7 +1173,7 @@ static struct Qdisc *qdisc_create(struct net_device *dev, +@@ -1195,7 +1195,7 @@ static struct Qdisc *qdisc_create(struct net_device *dev, rcu_assign_pointer(sch->stab, stab); } if (tca[TCA_RATE]) { @@ -25593,7 +26171,7 @@ index 2c9aa5507..0e6f03129 100644 err = -EOPNOTSUPP; if (sch->flags & TCQ_F_MQROOT) { diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c -index c2276a3c9..bcb82fa3c 100644 +index 64ae84bea..1f1c2d20f 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -571,7 +571,11 @@ struct Qdisc noop_qdisc = { @@ -25626,7 +26204,7 @@ index c2276a3c9..bcb82fa3c 100644 sch->ops = ops; sch->flags = ops->static_flags; -@@ -1220,7 +1232,7 @@ void dev_deactivate_many(struct list_head *head) +@@ -1227,7 +1239,7 @@ void dev_deactivate_many(struct list_head *head) /* Wait for outstanding qdisc_run calls. */ list_for_each_entry(dev, head, close_list) { while (some_qdisc_is_busy(dev)) @@ -25658,7 +26236,7 @@ index 0ab649e02..a6b8ba031 100644 } EXPORT_SYMBOL_GPL(svc_xprt_do_enqueue); diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c -index a00ec715a..a97997385 100644 +index 32aed1d0f..2fb55dba4 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -20,6 +20,7 @@ @@ -25858,7 +26436,7 @@ index 0f8cfc95a..767894d24 100644 vtimer->irq.irq = default_vtimer_irq.irq; diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c -index 127177987..0948a646e 100644 +index 0ab79ed49..c747f38ed 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -809,7 +809,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) @@ -25888,3 +26466,6 @@ index 127177987..0948a646e 100644 ret = handle_exit(vcpu, run, ret); update_vcpu_stat_time(&vcpu->stat); +-- +2.33.0 +