diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2019-04-09 00:49:20 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-04-09 00:53:38 +0100 |
commit | a0366b7dd12397f3661a6bd95ad6f19b3513ab66 (patch) | |
tree | fb35dcf7837bea8f5b40c7d2bba51d7e261d6778 /debian | |
parent | 6fa9d663788cb32abc32c6f96735cbe211c2ca2e (diff) | |
download | linux-debian-a0366b7dd12397f3661a6bd95ad6f19b3513ab66.tar.gz |
[rt] Update to 4.19.31-rt18
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch | 13 | ||||
-rw-r--r-- | debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch | 25 | ||||
-rw-r--r-- | debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch | 24 | ||||
-rw-r--r-- | debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch | 14 | ||||
-rw-r--r-- | debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch | 12 | ||||
-rw-r--r-- | debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch | 16 | ||||
-rw-r--r-- | debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch | 16 | ||||
-rw-r--r-- | debian/patches-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch (renamed from debian/patches-rt/irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch) | 32 | ||||
-rw-r--r-- | debian/patches-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch (renamed from debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch) | 40 | ||||
-rw-r--r-- | debian/patches-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch (renamed from debian/patches-rt/crypto-caam-qi-simplify-CGR-allocation-freeing.patch) | 34 | ||||
-rw-r--r-- | debian/patches-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch (renamed from debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch) | 26 | ||||
-rw-r--r-- | debian/patches-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch (renamed from debian/patches-rt/arm-convert-boot-lock-to-raw.patch) | 100 | ||||
-rw-r--r-- | debian/patches-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch (renamed from debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch) | 20 | ||||
-rw-r--r-- | debian/patches-rt/0014-arm-kprobe-replace-patch_lock-to-raw-lock.patch (renamed from debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0016-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch (renamed from debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0017-fscache-initialize-cookie-hash-table-raw-spinlocks.patch (renamed from debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0018-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch (renamed from debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0019-percpu-include-irqflags.h-for-raw_local_irq_save.patch (renamed from debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0020-efi-Allow-efi-runtime.patch (renamed from debian/patches-rt/efi-Allow-efi-runtime.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0021-x86-efi-drop-task_lock-from-efi_switch_mm.patch (renamed from debian/patches-rt/x86-efi-drop-task_lock-from-efi_switch_mm.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0022-arm64-KVM-compute_layout-before-altenates-are-applie.patch (renamed from debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch) | 29 | ||||
-rw-r--r-- | debian/patches-rt/0023-of-allocate-free-phandle-cache-outside-of-the-devtre.patch (renamed from debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch) | 13 | ||||
-rw-r--r-- | debian/patches-rt/0024-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch (renamed from debian/patches-rt/mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0025-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch (renamed from debian/patches-rt/EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch) | 19 | ||||
-rw-r--r-- | debian/patches-rt/0026-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch (renamed from debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch) | 27 | ||||
-rw-r--r-- | debian/patches-rt/0027-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch (renamed from debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch) | 44 | ||||
-rw-r--r-- | debian/patches-rt/0028-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch (renamed from debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch) | 199 | ||||
-rw-r--r-- | debian/patches-rt/0029-kernel-sched-core-add-migrate_disable.patch (renamed from debian/patches-rt/add_migrate_disable.patch) | 38 | ||||
-rw-r--r-- | debian/patches-rt/0030-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch (renamed from debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0031-arm-at91-do-not-disable-enable-clocks-in-a-row.patch (renamed from debian/patches-rt/at91_dont_enable_disable_clock.patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0032-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch (renamed from debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch) | 34 | ||||
-rw-r--r-- | debian/patches-rt/0033-timekeeping-Split-jiffies-seqlock.patch (renamed from debian/patches-rt/timekeeping-split-jiffies-lock.patch) | 40 | ||||
-rw-r--r-- | debian/patches-rt/0034-signal-Revert-ptrace-preempt-magic.patch (renamed from debian/patches-rt/signal-revert-ptrace-preempt-magic.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0035-net-sched-Use-msleep-instead-of-yield.patch (renamed from debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0036-dm-rq-remove-BUG_ON-irqs_disabled-check.patch (renamed from debian/patches-rt/dm-rq-remove-BUG_ON-irqs_disabled-check.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0037-usb-do-no-disable-interrupts-in-giveback.patch (renamed from debian/patches-rt/usb-do-not-disable-interrupts-in-giveback.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0038-rt-Provide-PREEMPT_RT_BASE-config-switch.patch (renamed from debian/patches-rt/rt-preempt-base-config.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0039-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch (renamed from debian/patches-rt/cpumask-disable-offstack-on-rt.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0040-jump-label-disable-if-stop_machine-is-used.patch (renamed from debian/patches-rt/jump-label-rt.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0041-kconfig-Disable-config-options-which-are-not-RT-comp.patch (renamed from debian/patches-rt/kconfig-disable-a-few-options-rt.patch) | 17 | ||||
-rw-r--r-- | debian/patches-rt/0042-lockdep-disable-self-test.patch (renamed from debian/patches-rt/lockdep-disable-self-test.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0043-mm-Allow-only-slub-on-RT.patch (renamed from debian/patches-rt/mm-disable-sloub-rt.patch) | 13 | ||||
-rw-r--r-- | debian/patches-rt/0044-locking-Disable-spin-on-owner-for-RT.patch (renamed from debian/patches-rt/mutex-no-spin-on-rt.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0045-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch (renamed from debian/patches-rt/rcu-disable-rcu-fast-no-hz-on-rt.patch) | 13 | ||||
-rw-r--r-- | debian/patches-rt/0046-rcu-make-RCU_BOOST-default-on-RT.patch (renamed from debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0047-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch (renamed from debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0048-net-core-disable-NET_RX_BUSY_POLL.patch (renamed from debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0049-arm-disable-NEON-in-kernel-mode.patch (renamed from debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0050-powerpc-Use-generic-rwsem-on-RT.patch (renamed from debian/patches-rt/power-use-generic-rwsem-on-rt.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0051-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch (renamed from debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch) | 13 | ||||
-rw-r--r-- | debian/patches-rt/0052-powerpc-Disable-highmem-on-RT.patch (renamed from debian/patches-rt/power-disable-highmem-on-rt.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0053-mips-Disable-highmem-on-RT.patch (renamed from debian/patches-rt/mips-disable-highmem-on-rt.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0054-x86-Use-generic-rwsem_spinlocks-on-rt.patch (renamed from debian/patches-rt/x86-use-gen-rwsem-spinlocks-rt.patch) | 13 | ||||
-rw-r--r-- | debian/patches-rt/0055-leds-trigger-disable-CPU-trigger-on-RT.patch (renamed from debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0056-cpufreq-drop-K8-s-driver-from-beeing-selected.patch (renamed from debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0057-md-disable-bcache.patch (renamed from debian/patches-rt/md-disable-bcache.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0058-efi-Disable-runtime-services-on-RT.patch (renamed from debian/patches-rt/efi-Disable-runtime-services-on-RT.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0059-printk-Add-a-printk-kill-switch.patch (renamed from debian/patches-rt/printk-kill.patch) | 30 | ||||
-rw-r--r-- | debian/patches-rt/0060-printk-Add-force_early_printk-boot-param-to-help-wit.patch (renamed from debian/patches-rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch) | 17 | ||||
-rw-r--r-- | debian/patches-rt/0061-preempt-Provide-preempt_-_-no-rt-variants.patch (renamed from debian/patches-rt/preempt-nort-rt-variants.patch) | 13 | ||||
-rw-r--r-- | debian/patches-rt/0062-futex-workaround-migrate_disable-enable-in-different.patch (renamed from debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch) | 19 | ||||
-rw-r--r-- | debian/patches-rt/0063-rt-Add-local-irq-locks.patch (renamed from debian/patches-rt/rt-local-irq-lock.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0064-locallock-provide-get-put-_locked_ptr-variants.patch (renamed from debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0065-mm-scatterlist-Do-not-disable-irqs-on-RT.patch (renamed from debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0066-signal-x86-Delay-calling-signals-in-atomic.patch (renamed from debian/patches-rt/oleg-signal-rt-fix.patch) | 31 | ||||
-rw-r--r-- | debian/patches-rt/0067-x86-signal-delay-calling-signals-on-32bit.patch (renamed from debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0068-buffer_head-Replace-bh_uptodate_lock-for-rt.patch (renamed from debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch) | 46 | ||||
-rw-r--r-- | debian/patches-rt/0069-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch (renamed from debian/patches-rt/fs-jbd-replace-bh_state-lock.patch) | 21 | ||||
-rw-r--r-- | debian/patches-rt/0070-list_bl-Make-list-head-locking-RT-safe.patch (renamed from debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0071-list_bl-fixup-bogus-lockdep-warning.patch (renamed from debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0072-genirq-Disable-irqpoll-on-rt.patch (renamed from debian/patches-rt/genirq-disable-irqpoll-on-rt.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0073-genirq-Force-interrupt-thread-on-RT.patch (renamed from debian/patches-rt/genirq-force-threading.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0074-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch (renamed from debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch) | 28 | ||||
-rw-r--r-- | debian/patches-rt/0075-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch (renamed from debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch) | 32 | ||||
-rw-r--r-- | debian/patches-rt/0076-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch (renamed from debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch) | 126 | ||||
-rw-r--r-- | debian/patches-rt/0077-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch (renamed from debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch) | 42 | ||||
-rw-r--r-- | debian/patches-rt/0078-mm-page_alloc-rt-friendly-per-cpu-pages.patch (renamed from debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch) | 36 | ||||
-rw-r--r-- | debian/patches-rt/0079-mm-swap-Convert-to-percpu-locked.patch (renamed from debian/patches-rt/mm-convert-swap-to-percpu-locked.patch) | 49 | ||||
-rw-r--r-- | debian/patches-rt/0080-mm-perform-lru_add_drain_all-remotely.patch (renamed from debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch) | 30 | ||||
-rw-r--r-- | debian/patches-rt/0081-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch (renamed from debian/patches-rt/mm-make-vmstat-rt-aware.patch) | 46 | ||||
-rw-r--r-- | debian/patches-rt/0082-ARM-Initialize-split-page-table-locks-for-vector-pag.patch (renamed from debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0083-mm-Enable-SLUB-for-RT.patch (renamed from debian/patches-rt/mm-enable-slub.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0084-slub-Enable-irqs-for-__GFP_WAIT.patch (renamed from debian/patches-rt/slub-enable-irqs-for-no-wait.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0085-slub-Disable-SLUB_CPU_PARTIAL.patch (renamed from debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0086-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch (renamed from debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0087-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch (renamed from debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch) | 27 | ||||
-rw-r--r-- | debian/patches-rt/0088-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch (renamed from debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch) | 26 | ||||
-rw-r--r-- | debian/patches-rt/0089-x86-mm-pat-disable-preemption-__split_large_page-aft.patch (renamed from debian/patches-rt/x86-mm-pat-disable-preemption-__split_large_page-aft.patch) | 25 | ||||
-rw-r--r-- | debian/patches-rt/0090-radix-tree-use-local-locks.patch (renamed from debian/patches-rt/radix-tree-use-local-locks.patch) | 38 | ||||
-rw-r--r-- | debian/patches-rt/0091-timers-Prepare-for-full-preemption.patch (renamed from debian/patches-rt/timers-prepare-for-full-preemption.patch) | 39 | ||||
-rw-r--r-- | debian/patches-rt/0092-x86-kvm-Require-const-tsc-for-RT.patch (renamed from debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0093-pci-switchtec-Don-t-use-completion-s-wait-queue.patch (renamed from debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch) | 26 | ||||
-rw-r--r-- | debian/patches-rt/0094-wait.h-include-atomic.h.patch (renamed from debian/patches-rt/wait.h-include-atomic.h.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0095-work-simple-Simple-work-queue-implemenation.patch (renamed from debian/patches-rt/work-simple-Simple-work-queue-implemenation.patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0096-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch (renamed from debian/patches-rt/work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch) | 13 | ||||
-rw-r--r-- | debian/patches-rt/0097-completion-Use-simple-wait-queues.patch (renamed from debian/patches-rt/completion-use-simple-wait-queues.patch) | 88 | ||||
-rw-r--r-- | debian/patches-rt/0098-fs-aio-simple-simple-work.patch (renamed from debian/patches-rt/fs-aio-simple-simple-work.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0099-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch (renamed from debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch) | 25 | ||||
-rw-r--r-- | debian/patches-rt/0100-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch (renamed from debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch) | 19 | ||||
-rw-r--r-- | debian/patches-rt/0101-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch (renamed from debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch) | 69 | ||||
-rw-r--r-- | debian/patches-rt/0102-hrtimers-Prepare-full-preemption.patch (renamed from debian/patches-rt/hrtimers-prepare-full-preemption.patch) | 67 | ||||
-rw-r--r-- | debian/patches-rt/0103-hrtimer-by-timers-by-default-into-the-softirq-contex.patch (renamed from debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch) | 77 | ||||
-rw-r--r-- | debian/patches-rt/0104-sched-fair-Make-the-hrtimers-non-hard-again.patch (renamed from debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0105-hrtimer-Move-schedule_work-call-to-helper-thread.patch (renamed from debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0106-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch (renamed from debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0107-posix-timers-Thread-posix-cpu-timers-on-rt.patch (renamed from debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch) | 33 | ||||
-rw-r--r-- | debian/patches-rt/0108-sched-Move-task_struct-cleanup-to-RCU.patch (renamed from debian/patches-rt/sched-delay-put-task.patch) | 26 | ||||
-rw-r--r-- | debian/patches-rt/0109-sched-Limit-the-number-of-task-migrations-per-batch.patch (renamed from debian/patches-rt/sched-limit-nr-migrate.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0110-sched-Move-mmdrop-to-RCU-on-RT.patch (renamed from debian/patches-rt/sched-mmdrop-delayed.patch) | 36 | ||||
-rw-r--r-- | debian/patches-rt/0111-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch (renamed from debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch) | 20 | ||||
-rw-r--r-- | debian/patches-rt/0112-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch (renamed from debian/patches-rt/sched-rt-mutex-wakeup.patch) | 29 | ||||
-rw-r--r-- | debian/patches-rt/0113-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch (renamed from debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch) | 23 | ||||
-rw-r--r-- | debian/patches-rt/0114-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch (renamed from debian/patches-rt/cond-resched-lock-rt-tweak.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0115-sched-Disable-TTWU_QUEUE-on-RT.patch (renamed from debian/patches-rt/sched-disable-ttwu-queue.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0116-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch (renamed from debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0117-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch (renamed from debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch) | 19 | ||||
-rw-r--r-- | debian/patches-rt/0118-hotplug-Lightweight-get-online-cpus.patch (renamed from debian/patches-rt/hotplug-light-get-online-cpus.patch) | 26 | ||||
-rw-r--r-- | debian/patches-rt/0119-trace-Add-migrate-disabled-counter-to-tracing-output.patch (renamed from debian/patches-rt/ftrace-migrate-disable-tracing.patch) | 32 | ||||
-rw-r--r-- | debian/patches-rt/0120-lockdep-Make-it-RT-aware.patch (renamed from debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch) | 28 | ||||
-rw-r--r-- | debian/patches-rt/0121-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch (renamed from debian/patches-rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch) | 42 | ||||
-rw-r--r-- | debian/patches-rt/0122-softirq-Check-preemption-after-reenabling-interrupts.patch (renamed from debian/patches-rt/softirq-preempt-fix-3-re.patch) | 53 | ||||
-rw-r--r-- | debian/patches-rt/0123-softirq-Disable-softirq-stacks-for-RT.patch (renamed from debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch) | 48 | ||||
-rw-r--r-- | debian/patches-rt/0124-softirq-Split-softirq-locks.patch (renamed from debian/patches-rt/softirq-split-locks.patch) | 66 | ||||
-rw-r--r-- | debian/patches-rt/0125-net-core-use-local_bh_disable-in-netif_rx_ni.patch (renamed from debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0126-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch (renamed from debian/patches-rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch) | 36 | ||||
-rw-r--r-- | debian/patches-rt/0127-softirq-split-timer-softirqs-out-of-ksoftirqd.patch (renamed from debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch) | 27 | ||||
-rw-r--r-- | debian/patches-rt/0128-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch (renamed from debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-ksof.patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0129-softirq-Avoid-local_softirq_pending-messages-if-task.patch (renamed from debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-task.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0130-rtmutex-trylock-is-okay-on-RT.patch (renamed from debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0131-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch (renamed from debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch) | 36 | ||||
-rw-r--r-- | debian/patches-rt/0132-rtmutex-Handle-the-various-new-futex-race-conditions.patch (renamed from debian/patches-rt/rtmutex-futex-prepare-rt.patch) | 46 | ||||
-rw-r--r-- | debian/patches-rt/0133-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch (renamed from debian/patches-rt/futex-requeue-pi-fix.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0134-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch (renamed from debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0135-pid.h-include-atomic.h.patch (renamed from debian/patches-rt/pid.h-include-atomic.h.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0136-arm-include-definition-for-cpumask_t.patch (renamed from debian/patches-rt/arm-include-definition-for-cpumask_t.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0137-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch (renamed from debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch) | 13 | ||||
-rw-r--r-- | debian/patches-rt/0138-rtmutex-Add-rtmutex_lock_killable.patch (renamed from debian/patches-rt/rtmutex-lock-killable.patch) | 28 | ||||
-rw-r--r-- | debian/patches-rt/0139-rtmutex-Make-lock_killable-work.patch (renamed from debian/patches-rt/rtmutex-Make-lock_killable-work.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0140-spinlock-Split-the-lock-types-header.patch (renamed from debian/patches-rt/spinlock-types-separate-raw.patch) | 28 | ||||
-rw-r--r-- | debian/patches-rt/0141-rtmutex-Avoid-include-hell.patch (renamed from debian/patches-rt/rtmutex-avoid-include-hell.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0142-rbtree-don-t-include-the-rcu-header.patch (renamed from debian/patches-rt/rtmutex_dont_include_rcu.patch) | 34 | ||||
-rw-r--r-- | debian/patches-rt/0143-rtmutex-Provide-rt_mutex_slowlock_locked.patch (renamed from debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0144-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch (renamed from debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch) | 30 | ||||
-rw-r--r-- | debian/patches-rt/0145-rtmutex-add-sleeping-lock-implementation.patch (renamed from debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch) | 118 | ||||
-rw-r--r-- | debian/patches-rt/0146-rtmutex-add-mutex-implementation-based-on-rtmutex.patch (renamed from debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0147-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch (renamed from debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0148-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch (renamed from debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch) | 23 | ||||
-rw-r--r-- | debian/patches-rt/0149-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch (renamed from debian/patches-rt/rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0150-rtmutex-wire-up-RT-s-locking.patch (renamed from debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch) | 66 | ||||
-rw-r--r-- | debian/patches-rt/0151-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch (renamed from debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch) | 48 | ||||
-rw-r--r-- | debian/patches-rt/0152-kconfig-Add-PREEMPT_RT_FULL.patch (renamed from debian/patches-rt/kconfig-preempt-rt-full.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0153-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch (renamed from debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch) | 17 | ||||
-rw-r--r-- | debian/patches-rt/0154-locking-rt-mutex-Flush-block-plug-on-__down_read.patch (renamed from debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0155-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch (renamed from debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0156-ptrace-fix-ptrace-vs-tasklist_lock-race.patch (renamed from debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch) | 30 | ||||
-rw-r--r-- | debian/patches-rt/0157-rtmutex-annotate-sleeping-lock-context.patch (renamed from debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch) | 58 | ||||
-rw-r--r-- | debian/patches-rt/0158-sched-migrate_disable-fallback-to-preempt_disable-in.patch (renamed from debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch) | 40 | ||||
-rw-r--r-- | debian/patches-rt/0159-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch (renamed from debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch) | 50 | ||||
-rw-r--r-- | debian/patches-rt/0160-rcu-Frob-softirq-test.patch (renamed from debian/patches-rt/peter_zijlstra-frob-rcu.patch) | 40 | ||||
-rw-r--r-- | debian/patches-rt/0161-rcu-Merge-RCU-bh-into-RCU-preempt.patch (renamed from debian/patches-rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch) | 77 | ||||
-rw-r--r-- | debian/patches-rt/0162-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch (renamed from debian/patches-rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch) | 25 | ||||
-rw-r--r-- | debian/patches-rt/0163-rcu-Eliminate-softirq-processing-from-rcutree.patch (renamed from debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch) | 75 | ||||
-rw-r--r-- | debian/patches-rt/0164-srcu-use-cpu_online-instead-custom-check.patch (renamed from debian/patches-rt/srcu-use-cpu_online-instead-custom-check.patch) | 30 | ||||
-rw-r--r-- | debian/patches-rt/0165-srcu-replace-local_irqsave-with-a-locallock.patch (renamed from debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch) | 20 | ||||
-rw-r--r-- | debian/patches-rt/0166-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch (renamed from debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0167-tty-serial-omap-Make-the-locking-RT-aware.patch (renamed from debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0168-tty-serial-pl011-Make-the-locking-work-on-RT.patch (renamed from debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0169-tty-serial-pl011-explicitly-initialize-the-flags-var.patch (renamed from debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0170-rt-Improve-the-serial-console-PASS_LIMIT.patch (renamed from debian/patches-rt/rt-serial-warn-fix.patch) | 19 | ||||
-rw-r--r-- | debian/patches-rt/0171-tty-serial-8250-don-t-take-the-trylock-during-oops.patch (renamed from debian/patches-rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0172-locking-percpu-rwsem-Remove-preempt_disable-variants.patch (renamed from debian/patches-rt/peterz-percpu-rwsem-rt.patch) | 51 | ||||
-rw-r--r-- | debian/patches-rt/0173-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch (renamed from debian/patches-rt/mm-protect-activate-switch-mm.patch) | 19 | ||||
-rw-r--r-- | debian/patches-rt/0174-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch (renamed from debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch) | 17 | ||||
-rw-r--r-- | debian/patches-rt/0175-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch (renamed from debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch) | 39 | ||||
-rw-r--r-- | debian/patches-rt/0176-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch (renamed from debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0177-thermal-Defer-thermal-wakups-to-threads.patch (renamed from debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0178-x86-fpu-Disable-preemption-around-local_bh_disable.patch (renamed from debian/patches-rt/x86-fpu-Disable-preemption-around-local_bh_disable.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0179-fs-epoll-Do-not-disable-preemption-on-RT.patch (renamed from debian/patches-rt/epoll-use-get-cpu-light.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0180-mm-vmalloc-Another-preempt-disable-region-which-suck.patch (renamed from debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch) | 23 | ||||
-rw-r--r-- | debian/patches-rt/0181-block-mq-use-cpu_light.patch (renamed from debian/patches-rt/block-mq-use-cpu_light.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0182-block-mq-do-not-invoke-preempt_disable.patch (renamed from debian/patches-rt/block-mq-drop-preempt-disable.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0183-block-mq-don-t-complete-requests-via-IPI.patch (renamed from debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch) | 34 | ||||
-rw-r--r-- | debian/patches-rt/0184-md-raid5-Make-raid5_percpu-handling-RT-aware.patch (renamed from debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch) | 25 | ||||
-rw-r--r-- | debian/patches-rt/0185-rt-Introduce-cpu_chill.patch (renamed from debian/patches-rt/rt-introduce-cpu-chill.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0186-hrtimer-Don-t-lose-state-in-cpu_chill.patch (renamed from debian/patches-rt/hrtimer-Don-t-lose-state-in-cpu_chill.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0187-hrtimer-cpu_chill-save-task-state-in-saved_state.patch (renamed from debian/patches-rt/hrtimer-cpu_chill-save-task-state-in-saved_state.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0188-block-blk-mq-move-blk_queue_usage_counter_release-in.patch (renamed from debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch) | 20 | ||||
-rw-r--r-- | debian/patches-rt/0189-block-Use-cpu_chill-for-retry-loops.patch (renamed from debian/patches-rt/block-use-cpu-chill.patch) | 17 | ||||
-rw-r--r-- | debian/patches-rt/0190-fs-dcache-Use-cpu_chill-in-trylock-loops.patch (renamed from debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch) | 21 | ||||
-rw-r--r-- | debian/patches-rt/0191-net-Use-cpu_chill-instead-of-cpu_relax.patch (renamed from debian/patches-rt/net-use-cpu-chill.patch) | 25 | ||||
-rw-r--r-- | debian/patches-rt/0192-fs-dcache-use-swait_queue-instead-of-waitqueue.patch (renamed from debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch) | 76 | ||||
-rw-r--r-- | debian/patches-rt/0193-workqueue-Use-normal-rcu.patch (renamed from debian/patches-rt/workqueue-use-rcu.patch) | 56 | ||||
-rw-r--r-- | debian/patches-rt/0194-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch (renamed from debian/patches-rt/workqueue-use-locallock.patch) | 35 | ||||
-rw-r--r-- | debian/patches-rt/0195-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch (renamed from debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0196-sched-Distangle-worker-accounting-from-rqlock.patch (renamed from debian/patches-rt/workqueue-distangle-from-rq-lock.patch) | 55 | ||||
-rw-r--r-- | debian/patches-rt/0197-debugobjects-Make-RT-aware.patch (renamed from debian/patches-rt/debugobjects-rt.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0198-seqlock-Prevent-rt-starvation.patch (renamed from debian/patches-rt/seqlock-prevent-rt-starvation.patch) | 30 | ||||
-rw-r--r-- | debian/patches-rt/0199-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch (renamed from debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch) | 17 | ||||
-rw-r--r-- | debian/patches-rt/0200-net-Use-skbufhead-with-raw-lock.patch (renamed from debian/patches-rt/skbufhead-raw-lock.patch) | 36 | ||||
-rw-r--r-- | debian/patches-rt/0201-net-move-xmit_recursion-to-per-task-variable-on-RT.patch (renamed from debian/patches-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch) | 50 | ||||
-rw-r--r-- | debian/patches-rt/0202-net-provide-a-way-to-delegate-processing-a-softirq-t.patch (renamed from debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch) | 32 | ||||
-rw-r--r-- | debian/patches-rt/0203-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch (renamed from debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0204-net-Qdisc-use-a-seqlock-instead-seqcount.patch (renamed from debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch) | 67 | ||||
-rw-r--r-- | debian/patches-rt/0205-net-add-back-the-missing-serialization-in-ip_send_un.patch (renamed from debian/patches-rt/net-add-back-the-missing-serialization-in-ip_send_un.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0206-net-add-a-lock-around-icmp_sk.patch (renamed from debian/patches-rt/net-add-a-lock-around-icmp_sk.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0207-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch (renamed from debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0208-irqwork-push-most-work-into-softirq-context.patch (renamed from debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch) | 52 | ||||
-rw-r--r-- | debian/patches-rt/0209-printk-Make-rt-aware.patch (renamed from debian/patches-rt/printk-rt-aware.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0210-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch (renamed from debian/patches-rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0211-printk-Drop-the-logbuf_lock-more-often.patch (renamed from debian/patches-rt/HACK-printk-drop-the-logbuf_lock-more-often.patch) | 20 | ||||
-rw-r--r-- | debian/patches-rt/0212-ARM-enable-irq-in-translation-section-permission-fau.patch (renamed from debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch) | 20 | ||||
-rw-r--r-- | debian/patches-rt/0213-genirq-update-irq_set_irqchip_state-documentation.patch (renamed from debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0214-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch (renamed from debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch) | 19 | ||||
-rw-r--r-- | debian/patches-rt/0215-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch (renamed from debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch) | 28 | ||||
-rw-r--r-- | debian/patches-rt/0216-kgdb-serial-Short-term-workaround.patch (renamed from debian/patches-rt/kgb-serial-hackaround.patch) | 27 | ||||
-rw-r--r-- | debian/patches-rt/0217-sysfs-Add-sys-kernel-realtime-entry.patch (renamed from debian/patches-rt/sysfs-realtime-entry.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0218-mm-rt-kmap_atomic-scheduling.patch (renamed from debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch) | 56 | ||||
-rw-r--r-- | debian/patches-rt/0219-x86-highmem-Add-a-already-used-pte-check.patch (renamed from debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0220-arm-highmem-Flush-tlb-on-unmap.patch (renamed from debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0221-arm-Enable-highmem-for-rt.patch (renamed from debian/patches-rt/arm-enable-highmem-for-rt.patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0222-scsi-fcoe-Make-RT-aware.patch (renamed from debian/patches-rt/scsi-fcoe-rt-aware.patch) | 34 | ||||
-rw-r--r-- | debian/patches-rt/0223-x86-crypto-Reduce-preempt-disabled-regions.patch (renamed from debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0224-crypto-Reduce-preempt-disabled-regions-more-algos.patch (renamed from debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch) | 52 | ||||
-rw-r--r-- | debian/patches-rt/0225-crypto-limit-more-FPU-enabled-sections.patch (renamed from debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0226-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch (renamed from debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch) | 20 | ||||
-rw-r--r-- | debian/patches-rt/0227-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch (renamed from debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0228-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch (renamed from debian/patches-rt/panic-disable-random-on-rt.patch) | 13 | ||||
-rw-r--r-- | debian/patches-rt/0229-x86-stackprotector-Avoid-random-pool-on-rt.patch (renamed from debian/patches-rt/x86-stackprot-no-random-on-rt.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0230-random-Make-it-work-on-rt.patch (renamed from debian/patches-rt/random-make-it-work-on-rt.patch) | 47 | ||||
-rw-r--r-- | debian/patches-rt/0231-random-avoid-preempt_disable-ed-section.patch (renamed from debian/patches-rt/random-avoid-preempt_disable-ed-section.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0232-cpu-hotplug-Implement-CPU-pinning.patch (renamed from debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0233-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch (renamed from debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0234-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch (renamed from debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0235-net-Remove-preemption-disabling-in-netif_rx.patch (renamed from debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0236-net-Another-local_irq_disable-kmalloc-headache.patch (renamed from debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch) | 16 | ||||
-rw-r--r-- | debian/patches-rt/0237-net-core-protect-users-of-napi_alloc_cache-against-r.patch (renamed from debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch) | 20 | ||||
-rw-r--r-- | debian/patches-rt/0238-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch (renamed from debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0239-net-Add-a-mutex-around-devnet_rename_seq.patch (renamed from debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0240-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch (renamed from debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch) | 17 | ||||
-rw-r--r-- | debian/patches-rt/0241-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch (renamed from debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch) | 33 | ||||
-rw-r--r-- | debian/patches-rt/0242-sched-Add-support-for-lazy-preemption.patch (renamed from debian/patches-rt/preempt-lazy-support.patch) | 116 | ||||
-rw-r--r-- | debian/patches-rt/0243-ftrace-Fix-trace-header-alignment.patch (renamed from debian/patches-rt/ftrace-Fix-trace-header-alignment.patch) | 14 | ||||
-rw-r--r-- | debian/patches-rt/0244-x86-Support-for-lazy-preemption.patch (renamed from debian/patches-rt/x86-preempt-lazy.patch) | 46 | ||||
-rw-r--r-- | debian/patches-rt/0245-x86-lazy-preempt-properly-check-against-preempt-mask.patch (renamed from debian/patches-rt/x86-lazy-preempt-properly-check-against-preempt-mask.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0246-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch (renamed from debian/patches-rt/x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch) | 13 | ||||
-rw-r--r-- | debian/patches-rt/0247-arm-Add-support-for-lazy-preemption.patch (renamed from debian/patches-rt/arm-preempt-lazy-support.patch) | 48 | ||||
-rw-r--r-- | debian/patches-rt/0248-powerpc-Add-support-for-lazy-preemption.patch (renamed from debian/patches-rt/powerpc-preempt-lazy-support.patch) | 52 | ||||
-rw-r--r-- | debian/patches-rt/0249-arch-arm64-Add-lazy-preempt-support.patch (renamed from debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch) | 40 | ||||
-rw-r--r-- | debian/patches-rt/0250-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch (renamed from debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0251-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch (renamed from debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0252-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch (renamed from debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch) | 30 | ||||
-rw-r--r-- | debian/patches-rt/0253-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch (renamed from debian/patches-rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0254-tpm_tis-fix-stall-after-iowrite-s.patch (renamed from debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch) | 18 | ||||
-rw-r--r-- | debian/patches-rt/0255-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch (renamed from debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch) | 20 | ||||
-rw-r--r-- | debian/patches-rt/0256-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch (renamed from debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch) | 25 | ||||
-rw-r--r-- | debian/patches-rt/0257-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch (renamed from debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch) | 24 | ||||
-rw-r--r-- | debian/patches-rt/0258-drm-i915-disable-tracing-on-RT.patch (renamed from debian/patches-rt/drm-i915-disable-tracing-on-RT.patch) | 12 | ||||
-rw-r--r-- | debian/patches-rt/0259-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch (renamed from debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch) | 15 | ||||
-rw-r--r-- | debian/patches-rt/0260-cgroups-use-simple-wait-in-css_release.patch (renamed from debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch) | 22 | ||||
-rw-r--r-- | debian/patches-rt/0261-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch (renamed from debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch) | 44 | ||||
-rw-r--r-- | debian/patches-rt/0262-apparmor-use-a-locallock-instead-preempt_disable.patch (renamed from debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch) | 20 | ||||
-rw-r--r-- | debian/patches-rt/0263-workqueue-Prevent-deadlock-stall-on-RT.patch (renamed from debian/patches-rt/workqueue-prevent-deadlock-stall.patch) | 37 | ||||
-rw-r--r-- | debian/patches-rt/0264-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch (renamed from debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch) | 55 | ||||
-rw-r--r-- | debian/patches-rt/0265-Add-localversion-for-RT-release.patch | 22 | ||||
-rw-r--r-- | debian/patches-rt/0266-Linux-4.19.31-rt18-REBASE.patch | 20 | ||||
-rw-r--r-- | debian/patches-rt/arm-unwind-use_raw_lock.patch | 84 | ||||
-rw-r--r-- | debian/patches-rt/localversion.patch | 14 | ||||
-rw-r--r-- | debian/patches-rt/series | 687 |
269 files changed, 5047 insertions, 2966 deletions
diff --git a/debian/changelog b/debian/changelog index 51c3f943e..b97574924 100644 --- a/debian/changelog +++ b/debian/changelog @@ -795,6 +795,7 @@ linux (4.19.34-1) UNRELEASED; urgency=medium (Closes: #785065) * Bump ABI to 5 * [rt] Add new signing subkey for Steven Rostedt + * [rt] Update to 4.19.31-rt18 (no functional change) -- Ben Hutchings <ben@decadent.org.uk> Mon, 18 Mar 2019 22:50:08 +0000 diff --git a/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch b/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch index b52979fa4..64ed2b1fc 100644 --- a/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch +++ b/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch @@ -1,7 +1,8 @@ +From a65d4f22e9030ffe94b74319c170821fb7bc2a81 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni <alexandre.belloni@bootlin.com> Date: Thu, 13 Sep 2018 13:30:18 +0200 -Subject: [PATCH 1/7] ARM: at91: add TCB registers definitions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 001/266] ARM: at91: add TCB registers definitions +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Add registers and bits definitions for the timer counter blocks found on Atmel ARM SoCs. @@ -11,10 +12,13 @@ Tested-by: Andras Szemzo <szemzo.andras@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/soc/at91/atmel_tcb.h | 183 +++++++++++++++++++++++++++++++++++++++++++ + include/soc/at91/atmel_tcb.h | 183 +++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 include/soc/at91/atmel_tcb.h +diff --git a/include/soc/at91/atmel_tcb.h b/include/soc/at91/atmel_tcb.h +new file mode 100644 +index 000000000000..657e234b1483 --- /dev/null +++ b/include/soc/at91/atmel_tcb.h @@ -0,0 +1,183 @@ @@ -201,3 +205,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +}; + +#endif /* __SOC_ATMEL_TCB_H */ +-- +2.20.1 + diff --git a/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch b/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch index 1165a2663..3463d0d35 100644 --- a/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch +++ b/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch @@ -1,8 +1,9 @@ +From ec74d20d992913ef170482f3ad9afa7ddf59cdf4 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni <alexandre.belloni@bootlin.com> Date: Thu, 13 Sep 2018 13:30:19 +0200 -Subject: [PATCH 2/7] clocksource/drivers: Add a new driver for the Atmel ARM - TC blocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 002/266] clocksource/drivers: Add a new driver for the Atmel + ARM TC blocks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Add a driver for the Atmel Timer Counter Blocks. This driver provides a clocksource and two clockevent devices. @@ -24,15 +25,17 @@ Tested-by: Andras Szemzo <szemzo.andras@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/clocksource/Kconfig | 8 - drivers/clocksource/Makefile | 3 - drivers/clocksource/timer-atmel-tcb.c | 410 ++++++++++++++++++++++++++++++++++ + drivers/clocksource/Kconfig | 8 + + drivers/clocksource/Makefile | 3 +- + drivers/clocksource/timer-atmel-tcb.c | 410 ++++++++++++++++++++++++++ 3 files changed, 420 insertions(+), 1 deletion(-) create mode 100644 drivers/clocksource/timer-atmel-tcb.c +diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig +index c1ddafa4c299..c5a5ad4e22e7 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig -@@ -404,6 +404,14 @@ config ATMEL_ST +@@ -414,6 +414,14 @@ config ATMEL_ST help Support for the Atmel ST timer. @@ -47,6 +50,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> config CLKSRC_EXYNOS_MCT bool "Exynos multi core timer driver" if COMPILE_TEST depends on ARM || ARM64 +diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile +index db51b2427e8a..0df9384a1230 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile @@ -3,7 +3,8 @@ obj-$(CONFIG_TIMER_OF) += timer-of.o @@ -59,6 +64,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o obj-$(CONFIG_SCx200HR_TIMER) += scx200_hrt.o obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC) += cs5535-clockevt.o +diff --git a/drivers/clocksource/timer-atmel-tcb.c b/drivers/clocksource/timer-atmel-tcb.c +new file mode 100644 +index 000000000000..21fbe430f91b --- /dev/null +++ b/drivers/clocksource/timer-atmel-tcb.c @@ -0,0 +1,410 @@ @@ -472,3 +480,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + bits); +} +TIMER_OF_DECLARE(atmel_tcb_clksrc, "atmel,tcb-timer", tcb_clksrc_init); +-- +2.20.1 + diff --git a/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch b/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch index 4f6314b5d..2609db9dd 100644 --- a/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch +++ b/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch @@ -1,8 +1,9 @@ +From f303771b4daf883ace6cfd76268c38b280178d47 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni <alexandre.belloni@bootlin.com> Date: Thu, 13 Sep 2018 13:30:20 +0200 -Subject: [PATCH 3/7] clocksource/drivers: timer-atmel-tcb: add clockevent +Subject: [PATCH 003/266] clocksource/drivers: timer-atmel-tcb: add clockevent device on separate channel -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Add an other clockevent device that uses a separate TCB channel when available. @@ -10,9 +11,11 @@ available. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/clocksource/timer-atmel-tcb.c | 217 +++++++++++++++++++++++++++++++++- + drivers/clocksource/timer-atmel-tcb.c | 217 +++++++++++++++++++++++++- 1 file changed, 212 insertions(+), 5 deletions(-) +diff --git a/drivers/clocksource/timer-atmel-tcb.c b/drivers/clocksource/timer-atmel-tcb.c +index 21fbe430f91b..63ce3b69338a 100644 --- a/drivers/clocksource/timer-atmel-tcb.c +++ b/drivers/clocksource/timer-atmel-tcb.c @@ -32,7 +32,7 @@ struct atmel_tcb_clksrc { @@ -24,10 +27,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static struct clk *tcb_clk_get(struct device_node *node, int channel) { -@@ -48,6 +48,203 @@ static struct clk *tcb_clk_get(struct de +@@ -47,6 +47,203 @@ static struct clk *tcb_clk_get(struct device_node *node, int channel) + return of_clk_get_by_name(node->parent, "t0_clk"); } - /* ++/* + * Clockevent device using its own channel + */ + @@ -224,11 +228,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + return ret; +} + -+/* + /* * Clocksource and clockevent using the same channel(s) */ - static u64 tc_get_cycles(struct clocksource *cs) -@@ -363,7 +560,7 @@ static int __init tcb_clksrc_init(struct +@@ -363,7 +560,7 @@ static int __init tcb_clksrc_init(struct device_node *node) int irq, err, chan1 = -1; unsigned bits; @@ -237,7 +240,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return -ENODEV; /* -@@ -395,12 +592,22 @@ static int __init tcb_clksrc_init(struct +@@ -395,12 +592,22 @@ static int __init tcb_clksrc_init(struct device_node *node) return irq; } @@ -263,3 +266,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } +-- +2.20.1 + diff --git a/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch b/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch index 68b04f759..ac7fb00e6 100644 --- a/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch +++ b/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch @@ -1,7 +1,8 @@ +From 89b749f497d850591d338a05290961a95c9a1e9e Mon Sep 17 00:00:00 2001 From: Alexandre Belloni <alexandre.belloni@bootlin.com> Date: Thu, 13 Sep 2018 13:30:21 +0200 -Subject: [PATCH 4/7] clocksource/drivers: atmel-pit: make option silent -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 004/266] clocksource/drivers: atmel-pit: make option silent +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz To conform with the other option, make the ATMEL_PIT option silent so it can be selected from the platform @@ -10,12 +11,14 @@ Tested-by: Alexander Dahl <ada@thorsis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/clocksource/Kconfig | 5 ++++- + drivers/clocksource/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig +index c5a5ad4e22e7..076aa8184961 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig -@@ -393,8 +393,11 @@ config ARMV7M_SYSTICK +@@ -403,8 +403,11 @@ config ARMV7M_SYSTICK This options enables support for the ARMv7M system timer unit config ATMEL_PIT @@ -28,3 +31,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> config ATMEL_ST bool "Atmel ST timer support" if COMPILE_TEST +-- +2.20.1 + diff --git a/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch b/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch index c0b3a2f3d..8c1690854 100644 --- a/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch +++ b/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch @@ -1,7 +1,8 @@ +From c508ebe2604e0acd904da4940c042924ed2f19a8 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni <alexandre.belloni@bootlin.com> Date: Thu, 13 Sep 2018 13:30:22 +0200 -Subject: [PATCH 5/7] ARM: at91: Implement clocksource selection -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 005/266] ARM: at91: Implement clocksource selection +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Allow selecting and unselecting the PIT clocksource driver so it doesn't have to be compile when unused. @@ -10,9 +11,11 @@ Tested-by: Alexander Dahl <ada@thorsis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm/mach-at91/Kconfig | 25 +++++++++++++++++++++++++ + arch/arm/mach-at91/Kconfig | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) +diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig +index 903f23c309df..fa493a86e2bb 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -107,6 +107,31 @@ config SOC_AT91SAM9 @@ -47,3 +50,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> config HAVE_AT91_UTMI bool +-- +2.20.1 + diff --git a/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch b/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch index ddb783c51..251132bc8 100644 --- a/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch +++ b/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch @@ -1,7 +1,8 @@ +From d8964bb5d00d91ccdd8e3cd971ccb9e13dff91b4 Mon Sep 17 00:00:00 2001 From: Alexandre Belloni <alexandre.belloni@bootlin.com> Date: Thu, 13 Sep 2018 13:30:23 +0200 -Subject: [PATCH 6/7] ARM: configs: at91: use new TCB timer driver -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 006/266] ARM: configs: at91: use new TCB timer driver +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Unselecting ATMEL_TCLIB switches the TCB timer driver from tcb_clksrc to timer-atmel-tcb. @@ -9,10 +10,12 @@ timer-atmel-tcb. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm/configs/at91_dt_defconfig | 1 - - arch/arm/configs/sama5_defconfig | 1 - + arch/arm/configs/at91_dt_defconfig | 1 - + arch/arm/configs/sama5_defconfig | 1 - 2 files changed, 2 deletions(-) +diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig +index e4b1be66b3f5..09f262e59fef 100644 --- a/arch/arm/configs/at91_dt_defconfig +++ b/arch/arm/configs/at91_dt_defconfig @@ -64,7 +64,6 @@ CONFIG_BLK_DEV_LOOP=y @@ -23,6 +26,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> CONFIG_ATMEL_SSC=y CONFIG_SCSI=y CONFIG_BLK_DEV_SD=y +diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig +index 2080025556b5..f2bbc6339ca6 100644 --- a/arch/arm/configs/sama5_defconfig +++ b/arch/arm/configs/sama5_defconfig @@ -75,7 +75,6 @@ CONFIG_BLK_DEV_LOOP=y @@ -33,3 +38,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> CONFIG_ATMEL_SSC=y CONFIG_EEPROM_AT24=y CONFIG_SCSI=y +-- +2.20.1 + diff --git a/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch b/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch index e9d16c60d..936cb86ea 100644 --- a/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch +++ b/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch @@ -1,7 +1,8 @@ +From bc6d50051826beac487e82f8187a8ef8e43f04df Mon Sep 17 00:00:00 2001 From: Alexandre Belloni <alexandre.belloni@bootlin.com> Date: Thu, 13 Sep 2018 13:30:24 +0200 -Subject: [PATCH 7/7] ARM: configs: at91: unselect PIT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 007/266] ARM: configs: at91: unselect PIT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The PIT is not required anymore to successfully boot and may actually harm in case preempt-rt is used because the PIT interrupt is shared. @@ -10,10 +11,12 @@ Disable it so the TCB clocksource is used. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm/configs/at91_dt_defconfig | 1 + - arch/arm/configs/sama5_defconfig | 1 + + arch/arm/configs/at91_dt_defconfig | 1 + + arch/arm/configs/sama5_defconfig | 1 + 2 files changed, 2 insertions(+) +diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig +index 09f262e59fef..f4b253bd05ed 100644 --- a/arch/arm/configs/at91_dt_defconfig +++ b/arch/arm/configs/at91_dt_defconfig @@ -19,6 +19,7 @@ CONFIG_ARCH_MULTI_V5=y @@ -24,6 +27,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> CONFIG_AEABI=y CONFIG_UACCESS_WITH_MEMCPY=y CONFIG_ZBOOT_ROM_TEXT=0x0 +diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig +index f2bbc6339ca6..be92871ab155 100644 --- a/arch/arm/configs/sama5_defconfig +++ b/arch/arm/configs/sama5_defconfig @@ -20,6 +20,7 @@ CONFIG_ARCH_AT91=y @@ -34,3 +39,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> CONFIG_AEABI=y CONFIG_UACCESS_WITH_MEMCPY=y CONFIG_ZBOOT_ROM_TEXT=0x0 +-- +2.20.1 + diff --git a/debian/patches-rt/irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch b/debian/patches-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch index a1cfdb8e6..38e7605a1 100644 --- a/debian/patches-rt/irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch +++ b/debian/patches-rt/0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch @@ -1,16 +1,19 @@ +From 63b24725baf9adfb75e97b162a7ed52025e132bb Mon Sep 17 00:00:00 2001 From: Marc Zyngier <marc.zyngier@arm.com> Date: Fri, 27 Jul 2018 13:38:54 +0100 -Subject: [PATCH] irqchip/gic-v3-its: Move pending table allocation to init - time -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 008/266] irqchip/gic-v3-its: Move pending table allocation to + init time +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/irqchip/irq-gic-v3-its.c | 80 ++++++++++++++++++++++++------------- - include/linux/irqchip/arm-gic-v3.h | 1 + drivers/irqchip/irq-gic-v3-its.c | 80 +++++++++++++++++++----------- + include/linux/irqchip/arm-gic-v3.h | 1 + 2 files changed, 53 insertions(+), 28 deletions(-) +diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c +index 78970cdf2ef6..163cef00a033 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -179,6 +179,7 @@ static DEFINE_RAW_SPINLOCK(vmovp_lock); @@ -21,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define gic_data_rdist_rd_base() (gic_data_rdist()->rd_base) #define gic_data_rdist_vlpi_base() (gic_data_rdist_rd_base() + SZ_128K) -@@ -1628,7 +1629,7 @@ static void its_free_prop_table(struct p +@@ -1631,7 +1632,7 @@ static void its_free_prop_table(struct page *prop_page) get_order(LPI_PROPBASE_SZ)); } @@ -30,8 +33,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { phys_addr_t paddr; -@@ -1951,30 +1952,47 @@ static void its_free_pending_table(struc - get_order(max_t(u32, LPI_PENDBASE_SZ, SZ_64K))); +@@ -1979,30 +1980,47 @@ static u64 its_clear_vpend_valid(void __iomem *vlpi_base) + return val; } -static void its_cpu_init_lpis(void) @@ -93,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* set PROPBASE */ val = (page_to_phys(gic_rdists->prop_page) | GICR_PROPBASER_InnerShareable | -@@ -2026,6 +2044,10 @@ static void its_cpu_init_lpis(void) +@@ -2078,6 +2096,10 @@ static void its_cpu_init_lpis(void) /* Make sure the GIC has seen the above */ dsb(sy); @@ -104,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static void its_cpu_init_collection(struct its_node *its) -@@ -3521,16 +3543,6 @@ static int redist_disable_lpis(void) +@@ -3558,16 +3580,6 @@ static int redist_disable_lpis(void) u64 timeout = USEC_PER_SEC; u64 val; @@ -121,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!gic_rdists_supports_plpis()) { pr_info("CPU%d: LPIs not supported\n", smp_processor_id()); return -ENXIO; -@@ -3540,7 +3552,18 @@ static int redist_disable_lpis(void) +@@ -3577,7 +3589,18 @@ static int redist_disable_lpis(void) if (!(val & GICR_CTLR_ENABLE_LPIS)) return 0; @@ -141,7 +144,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> smp_processor_id()); add_taint(TAINT_CRAP, LOCKDEP_STILL_OK); -@@ -3796,7 +3819,8 @@ int __init its_init(struct fwnode_handle +@@ -3833,7 +3856,8 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, } gic_rdists = rdists; @@ -151,6 +154,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (err) return err; +diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h +index 3188c0bef3e7..5b57501fd2e7 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -585,6 +585,7 @@ struct rdists { @@ -161,3 +166,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } __percpu *rdist; struct page *prop_page; u64 flags; +-- +2.20.1 + diff --git a/debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch b/debian/patches-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch index 718a07415..683753c94 100644 --- a/debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch +++ b/debian/patches-rt/0009-kthread-convert-worker-lock-to-raw-spinlock.patch @@ -1,7 +1,8 @@ +From 67a71e8bdd5bed22f28763f05687dc8afe3d028e Mon Sep 17 00:00:00 2001 From: Julia Cartwright <julia@ni.com> Date: Fri, 28 Sep 2018 21:03:51 +0000 -Subject: [PATCH] kthread: convert worker lock to raw spinlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 009/266] kthread: convert worker lock to raw spinlock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In order to enable the queuing of kthread work items from hardirq context even when PREEMPT_RT_FULL is enabled, convert the worker @@ -17,10 +18,12 @@ Reported-by: Tim Sander <tim@krieglstein.org> Signed-off-by: Julia Cartwright <julia@ni.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/kthread.h | 2 +- - kernel/kthread.c | 42 +++++++++++++++++++++--------------------- + include/linux/kthread.h | 2 +- + kernel/kthread.c | 42 ++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) +diff --git a/include/linux/kthread.h b/include/linux/kthread.h +index c1961761311d..ad292898f7f2 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h @@ -85,7 +85,7 @@ enum { @@ -32,9 +35,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct list_head work_list; struct list_head delayed_work_list; struct task_struct *task; +diff --git a/kernel/kthread.c b/kernel/kthread.c +index 087d18d771b5..5641b55783a6 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c -@@ -599,7 +599,7 @@ void __kthread_init_worker(struct kthrea +@@ -599,7 +599,7 @@ void __kthread_init_worker(struct kthread_worker *worker, struct lock_class_key *key) { memset(worker, 0, sizeof(struct kthread_worker)); @@ -69,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (work) { __set_current_state(TASK_RUNNING); -@@ -812,12 +812,12 @@ bool kthread_queue_work(struct kthread_w +@@ -812,12 +812,12 @@ bool kthread_queue_work(struct kthread_worker *worker, bool ret = false; unsigned long flags; @@ -84,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } EXPORT_SYMBOL_GPL(kthread_queue_work); -@@ -843,7 +843,7 @@ void kthread_delayed_work_timer_fn(struc +@@ -843,7 +843,7 @@ void kthread_delayed_work_timer_fn(struct timer_list *t) if (WARN_ON_ONCE(!worker)) return; @@ -93,7 +98,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Work must not be used with >1 worker, see kthread_queue_work(). */ WARN_ON_ONCE(work->worker != worker); -@@ -852,7 +852,7 @@ void kthread_delayed_work_timer_fn(struc +@@ -852,7 +852,7 @@ void kthread_delayed_work_timer_fn(struct timer_list *t) list_del_init(&work->node); kthread_insert_work(worker, work, &worker->work_list); @@ -102,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL(kthread_delayed_work_timer_fn); -@@ -908,14 +908,14 @@ bool kthread_queue_delayed_work(struct k +@@ -908,14 +908,14 @@ bool kthread_queue_delayed_work(struct kthread_worker *worker, unsigned long flags; bool ret = false; @@ -119,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } EXPORT_SYMBOL_GPL(kthread_queue_delayed_work); -@@ -951,7 +951,7 @@ void kthread_flush_work(struct kthread_w +@@ -951,7 +951,7 @@ void kthread_flush_work(struct kthread_work *work) if (!worker) return; @@ -128,7 +133,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Work must not be used with >1 worker, see kthread_queue_work(). */ WARN_ON_ONCE(work->worker != worker); -@@ -963,7 +963,7 @@ void kthread_flush_work(struct kthread_w +@@ -963,7 +963,7 @@ void kthread_flush_work(struct kthread_work *work) else noop = true; @@ -137,7 +142,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!noop) wait_for_completion(&fwork.done); -@@ -996,9 +996,9 @@ static bool __kthread_cancel_work(struct +@@ -996,9 +996,9 @@ static bool __kthread_cancel_work(struct kthread_work *work, bool is_dwork, * any queuing is blocked by setting the canceling counter. */ work->canceling++; @@ -149,7 +154,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> work->canceling--; } -@@ -1045,7 +1045,7 @@ bool kthread_mod_delayed_work(struct kth +@@ -1045,7 +1045,7 @@ bool kthread_mod_delayed_work(struct kthread_worker *worker, unsigned long flags; int ret = false; @@ -158,7 +163,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Do not bother with canceling when never queued. */ if (!work->worker) -@@ -1062,7 +1062,7 @@ bool kthread_mod_delayed_work(struct kth +@@ -1062,7 +1062,7 @@ bool kthread_mod_delayed_work(struct kthread_worker *worker, fast_queue: __kthread_queue_delayed_work(worker, dwork, delay); out: @@ -167,7 +172,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } EXPORT_SYMBOL_GPL(kthread_mod_delayed_work); -@@ -1076,7 +1076,7 @@ static bool __kthread_cancel_work_sync(s +@@ -1076,7 +1076,7 @@ static bool __kthread_cancel_work_sync(struct kthread_work *work, bool is_dwork) if (!worker) goto out; @@ -176,7 +181,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Work must not be used with >1 worker, see kthread_queue_work(). */ WARN_ON_ONCE(work->worker != worker); -@@ -1090,13 +1090,13 @@ static bool __kthread_cancel_work_sync(s +@@ -1090,13 +1090,13 @@ static bool __kthread_cancel_work_sync(struct kthread_work *work, bool is_dwork) * In the meantime, block any queuing by setting the canceling counter. */ work->canceling++; @@ -193,3 +198,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> out: return ret; } +-- +2.20.1 + diff --git a/debian/patches-rt/crypto-caam-qi-simplify-CGR-allocation-freeing.patch b/debian/patches-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch index d1c41dcfc..0076368fb 100644 --- a/debian/patches-rt/crypto-caam-qi-simplify-CGR-allocation-freeing.patch +++ b/debian/patches-rt/0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch @@ -1,10 +1,11 @@ +From b4cb1ff0cceb0ca014a49e47cb93a112574e6339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horia=20Geant=C4=83?= <horia.geanta@nxp.com> Date: Mon, 8 Oct 2018 14:09:37 +0300 -Subject: [PATCH] crypto: caam/qi - simplify CGR allocation, freeing +Subject: [PATCH 010/266] crypto: caam/qi - simplify CGR allocation, freeing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz [Upstream commit 29e83c757006fd751966bdc53392bb22d74179c6] @@ -23,27 +24,29 @@ Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> --- - drivers/crypto/caam/qi.c | 43 ++++--------------------------------------- - drivers/crypto/caam/qi.h | 2 +- + drivers/crypto/caam/qi.c | 43 ++++------------------------------------ + drivers/crypto/caam/qi.h | 2 +- 2 files changed, 5 insertions(+), 40 deletions(-) +diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c +index 67f7f8c42c93..b84e6c8b1e13 100644 --- a/drivers/crypto/caam/qi.c +++ b/drivers/crypto/caam/qi.c -@@ -84,13 +84,6 @@ static u64 times_congested; +@@ -83,13 +83,6 @@ EXPORT_SYMBOL(caam_congested); + static u64 times_congested; #endif - /* +-/* - * CPU from where the module initialised. This is required because QMan driver - * requires CGRs to be removed from same CPU from where they were originally - * allocated. - */ -static int mod_init_cpu; - --/* + /* * This is a a cache of buffers, from which the users of CAAM QI driver * can allocate short (CAAM_QI_MEMCACHE_SIZE) buffers. It's faster than - * doing malloc on the hotpath. -@@ -492,12 +485,11 @@ void caam_drv_ctx_rel(struct caam_drv_ct +@@ -492,12 +485,11 @@ void caam_drv_ctx_rel(struct caam_drv_ctx *drv_ctx) } EXPORT_SYMBOL(caam_drv_ctx_rel); @@ -58,7 +61,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> for_each_cpu(i, cpus) { struct napi_struct *irqtask; -@@ -510,26 +502,12 @@ int caam_qi_shutdown(struct device *qide +@@ -510,26 +502,12 @@ int caam_qi_shutdown(struct device *qidev) dev_err(qidev, "Rsp FQ kill failed, cpu: %d\n", i); } @@ -87,7 +90,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> } static void cgr_cb(struct qman_portal *qm, struct qman_cgr *cgr, int congested) -@@ -718,22 +696,11 @@ int caam_qi_init(struct platform_device +@@ -718,22 +696,11 @@ int caam_qi_init(struct platform_device *caam_pdev) struct device *ctrldev = &caam_pdev->dev, *qidev; struct caam_drv_private *ctrlpriv; const cpumask_t *cpus = qman_affine_cpus(); @@ -110,7 +113,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> qi_pdev_info.parent = ctrldev; qi_pdev_info.dma_mask = dma_get_mask(ctrldev); qi_pdev = platform_device_register_full(&qi_pdev_info); -@@ -795,8 +762,6 @@ int caam_qi_init(struct platform_device +@@ -795,8 +762,6 @@ int caam_qi_init(struct platform_device *caam_pdev) return -ENOMEM; } @@ -119,9 +122,11 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> #ifdef CONFIG_DEBUG_FS debugfs_create_file("qi_congested", 0444, ctrlpriv->ctl, ×_congested, &caam_fops_u64_ro); +diff --git a/drivers/crypto/caam/qi.h b/drivers/crypto/caam/qi.h +index 357b69f57072..b6c8acc30853 100644 --- a/drivers/crypto/caam/qi.h +++ b/drivers/crypto/caam/qi.h -@@ -174,7 +174,7 @@ int caam_drv_ctx_update(struct caam_drv_ +@@ -174,7 +174,7 @@ int caam_drv_ctx_update(struct caam_drv_ctx *drv_ctx, u32 *sh_desc); void caam_drv_ctx_rel(struct caam_drv_ctx *drv_ctx); int caam_qi_init(struct platform_device *pdev); @@ -130,3 +135,6 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> /** * qi_cache_alloc - Allocate buffers from CAAM-QI cache +-- +2.20.1 + diff --git a/debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch b/debian/patches-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch index 1d5acef09..7cc3a1e08 100644 --- a/debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch +++ b/debian/patches-rt/0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch @@ -1,7 +1,8 @@ +From a4524b7d31b9a9d9a25b35af08ee65b73d214893 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra <peterz@infradead.org> Date: Mon, 7 Jan 2019 13:52:31 +0100 -Subject: [PATCH] sched/fair: Robustify CFS-bandwidth timer locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 011/266] sched/fair: Robustify CFS-bandwidth timer locking +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Traditionally hrtimer callbacks were run with IRQs disabled, but with the introduction of HRTIMER_MODE_SOFT it is possible they run from @@ -25,12 +26,14 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20190107125231.GE14122@hirez.programming.kicks-ass.net Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/sched/fair.c | 30 ++++++++++++++++-------------- + kernel/sched/fair.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index f7c375d1e601..6afda059e882 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4553,7 +4553,7 @@ static u64 distribute_cfs_runtime(struct +@@ -4553,7 +4553,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, struct rq *rq = rq_of(cfs_rq); struct rq_flags rf; @@ -39,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!cfs_rq_throttled(cfs_rq)) goto next; -@@ -4570,7 +4570,7 @@ static u64 distribute_cfs_runtime(struct +@@ -4570,7 +4570,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, unthrottle_cfs_rq(cfs_rq); next: @@ -48,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!remaining) break; -@@ -4586,7 +4586,7 @@ static u64 distribute_cfs_runtime(struct +@@ -4586,7 +4586,7 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, * period the timer is deactivated until scheduling resumes; cfs_b->idle is * used to track this state. */ @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { u64 runtime, runtime_expires; int throttled; -@@ -4628,11 +4628,11 @@ static int do_sched_cfs_period_timer(str +@@ -4628,11 +4628,11 @@ static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun) while (throttled && cfs_b->runtime > 0 && !cfs_b->distribute_running) { runtime = cfs_b->runtime; cfs_b->distribute_running = 1; @@ -71,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cfs_b->distribute_running = 0; throttled = !list_empty(&cfs_b->throttled_cfs_rq); -@@ -4741,17 +4741,18 @@ static __always_inline void return_cfs_r +@@ -4741,17 +4741,18 @@ static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq) static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b) { u64 runtime = 0, slice = sched_cfs_bandwidth_slice(); @@ -93,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return; } -@@ -4762,18 +4763,18 @@ static void do_sched_cfs_slack_timer(str +@@ -4762,18 +4763,18 @@ static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b) if (runtime) cfs_b->distribute_running = 1; @@ -115,7 +118,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -4851,20 +4852,21 @@ static enum hrtimer_restart sched_cfs_pe +@@ -4851,20 +4852,21 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) { struct cfs_bandwidth *cfs_b = container_of(timer, struct cfs_bandwidth, period_timer); @@ -140,3 +143,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return idle ? HRTIMER_NORESTART : HRTIMER_RESTART; } +-- +2.20.1 + diff --git a/debian/patches-rt/arm-convert-boot-lock-to-raw.patch b/debian/patches-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch index e090291d6..39ec3af97 100644 --- a/debian/patches-rt/arm-convert-boot-lock-to-raw.patch +++ b/debian/patches-rt/0012-arm-Convert-arm-boot_lock-to-raw.patch @@ -1,7 +1,8 @@ +From 37261737c2ad09732c9131095b574191058afc92 Mon Sep 17 00:00:00 2001 From: Frank Rowand <frank.rowand@am.sony.com> Date: Mon, 19 Sep 2011 14:51:14 -0700 -Subject: arm: Convert arm boot_lock to raw -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 012/266] arm: Convert arm boot_lock to raw +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The arm boot_lock is used by the secondary processor startup code. The locking task is the idle thread, which has idle->sched_class == &idle_sched_class. @@ -24,16 +25,18 @@ Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Tested-by: Krzysztof Kozlowski <krzk@kernel.org> [Exynos5422 Linaro PM-QA] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm/mach-exynos/platsmp.c | 12 ++++++------ - arch/arm/mach-hisi/platmcpm.c | 22 +++++++++++----------- - 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/plat-versatile/platsmp.c | 10 +++++----- + arch/arm/mach-exynos/platsmp.c | 12 ++++++------ + arch/arm/mach-hisi/platmcpm.c | 22 +++++++++++----------- + 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/plat-versatile/platsmp.c | 10 +++++----- 8 files changed, 47 insertions(+), 47 deletions(-) +diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c +index 6a1e682371b3..17dca0ff336e 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -239,7 +239,7 @@ static void write_pen_release(int val) @@ -45,7 +48,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void exynos_secondary_init(unsigned int cpu) { -@@ -252,8 +252,8 @@ static void exynos_secondary_init(unsign +@@ -252,8 +252,8 @@ static void exynos_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -56,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } int exynos_set_boot_addr(u32 core_id, unsigned long boot_addr) -@@ -317,7 +317,7 @@ static int exynos_boot_secondary(unsigne +@@ -317,7 +317,7 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) * Set synchronisation state between this boot processor * and the secondary one */ @@ -65,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * The secondary processor is waiting to be released from -@@ -344,7 +344,7 @@ static int exynos_boot_secondary(unsigne +@@ -344,7 +344,7 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) if (timeout == 0) { printk(KERN_ERR "cpu1 power enable failed"); @@ -74,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return -ETIMEDOUT; } } -@@ -390,7 +390,7 @@ static int exynos_boot_secondary(unsigne +@@ -390,7 +390,7 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) * calibrations, then wait for it to finish */ fail: @@ -83,6 +86,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return pen_release != -1 ? ret : 0; } +diff --git a/arch/arm/mach-hisi/platmcpm.c b/arch/arm/mach-hisi/platmcpm.c +index f66815c3dd07..00524abd963f 100644 --- a/arch/arm/mach-hisi/platmcpm.c +++ b/arch/arm/mach-hisi/platmcpm.c @@ -61,7 +61,7 @@ @@ -94,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static u32 fabric_phys_addr; /* * [0]: bootwrapper physical address -@@ -113,7 +113,7 @@ static int hip04_boot_secondary(unsigned +@@ -113,7 +113,7 @@ static int hip04_boot_secondary(unsigned int l_cpu, struct task_struct *idle) if (cluster >= HIP04_MAX_CLUSTERS || cpu >= HIP04_MAX_CPUS_PER_CLUSTER) return -EINVAL; @@ -103,7 +108,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (hip04_cpu_table[cluster][cpu]) goto out; -@@ -147,7 +147,7 @@ static int hip04_boot_secondary(unsigned +@@ -147,7 +147,7 @@ static int hip04_boot_secondary(unsigned int l_cpu, struct task_struct *idle) out: hip04_cpu_table[cluster][cpu]++; @@ -112,7 +117,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } -@@ -162,11 +162,11 @@ static void hip04_cpu_die(unsigned int l +@@ -162,11 +162,11 @@ static void hip04_cpu_die(unsigned int l_cpu) cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); @@ -126,7 +131,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return; } else if (hip04_cpu_table[cluster][cpu] > 1) { pr_err("Cluster %d CPU%d boots multiple times\n", cluster, cpu); -@@ -174,7 +174,7 @@ static void hip04_cpu_die(unsigned int l +@@ -174,7 +174,7 @@ static void hip04_cpu_die(unsigned int l_cpu) } last_man = hip04_cluster_is_down(cluster); @@ -135,7 +140,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (last_man) { /* Since it's Cortex A15, disable L2 prefetching. */ asm volatile( -@@ -203,7 +203,7 @@ static int hip04_cpu_kill(unsigned int l +@@ -203,7 +203,7 @@ static int hip04_cpu_kill(unsigned int l_cpu) cpu >= HIP04_MAX_CPUS_PER_CLUSTER); count = TIMEOUT_MSEC / POLL_MSEC; @@ -144,7 +149,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> for (tries = 0; tries < count; tries++) { if (hip04_cpu_table[cluster][cpu]) goto err; -@@ -211,10 +211,10 @@ static int hip04_cpu_kill(unsigned int l +@@ -211,10 +211,10 @@ static int hip04_cpu_kill(unsigned int l_cpu) data = readl_relaxed(sysctrl + SC_CPU_RESET_STATUS(cluster)); if (data & CORE_WFI_STATUS(cpu)) break; @@ -157,7 +162,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } if (tries >= count) goto err; -@@ -231,10 +231,10 @@ static int hip04_cpu_kill(unsigned int l +@@ -231,10 +231,10 @@ static int hip04_cpu_kill(unsigned int l_cpu) goto err; if (hip04_cluster_is_down(cluster)) hip04_set_snoop_filter(cluster, 0); @@ -170,9 +175,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } #endif +diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c +index 1c73694c871a..ac4d2f030b87 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c -@@ -69,7 +69,7 @@ static const struct omap_smp_config omap +@@ -69,7 +69,7 @@ static const struct omap_smp_config omap5_cfg __initconst = { .startup_addr = omap5_secondary_startup, }; @@ -181,7 +188,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void __iomem *omap4_get_scu_base(void) { -@@ -177,8 +177,8 @@ static void omap4_secondary_init(unsigne +@@ -177,8 +177,8 @@ static void omap4_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -192,7 +199,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static int omap4_boot_secondary(unsigned int cpu, struct task_struct *idle) -@@ -191,7 +191,7 @@ static int omap4_boot_secondary(unsigned +@@ -191,7 +191,7 @@ static int omap4_boot_secondary(unsigned int cpu, struct task_struct *idle) * Set synchronisation state between this boot processor * and the secondary one */ @@ -201,7 +208,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Update the AuxCoreBoot0 with boot state for secondary core. -@@ -270,7 +270,7 @@ static int omap4_boot_secondary(unsigned +@@ -270,7 +270,7 @@ static int omap4_boot_secondary(unsigned int cpu, struct task_struct *idle) * Now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -210,6 +217,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } +diff --git a/arch/arm/mach-prima2/platsmp.c b/arch/arm/mach-prima2/platsmp.c +index 75ef5d4be554..c17c86e5d860 100644 --- a/arch/arm/mach-prima2/platsmp.c +++ b/arch/arm/mach-prima2/platsmp.c @@ -22,7 +22,7 @@ @@ -221,7 +230,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void sirfsoc_secondary_init(unsigned int cpu) { -@@ -36,8 +36,8 @@ static void sirfsoc_secondary_init(unsig +@@ -36,8 +36,8 @@ static void sirfsoc_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -232,7 +241,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static const struct of_device_id clk_ids[] = { -@@ -75,7 +75,7 @@ static int sirfsoc_boot_secondary(unsign +@@ -75,7 +75,7 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle) /* make sure write buffer is drained */ mb(); @@ -241,7 +250,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * The secondary processor is waiting to be released from -@@ -107,7 +107,7 @@ static int sirfsoc_boot_secondary(unsign +@@ -107,7 +107,7 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -250,6 +259,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return pen_release != -1 ? -ENOSYS : 0; } +diff --git a/arch/arm/mach-qcom/platsmp.c b/arch/arm/mach-qcom/platsmp.c +index 5494c9e0c909..e8ce157d3548 100644 --- a/arch/arm/mach-qcom/platsmp.c +++ b/arch/arm/mach-qcom/platsmp.c @@ -46,7 +46,7 @@ @@ -261,7 +272,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_HOTPLUG_CPU static void qcom_cpu_die(unsigned int cpu) -@@ -60,8 +60,8 @@ static void qcom_secondary_init(unsigned +@@ -60,8 +60,8 @@ static void qcom_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -272,7 +283,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static int scss_release_secondary(unsigned int cpu) -@@ -284,7 +284,7 @@ static int qcom_boot_secondary(unsigned +@@ -284,7 +284,7 @@ static int qcom_boot_secondary(unsigned int cpu, int (*func)(unsigned int)) * set synchronisation state between this boot processor * and the secondary one */ @@ -281,7 +292,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Send the secondary CPU a soft interrupt, thereby causing -@@ -297,7 +297,7 @@ static int qcom_boot_secondary(unsigned +@@ -297,7 +297,7 @@ static int qcom_boot_secondary(unsigned int cpu, int (*func)(unsigned int)) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -290,6 +301,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } +diff --git a/arch/arm/mach-spear/platsmp.c b/arch/arm/mach-spear/platsmp.c +index 39038a03836a..6da5c93872bf 100644 --- a/arch/arm/mach-spear/platsmp.c +++ b/arch/arm/mach-spear/platsmp.c @@ -32,7 +32,7 @@ static void write_pen_release(int val) @@ -301,7 +314,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void __iomem *scu_base = IOMEM(VA_SCU_BASE); -@@ -47,8 +47,8 @@ static void spear13xx_secondary_init(uns +@@ -47,8 +47,8 @@ static void spear13xx_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -312,7 +325,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle) -@@ -59,7 +59,7 @@ static int spear13xx_boot_secondary(unsi +@@ -59,7 +59,7 @@ static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle) * set synchronisation state between this boot processor * and the secondary one */ @@ -321,7 +334,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * The secondary processor is waiting to be released from -@@ -84,7 +84,7 @@ static int spear13xx_boot_secondary(unsi +@@ -84,7 +84,7 @@ static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -330,6 +343,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return pen_release != -1 ? -ENOSYS : 0; } +diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/platsmp.c +index 231f19e17436..a3419b7003e6 100644 --- a/arch/arm/mach-sti/platsmp.c +++ b/arch/arm/mach-sti/platsmp.c @@ -35,7 +35,7 @@ static void write_pen_release(int val) @@ -341,7 +356,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void sti_secondary_init(unsigned int cpu) { -@@ -48,8 +48,8 @@ static void sti_secondary_init(unsigned +@@ -48,8 +48,8 @@ static void sti_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -352,7 +367,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static int sti_boot_secondary(unsigned int cpu, struct task_struct *idle) -@@ -60,7 +60,7 @@ static int sti_boot_secondary(unsigned i +@@ -60,7 +60,7 @@ static int sti_boot_secondary(unsigned int cpu, struct task_struct *idle) * set synchronisation state between this boot processor * and the secondary one */ @@ -361,7 +376,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * The secondary processor is waiting to be released from -@@ -91,7 +91,7 @@ static int sti_boot_secondary(unsigned i +@@ -91,7 +91,7 @@ static int sti_boot_secondary(unsigned int cpu, struct task_struct *idle) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -370,6 +385,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return pen_release != -1 ? -ENOSYS : 0; } +diff --git a/arch/arm/plat-versatile/platsmp.c b/arch/arm/plat-versatile/platsmp.c +index c2366510187a..6b60f582b738 100644 --- a/arch/arm/plat-versatile/platsmp.c +++ b/arch/arm/plat-versatile/platsmp.c @@ -32,7 +32,7 @@ static void write_pen_release(int val) @@ -381,7 +398,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void versatile_secondary_init(unsigned int cpu) { -@@ -45,8 +45,8 @@ void versatile_secondary_init(unsigned i +@@ -45,8 +45,8 @@ void versatile_secondary_init(unsigned int cpu) /* * Synchronise with the boot thread. */ @@ -392,7 +409,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) -@@ -57,7 +57,7 @@ int versatile_boot_secondary(unsigned in +@@ -57,7 +57,7 @@ int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) * Set synchronisation state between this boot processor * and the secondary one */ @@ -401,7 +418,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * This is really belt and braces; we hold unintended secondary -@@ -87,7 +87,7 @@ int versatile_boot_secondary(unsigned in +@@ -87,7 +87,7 @@ int versatile_boot_secondary(unsigned int cpu, struct task_struct *idle) * now the secondary core is starting up let it run its * calibrations, then wait for it to finish */ @@ -410,3 +427,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return pen_release != -1 ? -ENOSYS : 0; } +-- +2.20.1 + diff --git a/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch b/debian/patches-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch index a42ae24cc..f9711464e 100644 --- a/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch +++ b/debian/patches-rt/0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch @@ -1,8 +1,9 @@ +From b7623467c5f4754d6461928696e789b3fa834b7a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 17 Jul 2018 18:25:31 +0200 -Subject: [PATCH] x86/ioapic: Don't let setaffinity unmask threaded EOI +Subject: [PATCH 013/266] x86/ioapic: Don't let setaffinity unmask threaded EOI interrupt too early -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz There is an issue with threaded interrupts which are marked ONESHOT and using the fasteoi handler. @@ -30,12 +31,14 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ifdef paths (spotted by Andy Shevchenko)] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/kernel/apic/io_apic.c | 23 +++++++++++++---------- + arch/x86/kernel/apic/io_apic.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) +diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c +index ff0d14cd9e82..c2bd6e0433f8 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c -@@ -1722,19 +1722,20 @@ static bool io_apic_level_ack_pending(st +@@ -1722,19 +1722,20 @@ static bool io_apic_level_ack_pending(struct mp_chip_data *data) return false; } @@ -60,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Only migrate the irq if the ack has been received. * * On rare occasions the broadcast level triggered ack gets -@@ -1763,15 +1764,17 @@ static inline void ioapic_irqd_unmask(st +@@ -1763,15 +1764,17 @@ static inline void ioapic_irqd_unmask(struct irq_data *data, bool masked) */ if (!io_apic_level_ack_pending(data->chip_data)) irq_move_masked_irq(data); @@ -81,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { } #endif -@@ -1780,11 +1783,11 @@ static void ioapic_ack_level(struct irq_ +@@ -1780,11 +1783,11 @@ static void ioapic_ack_level(struct irq_data *irq_data) { struct irq_cfg *cfg = irqd_cfg(irq_data); unsigned long v; @@ -95,7 +98,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * It appears there is an erratum which affects at least version 0x11 -@@ -1839,7 +1842,7 @@ static void ioapic_ack_level(struct irq_ +@@ -1839,7 +1842,7 @@ static void ioapic_ack_level(struct irq_data *irq_data) eoi_ioapic_pin(cfg->vector, irq_data->chip_data); } @@ -104,3 +107,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static void ioapic_ir_ack_level(struct irq_data *irq_data) +-- +2.20.1 + diff --git a/debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch b/debian/patches-rt/0014-arm-kprobe-replace-patch_lock-to-raw-lock.patch index e514e3718..3f93a16bb 100644 --- a/debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch +++ b/debian/patches-rt/0014-arm-kprobe-replace-patch_lock-to-raw-lock.patch @@ -1,7 +1,8 @@ +From c04aa401b3b76817b02a653adeeb221b31c0769b Mon Sep 17 00:00:00 2001 From: Yang Shi <yang.shi@linaro.org> Date: Thu, 10 Nov 2016 16:17:55 -0800 -Subject: [PATCH] arm: kprobe: replace patch_lock to raw lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 014/266] arm: kprobe: replace patch_lock to raw lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz When running kprobe on -rt kernel, the below bug is caught: @@ -36,9 +37,11 @@ to raw lock. Signed-off-by: Yang Shi <yang.shi@linaro.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm/kernel/patch.c | 6 +++--- + arch/arm/kernel/patch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) +diff --git a/arch/arm/kernel/patch.c b/arch/arm/kernel/patch.c +index a50dc00d79a2..d0a05a3bdb96 100644 --- a/arch/arm/kernel/patch.c +++ b/arch/arm/kernel/patch.c @@ -16,7 +16,7 @@ struct patch { @@ -50,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) __acquires(&patch_lock) -@@ -33,7 +33,7 @@ static void __kprobes *patch_map(void *a +@@ -33,7 +33,7 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) return addr; if (flags) @@ -59,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> else __acquire(&patch_lock); -@@ -48,7 +48,7 @@ static void __kprobes patch_unmap(int fi +@@ -48,7 +48,7 @@ static void __kprobes patch_unmap(int fixmap, unsigned long *flags) clear_fixmap(fixmap); if (flags) @@ -68,3 +71,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> else __release(&patch_lock); } +-- +2.20.1 + diff --git a/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch b/debian/patches-rt/0016-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch index a53b33e5d..f45a8f34f 100644 --- a/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch +++ b/debian/patches-rt/0016-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch @@ -1,7 +1,8 @@ +From 8802563fe8efa798671fe55ab1417f3665f63cc7 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 3 Jul 2018 18:19:48 +0200 -Subject: [PATCH] cgroup: use irqsave in cgroup_rstat_flush_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 016/266] cgroup: use irqsave in cgroup_rstat_flush_locked() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz All callers of cgroup_rstat_flush_locked() acquire cgroup_rstat_lock either with spin_lock_irq() or spin_lock_irqsave(). @@ -17,12 +18,14 @@ Acquire the raw_spin_lock_t with disabled interrupts. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/cgroup/rstat.c | 5 +++-- + kernel/cgroup/rstat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) +diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c +index d503d1a9007c..63fc5e472c82 100644 --- a/kernel/cgroup/rstat.c +++ b/kernel/cgroup/rstat.c -@@ -157,8 +157,9 @@ static void cgroup_rstat_flush_locked(st +@@ -157,8 +157,9 @@ static void cgroup_rstat_flush_locked(struct cgroup *cgrp, bool may_sleep) raw_spinlock_t *cpu_lock = per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu); struct cgroup *pos = NULL; @@ -33,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> while ((pos = cgroup_rstat_cpu_pop_updated(pos, cgrp, cpu))) { struct cgroup_subsys_state *css; -@@ -170,7 +171,7 @@ static void cgroup_rstat_flush_locked(st +@@ -170,7 +171,7 @@ static void cgroup_rstat_flush_locked(struct cgroup *cgrp, bool may_sleep) css->ss->css_rstat_flush(css, cpu); rcu_read_unlock(); } @@ -42,3 +45,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* if @may_sleep, play nice and yield if necessary */ if (may_sleep && (need_resched() || +-- +2.20.1 + diff --git a/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch b/debian/patches-rt/0017-fscache-initialize-cookie-hash-table-raw-spinlocks.patch index d0bc8209b..d153d0ebe 100644 --- a/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch +++ b/debian/patches-rt/0017-fscache-initialize-cookie-hash-table-raw-spinlocks.patch @@ -1,7 +1,8 @@ +From e9ac49cf76873f8ca7a6868b1a467d3e4a126834 Mon Sep 17 00:00:00 2001 From: Clark Williams <williams@redhat.com> Date: Tue, 3 Jul 2018 13:34:30 -0500 -Subject: [PATCH] fscache: initialize cookie hash table raw spinlocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 017/266] fscache: initialize cookie hash table raw spinlocks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The fscache cookie mechanism uses a hash table of hlist_bl_head structures. The PREEMPT_RT patcheset adds a raw spinlock to this structure and so on PREEMPT_RT @@ -13,14 +14,16 @@ Use the init function for fscache cookies. Signed-off-by: Clark Williams <williams@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - fs/fscache/cookie.c | 8 ++++++++ - fs/fscache/main.c | 1 + - include/linux/fscache.h | 1 + + fs/fscache/cookie.c | 8 ++++++++ + fs/fscache/main.c | 1 + + include/linux/fscache.h | 1 + 3 files changed, 10 insertions(+) +diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c +index c550512ce335..d5d57da32ffa 100644 --- a/fs/fscache/cookie.c +++ b/fs/fscache/cookie.c -@@ -962,3 +962,11 @@ int __fscache_check_consistency(struct f +@@ -962,3 +962,11 @@ int __fscache_check_consistency(struct fscache_cookie *cookie, return -ESTALE; } EXPORT_SYMBOL(__fscache_check_consistency); @@ -32,6 +35,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + for (i = 0; i < (1 << fscache_cookie_hash_shift) - 1; i++) + INIT_HLIST_BL_HEAD(&fscache_cookie_hash[i]); +} +diff --git a/fs/fscache/main.c b/fs/fscache/main.c +index 30ad89db1efc..1d5f1d679ffa 100644 --- a/fs/fscache/main.c +++ b/fs/fscache/main.c @@ -149,6 +149,7 @@ static int __init fscache_init(void) @@ -42,9 +47,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> fscache_root = kobject_create_and_add("fscache", kernel_kobj); if (!fscache_root) +diff --git a/include/linux/fscache.h b/include/linux/fscache.h +index 84b90a79d75a..87a9330eafa2 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h -@@ -230,6 +230,7 @@ extern void __fscache_readpages_cancel(s +@@ -230,6 +230,7 @@ extern void __fscache_readpages_cancel(struct fscache_cookie *cookie, extern void __fscache_disable_cookie(struct fscache_cookie *, const void *, bool); extern void __fscache_enable_cookie(struct fscache_cookie *, const void *, loff_t, bool (*)(void *), void *); @@ -52,3 +59,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * fscache_register_netfs - Register a filesystem as desiring caching services +-- +2.20.1 + diff --git a/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch b/debian/patches-rt/0018-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch index e00e88022..0042ff5c4 100644 --- a/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch +++ b/debian/patches-rt/0018-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch @@ -1,10 +1,11 @@ +From 26295661cf99f6bcac999f0c1001001ae6ece3b1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 29 Aug 2018 21:59:04 +0200 -Subject: [PATCH] Drivers: hv: vmbus: include header for get_irq_regs() +Subject: [PATCH 018/266] Drivers: hv: vmbus: include header for get_irq_regs() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On !RT the header file get_irq_regs() gets pulled in via other header files. On RT it does not and the build fails: @@ -19,9 +20,11 @@ Reported-by: Bernhard Landauer <oberon@manjaro.org> Reported-by: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/hv/hyperv_vmbus.h | 1 + + drivers/hv/hyperv_vmbus.h | 1 + 1 file changed, 1 insertion(+) +diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h +index 87d3d7da78f8..1d2d8a4b837d 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -31,6 +31,7 @@ @@ -32,3 +35,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "hv_trace.h" +-- +2.20.1 + diff --git a/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch b/debian/patches-rt/0019-percpu-include-irqflags.h-for-raw_local_irq_save.patch index 482418272..b0fff294e 100644 --- a/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch +++ b/debian/patches-rt/0019-percpu-include-irqflags.h-for-raw_local_irq_save.patch @@ -1,7 +1,8 @@ +From 359af9f6304a32c08a0983076d636a524e1e8697 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 11 Oct 2018 16:39:59 +0200 -Subject: [PATCH] percpu: include irqflags.h for raw_local_irq_save() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 019/266] percpu: include irqflags.h for raw_local_irq_save() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The header percpu.h header file is using raw_local_irq_save() but does not include irqflags.h for its definition. It compiles because the @@ -12,9 +13,11 @@ Include irqflags.h in percpu.h. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/asm-generic/percpu.h | 1 + + include/asm-generic/percpu.h | 1 + 1 file changed, 1 insertion(+) +diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h +index 1817a8415a5e..942d64c0476e 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h @@ -5,6 +5,7 @@ @@ -25,3 +28,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_SMP +-- +2.20.1 + diff --git a/debian/patches-rt/efi-Allow-efi-runtime.patch b/debian/patches-rt/0020-efi-Allow-efi-runtime.patch index 9681f9f81..4a2df50d1 100644 --- a/debian/patches-rt/efi-Allow-efi-runtime.patch +++ b/debian/patches-rt/0020-efi-Allow-efi-runtime.patch @@ -1,7 +1,8 @@ +From b83100f22895ed8f43d7f1ddc629ac5f378364cb Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 26 Jul 2018 15:06:10 +0200 -Subject: [PATCH] efi: Allow efi=runtime -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 020/266] efi: Allow efi=runtime +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In case the option "efi=noruntime" is default at built-time, the user could overwrite its sate by `efi=runtime' and allow it again. @@ -9,12 +10,14 @@ could overwrite its sate by `efi=runtime' and allow it again. Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/firmware/efi/efi.c | 3 +++ + drivers/firmware/efi/efi.c | 3 +++ 1 file changed, 3 insertions(+) +diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c +index 2a29dd9c986d..ab668e17fd05 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c -@@ -113,6 +113,9 @@ static int __init parse_efi_cmdline(char +@@ -113,6 +113,9 @@ static int __init parse_efi_cmdline(char *str) if (parse_option_str(str, "noruntime")) disable_runtime = true; @@ -24,3 +27,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } early_param("efi", parse_efi_cmdline); +-- +2.20.1 + diff --git a/debian/patches-rt/x86-efi-drop-task_lock-from-efi_switch_mm.patch b/debian/patches-rt/0021-x86-efi-drop-task_lock-from-efi_switch_mm.patch index 803ded331..50cdd0a4f 100644 --- a/debian/patches-rt/x86-efi-drop-task_lock-from-efi_switch_mm.patch +++ b/debian/patches-rt/0021-x86-efi-drop-task_lock-from-efi_switch_mm.patch @@ -1,7 +1,8 @@ +From a70a1ff87b4876681228007d218d34d59473ea36 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 24 Jul 2018 14:48:55 +0200 -Subject: [PATCH] x86/efi: drop task_lock() from efi_switch_mm() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 021/266] x86/efi: drop task_lock() from efi_switch_mm() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz efi_switch_mm() is a wrapper around switch_mm() which saves current's ->active_mm, sets the requests mm as ->active_mm and invokes @@ -19,9 +20,11 @@ Remove task_lock() and also update the comment to reflect it. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/platform/efi/efi_64.c | 10 ++++------ + arch/x86/platform/efi/efi_64.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) +diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c +index ee5d08f25ce4..e8da7f492970 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c @@ -619,18 +619,16 @@ void __init efi_dump_pagetable(void) @@ -47,3 +50,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } #ifdef CONFIG_EFI_MIXED +-- +2.20.1 + diff --git a/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch b/debian/patches-rt/0022-arm64-KVM-compute_layout-before-altenates-are-applie.patch index 61db4820f..e33794626 100644 --- a/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch +++ b/debian/patches-rt/0022-arm64-KVM-compute_layout-before-altenates-are-applie.patch @@ -1,7 +1,9 @@ +From 9af14e5327e358a220624588caf607074b903d2e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 26 Jul 2018 09:13:42 +0200 -Subject: [PATCH] arm64: KVM: compute_layout before altenates are applied -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 022/266] arm64: KVM: compute_layout before altenates are + applied +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz compute_layout() is invoked as part of an alternative fixup under stop_machine() and needs a sleeping lock as part of get_random_long(). @@ -10,14 +12,16 @@ Invoke compute_layout() before the alternatives are applied. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm64/include/asm/alternative.h | 6 ++++++ - arch/arm64/kernel/alternative.c | 1 + - arch/arm64/kvm/va_layout.c | 7 +------ + arch/arm64/include/asm/alternative.h | 6 ++++++ + arch/arm64/kernel/alternative.c | 1 + + arch/arm64/kvm/va_layout.c | 7 +------ 3 files changed, 8 insertions(+), 6 deletions(-) +diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h +index 4b650ec1d7dd..f561ea0ac645 100644 --- a/arch/arm64/include/asm/alternative.h +++ b/arch/arm64/include/asm/alternative.h -@@ -35,6 +35,12 @@ void apply_alternatives_module(void *sta +@@ -35,6 +35,12 @@ void apply_alternatives_module(void *start, size_t length); static inline void apply_alternatives_module(void *start, size_t length) { } #endif @@ -30,9 +34,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define ALTINSTR_ENTRY(feature,cb) \ " .word 661b - .\n" /* label */ \ " .if " __stringify(cb) " == 0\n" \ +diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c +index b5d603992d40..f92815d56d17 100644 --- a/arch/arm64/kernel/alternative.c +++ b/arch/arm64/kernel/alternative.c -@@ -224,6 +224,7 @@ static int __apply_alternatives_multi_st +@@ -224,6 +224,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 */ @@ -40,6 +46,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> stop_machine(__apply_alternatives_multi_stop, NULL, cpu_online_mask); } +diff --git a/arch/arm64/kvm/va_layout.c b/arch/arm64/kvm/va_layout.c +index c712a7376bc1..792da0e125de 100644 --- a/arch/arm64/kvm/va_layout.c +++ b/arch/arm64/kvm/va_layout.c @@ -33,7 +33,7 @@ static u8 tag_lsb; @@ -51,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { phys_addr_t idmap_addr = __pa_symbol(__hyp_idmap_text_start); u64 hyp_va_msb; -@@ -121,8 +121,6 @@ void __init kvm_update_va_mask(struct al +@@ -121,8 +121,6 @@ void __init kvm_update_va_mask(struct alt_instr *alt, BUG_ON(nr_inst != 5); @@ -60,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> for (i = 0; i < nr_inst; i++) { u32 rd, rn, insn, oinsn; -@@ -167,9 +165,6 @@ void kvm_patch_vector_branch(struct alt_ +@@ -167,9 +165,6 @@ void kvm_patch_vector_branch(struct alt_instr *alt, return; } @@ -70,3 +78,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Compute HYP VA by using the same computation as kern_hyp_va() */ +-- +2.20.1 + diff --git a/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch b/debian/patches-rt/0023-of-allocate-free-phandle-cache-outside-of-the-devtre.patch index 7e0076429..68b5cf17d 100644 --- a/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch +++ b/debian/patches-rt/0023-of-allocate-free-phandle-cache-outside-of-the-devtre.patch @@ -1,7 +1,9 @@ +From 620c41f6fc3705fe88d4ede270d434f2e8494e41 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 31 Aug 2018 14:16:30 +0200 -Subject: [PATCH] of: allocate / free phandle cache outside of the devtree_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 023/266] of: allocate / free phandle cache outside of the + devtree_lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The phandle cache code allocates memory while holding devtree_lock which is a raw_spinlock_t. Memory allocation (and free()) is not possible on @@ -13,9 +15,11 @@ Cc: Frank Rowand <frowand.list@gmail.com> Cc: devicetree@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/of/base.c | 19 +++++++++++++------ + drivers/of/base.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) +diff --git a/drivers/of/base.c b/drivers/of/base.c +index 3f21ea6a90dc..2c7cf83b200c 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -130,31 +130,34 @@ static u32 phandle_cache_mask; @@ -94,3 +98,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } void __init of_core_init(void) +-- +2.20.1 + diff --git a/debian/patches-rt/mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch b/debian/patches-rt/0024-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch index 5d14de34e..82ad5144e 100644 --- a/debian/patches-rt/mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch +++ b/debian/patches-rt/0024-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch @@ -1,7 +1,8 @@ +From 8a311199e1b8b0034e48f571a77dc0dba92493fc Mon Sep 17 00:00:00 2001 From: Clark Williams <williams@redhat.com> Date: Tue, 18 Sep 2018 10:29:31 -0500 -Subject: [PATCH] mm/kasan: make quarantine_lock a raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 024/266] mm/kasan: make quarantine_lock a raw_spinlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The static lock quarantine_lock is used in quarantine.c to protect the quarantine queue datastructures. It is taken inside quarantine queue @@ -18,9 +19,11 @@ the lock is held is limited. Signed-off-by: Clark Williams <williams@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - mm/kasan/quarantine.c | 18 +++++++++--------- + mm/kasan/quarantine.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) +diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c +index 3a8ddf8baf7d..b209dbaefde8 100644 --- a/mm/kasan/quarantine.c +++ b/mm/kasan/quarantine.c @@ -103,7 +103,7 @@ static int quarantine_head; @@ -32,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> DEFINE_STATIC_SRCU(remove_cache_srcu); /* Maximum size of the global queue. */ -@@ -190,7 +190,7 @@ void quarantine_put(struct kasan_free_me +@@ -190,7 +190,7 @@ void quarantine_put(struct kasan_free_meta *info, struct kmem_cache *cache) if (unlikely(q->bytes > QUARANTINE_PERCPU_SIZE)) { qlist_move_all(q, &temp); @@ -41,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> WRITE_ONCE(quarantine_size, quarantine_size + temp.bytes); qlist_move_all(&temp, &global_quarantine[quarantine_tail]); if (global_quarantine[quarantine_tail].bytes >= -@@ -203,7 +203,7 @@ void quarantine_put(struct kasan_free_me +@@ -203,7 +203,7 @@ void quarantine_put(struct kasan_free_meta *info, struct kmem_cache *cache) if (new_tail != quarantine_head) quarantine_tail = new_tail; } @@ -68,7 +71,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> qlist_free_all(&to_free, NULL); srcu_read_unlock(&remove_cache_srcu, srcu_idx); -@@ -310,17 +310,17 @@ void quarantine_remove_cache(struct kmem +@@ -310,17 +310,17 @@ void quarantine_remove_cache(struct kmem_cache *cache) */ on_each_cpu(per_cpu_remove_cache, cache, 1); @@ -90,3 +93,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> qlist_free_all(&to_free, cache); +-- +2.20.1 + diff --git a/debian/patches-rt/EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch b/debian/patches-rt/0025-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch index 4992b753b..402bc340e 100644 --- a/debian/patches-rt/EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch +++ b/debian/patches-rt/0025-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch @@ -1,7 +1,9 @@ -From: Paul E. McKenney <paulmck@linux.ibm.com> +From 383db1cd23d5f1b7583f5723fc8460c51ee469a8 Mon Sep 17 00:00:00 2001 +From: "Paul E. McKenney" <paulmck@linux.ibm.com> Date: Mon, 29 Oct 2018 11:53:01 +0100 -Subject: [PATCH] EXP rcu: Revert expedited GP parallelization cleverness -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 025/266] EXP rcu: Revert expedited GP parallelization + cleverness +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz (Commit 258ba8e089db23f760139266c232f01bad73f85c from linux-rcu) @@ -14,12 +16,14 @@ Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/rcu/tree_exp.h | 9 +-------- + kernel/rcu/tree_exp.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) +diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h +index 0b2c2ad69629..a0486414edb4 100644 --- a/kernel/rcu/tree_exp.h +++ b/kernel/rcu/tree_exp.h -@@ -472,7 +472,6 @@ static void sync_rcu_exp_select_node_cpu +@@ -472,7 +472,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) { @@ -27,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> 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(str +@@ -494,13 +493,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); @@ -42,3 +46,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rnp->exp_need_flush = true; } +-- +2.20.1 + diff --git a/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch b/debian/patches-rt/0026-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch index bead1d0dc..3cfc93de5 100644 --- a/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch +++ b/debian/patches-rt/0026-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch @@ -1,7 +1,11 @@ +From dcf4a87ee4351ab504708b78c95b72551e34f774 Mon Sep 17 00:00:00 2001 From: He Zhe <zhe.he@windriver.com> Date: Wed, 19 Dec 2018 16:30:57 +0100 -Subject: [PATCH] kmemleak: Turn kmemleak_lock to raw spinlock on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 026/266] kmemleak: Turn kmemleak_lock to raw spinlock on RT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz kmemleak_lock, as a rwlock on RT, can possibly be held in atomic context and causes the follow BUG. @@ -71,9 +75,11 @@ Link: https://lkml.kernel.org/r/1542877459-144382-1-git-send-email-zhe.he@windri Link: https://lkml.kernel.org/r/20181218150744.GB20197@arrakis.emea.arm.com Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - mm/kmemleak.c | 20 ++++++++++---------- + mm/kmemleak.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) +diff --git a/mm/kmemleak.c b/mm/kmemleak.c +index 17dd883198ae..b68a3d0d075f 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -26,7 +26,7 @@ @@ -94,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* allocation caches for kmemleak internal data */ static struct kmem_cache *object_cache; -@@ -491,9 +491,9 @@ static struct kmemleak_object *find_and_ +@@ -491,9 +491,9 @@ static struct kmemleak_object *find_and_get_object(unsigned long ptr, int alias) struct kmemleak_object *object; rcu_read_lock(); @@ -106,7 +112,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* check whether the object is still available */ if (object && !get_object(object)) -@@ -513,13 +513,13 @@ static struct kmemleak_object *find_and_ +@@ -513,13 +513,13 @@ static struct kmemleak_object *find_and_remove_object(unsigned long ptr, int ali unsigned long flags; struct kmemleak_object *object; @@ -122,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return object; } -@@ -593,7 +593,7 @@ static struct kmemleak_object *create_ob +@@ -593,7 +593,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, /* kernel backtrace */ object->trace_len = __save_stack_trace(object->trace); @@ -131,7 +137,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> min_addr = min(min_addr, ptr); max_addr = max(max_addr, ptr + size); -@@ -624,7 +624,7 @@ static struct kmemleak_object *create_ob +@@ -624,7 +624,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, list_add_tail_rcu(&object->object_list, &object_list); out: @@ -140,7 +146,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return object; } -@@ -1310,7 +1310,7 @@ static void scan_block(void *_start, voi +@@ -1310,7 +1310,7 @@ static void scan_block(void *_start, void *_end, unsigned long *end = _end - (BYTES_PER_POINTER - 1); unsigned long flags; @@ -149,7 +155,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> for (ptr = start; ptr < end; ptr++) { struct kmemleak_object *object; unsigned long pointer; -@@ -1367,7 +1367,7 @@ static void scan_block(void *_start, voi +@@ -1367,7 +1367,7 @@ static void scan_block(void *_start, void *_end, spin_unlock(&object->lock); } } @@ -158,3 +164,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* +-- +2.20.1 + diff --git a/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/debian/patches-rt/0027-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch index 2e3798c21..b7e90f906 100644 --- a/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +++ b/debian/patches-rt/0027-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -1,11 +1,8 @@ -Date: Fri, 28 Oct 2016 23:05:11 +0200 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -To: Trond Myklebust <trond.myklebust@primarydata.com> -Cc: Anna Schumaker <anna.schumaker@netapp.com>, - linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, - tglx@linutronix.de -Subject: NFSv4: replace seqcount_t with a seqlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +From 2392a2ef206d32260f9bf32e3f5041bb86920b15 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +Date: Fri, 28 Oct 2016 23:05:11 +0200 +Subject: [PATCH 027/266] NFSv4: replace seqcount_t with a seqlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The raw_write_seqcount_begin() in nfs4_reclaim_open_state() bugs me because it maps to preempt_disable() in -RT which I can't have at this @@ -23,15 +20,17 @@ block readers). Reported-by: kernel test robot <xiaolong.ye@intel.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - fs/nfs/delegation.c | 4 ++-- - fs/nfs/nfs4_fs.h | 2 +- - fs/nfs/nfs4proc.c | 4 ++-- - fs/nfs/nfs4state.c | 22 ++++++++++++++++------ + fs/nfs/delegation.c | 4 ++-- + fs/nfs/nfs4_fs.h | 2 +- + fs/nfs/nfs4proc.c | 4 ++-- + fs/nfs/nfs4state.c | 22 ++++++++++++++++------ 4 files changed, 21 insertions(+), 11 deletions(-) +diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c +index 75fe92eaa681..e8d05393443f 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c -@@ -152,11 +152,11 @@ static int nfs_delegation_claim_opens(st +@@ -152,11 +152,11 @@ static int nfs_delegation_claim_opens(struct inode *inode, sp = state->owner; /* Block nfs4_proc_unlck */ mutex_lock(&sp->so_delegreturn_mutex); @@ -45,6 +44,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> err = -EAGAIN; mutex_unlock(&sp->so_delegreturn_mutex); put_nfs_open_context(ctx); +diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h +index 63287d911c08..2ae55eaa4a1e 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h @@ -114,7 +114,7 @@ struct nfs4_state_owner { @@ -56,9 +57,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct mutex so_delegreturn_mutex; }; +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c +index e7abcf7629b3..d95afb31b918 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c -@@ -2859,7 +2859,7 @@ static int _nfs4_open_and_get_state(stru +@@ -2863,7 +2863,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, unsigned int seq; int ret; @@ -67,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ret = _nfs4_proc_open(opendata, ctx); if (ret != 0) -@@ -2900,7 +2900,7 @@ static int _nfs4_open_and_get_state(stru +@@ -2904,7 +2904,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, if (d_inode(dentry) == state->inode) { nfs_inode_attach_open_context(ctx); @@ -76,9 +79,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> nfs4_schedule_stateid_recovery(server, state); } +diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c +index d2f645d34eb1..1698dd2ca20b 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c -@@ -511,7 +511,7 @@ nfs4_alloc_state_owner(struct nfs_server +@@ -511,7 +511,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); @@ -87,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> mutex_init(&sp->so_delegreturn_mutex); return sp; } -@@ -1564,8 +1564,12 @@ static int nfs4_reclaim_open_state(struc +@@ -1564,8 +1564,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. */ @@ -101,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> restart: list_for_each_entry(state, &sp->so_states, open_states) { if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) -@@ -1652,14 +1656,20 @@ static int nfs4_reclaim_open_state(struc +@@ -1652,14 +1656,20 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs spin_lock(&sp->so_lock); goto restart; } @@ -126,3 +131,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return status; } +-- +2.20.1 + diff --git a/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch b/debian/patches-rt/0028-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch index d12c8ff8f..e02aafe63 100644 --- a/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +++ b/debian/patches-rt/0028-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch @@ -1,10 +1,12 @@ +From 3550c358113e3e973671b39bbf26eacab512ef1c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 4 Apr 2017 12:50:16 +0200 -Subject: [PATCH] kernel: sched: Provide a pointer to the valid CPU mask +Subject: [PATCH 028/266] kernel: sched: Provide a pointer to the valid CPU + mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In commit 4b53a3412d66 ("sched/core: Remove the tsk_nr_cpus_allowed() wrapper") the tsk_nr_cpus_allowed() wrapper was removed. There was not @@ -57,34 +59,36 @@ Cc: Ingo Molnar <mingo@elte.hu> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/ia64/kernel/mca.c | 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/platforms/cell/spufs/sched.c | 2 - - arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c | 2 - - drivers/infiniband/hw/hfi1/affinity.c | 6 ++-- - drivers/infiniband/hw/hfi1/sdma.c | 3 -- - drivers/infiniband/hw/qib/qib_file_ops.c | 7 ++-- - fs/proc/array.c | 4 +- - include/linux/sched.h | 5 ++- - init/init_task.c | 3 +- - kernel/cgroup/cpuset.c | 2 - - kernel/fork.c | 2 + - kernel/sched/core.c | 40 ++++++++++++++-------------- - kernel/sched/cpudeadline.c | 4 +- - kernel/sched/cpupri.c | 4 +- - kernel/sched/deadline.c | 6 ++-- - kernel/sched/fair.c | 32 +++++++++++----------- - kernel/sched/rt.c | 4 +- - kernel/trace/trace_hwlat.c | 2 - - lib/smp_processor_id.c | 2 - - samples/trace_events/trace-events-sample.c | 2 - + arch/ia64/kernel/mca.c | 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/platforms/cell/spufs/sched.c | 2 +- + arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c | 2 +- + drivers/infiniband/hw/hfi1/affinity.c | 6 ++-- + drivers/infiniband/hw/hfi1/sdma.c | 3 +- + drivers/infiniband/hw/qib/qib_file_ops.c | 7 ++-- + fs/proc/array.c | 4 +-- + include/linux/sched.h | 5 +-- + init/init_task.c | 3 +- + kernel/cgroup/cpuset.c | 2 +- + kernel/fork.c | 2 ++ + kernel/sched/core.c | 40 ++++++++++----------- + kernel/sched/cpudeadline.c | 4 +-- + kernel/sched/cpupri.c | 4 +-- + kernel/sched/deadline.c | 6 ++-- + kernel/sched/fair.c | 32 ++++++++--------- + kernel/sched/rt.c | 4 +-- + kernel/trace/trace_hwlat.c | 2 +- + lib/smp_processor_id.c | 2 +- + samples/trace_events/trace-events-sample.c | 2 +- 23 files changed, 74 insertions(+), 72 deletions(-) +diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c +index 6115464d5f03..f09e34c8409c 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c -@@ -1824,7 +1824,7 @@ format_mca_init_stack(void *mca_data, un +@@ -1824,7 +1824,7 @@ format_mca_init_stack(void *mca_data, unsigned long offset, ti->cpu = cpu; p->stack = ti; p->state = TASK_UNINTERRUPTIBLE; @@ -93,6 +97,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> INIT_LIST_HEAD(&p->tasks); p->parent = p->real_parent = p->group_leader = p; INIT_LIST_HEAD(&p->children); +diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h +index e610473d61b8..1428b4febbc9 100644 --- a/arch/mips/include/asm/switch_to.h +++ b/arch/mips/include/asm/switch_to.h @@ -42,7 +42,7 @@ extern struct task_struct *ll_task; @@ -113,9 +119,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } \ next->thread.emulated_fp = 0; \ } while(0) +diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c +index a7c0f97e4b0d..1a08428eedcf 100644 --- a/arch/mips/kernel/mips-mt-fpaff.c +++ b/arch/mips/kernel/mips-mt-fpaff.c -@@ -177,7 +177,7 @@ asmlinkage long mipsmt_sys_sched_getaffi +@@ -177,7 +177,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, if (retval) goto out_unlock; @@ -124,6 +132,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cpumask_and(&mask, &allowed, cpu_active_mask); out_unlock: +diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c +index 9dab0ed1b227..3623cf32f5f4 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -1174,12 +1174,12 @@ static void mt_ase_fp_affinity(void) @@ -142,9 +152,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> &mt_fpu_cpumask); set_cpus_allowed_ptr(current, &tmask); set_thread_flag(TIF_FPUBOUND); +diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c +index c9ef3c532169..cb10249b1125 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c -@@ -141,7 +141,7 @@ void __spu_update_sched_info(struct spu_ +@@ -141,7 +141,7 @@ void __spu_update_sched_info(struct spu_context *ctx) * runqueue. The context will be rescheduled on the proper node * if it is timesliced or preempted. */ @@ -153,9 +165,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Save the current cpu id for spu interrupt routing. */ ctx->last_ran = raw_smp_processor_id(); +diff --git a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c +index f8c260d522ca..befeec6414b0 100644 --- a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c +++ b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c -@@ -1435,7 +1435,7 @@ static int pseudo_lock_dev_mmap(struct f +@@ -1435,7 +1435,7 @@ static int pseudo_lock_dev_mmap(struct file *filp, struct vm_area_struct *vma) * may be scheduled elsewhere and invalidate entries in the * pseudo-locked region. */ @@ -164,6 +178,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> mutex_unlock(&rdtgroup_mutex); return -EINVAL; } +diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c +index bedd5fba33b0..3f4259f11a35 100644 --- a/drivers/infiniband/hw/hfi1/affinity.c +++ b/drivers/infiniband/hw/hfi1/affinity.c @@ -1037,7 +1037,7 @@ int hfi1_get_proc_affinity(int node) @@ -193,9 +209,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> hfi1_cdbg(PROC, "PID %u %s affinity set to CPU set(s) %*pbl", current->pid, current->comm, cpumask_pr_args(proc_mask)); +diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c +index 88e326d6cc49..b0d01ace6611 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c -@@ -855,14 +855,13 @@ struct sdma_engine *sdma_select_user_eng +@@ -855,14 +855,13 @@ struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd, { struct sdma_rht_node *rht_node; struct sdma_engine *sde = NULL; @@ -211,9 +229,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto out; cpu_id = smp_processor_id(); +diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c +index 98e1ce14fa2a..5d3828625017 100644 --- a/drivers/infiniband/hw/qib/qib_file_ops.c +++ b/drivers/infiniband/hw/qib/qib_file_ops.c -@@ -1142,7 +1142,7 @@ static __poll_t qib_poll(struct file *fp +@@ -1142,7 +1142,7 @@ static __poll_t qib_poll(struct file *fp, struct poll_table_struct *pt) static void assign_ctxt_affinity(struct file *fp, struct qib_devdata *dd) { struct qib_filedata *fd = fp->private_data; @@ -222,7 +242,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> const struct cpumask *local_mask = cpumask_of_pcibus(dd->pcidev->bus); int local_cpu; -@@ -1623,9 +1623,8 @@ static int qib_assign_ctxt(struct file * +@@ -1623,9 +1623,8 @@ static int qib_assign_ctxt(struct file *fp, const struct qib_user_info *uinfo) ret = find_free_ctxt(i_minor - 1, fp, uinfo); else { int unit; @@ -234,9 +254,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (weight == 1 && !test_bit(cpu, qib_cpulist)) if (!find_hca(cpu, &unit) && unit >= 0) +diff --git a/fs/proc/array.c b/fs/proc/array.c +index 0ceb3b6b37e7..ccfef702c771 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c -@@ -381,9 +381,9 @@ static inline void task_context_switch_c +@@ -381,9 +381,9 @@ static inline void task_context_switch_counts(struct seq_file *m, static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) { seq_printf(m, "Cpus_allowed:\t%*pb\n", @@ -248,6 +270,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static inline void task_core_dumping(struct seq_file *m, struct mm_struct *mm) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 4abb5bd74b04..b347614b42f4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -660,7 +660,8 @@ struct task_struct { @@ -269,6 +293,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ +diff --git a/init/init_task.c b/init/init_task.c +index 5aebe3be4d7c..0b49b9cf5571 100644 --- a/init/init_task.c +++ b/init/init_task.c @@ -71,7 +71,8 @@ struct task_struct init_task @@ -281,9 +307,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> .nr_cpus_allowed= NR_CPUS, .mm = NULL, .active_mm = &init_mm, +diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c +index 266f10cb7222..ef085d84a940 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c -@@ -2090,7 +2090,7 @@ static void cpuset_fork(struct task_stru +@@ -2090,7 +2090,7 @@ static void cpuset_fork(struct task_struct *task) if (task_css_is_root(task, cpuset_cgrp_id)) return; @@ -292,9 +320,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> task->mems_allowed = current->mems_allowed; } +diff --git a/kernel/fork.c b/kernel/fork.c +index 64ef113e387e..bfe9c5c3eb88 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -845,6 +845,8 @@ static struct task_struct *dup_task_stru +@@ -845,6 +845,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) #ifdef CONFIG_STACKPROTECTOR tsk->stack_canary = get_random_canary(); #endif @@ -303,9 +333,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * One for us, one for whoever does the "release_task()" (usually +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 152a0b0c91bb..c7377dcaf718 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -876,7 +876,7 @@ static inline bool is_per_cpu_kthread(st +@@ -877,7 +877,7 @@ static inline bool is_per_cpu_kthread(struct task_struct *p) */ static inline bool is_cpu_allowed(struct task_struct *p, int cpu) { @@ -314,7 +346,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return false; if (is_per_cpu_kthread(p)) -@@ -971,7 +971,7 @@ static int migration_cpu_stop(void *data +@@ -972,7 +972,7 @@ static int migration_cpu_stop(void *data) local_irq_disable(); /* * We need to explicitly wake pending tasks before running @@ -323,7 +355,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * during wakeups, see set_cpus_allowed_ptr()'s TASK_WAKING test. */ sched_ttwu_pending(); -@@ -1002,7 +1002,7 @@ static int migration_cpu_stop(void *data +@@ -1003,7 +1003,7 @@ static int migration_cpu_stop(void *data) */ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_mask) { @@ -332,7 +364,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> p->nr_cpus_allowed = cpumask_weight(new_mask); } -@@ -1072,7 +1072,7 @@ static int __set_cpus_allowed_ptr(struct +@@ -1073,7 +1073,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, goto out; } @@ -341,7 +373,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto out; if (!cpumask_intersects(new_mask, cpu_valid_mask)) { -@@ -1235,10 +1235,10 @@ static int migrate_swap_stop(void *data) +@@ -1236,10 +1236,10 @@ static int migrate_swap_stop(void *data) if (task_cpu(arg->src_task) != arg->src_cpu) goto unlock; @@ -354,7 +386,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto unlock; __migrate_swap_task(arg->src_task, arg->dst_cpu); -@@ -1280,10 +1280,10 @@ int migrate_swap(struct task_struct *cur +@@ -1281,10 +1281,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; @@ -367,7 +399,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto out; trace_sched_swap_numa(cur, arg.src_cpu, p, arg.dst_cpu); -@@ -1428,7 +1428,7 @@ void kick_process(struct task_struct *p) +@@ -1429,7 +1429,7 @@ void kick_process(struct task_struct *p) EXPORT_SYMBOL_GPL(kick_process); /* @@ -376,7 +408,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * * A few notes on cpu_active vs cpu_online: * -@@ -1468,14 +1468,14 @@ static int select_fallback_rq(int cpu, s +@@ -1469,14 +1469,14 @@ static int select_fallback_rq(int cpu, struct task_struct *p) for_each_cpu(dest_cpu, nodemask) { if (!cpu_active(dest_cpu)) continue; @@ -393,7 +425,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!is_cpu_allowed(p, dest_cpu)) continue; -@@ -1519,7 +1519,7 @@ static int select_fallback_rq(int cpu, s +@@ -1520,7 +1520,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p) } /* @@ -402,7 +434,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> */ static inline int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) -@@ -1529,11 +1529,11 @@ int select_task_rq(struct task_struct *p +@@ -1530,11 +1530,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 @@ -416,7 +448,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * CPU. * * Since this is common to all placement strategies, this lives here. -@@ -2400,7 +2400,7 @@ void wake_up_new_task(struct task_struct +@@ -2401,7 +2401,7 @@ void wake_up_new_task(struct task_struct *p) #ifdef CONFIG_SMP /* * Fork balancing, do it here and not earlier because: @@ -425,7 +457,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * - any previously selected CPU might disappear through hotplug * * Use __set_task_cpu() to avoid calling sched_class::migrate_task_rq, -@@ -4273,7 +4273,7 @@ static int __sched_setscheduler(struct t +@@ -4274,7 +4274,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. */ @@ -434,7 +466,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rq->rd->dl_bw.bw == 0) { task_rq_unlock(rq, p, &rf); return -EPERM; -@@ -4872,7 +4872,7 @@ long sched_getaffinity(pid_t pid, struct +@@ -4873,7 +4873,7 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask) goto out_unlock; raw_spin_lock_irqsave(&p->pi_lock, flags); @@ -443,7 +475,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock_irqrestore(&p->pi_lock, flags); out_unlock: -@@ -5452,7 +5452,7 @@ int task_can_attach(struct task_struct * +@@ -5453,7 +5453,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 @@ -452,7 +484,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> */ if (p->flags & PF_NO_SETAFFINITY) { ret = -EINVAL; -@@ -5479,7 +5479,7 @@ int migrate_task_to(struct task_struct * +@@ -5480,7 +5480,7 @@ int migrate_task_to(struct task_struct *p, int target_cpu) if (curr_cpu == target_cpu) return 0; @@ -461,7 +493,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return -EINVAL; /* TODO: This is not properly updating schedstats */ -@@ -5617,7 +5617,7 @@ static void migrate_tasks(struct rq *dea +@@ -5618,7 +5618,7 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf) put_prev_task(rq, next); /* @@ -470,9 +502,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * both pi_lock and rq->lock, such that holding either * stabilizes the mask. * +diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c +index 50316455ea66..d57fb2f8ae67 100644 --- a/kernel/sched/cpudeadline.c +++ b/kernel/sched/cpudeadline.c -@@ -124,14 +124,14 @@ int cpudl_find(struct cpudl *cp, struct +@@ -124,14 +124,14 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p, const struct sched_dl_entity *dl_se = &p->dl; if (later_mask && @@ -489,9 +523,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> dl_time_before(dl_se->deadline, cp->elements[0].dl)) { if (later_mask) cpumask_set_cpu(best_cpu, later_mask); +diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c +index daaadf939ccb..f7d2c10b4c92 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c -@@ -98,11 +98,11 @@ int cpupri_find(struct cpupri *cp, struc +@@ -98,11 +98,11 @@ int cpupri_find(struct cpupri *cp, struct task_struct *p, if (skip) continue; @@ -505,9 +541,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * We have to ensure that we have at least one bit +diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c +index 91e4202b0634..f927b1f45474 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c -@@ -539,7 +539,7 @@ static struct rq *dl_task_offline_migrat +@@ -539,7 +539,7 @@ static struct rq *dl_task_offline_migration(struct rq *rq, struct task_struct *p * If we cannot preempt any rq, fall back to pick any * online CPU: */ @@ -516,7 +554,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (cpu >= nr_cpu_ids) { /* * Failed to find any suitable CPU. -@@ -1824,7 +1824,7 @@ static void set_curr_task_dl(struct rq * +@@ -1824,7 +1824,7 @@ static void set_curr_task_dl(struct rq *rq) static int pick_dl_task(struct rq *rq, struct task_struct *p, int cpu) { if (!task_running(rq, p) && @@ -525,7 +563,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 1; return 0; } -@@ -1974,7 +1974,7 @@ static struct rq *find_lock_later_rq(str +@@ -1974,7 +1974,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq) /* Retry if something changed. */ if (double_lock_balance(rq, later_rq)) { if (unlikely(task_rq(task) != rq || @@ -534,9 +572,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> task_running(rq, task) || !dl_task(task) || !task_on_rq_queued(task))) { +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index 6afda059e882..09a1e32c366f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -1630,7 +1630,7 @@ static void task_numa_compare(struct tas +@@ -1630,7 +1630,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 */ @@ -545,7 +585,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto unlock; /* -@@ -1727,7 +1727,7 @@ static void task_numa_find_cpu(struct ta +@@ -1727,7 +1727,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 */ @@ -554,7 +594,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> continue; env->dst_cpu = cpu; -@@ -5712,7 +5712,7 @@ find_idlest_group(struct sched_domain *s +@@ -5712,7 +5712,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, /* Skip over this group if it has no CPUs allowed */ if (!cpumask_intersects(sched_group_span(group), @@ -563,7 +603,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> continue; local_group = cpumask_test_cpu(this_cpu, -@@ -5844,7 +5844,7 @@ find_idlest_group_cpu(struct sched_group +@@ -5844,7 +5844,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 */ @@ -572,7 +612,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (available_idle_cpu(i)) { struct rq *rq = cpu_rq(i); struct cpuidle_state *idle = idle_get_state(rq); -@@ -5884,7 +5884,7 @@ static inline int find_idlest_cpu(struct +@@ -5884,7 +5884,7 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p { int new_cpu = cpu; @@ -581,7 +621,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return prev_cpu; /* -@@ -6001,7 +6001,7 @@ static int select_idle_core(struct task_ +@@ -6001,7 +6001,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int if (!test_idle_cores(target, false)) return -1; @@ -590,7 +630,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> for_each_cpu_wrap(core, cpus, target) { bool idle = true; -@@ -6035,7 +6035,7 @@ static int select_idle_smt(struct task_s +@@ -6035,7 +6035,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)) { @@ -599,7 +639,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> continue; if (available_idle_cpu(cpu)) return cpu; -@@ -6098,7 +6098,7 @@ static int select_idle_cpu(struct task_s +@@ -6098,7 +6098,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t for_each_cpu_wrap(cpu, sched_domain_span(sd), target) { if (!--nr) return -1; @@ -608,7 +648,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> continue; if (available_idle_cpu(cpu)) break; -@@ -6135,7 +6135,7 @@ static int select_idle_sibling(struct ta +@@ -6135,7 +6135,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) && @@ -617,7 +657,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Replace recent_used_cpu with prev as it is a potential * candidate for the next wake: -@@ -6353,7 +6353,7 @@ select_task_rq_fair(struct task_struct * +@@ -6353,7 +6353,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) @@ -626,7 +666,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } rcu_read_lock(); -@@ -7092,14 +7092,14 @@ int can_migrate_task(struct task_struct +@@ -7092,14 +7092,14 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) /* * We do not migrate tasks that are: * 1) throttled_lb_pair, or @@ -643,7 +683,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int cpu; schedstat_inc(p->se.statistics.nr_failed_migrations_affine); -@@ -7119,7 +7119,7 @@ int can_migrate_task(struct task_struct +@@ -7119,7 +7119,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) { @@ -652,7 +692,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> env->flags |= LBF_DST_PINNED; env->new_dst_cpu = cpu; break; -@@ -7716,7 +7716,7 @@ check_cpu_capacity(struct rq *rq, struct +@@ -7716,7 +7716,7 @@ check_cpu_capacity(struct rq *rq, struct sched_domain *sd) /* * Group imbalance indicates (and tries to solve) the problem where balancing @@ -661,7 +701,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * * 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. -@@ -8331,7 +8331,7 @@ static struct sched_group *find_busiest_ +@@ -8331,7 +8331,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 @@ -670,7 +710,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> */ if (busiest->group_type == group_imbalanced) goto force_balance; -@@ -8727,7 +8727,7 @@ static int load_balance(int this_cpu, st +@@ -8727,7 +8727,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: */ @@ -679,9 +719,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock_irqrestore(&busiest->lock, flags); env.flags |= LBF_ALL_PINNED; +diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c +index 2e2955a8cf8f..4857ca145119 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c -@@ -1611,7 +1611,7 @@ static void put_prev_task_rt(struct rq * +@@ -1611,7 +1611,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) && @@ -690,7 +732,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 1; return 0; -@@ -1748,7 +1748,7 @@ static struct rq *find_lock_lowest_rq(st +@@ -1748,7 +1748,7 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq) * Also make sure that it wasn't scheduled on its rq. */ if (unlikely(task_rq(task) != rq || @@ -699,6 +741,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> task_running(rq, task) || !rt_task(task) || !task_on_rq_queued(task))) { +diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c +index 1e6db9cbe4dc..fa95139445b2 100644 --- a/kernel/trace/trace_hwlat.c +++ b/kernel/trace/trace_hwlat.c @@ -277,7 +277,7 @@ static void move_to_next_cpu(void) @@ -710,9 +754,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto disable; get_online_cpus(); +diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c +index 85925aaa4fff..fb35c45b9421 100644 --- a/lib/smp_processor_id.c +++ b/lib/smp_processor_id.c -@@ -22,7 +22,7 @@ notrace static unsigned int check_preemp +@@ -22,7 +22,7 @@ notrace static unsigned int check_preemption_disabled(const char *what1, * Kernel threads bound to a single CPU can safely use * smp_processor_id(): */ @@ -721,6 +767,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto out; /* +diff --git a/samples/trace_events/trace-events-sample.c b/samples/trace_events/trace-events-sample.c +index 5522692100ba..8b4be8e1802a 100644 --- a/samples/trace_events/trace-events-sample.c +++ b/samples/trace_events/trace-events-sample.c @@ -33,7 +33,7 @@ static void simple_thread_func(int cnt) @@ -732,3 +780,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> trace_foo_with_template_simple("HELLO", cnt); +-- +2.20.1 + diff --git a/debian/patches-rt/add_migrate_disable.patch b/debian/patches-rt/0029-kernel-sched-core-add-migrate_disable.patch index c958abe27..8f48d6959 100644 --- a/debian/patches-rt/add_migrate_disable.patch +++ b/debian/patches-rt/0029-kernel-sched-core-add-migrate_disable.patch @@ -1,16 +1,19 @@ +From 6a012b467f25731ba6206a66f07c024a3b88a964 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Sat, 27 May 2017 19:02:06 +0200 -Subject: kernel/sched/core: add migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 029/266] kernel/sched/core: add migrate_disable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz --- - include/linux/preempt.h | 23 ++++++++ - include/linux/sched.h | 7 ++ - include/linux/smp.h | 3 + - kernel/sched/core.c | 130 +++++++++++++++++++++++++++++++++++++++++++++++- - kernel/sched/debug.c | 4 + + include/linux/preempt.h | 23 +++++++ + include/linux/sched.h | 7 +++ + include/linux/smp.h | 3 + + kernel/sched/core.c | 130 +++++++++++++++++++++++++++++++++++++++- + kernel/sched/debug.c | 4 ++ 5 files changed, 165 insertions(+), 2 deletions(-) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index c01813c3fbe9..3196d0e76719 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -185,6 +185,22 @@ do { \ @@ -50,6 +53,8 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4 #endif /* CONFIG_PREEMPT_COUNT */ #ifdef MODULE +diff --git a/include/linux/sched.h b/include/linux/sched.h +index b347614b42f4..fad3583f0933 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -662,6 +662,13 @@ struct task_struct { @@ -66,6 +71,8 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4 #ifdef CONFIG_PREEMPT_RCU int rcu_read_lock_nesting; +diff --git a/include/linux/smp.h b/include/linux/smp.h +index 9fb239e12b82..5801e516ba63 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -202,6 +202,9 @@ static inline int get_boot_cpu_id(void) @@ -78,9 +85,11 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4 /* * Callback to arch code if there's nosmp or maxcpus=0 on the * boot command line: +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index c7377dcaf718..77f3c4771a2b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1006,7 +1006,15 @@ void set_cpus_allowed_common(struct task +@@ -1007,7 +1007,15 @@ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_ma p->nr_cpus_allowed = cpumask_weight(new_mask); } @@ -97,7 +106,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4 { struct rq *rq = task_rq(p); bool queued, running; -@@ -1035,6 +1043,20 @@ void do_set_cpus_allowed(struct task_str +@@ -1036,6 +1044,20 @@ void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) set_curr_task(rq, p); } @@ -118,7 +127,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4 /* * Change a given task's CPU affinity. Migrate the thread to a * proper CPU and schedule it away if the CPU it's executing on -@@ -1093,9 +1115,16 @@ static int __set_cpus_allowed_ptr(struct +@@ -1094,9 +1116,16 @@ 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 */ @@ -136,7 +145,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4 dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask); if (task_running(rq, p) || p->state == TASK_WAKING) { struct migration_arg arg = { p, dest_cpu }; -@@ -7058,3 +7087,100 @@ const u32 sched_prio_to_wmult[40] = { +@@ -7059,3 +7088,100 @@ const u32 sched_prio_to_wmult[40] = { }; #undef CREATE_TRACE_POINTS @@ -237,9 +246,11 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4 +} +EXPORT_SYMBOL(migrate_enable); +#endif +diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c +index 6383aa6a60ca..a719e44debdf 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c -@@ -978,6 +978,10 @@ void proc_sched_show_task(struct task_st +@@ -978,6 +978,10 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, P(dl.runtime); P(dl.deadline); } @@ -250,3 +261,6 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4 #undef PN_SCHEDSTAT #undef PN #undef __PN +-- +2.20.1 + diff --git a/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch b/debian/patches-rt/0030-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch index a47fe8dad..14b117dac 100644 --- a/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch +++ b/debian/patches-rt/0030-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch @@ -1,8 +1,9 @@ +From 44ee5f4d373ec3180cec3b68f606a77be0ac2dfb Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 9 Oct 2018 17:34:50 +0200 -Subject: [PATCH] sched/migrate_disable: Add export_symbol_gpl for +Subject: [PATCH 030/266] sched/migrate_disable: Add export_symbol_gpl for __migrate_disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Jonathan reported that lttng/modules can't use __migrate_disabled(). This function is only used by sched/core itself and the tracing @@ -17,12 +18,14 @@ EXPORT_SYMBOL_GPL to allow the module/LTTNG usage. Reported-by: Jonathan Rajott <jonathan.rajotte-julien@efficios.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/sched/core.c | 1 + + kernel/sched/core.c | 1 + 1 file changed, 1 insertion(+) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 77f3c4771a2b..f027ac73f1df 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1011,6 +1011,7 @@ int __migrate_disabled(struct task_struc +@@ -1012,6 +1012,7 @@ int __migrate_disabled(struct task_struct *p) { return p->migrate_disable; } @@ -30,3 +33,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #endif static void __do_set_cpus_allowed_tail(struct task_struct *p, +-- +2.20.1 + diff --git a/debian/patches-rt/at91_dont_enable_disable_clock.patch b/debian/patches-rt/0031-arm-at91-do-not-disable-enable-clocks-in-a-row.patch index d215c2f9e..078a96a2d 100644 --- a/debian/patches-rt/at91_dont_enable_disable_clock.patch +++ b/debian/patches-rt/0031-arm-at91-do-not-disable-enable-clocks-in-a-row.patch @@ -1,7 +1,8 @@ +From 884ce05ebcdf5862f6b5a568ab9635db6bd7618b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 09 Mar 2016 10:51:06 +0100 -Subject: arm: at91: do not disable/enable clocks in a row -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Wed, 9 Mar 2016 10:51:06 +0100 +Subject: [PATCH 031/266] arm: at91: do not disable/enable clocks in a row +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Currently the driver will disable the clock and enable it one line later if it is switching from periodic mode into one shot. @@ -9,9 +10,11 @@ This can be avoided and causes a needless warning on -RT. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/clocksource/tcb_clksrc.c | 33 +++++++++++++++++++++++++++++---- + drivers/clocksource/tcb_clksrc.c | 33 ++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) +diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c +index 43f4d5c4d6fa..de6baf564dfe 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c @@ -126,6 +126,7 @@ static struct clocksource clksrc = { @@ -22,7 +25,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void __iomem *regs; }; -@@ -143,6 +144,24 @@ static struct tc_clkevt_device *to_tc_cl +@@ -143,6 +144,24 @@ static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) */ static u32 timer_clock; @@ -47,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static int tc_shutdown(struct clock_event_device *d) { struct tc_clkevt_device *tcd = to_tc_clkevt(d); -@@ -150,8 +169,14 @@ static int tc_shutdown(struct clock_even +@@ -150,8 +169,14 @@ static int tc_shutdown(struct clock_event_device *d) writel(0xff, regs + ATMEL_TC_REG(2, IDR)); writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR)); @@ -63,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } -@@ -164,7 +189,7 @@ static int tc_set_oneshot(struct clock_e +@@ -164,7 +189,7 @@ static int tc_set_oneshot(struct clock_event_device *d) if (clockevent_state_oneshot(d) || clockevent_state_periodic(d)) tc_shutdown(d); @@ -72,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* slow clock, count up to RC, then irq and stop */ writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE | -@@ -186,7 +211,7 @@ static int tc_set_periodic(struct clock_ +@@ -186,7 +211,7 @@ static int tc_set_periodic(struct clock_event_device *d) /* By not making the gentime core emulate periodic mode on top * of oneshot, we get lower overhead and improved accuracy. */ @@ -81,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* slow clock, count up to RC, then irq and restart */ writel(timer_clock | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, -@@ -220,7 +245,7 @@ static struct tc_clkevt_device clkevt = +@@ -220,7 +245,7 @@ static struct tc_clkevt_device clkevt = { /* Should be lower than at91rm9200's system timer */ .rating = 125, .set_next_event = tc_next_event, @@ -90,3 +93,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> .set_state_periodic = tc_set_periodic, .set_state_oneshot = tc_set_oneshot, }, +-- +2.20.1 + diff --git a/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch b/debian/patches-rt/0032-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch index 3754f04c6..06774d27e 100644 --- a/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch +++ b/debian/patches-rt/0032-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch @@ -1,7 +1,12 @@ +From 49d48ae23e845a4b2daeb6bfae37d5c8f5e3acbf Mon Sep 17 00:00:00 2001 From: Benedikt Spranger <b.spranger@linutronix.de> Date: Mon, 8 Mar 2010 18:57:04 +0100 -Subject: clocksource: TCLIB: Allow higher clock rates for clock events -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 032/266] clocksource: TCLIB: Allow higher clock rates for + clock events +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz As default the TCLIB uses the 32KiHz base clock rate for clock events. Add a compile time selection to allow higher clock resulution. @@ -11,10 +16,12 @@ Add a compile time selection to allow higher clock resulution. Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - drivers/clocksource/tcb_clksrc.c | 36 +++++++++++++++++++++--------------- - drivers/misc/Kconfig | 12 ++++++++++-- + drivers/clocksource/tcb_clksrc.c | 36 +++++++++++++++++++------------- + drivers/misc/Kconfig | 12 +++++++++-- 2 files changed, 31 insertions(+), 17 deletions(-) +diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c +index de6baf564dfe..ba15242a6066 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c @@ -25,8 +25,7 @@ @@ -35,7 +42,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void __iomem *regs; }; -@@ -135,13 +135,6 @@ static struct tc_clkevt_device *to_tc_cl +@@ -135,13 +135,6 @@ static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt) return container_of(clkevt, struct tc_clkevt_device, clkevt); } @@ -49,7 +56,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static u32 timer_clock; static void tc_clk_disable(struct clock_event_device *d) -@@ -191,7 +184,7 @@ static int tc_set_oneshot(struct clock_e +@@ -191,7 +184,7 @@ static int tc_set_oneshot(struct clock_event_device *d) tc_clk_enable(d); @@ -58,7 +65,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO, regs + ATMEL_TC_REG(2, CMR)); writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); -@@ -213,10 +206,10 @@ static int tc_set_periodic(struct clock_ +@@ -213,10 +206,10 @@ static int tc_set_periodic(struct clock_event_device *d) */ tc_clk_enable(d); @@ -71,7 +78,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* Enable clock and interrupts on RC compare */ writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER)); -@@ -243,7 +236,11 @@ static struct tc_clkevt_device clkevt = +@@ -243,7 +236,11 @@ static struct tc_clkevt_device clkevt = { .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, /* Should be lower than at91rm9200's system timer */ @@ -83,7 +90,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> .set_next_event = tc_next_event, .set_state_shutdown = tc_shutdown_clk_off, .set_state_periodic = tc_set_periodic, -@@ -265,8 +262,9 @@ static irqreturn_t ch2_irq(int irq, void +@@ -265,8 +262,9 @@ static irqreturn_t ch2_irq(int irq, void *handle) return IRQ_NONE; } @@ -94,7 +101,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> int ret; struct clk *t2_clk = tc->clk[2]; int irq = tc->irq[2]; -@@ -287,7 +285,11 @@ static int __init setup_clkevents(struct +@@ -287,7 +285,11 @@ static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) clkevt.regs = tc->regs; clkevt.clk = t2_clk; @@ -107,7 +114,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> clkevt.clkevt.cpumask = cpumask_of(0); -@@ -298,7 +300,7 @@ static int __init setup_clkevents(struct +@@ -298,7 +300,7 @@ static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) return ret; } @@ -128,6 +135,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (ret) goto err_unregister_clksrc; +diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig +index 3726eacdf65d..0900dec7ec04 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -69,8 +69,7 @@ config ATMEL_TCB_CLKSRC @@ -156,3 +165,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> config DUMMY_IRQ tristate "Dummy IRQ handler" default n +-- +2.20.1 + diff --git a/debian/patches-rt/timekeeping-split-jiffies-lock.patch b/debian/patches-rt/0033-timekeeping-Split-jiffies-seqlock.patch index 8350e4446..f40ee0f68 100644 --- a/debian/patches-rt/timekeeping-split-jiffies-lock.patch +++ b/debian/patches-rt/0033-timekeeping-Split-jiffies-seqlock.patch @@ -1,23 +1,26 @@ -Subject: timekeeping: Split jiffies seqlock +From 3ae267e2e8aab45de92b1aa5900c038e4dc41f50 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 14 Feb 2013 22:36:59 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 033/266] timekeeping: Split jiffies seqlock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Replace jiffies_lock seqlock with a simple seqcounter and a rawlock so it can be taken in atomic context on RT. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/time/jiffies.c | 7 ++++--- - kernel/time/tick-common.c | 10 ++++++---- - kernel/time/tick-sched.c | 19 ++++++++++++------- - kernel/time/timekeeping.c | 6 ++++-- - kernel/time/timekeeping.h | 3 ++- + kernel/time/jiffies.c | 7 ++++--- + kernel/time/tick-common.c | 10 ++++++---- + kernel/time/tick-sched.c | 19 ++++++++++++------- + kernel/time/timekeeping.c | 6 ++++-- + kernel/time/timekeeping.h | 3 ++- 5 files changed, 28 insertions(+), 17 deletions(-) +diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c +index 497719127bf9..62acb8914c9e 100644 --- a/kernel/time/jiffies.c +++ b/kernel/time/jiffies.c -@@ -74,7 +74,8 @@ static struct clocksource clocksource_ji +@@ -74,7 +74,8 @@ static struct clocksource clocksource_jiffies = { .max_cycles = 10, }; @@ -39,6 +42,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return ret; } EXPORT_SYMBOL(get_jiffies_64); +diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c +index 14de3727b18e..7a87a4488a5e 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -79,13 +79,15 @@ int tick_is_oneshot_available(void) @@ -59,7 +64,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> update_wall_time(); } -@@ -157,9 +159,9 @@ void tick_setup_periodic(struct clock_ev +@@ -157,9 +159,9 @@ void tick_setup_periodic(struct clock_event_device *dev, int broadcast) ktime_t next; do { @@ -71,9 +76,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT); +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index 5b33e2f5c0ed..54fd344ef973 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -67,7 +67,8 @@ static void tick_do_update_jiffies64(kti +@@ -67,7 +67,8 @@ static void tick_do_update_jiffies64(ktime_t now) return; /* Reevaluate with jiffies_lock held */ @@ -83,7 +90,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> delta = ktime_sub(now, last_jiffies_update); if (delta >= tick_period) { -@@ -90,10 +91,12 @@ static void tick_do_update_jiffies64(kti +@@ -90,10 +91,12 @@ static void tick_do_update_jiffies64(ktime_t now) /* Keep the tick_next_period variable up to date */ tick_next_period = ktime_add(last_jiffies_update, tick_period); } else { @@ -98,7 +105,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> update_wall_time(); } -@@ -104,12 +107,14 @@ static ktime_t tick_init_jiffy_update(vo +@@ -104,12 +107,14 @@ static ktime_t tick_init_jiffy_update(void) { ktime_t period; @@ -115,7 +122,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return period; } -@@ -652,10 +657,10 @@ static ktime_t tick_nohz_next_event(stru +@@ -652,10 +657,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 { @@ -128,6 +135,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ts->last_jiffies = basejiff; ts->timer_expires_base = basemono; +diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c +index 7846ce24ecc0..68cf97548cba 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -2417,8 +2417,10 @@ EXPORT_SYMBOL(hardpps); @@ -143,6 +152,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> + raw_spin_unlock(&jiffies_lock); update_wall_time(); } +diff --git a/kernel/time/timekeeping.h b/kernel/time/timekeeping.h +index 7a9b4eb7a1d5..acdcf97c99b6 100644 --- a/kernel/time/timekeeping.h +++ b/kernel/time/timekeeping.h @@ -18,7 +18,8 @@ extern void timekeeping_resume(void); @@ -155,3 +166,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define CS_NAME_LEN 32 +-- +2.20.1 + diff --git a/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch b/debian/patches-rt/0034-signal-Revert-ptrace-preempt-magic.patch index fbca7a0b1..f07dbcea2 100644 --- a/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch +++ b/debian/patches-rt/0034-signal-Revert-ptrace-preempt-magic.patch @@ -1,7 +1,8 @@ -Subject: signal: Revert ptrace preempt magic +From 2175ca2814836e7e7d495cf207d249a002d49ee0 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 21 Sep 2011 19:57:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 034/266] signal: Revert ptrace preempt magic +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more than a bandaid around the ptrace design trainwreck. It's not a @@ -9,12 +10,14 @@ correctness issue, it's merily a cosmetic bandaid. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/signal.c | 8 -------- + kernel/signal.c | 8 -------- 1 file changed, 8 deletions(-) +diff --git a/kernel/signal.c b/kernel/signal.c +index 9102d60fc5c6..f29def2be652 100644 --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -2094,15 +2094,7 @@ static void ptrace_stop(int exit_code, i +@@ -2094,15 +2094,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); @@ -30,3 +33,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> freezable_schedule(); } else { /* +-- +2.20.1 + diff --git a/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch b/debian/patches-rt/0035-net-sched-Use-msleep-instead-of-yield.patch index 02af24684..723183248 100644 --- a/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch +++ b/debian/patches-rt/0035-net-sched-Use-msleep-instead-of-yield.patch @@ -1,7 +1,8 @@ +From df35af291276401c47cf6afbd0bc820042b377f6 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde <mkl@pengutronix.de> Date: Wed, 5 Mar 2014 00:49:47 +0100 -Subject: net: sched: Use msleep() instead of yield() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 035/266] net: sched: Use msleep() instead of yield() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On PREEMPT_RT enabled systems the interrupt handler run as threads at prio 50 (by default). If a high priority userspace process tries to shut down a busy @@ -42,12 +43,14 @@ solution. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - net/sched/sch_generic.c | 2 +- + net/sched/sch_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c +index 77b289da7763..31b9c2b415b4 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c -@@ -1184,7 +1184,7 @@ void dev_deactivate_many(struct list_hea +@@ -1183,7 +1183,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)) @@ -56,3 +59,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* The new qdisc is assigned at this point so we can safely * unwind stale skb lists and qdisc statistics */ +-- +2.20.1 + diff --git a/debian/patches-rt/dm-rq-remove-BUG_ON-irqs_disabled-check.patch b/debian/patches-rt/0036-dm-rq-remove-BUG_ON-irqs_disabled-check.patch index 35e3a5fe5..2488ae2af 100644 --- a/debian/patches-rt/dm-rq-remove-BUG_ON-irqs_disabled-check.patch +++ b/debian/patches-rt/0036-dm-rq-remove-BUG_ON-irqs_disabled-check.patch @@ -1,7 +1,8 @@ +From 8af534638743235393fc2e64e1c5733004109d9f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 27 Mar 2018 16:24:15 +0200 -Subject: [PATCH] dm rq: remove BUG_ON(!irqs_disabled) check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 036/266] dm rq: remove BUG_ON(!irqs_disabled) check +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In commit 052189a2ec95 ("dm: remove superfluous irq disablement in dm_request_fn") the spin_lock_irq() was replaced with spin_lock() + a @@ -16,12 +17,14 @@ Cc: Keith Busch <keith.busch@intel.com> Cc: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/md/dm-rq.c | 1 - + drivers/md/dm-rq.c | 1 - 1 file changed, 1 deletion(-) +diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c +index 6e547b8dd298..29736c7e5f1f 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c -@@ -688,7 +688,6 @@ static void dm_old_request_fn(struct req +@@ -688,7 +688,6 @@ static void dm_old_request_fn(struct request_queue *q) /* Establish tio->ti before queuing work (map_tio_request) */ tio->ti = ti; kthread_queue_work(&md->kworker, &tio->work); @@ -29,3 +32,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } +-- +2.20.1 + diff --git a/debian/patches-rt/usb-do-not-disable-interrupts-in-giveback.patch b/debian/patches-rt/0037-usb-do-no-disable-interrupts-in-giveback.patch index 0902e2b10..7576749be 100644 --- a/debian/patches-rt/usb-do-not-disable-interrupts-in-giveback.patch +++ b/debian/patches-rt/0037-usb-do-no-disable-interrupts-in-giveback.patch @@ -1,7 +1,8 @@ +From c2f85857815236fb7367336e1a6f1edcc87b137b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 8 Nov 2013 17:34:54 +0100 -Subject: usb: do no disable interrupts in giveback -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 037/266] usb: do no disable interrupts in giveback +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Since commit 94dfd7ed ("USB: HCD: support giveback of URB in tasklet context") the USB code disables interrupts before invoking the complete @@ -15,12 +16,14 @@ Longeterm we should force all HCDs to complete in the same context. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/usb/core/hcd.c | 3 --- + drivers/usb/core/hcd.c | 3 --- 1 file changed, 3 deletions(-) +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c +index 1c21955fe7c0..7863dec34f0b 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c -@@ -1738,7 +1738,6 @@ static void __usb_hcd_giveback_urb(struc +@@ -1738,7 +1738,6 @@ static void __usb_hcd_giveback_urb(struct urb *urb) struct usb_hcd *hcd = bus_to_hcd(urb->dev->bus); struct usb_anchor *anchor = urb->anchor; int status = urb->unlinked; @@ -28,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> urb->hcpriv = NULL; if (unlikely((urb->transfer_flags & URB_SHORT_NOT_OK) && -@@ -1766,9 +1765,7 @@ static void __usb_hcd_giveback_urb(struc +@@ -1766,9 +1765,7 @@ static void __usb_hcd_giveback_urb(struct urb *urb) * and no one may trigger the above deadlock situation when * running complete() in tasklet. */ @@ -38,3 +41,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> usb_anchor_resume_wakeups(anchor); atomic_dec(&urb->use_count); +-- +2.20.1 + diff --git a/debian/patches-rt/rt-preempt-base-config.patch b/debian/patches-rt/0038-rt-Provide-PREEMPT_RT_BASE-config-switch.patch index ef0bd33a8..da979e646 100644 --- a/debian/patches-rt/rt-preempt-base-config.patch +++ b/debian/patches-rt/0038-rt-Provide-PREEMPT_RT_BASE-config-switch.patch @@ -1,7 +1,8 @@ -Subject: rt: Provide PREEMPT_RT_BASE config switch +From 667e1ce22caf422d9c7b4b05bdde2c47a2e74756 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 17 Jun 2011 12:39:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 038/266] rt: Provide PREEMPT_RT_BASE config switch +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Introduce PREEMPT_RT_BASE which enables parts of PREEMPT_RT_FULL. Forces interrupt threading and enables some of the RT @@ -9,9 +10,11 @@ substitutions for testing. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/Kconfig.preempt | 21 ++++++++++++++++++--- + kernel/Kconfig.preempt | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) +diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt +index cd1655122ec0..027db5976c2f 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -1,3 +1,10 @@ @@ -56,3 +59,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - bool \ No newline at end of file + bool +-- +2.20.1 + diff --git a/debian/patches-rt/cpumask-disable-offstack-on-rt.patch b/debian/patches-rt/0039-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch index 10cff97d3..4b66f14de 100644 --- a/debian/patches-rt/cpumask-disable-offstack-on-rt.patch +++ b/debian/patches-rt/0039-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch @@ -1,7 +1,8 @@ -Subject: cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT +From 18f9f1c6657f01598563025bf4d8c56bee127c3e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 14 Dec 2011 01:03:49 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 039/266] cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz There are "valid" GFP_ATOMIC allocations such as @@ -41,10 +42,12 @@ which forbid allocations at run-time. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/x86/Kconfig | 2 +- - lib/Kconfig | 1 + + arch/x86/Kconfig | 2 +- + lib/Kconfig | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index 44c6a82b7ce5..06c3ec0c9c12 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -934,7 +934,7 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT @@ -56,6 +59,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---help--- Enable maximum number of CPUS and NUMA Nodes for this architecture. If unsure, say N. +diff --git a/lib/Kconfig b/lib/Kconfig +index a3928d4438b5..a50b2158f7cd 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -441,6 +441,7 @@ config CHECK_SIGNATURE @@ -66,3 +71,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> help Use dynamic allocation for cpumask_var_t, instead of putting them on the stack. This is a bit more expensive, but avoids +-- +2.20.1 + diff --git a/debian/patches-rt/jump-label-rt.patch b/debian/patches-rt/0040-jump-label-disable-if-stop_machine-is-used.patch index 09862188b..fba88e30d 100644 --- a/debian/patches-rt/jump-label-rt.patch +++ b/debian/patches-rt/0040-jump-label-disable-if-stop_machine-is-used.patch @@ -1,7 +1,8 @@ -Subject: jump-label: disable if stop_machine() is used +From 285155bfdfd713f7a20b7b2607bebaa3b6e226d6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 08 Jul 2015 17:14:48 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Wed, 8 Jul 2015 17:14:48 +0200 +Subject: [PATCH 040/266] jump-label: disable if stop_machine() is used +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Some architectures are using stop_machine() while switching the opcode which leads to latency spikes. @@ -20,9 +21,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> [bigeasy: only ARM for now] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm/Kconfig | 2 +- + arch/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index cd4c74daf71e..27a5f0b9ddc7 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -51,7 +51,7 @@ config ARM @@ -34,3 +37,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU select HAVE_ARCH_MMAP_RND_BITS if MMU select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) +-- +2.20.1 + diff --git a/debian/patches-rt/kconfig-disable-a-few-options-rt.patch b/debian/patches-rt/0041-kconfig-Disable-config-options-which-are-not-RT-comp.patch index 8373ebdc7..fde8177a5 100644 --- a/debian/patches-rt/kconfig-disable-a-few-options-rt.patch +++ b/debian/patches-rt/0041-kconfig-Disable-config-options-which-are-not-RT-comp.patch @@ -1,16 +1,20 @@ -Subject: kconfig: Disable config options which are not RT compatible +From d751d981bb0b049a6d70770a570d844cc6d7d69f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 24 Jul 2011 12:11:43 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 041/266] kconfig: Disable config options which are not RT + compatible +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Disable stuff which is known to have issues on RT Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/Kconfig | 1 + - mm/Kconfig | 2 +- + arch/Kconfig | 1 + + mm/Kconfig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) +diff --git a/arch/Kconfig b/arch/Kconfig +index 6801123932a5..42b9062b9dbf 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -28,6 +28,7 @@ config OPROFILE @@ -21,6 +25,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> select RING_BUFFER select RING_BUFFER_ALLOW_SWAP help +diff --git a/mm/Kconfig b/mm/Kconfig +index de64ea658716..438460486a5b 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -377,7 +377,7 @@ config NOMMU_INITIAL_TRIM_EXCESS @@ -32,3 +38,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> select COMPACTION select RADIX_TREE_MULTIORDER help +-- +2.20.1 + diff --git a/debian/patches-rt/lockdep-disable-self-test.patch b/debian/patches-rt/0042-lockdep-disable-self-test.patch index 2fd0534f9..de18c4b4d 100644 --- a/debian/patches-rt/lockdep-disable-self-test.patch +++ b/debian/patches-rt/0042-lockdep-disable-self-test.patch @@ -1,10 +1,11 @@ +From c0eb3a8fa85bf6f84e02e76fcb71c49ed95e08c3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 17 Oct 2017 16:36:18 +0200 -Subject: [PATCH] lockdep: disable self-test +Subject: [PATCH 042/266] lockdep: disable self-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The self-test wasn't always 100% accurate for RT. We disabled a few tests which failed because they had a different semantic for RT. Some @@ -13,9 +14,11 @@ during boot and it needs to be investigated… Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - lib/Kconfig.debug | 2 +- + lib/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug +index 4966c4fbe7f7..92e7d88946f7 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1207,7 +1207,7 @@ config DEBUG_ATOMIC_SLEEP @@ -27,3 +30,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> help Say Y here if you want the kernel to run a short self-test during bootup. The self-test checks whether common types of locking bugs +-- +2.20.1 + diff --git a/debian/patches-rt/mm-disable-sloub-rt.patch b/debian/patches-rt/0043-mm-Allow-only-slub-on-RT.patch index 897e69245..59089f609 100644 --- a/debian/patches-rt/mm-disable-sloub-rt.patch +++ b/debian/patches-rt/0043-mm-Allow-only-slub-on-RT.patch @@ -1,17 +1,19 @@ +From 3c67357f9ddd2cd3edc9e9703489fe065841c745 Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:44:03 -0500 -Subject: mm: Allow only slub on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 043/266] mm: Allow only slub on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - init/Kconfig | 2 ++ + init/Kconfig | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/init/Kconfig b/init/Kconfig +index 864af10bb1b9..f3f073942c30 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1634,6 +1634,7 @@ choice @@ -30,3 +32,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> help SLOB replaces the stock allocator with a drastically simpler allocator. SLOB is generally more space efficient but +-- +2.20.1 + diff --git a/debian/patches-rt/mutex-no-spin-on-rt.patch b/debian/patches-rt/0044-locking-Disable-spin-on-owner-for-RT.patch index 539766a92..346a8b6d2 100644 --- a/debian/patches-rt/mutex-no-spin-on-rt.patch +++ b/debian/patches-rt/0044-locking-Disable-spin-on-owner-for-RT.patch @@ -1,16 +1,22 @@ +From da969770d426e1540fefe9ce5babeb38ed79736e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 17 Jul 2011 21:51:45 +0200 -Subject: locking: Disable spin on owner for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 044/266] locking: Disable spin on owner for RT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Drop spin on owner for mutex / rwsem. We are most likely not using it but… Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/Kconfig.locks | 4 ++-- + kernel/Kconfig.locks | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks +index 84d882f3e299..af27c4000812 100644 --- a/kernel/Kconfig.locks +++ b/kernel/Kconfig.locks @@ -225,11 +225,11 @@ config ARCH_SUPPORTS_ATOMIC_RMW @@ -27,3 +33,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> config LOCK_SPIN_ON_OWNER def_bool y +-- +2.20.1 + diff --git a/debian/patches-rt/rcu-disable-rcu-fast-no-hz-on-rt.patch b/debian/patches-rt/0045-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch index 81ebd696f..298699ab6 100644 --- a/debian/patches-rt/rcu-disable-rcu-fast-no-hz-on-rt.patch +++ b/debian/patches-rt/0045-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch @@ -1,17 +1,19 @@ -Subject: rcu: Disable RCU_FAST_NO_HZ on RT +From 7693a7d0ace9236acfc968d46960678bf81951a2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 28 Oct 2012 13:26:09 +0000 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 045/266] rcu: Disable RCU_FAST_NO_HZ on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz This uses a timer_list timer from the irq disabled guts of the idle code. Disable it for now to prevent wreckage. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - kernel/rcu/Kconfig | 2 +- + kernel/rcu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig +index 9210379c0353..644264be90f0 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -172,7 +172,7 @@ config RCU_FANOUT_LEAF @@ -23,3 +25,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> default n help This option permits CPUs to enter dynticks-idle state even if +-- +2.20.1 + diff --git a/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch b/debian/patches-rt/0046-rcu-make-RCU_BOOST-default-on-RT.patch index 3934c4892..e896afe94 100644 --- a/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch +++ b/debian/patches-rt/0046-rcu-make-RCU_BOOST-default-on-RT.patch @@ -1,7 +1,8 @@ +From 9663e4eb2ef8749e6888e179b36148a33b0903b6 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 21 Mar 2014 20:19:05 +0100 -Subject: rcu: make RCU_BOOST default on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 046/266] rcu: make RCU_BOOST default on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Since it is no longer invoked from the softirq people run into OOM more often if the priority of the RCU thread is too low. Making boosting @@ -10,9 +11,11 @@ someone knows better. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/rcu/Kconfig | 4 ++-- + kernel/rcu/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig +index 644264be90f0..a243a78ff38c 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -190,8 +190,8 @@ config RCU_FAST_NO_HZ @@ -26,3 +29,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> help This option boosts the priority of preempted RCU readers that block the current preemptible RCU grace period for too long. +-- +2.20.1 + diff --git a/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch b/debian/patches-rt/0047-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch index 32cd533ae..50bef9763 100644 --- a/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch +++ b/debian/patches-rt/0047-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch @@ -1,7 +1,8 @@ -Subject: sched: Disable CONFIG_RT_GROUP_SCHED on RT +From 066901c0a5deb8707fb2288c085499a4c497b029 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 18 Jul 2011 17:03:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 047/266] sched: Disable CONFIG_RT_GROUP_SCHED on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Carsten reported problems when running: @@ -14,9 +15,11 @@ shell. Disabling CONFIG_RT_GROUP_SCHED solves that as well. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - init/Kconfig | 1 + + init/Kconfig | 1 + 1 file changed, 1 insertion(+) +diff --git a/init/Kconfig b/init/Kconfig +index f3f073942c30..707ca4d49944 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -781,6 +781,7 @@ config CFS_BANDWIDTH @@ -27,3 +30,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> default n help This feature lets you explicitly allocate real CPU bandwidth +-- +2.20.1 + diff --git a/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch b/debian/patches-rt/0048-net-core-disable-NET_RX_BUSY_POLL.patch index 2eb67878d..b41b2f643 100644 --- a/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch +++ b/debian/patches-rt/0048-net-core-disable-NET_RX_BUSY_POLL.patch @@ -1,7 +1,11 @@ +From 41d940e10ea6260a89e82f3bc62428bca1a8373a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Sat, 27 May 2017 19:02:06 +0200 -Subject: net/core: disable NET_RX_BUSY_POLL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 048/266] net/core: disable NET_RX_BUSY_POLL +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz sk_busy_loop() does preempt_disable() followed by a few operations which can take sleeping locks and may get long. @@ -13,9 +17,11 @@ could be invoked again. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - net/Kconfig | 2 +- + net/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/net/Kconfig b/net/Kconfig +index 228dfa382eec..bc8d01996f22 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -275,7 +275,7 @@ config CGROUP_NET_CLASSID @@ -27,3 +33,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> config BQL bool +-- +2.20.1 + diff --git a/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch b/debian/patches-rt/0049-arm-disable-NEON-in-kernel-mode.patch index f906f3bdd..1c5b9f445 100644 --- a/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch +++ b/debian/patches-rt/0049-arm-disable-NEON-in-kernel-mode.patch @@ -1,7 +1,8 @@ +From 971f370fb7433d4b34102c32dea2095776b569b1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 1 Dec 2017 10:42:03 +0100 -Subject: [PATCH] arm*: disable NEON in kernel mode -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 049/266] arm*: disable NEON in kernel mode +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz NEON in kernel mode is used by the crypto algorithms and raid6 code. While the raid6 code looks okay, the crypto algorithms do not: NEON @@ -14,14 +15,16 @@ stay on due to possible EFI callbacks so here I disable each algorithm. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm/Kconfig | 2 +- - arch/arm64/crypto/Kconfig | 28 ++++++++++++++-------------- - arch/arm64/crypto/crc32-ce-glue.c | 3 ++- + arch/arm/Kconfig | 2 +- + arch/arm64/crypto/Kconfig | 28 ++++++++++++++-------------- + arch/arm64/crypto/crc32-ce-glue.c | 3 ++- 3 files changed, 17 insertions(+), 16 deletions(-) +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index 27a5f0b9ddc7..91f4f80a6f24 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -2160,7 +2160,7 @@ config NEON +@@ -2161,7 +2161,7 @@ config NEON config KERNEL_MODE_NEON bool "Support for NEON in kernel mode" @@ -30,6 +33,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> help Say Y to include support for NEON in kernel mode. +diff --git a/arch/arm64/crypto/Kconfig b/arch/arm64/crypto/Kconfig +index d51944ff9f91..0d4b3f0cfba6 100644 --- a/arch/arm64/crypto/Kconfig +++ b/arch/arm64/crypto/Kconfig @@ -19,43 +19,43 @@ config CRYPTO_SHA512_ARM64 @@ -142,9 +147,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> select CRYPTO_BLKCIPHER select CRYPTO_AES_ARM64_NEON_BLK select CRYPTO_AES_ARM64 +diff --git a/arch/arm64/crypto/crc32-ce-glue.c b/arch/arm64/crypto/crc32-ce-glue.c +index 34b4e3d46aab..ae055cdad8cf 100644 --- a/arch/arm64/crypto/crc32-ce-glue.c +++ b/arch/arm64/crypto/crc32-ce-glue.c -@@ -208,7 +208,8 @@ static struct shash_alg crc32_pmull_algs +@@ -208,7 +208,8 @@ static struct shash_alg crc32_pmull_algs[] = { { static int __init crc32_pmull_mod_init(void) { @@ -154,3 +161,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> crc32_pmull_algs[0].update = crc32_pmull_update; crc32_pmull_algs[1].update = crc32c_pmull_update; +-- +2.20.1 + diff --git a/debian/patches-rt/power-use-generic-rwsem-on-rt.patch b/debian/patches-rt/0050-powerpc-Use-generic-rwsem-on-RT.patch index 16f18ce60..b1819104a 100644 --- a/debian/patches-rt/power-use-generic-rwsem-on-rt.patch +++ b/debian/patches-rt/0050-powerpc-Use-generic-rwsem-on-RT.patch @@ -1,15 +1,18 @@ +From 50ff216c2966385635b18c93bcbd6fc09bb6a942 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: powerpc: Use generic rwsem on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 050/266] powerpc: Use generic rwsem on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Use generic code which uses rtmutex Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/powerpc/Kconfig | 3 ++- + arch/powerpc/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) +diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig +index a80669209155..9952764db9c5 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -105,10 +105,11 @@ config LOCKDEP_SUPPORT @@ -25,3 +28,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> config GENERIC_LOCKBREAK bool +-- +2.20.1 + diff --git a/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/debian/patches-rt/0051-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch index 499aa51a8..32ab6e9ac 100644 --- a/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ b/debian/patches-rt/0051-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch @@ -1,7 +1,9 @@ +From a87ef1b342f7eccaee4350f3b40f04cb8146563f Mon Sep 17 00:00:00 2001 From: Bogdan Purcareata <bogdan.purcareata@freescale.com> Date: Fri, 24 Apr 2015 15:53:13 +0000 -Subject: powerpc/kvm: Disable in-kernel MPIC emulation for PREEMPT_RT_FULL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 051/266] powerpc/kvm: Disable in-kernel MPIC emulation for + PREEMPT_RT_FULL +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz While converting the openpic emulation code to use a raw_spinlock_t enables guests to run on RT, there's still a performance issue. For interrupts sent in @@ -23,9 +25,11 @@ Acked-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/powerpc/kvm/Kconfig | 1 + + arch/powerpc/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) +diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig +index 68a0e9d5b440..6f4d5d7615af 100644 --- a/arch/powerpc/kvm/Kconfig +++ b/arch/powerpc/kvm/Kconfig @@ -178,6 +178,7 @@ config KVM_E500MC @@ -36,3 +40,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> select HAVE_KVM_IRQCHIP select HAVE_KVM_IRQFD select HAVE_KVM_IRQ_ROUTING +-- +2.20.1 + diff --git a/debian/patches-rt/power-disable-highmem-on-rt.patch b/debian/patches-rt/0052-powerpc-Disable-highmem-on-RT.patch index 4050e77e7..3da0c3fd8 100644 --- a/debian/patches-rt/power-disable-highmem-on-rt.patch +++ b/debian/patches-rt/0052-powerpc-Disable-highmem-on-RT.patch @@ -1,15 +1,18 @@ -Subject: powerpc: Disable highmem on RT +From 82b9e441c6737a2e2b23018ef6ee5e8ea70bea92 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 18 Jul 2011 17:08:34 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 052/266] powerpc: Disable highmem on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The current highmem handling on -RT is not compatible and needs fixups. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/powerpc/Kconfig | 2 +- + arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig +index 9952764db9c5..1563820a37e8 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -398,7 +398,7 @@ menu "Kernel options" @@ -21,3 +24,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> source kernel/Kconfig.hz +-- +2.20.1 + diff --git a/debian/patches-rt/mips-disable-highmem-on-rt.patch b/debian/patches-rt/0053-mips-Disable-highmem-on-RT.patch index 6cc3bc089..4713003ff 100644 --- a/debian/patches-rt/mips-disable-highmem-on-rt.patch +++ b/debian/patches-rt/0053-mips-Disable-highmem-on-RT.patch @@ -1,15 +1,18 @@ -Subject: mips: Disable highmem on RT +From 1f9a74c4a2b97a80e19078334933194464eea4e4 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 18 Jul 2011 17:10:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 053/266] mips: Disable highmem on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The current highmem handling on -RT is not compatible and needs fixups. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/mips/Kconfig | 2 +- + arch/mips/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig +index 201caf226b47..bd268302efa4 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2517,7 +2517,7 @@ config MIPS_CRC_SUPPORT @@ -21,3 +24,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> config CPU_SUPPORTS_HIGHMEM bool +-- +2.20.1 + diff --git a/debian/patches-rt/x86-use-gen-rwsem-spinlocks-rt.patch b/debian/patches-rt/0054-x86-Use-generic-rwsem_spinlocks-on-rt.patch index 355dc4a7a..fbd8efa53 100644 --- a/debian/patches-rt/x86-use-gen-rwsem-spinlocks-rt.patch +++ b/debian/patches-rt/0054-x86-Use-generic-rwsem_spinlocks-on-rt.patch @@ -1,17 +1,19 @@ +From 9090d6e680a6bc0177bc228d335f7185ae51a20b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 26 Jul 2009 02:21:32 +0200 -Subject: x86: Use generic rwsem_spinlocks on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 054/266] x86: Use generic rwsem_spinlocks on -rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Simplifies the separation of anon_rw_semaphores and rw_semaphores for -rt. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - arch/x86/Kconfig | 5 ++++- + arch/x86/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index 06c3ec0c9c12..8c56260bdf84 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -264,8 +264,11 @@ config ARCH_MAY_HAVE_PC_FDC @@ -27,3 +29,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> config GENERIC_CALIBRATE_DELAY def_bool y +-- +2.20.1 + diff --git a/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch b/debian/patches-rt/0055-leds-trigger-disable-CPU-trigger-on-RT.patch index a99ea777c..31d298a8c 100644 --- a/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch +++ b/debian/patches-rt/0055-leds-trigger-disable-CPU-trigger-on-RT.patch @@ -1,7 +1,8 @@ +From 6735813a67410ba9afbfa1a69797e4b21b41e5d6 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 23 Jan 2014 14:45:59 +0100 -Subject: leds: trigger: disable CPU trigger on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 055/266] leds: trigger: disable CPU trigger on -RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz as it triggers: |CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 @@ -20,9 +21,11 @@ as it triggers: Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/leds/trigger/Kconfig | 1 + + drivers/leds/trigger/Kconfig | 1 + 1 file changed, 1 insertion(+) +diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig +index 4018af769969..b4ce8c115949 100644 --- a/drivers/leds/trigger/Kconfig +++ b/drivers/leds/trigger/Kconfig @@ -63,6 +63,7 @@ config LEDS_TRIGGER_BACKLIGHT @@ -33,3 +36,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> help This allows LEDs to be controlled by active CPUs. This shows the active CPUs across an array of LEDs so you can see which +-- +2.20.1 + diff --git a/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch b/debian/patches-rt/0056-cpufreq-drop-K8-s-driver-from-beeing-selected.patch index 871e92e93..21acd228e 100644 --- a/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch +++ b/debian/patches-rt/0056-cpufreq-drop-K8-s-driver-from-beeing-selected.patch @@ -1,7 +1,8 @@ +From 5c0e9974fc9f622e71e435b87ffad62998c6ab07 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 9 Apr 2015 15:23:01 +0200 -Subject: cpufreq: drop K8's driver from beeing selected -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 056/266] cpufreq: drop K8's driver from beeing selected +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Ralf posted a picture of a backtrace from @@ -17,9 +18,11 @@ I have no machine with this, I simply switch it off. Reported-by: Ralf Mardorf <ralf.mardorf@alice-dsl.net> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/cpufreq/Kconfig.x86 | 2 +- + drivers/cpufreq/Kconfig.x86 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86 +index 35f71825b7f3..bb4a6160d0f7 100644 --- a/drivers/cpufreq/Kconfig.x86 +++ b/drivers/cpufreq/Kconfig.x86 @@ -125,7 +125,7 @@ config X86_POWERNOW_K7_ACPI @@ -31,3 +34,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> help This adds the CPUFreq driver for K8/early Opteron/Athlon64 processors. Support for K10 and newer processors is now in acpi-cpufreq. +-- +2.20.1 + diff --git a/debian/patches-rt/md-disable-bcache.patch b/debian/patches-rt/0057-md-disable-bcache.patch index 5fa1d2fa9..bded8d530 100644 --- a/debian/patches-rt/md-disable-bcache.patch +++ b/debian/patches-rt/0057-md-disable-bcache.patch @@ -1,7 +1,11 @@ +From affa4221731e24ded417ce3ae0d456609f586437 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 29 Aug 2013 11:48:57 +0200 -Subject: md: disable bcache -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 057/266] md: disable bcache +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz It uses anon semaphores |drivers/md/bcache/request.c: In function ‘cached_dev_write_complete’: @@ -17,9 +21,11 @@ either we get rid of those or we have to introduce them… Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/md/bcache/Kconfig | 1 + + drivers/md/bcache/Kconfig | 1 + 1 file changed, 1 insertion(+) +diff --git a/drivers/md/bcache/Kconfig b/drivers/md/bcache/Kconfig +index f6e0a8b3a61e..18c03d79a442 100644 --- a/drivers/md/bcache/Kconfig +++ b/drivers/md/bcache/Kconfig @@ -1,6 +1,7 @@ @@ -30,3 +36,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> select CRC64 help Allows a block device to be used as cache for other devices; uses +-- +2.20.1 + diff --git a/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch b/debian/patches-rt/0058-efi-Disable-runtime-services-on-RT.patch index e402bd457..04406364f 100644 --- a/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch +++ b/debian/patches-rt/0058-efi-Disable-runtime-services-on-RT.patch @@ -1,7 +1,8 @@ +From f6bac5f902f6e18278e4e5882195b993725d520b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 26 Jul 2018 15:03:16 +0200 -Subject: [PATCH] efi: Disable runtime services on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 058/266] efi: Disable runtime services on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Based on meassurements the EFI functions get_variable / get_next_variable take up to 2us which looks okay. @@ -24,9 +25,11 @@ This was observed on "EFI v2.60 by SoftIron Overdrive 1000". Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/firmware/efi/efi.c | 2 +- + drivers/firmware/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c +index ab668e17fd05..f58ab9ed4ade 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -87,7 +87,7 @@ struct mm_struct efi_mm = { @@ -38,3 +41,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static int __init setup_noefi(char *arg) { disable_runtime = true; +-- +2.20.1 + diff --git a/debian/patches-rt/printk-kill.patch b/debian/patches-rt/0059-printk-Add-a-printk-kill-switch.patch index f31c685c9..236bebab3 100644 --- a/debian/patches-rt/printk-kill.patch +++ b/debian/patches-rt/0059-printk-Add-a-printk-kill-switch.patch @@ -1,18 +1,21 @@ -Subject: printk: Add a printk kill switch +From db94b434e576549c696fa88efa6da37686c3105e Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> Date: Fri, 22 Jul 2011 17:58:40 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 059/266] printk: Add a printk kill switch +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Add a prinkt-kill-switch. This is used from (NMI) watchdog to ensure that it does not dead-lock with the early printk code. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/printk.h | 2 + - kernel/printk/printk.c | 79 ++++++++++++++++++++++++++++++++++++------------- - kernel/watchdog_hld.c | 10 ++++++ + include/linux/printk.h | 2 ++ + kernel/printk/printk.c | 79 +++++++++++++++++++++++++++++++----------- + kernel/watchdog_hld.c | 10 ++++++ 3 files changed, 71 insertions(+), 20 deletions(-) +diff --git a/include/linux/printk.h b/include/linux/printk.h +index cf3eccfe1543..30ebf5f82a7c 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -140,9 +140,11 @@ struct va_format { @@ -27,6 +30,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif #ifdef CONFIG_PRINTK_NMI +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 06045abd1887..413160a93814 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -405,6 +405,58 @@ DEFINE_RAW_SPINLOCK(logbuf_lock); @@ -88,7 +93,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_PRINTK DECLARE_WAIT_QUEUE_HEAD(log_wait); /* the next printk record to read by syslog(READ) or /proc/kmsg */ -@@ -1897,6 +1949,13 @@ asmlinkage int vprintk_emit(int facility +@@ -1897,6 +1949,13 @@ asmlinkage int vprintk_emit(int facility, int level, bool in_sched = false; unsigned long flags; @@ -102,7 +107,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (level == LOGLEVEL_SCHED) { level = LOGLEVEL_DEFAULT; in_sched = true; -@@ -2037,26 +2096,6 @@ static bool suppress_message_printing(in +@@ -2037,26 +2096,6 @@ static bool suppress_message_printing(int level) { return false; } #endif /* CONFIG_PRINTK */ @@ -129,9 +134,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static int __add_preferred_console(char *name, int idx, char *options, char *brl_options) { +diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c +index 71381168dede..685443375dc0 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c -@@ -24,6 +24,8 @@ static DEFINE_PER_CPU(bool, hard_watchdo +@@ -24,6 +24,8 @@ static DEFINE_PER_CPU(bool, hard_watchdog_warn); static DEFINE_PER_CPU(bool, watchdog_nmi_touch); static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); static DEFINE_PER_CPU(struct perf_event *, dead_event); @@ -140,7 +147,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static struct cpumask dead_events_mask; static unsigned long hardlockup_allcpu_dumped; -@@ -134,6 +136,13 @@ static void watchdog_overflow_callback(s +@@ -134,6 +136,13 @@ static void watchdog_overflow_callback(struct perf_event *event, /* only print hardlockups once */ if (__this_cpu_read(hard_watchdog_warn) == true) return; @@ -154,7 +161,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> pr_emerg("Watchdog detected hard LOCKUP on cpu %d", this_cpu); print_modules(); -@@ -151,6 +160,7 @@ static void watchdog_overflow_callback(s +@@ -151,6 +160,7 @@ static void watchdog_overflow_callback(struct perf_event *event, !test_and_set_bit(0, &hardlockup_allcpu_dumped)) trigger_allbutself_cpu_backtrace(); @@ -162,3 +169,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (hardlockup_panic) nmi_panic(regs, "Hard LOCKUP"); +-- +2.20.1 + diff --git a/debian/patches-rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch b/debian/patches-rt/0060-printk-Add-force_early_printk-boot-param-to-help-wit.patch index 7eb7d7e0c..af3759441 100644 --- a/debian/patches-rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch +++ b/debian/patches-rt/0060-printk-Add-force_early_printk-boot-param-to-help-wit.patch @@ -1,7 +1,9 @@ -Subject: printk: Add "force_early_printk" boot param to help with debugging +From d8d56f3a4ed8403b82e04725ee6de60304deb3a3 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra <peterz@infradead.org> -Date: Fri, 02 Sep 2011 14:41:29 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Fri, 2 Sep 2011 14:41:29 +0200 +Subject: [PATCH 060/266] printk: Add "force_early_printk" boot param to help + with debugging +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Gives me an option to screw printk and actually see what the machine says. @@ -11,12 +13,14 @@ Link: http://lkml.kernel.org/r/1314967289.1301.11.camel@twins Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/n/tip-ykb97nsfmobq44xketrxs977@git.kernel.org --- - kernel/printk/printk.c | 7 +++++++ + kernel/printk/printk.c | 7 +++++++ 1 file changed, 7 insertions(+) +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 413160a93814..6553508ff388 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -435,6 +435,13 @@ asmlinkage void early_printk(const char +@@ -435,6 +435,13 @@ asmlinkage void early_printk(const char *fmt, ...) */ static bool __read_mostly printk_killswitch; @@ -30,3 +34,6 @@ Link: http://lkml.kernel.org/n/tip-ykb97nsfmobq44xketrxs977@git.kernel.org void printk_kill(void) { printk_killswitch = true; +-- +2.20.1 + diff --git a/debian/patches-rt/preempt-nort-rt-variants.patch b/debian/patches-rt/0061-preempt-Provide-preempt_-_-no-rt-variants.patch index 481f22c3e..91841a096 100644 --- a/debian/patches-rt/preempt-nort-rt-variants.patch +++ b/debian/patches-rt/0061-preempt-Provide-preempt_-_-no-rt-variants.patch @@ -1,17 +1,19 @@ +From 06d1d562d9934f5c0fa80e760657900af0dd35cd Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 24 Jul 2009 12:38:56 +0200 -Subject: preempt: Provide preempt_*_(no)rt variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 061/266] preempt: Provide preempt_*_(no)rt variants +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz RT needs a few preempt_disable/enable points which are not necessary otherwise. Implement variants to avoid #ifdeffery. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - include/linux/preempt.h | 18 +++++++++++++++++- + include/linux/preempt.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 3196d0e76719..f7a17fcc3fec 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -181,7 +181,11 @@ do { \ @@ -46,3 +48,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_PREEMPT_NOTIFIERS struct preempt_notifier; +-- +2.20.1 + diff --git a/debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch b/debian/patches-rt/0062-futex-workaround-migrate_disable-enable-in-different.patch index b7033104b..c6d6b6900 100644 --- a/debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch +++ b/debian/patches-rt/0062-futex-workaround-migrate_disable-enable-in-different.patch @@ -1,7 +1,9 @@ +From fcac9e8e052ad0a523a1cf3096b7e506754fa454 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 8 Mar 2017 14:23:35 +0100 -Subject: [PATCH] futex: workaround migrate_disable/enable in different context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 062/266] futex: workaround migrate_disable/enable in different + context +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz migrate_disable()/migrate_enable() takes a different path in atomic() vs !atomic() context. These little hacks ensure that we don't underflow / overflow @@ -11,12 +13,14 @@ enabled and unlock it with interrupts disabled. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/futex.c | 19 +++++++++++++++++++ + kernel/futex.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) +diff --git a/kernel/futex.c b/kernel/futex.c +index c5fca746edc4..cea098efd12e 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2856,6 +2856,14 @@ static int futex_lock_pi(u32 __user *uad +@@ -2859,6 +2859,14 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, * before __rt_mutex_start_proxy_lock() is done. */ raw_spin_lock_irq(&q.pi_state->pi_mutex.wait_lock); @@ -31,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> spin_unlock(q.lock_ptr); /* * __rt_mutex_start_proxy_lock() unconditionally enqueues the @rt_waiter -@@ -2864,6 +2872,7 @@ static int futex_lock_pi(u32 __user *uad +@@ -2867,6 +2875,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, */ ret = __rt_mutex_start_proxy_lock(&q.pi_state->pi_mutex, &rt_waiter, current); raw_spin_unlock_irq(&q.pi_state->pi_mutex.wait_lock); @@ -39,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (ret) { if (ret == 1) -@@ -3012,11 +3021,21 @@ static int futex_unlock_pi(u32 __user *u +@@ -3015,11 +3024,21 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) * rt_waiter. Also see the WARN in wake_futex_pi(). */ raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); @@ -61,3 +65,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> put_pi_state(pi_state); /* +-- +2.20.1 + diff --git a/debian/patches-rt/rt-local-irq-lock.patch b/debian/patches-rt/0063-rt-Add-local-irq-locks.patch index fe3ecdc33..e608fab40 100644 --- a/debian/patches-rt/rt-local-irq-lock.patch +++ b/debian/patches-rt/0063-rt-Add-local-irq-locks.patch @@ -1,7 +1,8 @@ -Subject: rt: Add local irq locks +From f9239dc23086d9c032d0d537c9963abb576143ee Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 20 Jun 2011 09:03:47 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 063/266] rt: Add local irq locks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Introduce locallock. For !RT this maps to preempt_disable()/ local_irq_disable() so there is not much that changes. For RT this will @@ -13,10 +14,14 @@ is held and the owner is preempted. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/locallock.h | 271 ++++++++++++++++++++++++++++++++++++++++++++++ - include/linux/percpu.h | 29 ++++ + include/linux/locallock.h | 271 ++++++++++++++++++++++++++++++++++++++ + include/linux/percpu.h | 29 ++++ 2 files changed, 300 insertions(+) + create mode 100644 include/linux/locallock.h +diff --git a/include/linux/locallock.h b/include/linux/locallock.h +new file mode 100644 +index 000000000000..d658c2552601 --- /dev/null +++ b/include/linux/locallock.h @@ -0,0 +1,271 @@ @@ -291,6 +296,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +#endif + +#endif +diff --git a/include/linux/percpu.h b/include/linux/percpu.h +index 70b7123f38c7..24421bf8c4b3 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -19,6 +19,35 @@ @@ -329,3 +336,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* minimum unit size, also is the maximum supported allocation size */ #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10) +-- +2.20.1 + diff --git a/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch b/debian/patches-rt/0064-locallock-provide-get-put-_locked_ptr-variants.patch index ed71abd2f..83f01db6b 100644 --- a/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch +++ b/debian/patches-rt/0064-locallock-provide-get-put-_locked_ptr-variants.patch @@ -1,7 +1,8 @@ +From 9e4d01906d9d81f07d456fb83b1bdd5ff019047f Mon Sep 17 00:00:00 2001 From: Julia Cartwright <julia@ni.com> Date: Mon, 7 May 2018 08:58:56 -0500 -Subject: [PATCH] locallock: provide {get,put}_locked_ptr() variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 064/266] locallock: provide {get,put}_locked_ptr() variants +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Provide a set of locallocked accessors for pointers to per-CPU data; this is useful for dynamically-allocated per-CPU regions, for example. @@ -12,12 +13,14 @@ variants. Signed-off-by: Julia Cartwright <julia@ni.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/locallock.h | 10 ++++++++++ + include/linux/locallock.h | 10 ++++++++++ 1 file changed, 10 insertions(+) +diff --git a/include/linux/locallock.h b/include/linux/locallock.h +index d658c2552601..921eab83cd34 100644 --- a/include/linux/locallock.h +++ b/include/linux/locallock.h -@@ -222,6 +222,14 @@ static inline int __local_unlock_irqrest +@@ -222,6 +222,14 @@ static inline int __local_unlock_irqrestore(struct local_irq_lock *lv, #define put_locked_var(lvar, var) local_unlock(lvar); @@ -32,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define local_lock_cpu(lvar) \ ({ \ local_lock(lvar); \ -@@ -262,6 +270,8 @@ static inline void local_irq_lock_init(i +@@ -262,6 +270,8 @@ static inline void local_irq_lock_init(int lvar) { } #define get_locked_var(lvar, var) get_cpu_var(var) #define put_locked_var(lvar, var) put_cpu_var(var) @@ -41,3 +44,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define local_lock_cpu(lvar) get_cpu() #define local_unlock_cpu(lvar) put_cpu() +-- +2.20.1 + diff --git a/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch b/debian/patches-rt/0065-mm-scatterlist-Do-not-disable-irqs-on-RT.patch index 25d62b0d5..6c66a1554 100644 --- a/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch +++ b/debian/patches-rt/0065-mm-scatterlist-Do-not-disable-irqs-on-RT.patch @@ -1,19 +1,22 @@ +From 4fd0a81c1f1b284d3b3833169556b1476d2aa4e8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 3 Jul 2009 08:44:34 -0500 -Subject: mm/scatterlist: Do not disable irqs on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 065/266] mm/scatterlist: Do not disable irqs on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz For -RT it is enough to keep pagefault disabled (which is currently handled by kmap_atomic()). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - lib/scatterlist.c | 2 +- + lib/scatterlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/lib/scatterlist.c b/lib/scatterlist.c +index 7c6096a71704..5c2c68962709 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c -@@ -776,7 +776,7 @@ void sg_miter_stop(struct sg_mapping_ite +@@ -776,7 +776,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter) flush_kernel_dcache_page(miter->page); if (miter->__flags & SG_MITER_ATOMIC) { @@ -22,3 +25,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> kunmap_atomic(miter->addr); } else kunmap(miter->page); +-- +2.20.1 + diff --git a/debian/patches-rt/oleg-signal-rt-fix.patch b/debian/patches-rt/0066-signal-x86-Delay-calling-signals-in-atomic.patch index 980395045..4d6130793 100644 --- a/debian/patches-rt/oleg-signal-rt-fix.patch +++ b/debian/patches-rt/0066-signal-x86-Delay-calling-signals-in-atomic.patch @@ -1,7 +1,8 @@ +From bacf069f1145a471fbdaafd0d2e75d1ca061c4e9 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov <oleg@redhat.com> Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: signal/x86: Delay calling signals in atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 066/266] signal/x86: Delay calling signals in atomic +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On x86_64 we must disable preemption before we enable interrupts for stack faults, int3 and debugging, because the current task is using @@ -30,16 +31,17 @@ Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - - arch/x86/entry/common.c | 7 +++++++ - arch/x86/include/asm/signal.h | 13 +++++++++++++ - include/linux/sched.h | 4 ++++ - kernel/signal.c | 37 +++++++++++++++++++++++++++++++++++-- + arch/x86/entry/common.c | 7 +++++++ + arch/x86/include/asm/signal.h | 13 ++++++++++++ + include/linux/sched.h | 4 ++++ + kernel/signal.c | 37 +++++++++++++++++++++++++++++++++-- 4 files changed, 59 insertions(+), 2 deletions(-) +diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c +index 3b2490b81918..ec46ee700791 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c -@@ -151,6 +151,13 @@ static void exit_to_usermode_loop(struct +@@ -151,6 +151,13 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) if (cached_flags & _TIF_NEED_RESCHED) schedule(); @@ -53,6 +55,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (cached_flags & _TIF_UPROBE) uprobe_notify_resume(regs); +diff --git a/arch/x86/include/asm/signal.h b/arch/x86/include/asm/signal.h +index 33d3c88a7225..fb0438d06ca7 100644 --- a/arch/x86/include/asm/signal.h +++ b/arch/x86/include/asm/signal.h @@ -28,6 +28,19 @@ typedef struct { @@ -75,6 +79,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifndef CONFIG_COMPAT typedef sigset_t compat_sigset_t; #endif +diff --git a/include/linux/sched.h b/include/linux/sched.h +index fad3583f0933..daa99f3b7c78 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -881,6 +881,10 @@ struct task_struct { @@ -88,9 +94,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> unsigned long sas_ss_sp; size_t sas_ss_size; unsigned int sas_ss_flags; +diff --git a/kernel/signal.c b/kernel/signal.c +index f29def2be652..57c48b3d1491 100644 --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -1268,8 +1268,8 @@ int do_send_sig_info(int sig, struct sig +@@ -1268,8 +1268,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. */ @@ -101,7 +109,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> { unsigned long int flags; int ret, blocked, ignored; -@@ -1298,6 +1298,39 @@ force_sig_info(int sig, struct siginfo * +@@ -1298,6 +1298,39 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t) return ret; } @@ -141,3 +149,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Nuke all other threads in the group. */ +-- +2.20.1 + diff --git a/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch b/debian/patches-rt/0067-x86-signal-delay-calling-signals-on-32bit.patch index 8e51799b4..11975669f 100644 --- a/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch +++ b/debian/patches-rt/0067-x86-signal-delay-calling-signals-on-32bit.patch @@ -1,7 +1,8 @@ +From fdbf4b87f2f3db9fbada1069ca5f38dc2384cec6 Mon Sep 17 00:00:00 2001 From: Yang Shi <yang.shi@linaro.org> Date: Thu, 10 Dec 2015 10:58:51 -0800 -Subject: x86/signal: delay calling signals on 32bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 067/266] x86/signal: delay calling signals on 32bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz When running some ptrace single step tests on x86-32 machine, the below problem is triggered: @@ -27,9 +28,11 @@ from IST context") which was merged in v4.1-rc1. Signed-off-by: Yang Shi <yang.shi@linaro.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/include/asm/signal.h | 2 +- + arch/x86/include/asm/signal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/x86/include/asm/signal.h b/arch/x86/include/asm/signal.h +index fb0438d06ca7..c00e27af2205 100644 --- a/arch/x86/include/asm/signal.h +++ b/arch/x86/include/asm/signal.h @@ -37,7 +37,7 @@ typedef struct { @@ -41,3 +44,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define ARCH_RT_DELAYS_SIGNAL_SEND #endif +-- +2.20.1 + diff --git a/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch b/debian/patches-rt/0068-buffer_head-Replace-bh_uptodate_lock-for-rt.patch index cf8a9add8..2c07c2e42 100644 --- a/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch +++ b/debian/patches-rt/0068-buffer_head-Replace-bh_uptodate_lock-for-rt.patch @@ -1,22 +1,25 @@ +From b46962ff96a6d54dd6173294d9ae9f48286b213e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 18 Mar 2011 09:18:52 +0100 -Subject: buffer_head: Replace bh_uptodate_lock for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 068/266] buffer_head: Replace bh_uptodate_lock for -rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Wrap the bit_spin_lock calls into a separate inline and add the RT replacements with a real spinlock. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - fs/buffer.c | 21 +++++++-------------- - fs/ext4/page-io.c | 6 ++---- - fs/ntfs/aops.c | 10 +++------- - include/linux/buffer_head.h | 34 ++++++++++++++++++++++++++++++++++ + fs/buffer.c | 21 +++++++-------------- + fs/ext4/page-io.c | 6 ++---- + fs/ntfs/aops.c | 10 +++------- + include/linux/buffer_head.h | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 25 deletions(-) +diff --git a/fs/buffer.c b/fs/buffer.c +index c083c4b3c1e7..b0ac4454b4a0 100644 --- a/fs/buffer.c +++ b/fs/buffer.c -@@ -273,8 +273,7 @@ static void end_buffer_async_read(struct +@@ -274,8 +274,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) * decide that the page is now completely done. */ first = page_buffers(page); @@ -26,7 +29,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> clear_buffer_async_read(bh); unlock_buffer(bh); tmp = bh; -@@ -287,8 +286,7 @@ static void end_buffer_async_read(struct +@@ -288,8 +287,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) } tmp = tmp->b_this_page; } while (tmp != bh); @@ -36,7 +39,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * If none of the buffers had errors and they are all -@@ -300,9 +298,7 @@ static void end_buffer_async_read(struct +@@ -301,9 +299,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate) return; still_busy: @@ -47,7 +50,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* -@@ -329,8 +325,7 @@ void end_buffer_async_write(struct buffe +@@ -330,8 +326,7 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate) } first = page_buffers(page); @@ -57,7 +60,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> clear_buffer_async_write(bh); unlock_buffer(bh); -@@ -342,15 +337,12 @@ void end_buffer_async_write(struct buffe +@@ -343,15 +338,12 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate) } tmp = tmp->b_this_page; } @@ -75,7 +78,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } EXPORT_SYMBOL(end_buffer_async_write); -@@ -3360,6 +3352,7 @@ struct buffer_head *alloc_buffer_head(gf +@@ -3361,6 +3353,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); @@ -83,9 +86,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> preempt_disable(); __this_cpu_inc(bh_accounting.nr); recalc_bh_state(); +diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c +index db7590178dfc..d76364124443 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c -@@ -95,8 +95,7 @@ static void ext4_finish_bio(struct bio * +@@ -95,8 +95,7 @@ static void ext4_finish_bio(struct bio *bio) * We check all buffers in the page under BH_Uptodate_Lock * to avoid races with other end io clearing async_write flags */ @@ -95,7 +100,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> 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 * +@@ -108,8 +107,7 @@ static void ext4_finish_bio(struct bio *bio) if (bio->bi_status) buffer_io_error(bh); } while ((bh = bh->b_this_page) != head); @@ -105,9 +110,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (!under_io) { #ifdef CONFIG_EXT4_FS_ENCRYPTION if (data_page) +diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c +index 8946130c87ad..71d0b3ba70f8 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c -@@ -106,8 +106,7 @@ static void ntfs_end_buffer_async_read(s +@@ -106,8 +106,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) "0x%llx.", (unsigned long long)bh->b_blocknr); } first = page_buffers(page); @@ -117,7 +124,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> clear_buffer_async_read(bh); unlock_buffer(bh); tmp = bh; -@@ -122,8 +121,7 @@ static void ntfs_end_buffer_async_read(s +@@ -122,8 +121,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) } tmp = tmp->b_this_page; } while (tmp != bh); @@ -127,7 +134,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * If none of the buffers had errors then we can set the page uptodate, * but we first have to perform the post read mst fixups, if the -@@ -156,9 +154,7 @@ static void ntfs_end_buffer_async_read(s +@@ -156,9 +154,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) unlock_page(page); return; still_busy: @@ -138,6 +145,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /** +diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h +index 96225a77c112..8a1bcfb145d7 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -76,8 +76,42 @@ struct buffer_head { @@ -183,3 +192,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * macro tricks to expand the set_buffer_foo(), clear_buffer_foo() * and buffer_foo() functions. +-- +2.20.1 + diff --git a/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch b/debian/patches-rt/0069-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch index 0647db39f..deafdb32b 100644 --- a/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch +++ b/debian/patches-rt/0069-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch @@ -1,7 +1,9 @@ +From 3c12ff53bd33aa4b2a87422ac8ae4a39ca3fd689 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 18 Mar 2011 10:11:25 +0100 -Subject: fs: jbd/jbd2: Make state lock and journal head lock rt safe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 069/266] fs: jbd/jbd2: Make state lock and journal head lock + rt safe +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz bit_spin_locks break under RT. @@ -11,7 +13,13 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> include/linux/buffer_head.h | 8 ++++++++ include/linux/jbd2.h | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) +--- + include/linux/buffer_head.h | 8 ++++++++ + include/linux/jbd2.h | 24 ++++++++++++++++++++++++ + 2 files changed, 32 insertions(+) +diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h +index 8a1bcfb145d7..5869330d1f38 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -78,6 +78,10 @@ struct buffer_head { @@ -25,7 +33,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif }; -@@ -109,6 +113,10 @@ static inline void buffer_head_init_lock +@@ -109,6 +113,10 @@ static inline void buffer_head_init_locks(struct buffer_head *bh) { #ifdef CONFIG_PREEMPT_RT_BASE spin_lock_init(&bh->b_uptodate_lock); @@ -36,9 +44,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif } +diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h +index b708e5169d1d..018665350951 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h -@@ -347,32 +347,56 @@ static inline struct journal_head *bh2jh +@@ -347,32 +347,56 @@ static inline struct journal_head *bh2jh(struct buffer_head *bh) static inline void jbd_lock_bh_state(struct buffer_head *bh) { @@ -95,3 +105,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } #define J_ASSERT(assert) BUG_ON(!(assert)) +-- +2.20.1 + diff --git a/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch b/debian/patches-rt/0070-list_bl-Make-list-head-locking-RT-safe.patch index 535550b95..c4f3690f0 100644 --- a/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch +++ b/debian/patches-rt/0070-list_bl-Make-list-head-locking-RT-safe.patch @@ -1,7 +1,8 @@ +From 49c5f6e11359ffcdc8b0c3dd8bf22a629534760e Mon Sep 17 00:00:00 2001 From: Paul Gortmaker <paul.gortmaker@windriver.com> Date: Fri, 21 Jun 2013 15:07:25 -0400 -Subject: list_bl: Make list head locking RT safe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 070/266] list_bl: Make list head locking RT safe +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz As per changes in include/linux/jbd_common.h for avoiding the bit_spin_locks on RT ("fs: jbd/jbd2: Make state lock and journal @@ -48,9 +49,11 @@ concern. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/list_bl.h | 28 ++++++++++++++++++++++++++-- + include/linux/list_bl.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) +diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h +index 3fc2cc57ba1b..69b659259bac 100644 --- a/include/linux/list_bl.h +++ b/include/linux/list_bl.h @@ -3,6 +3,7 @@ @@ -86,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) { -@@ -119,12 +129,26 @@ static inline void hlist_bl_del_init(str +@@ -119,12 +129,26 @@ static inline void hlist_bl_del_init(struct hlist_bl_node *n) static inline void hlist_bl_lock(struct hlist_bl_head *b) { @@ -113,3 +116,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static inline bool hlist_bl_is_locked(struct hlist_bl_head *b) +-- +2.20.1 + diff --git a/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch b/debian/patches-rt/0071-list_bl-fixup-bogus-lockdep-warning.patch index 62a936d1a..8dc52cb4d 100644 --- a/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch +++ b/debian/patches-rt/0071-list_bl-fixup-bogus-lockdep-warning.patch @@ -1,7 +1,8 @@ +From 18baa05e062b4a3e349cc30313d665960c98d33c Mon Sep 17 00:00:00 2001 From: Josh Cartwright <joshc@ni.com> Date: Thu, 31 Mar 2016 00:04:25 -0500 -Subject: [PATCH] list_bl: fixup bogus lockdep warning -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 071/266] list_bl: fixup bogus lockdep warning +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz At first glance, the use of 'static inline' seems appropriate for INIT_HLIST_BL_HEAD(). @@ -70,9 +71,11 @@ Tested-by: Luis Claudio R. Goncalves <lclaudio@uudg.org> Signed-off-by: Josh Cartwright <joshc@ni.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/list_bl.h | 12 +++++++----- + include/linux/list_bl.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) +diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h +index 69b659259bac..0b5de7d9ffcf 100644 --- a/include/linux/list_bl.h +++ b/include/linux/list_bl.h @@ -43,13 +43,15 @@ struct hlist_bl_node { @@ -96,3 +99,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) { +-- +2.20.1 + diff --git a/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch b/debian/patches-rt/0072-genirq-Disable-irqpoll-on-rt.patch index 0f5484f29..3e9005456 100644 --- a/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch +++ b/debian/patches-rt/0072-genirq-Disable-irqpoll-on-rt.patch @@ -1,20 +1,22 @@ +From 2f7ec5b079ec9ac3bff29d542d21e5ecd6f14d0f Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:29:57 -0500 -Subject: genirq: Disable irqpoll on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 072/266] genirq: Disable irqpoll on -rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Creates long latencies for no value Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - kernel/irq/spurious.c | 8 ++++++++ + kernel/irq/spurious.c | 8 ++++++++ 1 file changed, 8 insertions(+) +diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c +index d867d6ddafdd..cd12ee86c01e 100644 --- a/kernel/irq/spurious.c +++ b/kernel/irq/spurious.c -@@ -442,6 +442,10 @@ MODULE_PARM_DESC(noirqdebug, "Disable ir +@@ -442,6 +442,10 @@ MODULE_PARM_DESC(noirqdebug, "Disable irq lockup detection when true"); static int __init irqfixup_setup(char *str) { @@ -36,3 +38,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> irqfixup = 2; printk(KERN_WARNING "Misrouted IRQ fixup and polling support " "enabled\n"); +-- +2.20.1 + diff --git a/debian/patches-rt/genirq-force-threading.patch b/debian/patches-rt/0073-genirq-Force-interrupt-thread-on-RT.patch index c25fb81a4..92d2c0813 100644 --- a/debian/patches-rt/genirq-force-threading.patch +++ b/debian/patches-rt/0073-genirq-Force-interrupt-thread-on-RT.patch @@ -1,20 +1,23 @@ -Subject: genirq: Force interrupt thread on RT +From a21ce2ad1b7d3e1927e69f5ff85f00035cc31e43 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Sun, 03 Apr 2011 11:57:29 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Sun, 3 Apr 2011 11:57:29 +0200 +Subject: [PATCH 073/266] genirq: Force interrupt thread on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Force threaded_irqs and optimize the code (force_irqthreads) in regard to this. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/interrupt.h | 4 ++++ - kernel/irq/manage.c | 2 ++ + include/linux/interrupt.h | 4 ++++ + kernel/irq/manage.c | 2 ++ 2 files changed, 6 insertions(+) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index eeceac3376fc..315f852b4981 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -427,7 +427,11 @@ extern int irq_set_irqchip_state(unsigne +@@ -427,7 +427,11 @@ extern int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, bool state); #ifdef CONFIG_IRQ_FORCED_THREADING @@ -26,6 +29,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #else #define force_irqthreads (0) #endif +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index 5c0ba5ca5930..94a18cf54293 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -23,6 +23,7 @@ @@ -36,7 +41,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> __read_mostly bool force_irqthreads; EXPORT_SYMBOL_GPL(force_irqthreads); -@@ -32,6 +33,7 @@ static int __init setup_forced_irqthread +@@ -32,6 +33,7 @@ static int __init setup_forced_irqthreads(char *arg) return 0; } early_param("threadirqs", setup_forced_irqthreads); @@ -44,3 +49,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif static void __synchronize_hardirq(struct irq_desc *desc) +-- +2.20.1 + diff --git a/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0074-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index 98be06765..ff89cfd73 100644 --- a/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0074-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -1,8 +1,9 @@ +From 6993ab71f072edd10b4f3e076c474cea6290b9da Mon Sep 17 00:00:00 2001 From: Peter Zijlstra <peterz@infradead.org> Date: Mon, 28 May 2018 15:24:20 +0200 -Subject: [PATCH 1/4] Split IRQ-off and zone->lock while freeing pages from PCP - list #1 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 074/266] Split IRQ-off and zone->lock while freeing pages from + PCP list #1 +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. @@ -13,12 +14,14 @@ free_pcppages_bulk(). Signed-off-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - mm/page_alloc.c | 82 +++++++++++++++++++++++++++++++++++--------------------- + mm/page_alloc.c | 82 +++++++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 30 deletions(-) +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index ef99971c13dd..a84ac7af753d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1095,7 +1095,7 @@ static inline void prefetch_buddy(struct +@@ -1095,7 +1095,7 @@ static inline void prefetch_buddy(struct page *page) } /* @@ -27,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * Assumes all pages on list are in same zone, and of same order. * count is the number of pages to free. * -@@ -1106,14 +1106,41 @@ static inline void prefetch_buddy(struct +@@ -1106,14 +1106,41 @@ static inline void prefetch_buddy(struct page *page) * pinned" detection logic. */ static void free_pcppages_bulk(struct zone *zone, int count, @@ -73,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> while (count) { struct list_head *list; -@@ -1145,7 +1172,7 @@ static void free_pcppages_bulk(struct zo +@@ -1145,7 +1172,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, if (bulkfree_pcp_prepare(page)) continue; @@ -82,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * We are going to put the page back to the global -@@ -1160,26 +1187,6 @@ static void free_pcppages_bulk(struct zo +@@ -1160,26 +1187,6 @@ static void free_pcppages_bulk(struct zone *zone, int count, prefetch_buddy(page); } while (--count && --batch_free && !list_empty(list)); } @@ -109,7 +112,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static void free_one_page(struct zone *zone, -@@ -2536,13 +2543,18 @@ void drain_zone_pages(struct zone *zone, +@@ -2536,13 +2543,18 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) { unsigned long flags; int to_drain, batch; @@ -129,7 +132,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } #endif -@@ -2558,14 +2570,21 @@ static void drain_pages_zone(unsigned in +@@ -2558,14 +2570,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; @@ -153,7 +156,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -2787,7 +2806,10 @@ static void free_unref_page_commit(struc +@@ -2787,7 +2806,10 @@ 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); @@ -165,3 +168,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } +-- +2.20.1 + diff --git a/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0075-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index ab7c6f4fe..f0ebed802 100644 --- a/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0075-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -1,8 +1,9 @@ +From 51ba31edfd57dc313746febb2897e6b0735300c6 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra <peterz@infradead.org> Date: Mon, 28 May 2018 15:24:21 +0200 -Subject: [PATCH 2/4] Split IRQ-off and zone->lock while freeing pages from PCP - list #2 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 075/266] Split IRQ-off and zone->lock while freeing pages from + PCP list #2 +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. @@ -13,12 +14,14 @@ free_pcppages_bulk(). Signed-off-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - mm/page_alloc.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++---------- + mm/page_alloc.c | 60 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 10 deletions(-) +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index a84ac7af753d..8a96b1e6f4f4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1105,8 +1105,8 @@ static inline void prefetch_buddy(struct +@@ -1105,8 +1105,8 @@ static inline void prefetch_buddy(struct page *page) * And clear the zone's pages_scanned counter, to hold off the "all pages are * pinned" detection logic. */ @@ -29,7 +32,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { bool isolated_pageblocks; struct page *page, *tmp; -@@ -1121,12 +1121,27 @@ static void free_pcppages_bulk(struct zo +@@ -1121,12 +1121,27 @@ static void free_pcppages_bulk(struct zone *zone, int count, */ list_for_each_entry_safe(page, tmp, head, lru) { int mt = get_pcppage_migratetype(page); @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> __free_one_page(page, page_to_pfn(page), zone, 0, mt); trace_mm_page_pcpu_drain(page, 0, mt); } -@@ -2554,7 +2569,7 @@ void drain_zone_pages(struct zone *zone, +@@ -2554,7 +2569,7 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) local_irq_restore(flags); if (to_drain > 0) @@ -66,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } #endif -@@ -2584,7 +2599,7 @@ static void drain_pages_zone(unsigned in +@@ -2584,7 +2599,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) local_irq_restore(flags); if (count) @@ -75,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -2777,7 +2792,8 @@ static bool free_unref_page_prepare(stru +@@ -2777,7 +2792,8 @@ static bool free_unref_page_prepare(struct page *page, unsigned long pfn) return true; } @@ -85,7 +88,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { struct zone *zone = page_zone(page); struct per_cpu_pages *pcp; -@@ -2806,10 +2822,8 @@ static void free_unref_page_commit(struc +@@ -2806,10 +2822,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); @@ -116,7 +119,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -2837,6 +2855,11 @@ void free_unref_page_list(struct list_he +@@ -2837,6 +2855,11 @@ void free_unref_page_list(struct list_head *list) struct page *page, *next; unsigned long flags, pfn; int batch_count = 0; @@ -128,7 +131,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Prepare pages for freeing */ list_for_each_entry_safe(page, next, list, lru) { -@@ -2849,10 +2872,12 @@ void free_unref_page_list(struct list_he +@@ -2849,10 +2872,12 @@ void free_unref_page_list(struct list_head *list) local_irq_save(flags); list_for_each_entry_safe(page, next, list, lru) { unsigned long pfn = page_private(page); @@ -142,7 +145,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Guard against excessive IRQ disabled times when we get -@@ -2865,6 +2890,21 @@ void free_unref_page_list(struct list_he +@@ -2865,6 +2890,21 @@ void free_unref_page_list(struct list_head *list) } } local_irq_restore(flags); @@ -164,3 +167,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* +-- +2.20.1 + diff --git a/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch b/debian/patches-rt/0076-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch index 4b4d7c015..3b9ae98fc 100644 --- a/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/0076-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch @@ -1,7 +1,8 @@ +From b143284103a8a0d48389a1335bdef9311113921d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 28 May 2018 15:24:22 +0200 -Subject: [PATCH 3/4] mm/SLxB: change list_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 076/266] mm/SLxB: change list_lock to raw_spinlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The list_lock is used with used with IRQs off on RT. Make it a raw_spinlock_t otherwise the interrupts won't be disabled on -RT. The locking rules remain @@ -12,14 +13,16 @@ file for struct kmem_cache_node defintion. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - mm/slab.c | 94 +++++++++++++++++++++++++++++++------------------------------- - mm/slab.h | 2 - - mm/slub.c | 50 ++++++++++++++++---------------- + mm/slab.c | 94 +++++++++++++++++++++++++++---------------------------- + mm/slab.h | 2 +- + mm/slub.c | 50 ++++++++++++++--------------- 3 files changed, 73 insertions(+), 73 deletions(-) +diff --git a/mm/slab.c b/mm/slab.c +index fad6839e8eab..a7ab3957282b 100644 --- a/mm/slab.c +++ b/mm/slab.c -@@ -233,7 +233,7 @@ static void kmem_cache_node_init(struct +@@ -233,7 +233,7 @@ static void kmem_cache_node_init(struct kmem_cache_node *parent) parent->shared = NULL; parent->alien = NULL; parent->colour_next = 0; @@ -28,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> parent->free_objects = 0; parent->free_touched = 0; } -@@ -600,9 +600,9 @@ static noinline void cache_free_pfmemall +@@ -600,9 +600,9 @@ static noinline void cache_free_pfmemalloc(struct kmem_cache *cachep, page_node = page_to_nid(page); n = get_node(cachep, page_node); @@ -40,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> slabs_destroy(cachep, &list); } -@@ -730,7 +730,7 @@ static void __drain_alien_cache(struct k +@@ -730,7 +730,7 @@ static void __drain_alien_cache(struct kmem_cache *cachep, struct kmem_cache_node *n = get_node(cachep, node); if (ac->avail) { @@ -49,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Stuff objects into the remote nodes shared array first. * That way we could avoid the overhead of putting the objects -@@ -741,7 +741,7 @@ static void __drain_alien_cache(struct k +@@ -741,7 +741,7 @@ static void __drain_alien_cache(struct kmem_cache *cachep, free_block(cachep, ac->entry, ac->avail, node, list); ac->avail = 0; @@ -58,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } -@@ -814,9 +814,9 @@ static int __cache_free_alien(struct kme +@@ -814,9 +814,9 @@ static int __cache_free_alien(struct kmem_cache *cachep, void *objp, slabs_destroy(cachep, &list); } else { n = get_node(cachep, page_node); @@ -70,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> slabs_destroy(cachep, &list); } return 1; -@@ -857,10 +857,10 @@ static int init_cache_node(struct kmem_c +@@ -857,10 +857,10 @@ static int init_cache_node(struct kmem_cache *cachep, int node, gfp_t gfp) */ n = get_node(cachep, node); if (n) { @@ -83,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } -@@ -939,7 +939,7 @@ static int setup_kmem_cache_node(struct +@@ -939,7 +939,7 @@ static int setup_kmem_cache_node(struct kmem_cache *cachep, goto fail; n = get_node(cachep, node); @@ -92,7 +95,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (n->shared && force_change) { free_block(cachep, n->shared->entry, n->shared->avail, node, &list); -@@ -957,7 +957,7 @@ static int setup_kmem_cache_node(struct +@@ -957,7 +957,7 @@ static int setup_kmem_cache_node(struct kmem_cache *cachep, new_alien = NULL; } @@ -128,7 +131,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> kfree(shared); if (alien) { -@@ -1207,7 +1207,7 @@ static void __init init_list(struct kmem +@@ -1207,7 +1207,7 @@ static void __init init_list(struct kmem_cache *cachep, struct kmem_cache_node * /* * Do not assume that spinlocks can be initialized via memcpy: */ @@ -137,7 +140,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> MAKE_ALL_LISTS(cachep, ptr, nodeid); cachep->node[nodeid] = ptr; -@@ -1378,11 +1378,11 @@ slab_out_of_memory(struct kmem_cache *ca +@@ -1378,11 +1378,11 @@ slab_out_of_memory(struct kmem_cache *cachep, gfp_t gfpflags, int nodeid) for_each_kmem_cache_node(cachep, node, n) { unsigned long total_slabs, free_slabs, free_objs; @@ -151,7 +154,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> pr_warn(" node %d: slabs: %ld/%ld, objs: %ld/%ld\n", node, total_slabs - free_slabs, total_slabs, -@@ -2175,7 +2175,7 @@ static void check_spinlock_acquired(stru +@@ -2175,7 +2175,7 @@ static void check_spinlock_acquired(struct kmem_cache *cachep) { #ifdef CONFIG_SMP check_irq_off(); @@ -160,7 +163,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #endif } -@@ -2183,7 +2183,7 @@ static void check_spinlock_acquired_node +@@ -2183,7 +2183,7 @@ static void check_spinlock_acquired_node(struct kmem_cache *cachep, int node) { #ifdef CONFIG_SMP check_irq_off(); @@ -181,7 +184,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> slabs_destroy(cachep, &list); ac->avail = 0; } -@@ -2243,9 +2243,9 @@ static void drain_cpu_caches(struct kmem +@@ -2243,9 +2243,9 @@ static void drain_cpu_caches(struct kmem_cache *cachep) drain_alien_cache(cachep, n->alien); for_each_kmem_cache_node(cachep, node, n) { @@ -193,7 +196,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> slabs_destroy(cachep, &list); } -@@ -2267,10 +2267,10 @@ static int drain_freelist(struct kmem_ca +@@ -2267,10 +2267,10 @@ static int drain_freelist(struct kmem_cache *cache, nr_freed = 0; while (nr_freed < tofree && !list_empty(&n->slabs_free)) { @@ -206,7 +209,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto out; } -@@ -2283,7 +2283,7 @@ static int drain_freelist(struct kmem_ca +@@ -2283,7 +2283,7 @@ static int drain_freelist(struct kmem_cache *cache, * to the cache. */ n->free_objects -= cache->num; @@ -215,7 +218,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> slab_destroy(cache, page); nr_freed++; } -@@ -2731,7 +2731,7 @@ static void cache_grow_end(struct kmem_c +@@ -2731,7 +2731,7 @@ static void cache_grow_end(struct kmem_cache *cachep, struct page *page) INIT_LIST_HEAD(&page->lru); n = get_node(cachep, page_to_nid(page)); @@ -224,7 +227,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> n->total_slabs++; if (!page->active) { list_add_tail(&page->lru, &(n->slabs_free)); -@@ -2741,7 +2741,7 @@ static void cache_grow_end(struct kmem_c +@@ -2741,7 +2741,7 @@ static void cache_grow_end(struct kmem_cache *cachep, struct page *page) STATS_INC_GROWN(cachep); n->free_objects += cachep->num - page->active; @@ -233,7 +236,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> fixup_objfreelist_debug(cachep, &list); } -@@ -2909,7 +2909,7 @@ static struct page *get_first_slab(struc +@@ -2909,7 +2909,7 @@ static struct page *get_first_slab(struct kmem_cache_node *n, bool pfmemalloc) { struct page *page; @@ -242,7 +245,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> page = list_first_entry_or_null(&n->slabs_partial, struct page, lru); if (!page) { n->free_touched = 1; -@@ -2935,10 +2935,10 @@ static noinline void *cache_alloc_pfmema +@@ -2935,10 +2935,10 @@ static noinline void *cache_alloc_pfmemalloc(struct kmem_cache *cachep, if (!gfp_pfmemalloc_allowed(flags)) return NULL; @@ -255,7 +258,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return NULL; } -@@ -2947,7 +2947,7 @@ static noinline void *cache_alloc_pfmema +@@ -2947,7 +2947,7 @@ static noinline void *cache_alloc_pfmemalloc(struct kmem_cache *cachep, fixup_slab_list(cachep, n, page, &list); @@ -264,7 +267,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> fixup_objfreelist_debug(cachep, &list); return obj; -@@ -3006,7 +3006,7 @@ static void *cache_alloc_refill(struct k +@@ -3006,7 +3006,7 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags) if (!n->free_objects && (!shared || !shared->avail)) goto direct_grow; @@ -273,7 +276,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> shared = READ_ONCE(n->shared); /* See if we can refill from the shared array */ -@@ -3030,7 +3030,7 @@ static void *cache_alloc_refill(struct k +@@ -3030,7 +3030,7 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags) must_grow: n->free_objects -= ac->avail; alloc_done: @@ -282,7 +285,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> fixup_objfreelist_debug(cachep, &list); direct_grow: -@@ -3255,7 +3255,7 @@ static void *____cache_alloc_node(struct +@@ -3255,7 +3255,7 @@ static void *____cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, BUG_ON(!n); check_irq_off(); @@ -291,7 +294,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> page = get_first_slab(n, false); if (!page) goto must_grow; -@@ -3273,12 +3273,12 @@ static void *____cache_alloc_node(struct +@@ -3273,12 +3273,12 @@ static void *____cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, fixup_slab_list(cachep, n, page, &list); @@ -306,7 +309,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> page = cache_grow_begin(cachep, gfp_exact_node(flags), nodeid); if (page) { /* This slab isn't counted yet so don't update free_objects */ -@@ -3454,7 +3454,7 @@ static void cache_flusharray(struct kmem +@@ -3454,7 +3454,7 @@ static void cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac) check_irq_off(); n = get_node(cachep, node); @@ -315,7 +318,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (n->shared) { struct array_cache *shared_array = n->shared; int max = shared_array->limit - shared_array->avail; -@@ -3483,7 +3483,7 @@ static void cache_flusharray(struct kmem +@@ -3483,7 +3483,7 @@ static void cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac) STATS_SET_FREEABLE(cachep, i); } #endif @@ -324,7 +327,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> slabs_destroy(cachep, &list); ac->avail -= batchcount; memmove(ac->entry, &(ac->entry[batchcount]), sizeof(void *)*ac->avail); -@@ -3893,9 +3893,9 @@ static int __do_tune_cpucache(struct kme +@@ -3893,9 +3893,9 @@ static int __do_tune_cpucache(struct kmem_cache *cachep, int limit, node = cpu_to_mem(cpu); n = get_node(cachep, node); @@ -336,7 +339,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> slabs_destroy(cachep, &list); } free_percpu(prev); -@@ -4020,9 +4020,9 @@ static void drain_array(struct kmem_cach +@@ -4020,9 +4020,9 @@ static void drain_array(struct kmem_cache *cachep, struct kmem_cache_node *n, return; } @@ -348,7 +351,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> slabs_destroy(cachep, &list); } -@@ -4106,7 +4106,7 @@ void get_slabinfo(struct kmem_cache *cac +@@ -4106,7 +4106,7 @@ void get_slabinfo(struct kmem_cache *cachep, struct slabinfo *sinfo) for_each_kmem_cache_node(cachep, node, n) { check_irq_on(); @@ -357,7 +360,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> total_slabs += n->total_slabs; free_slabs += n->free_slabs; -@@ -4115,7 +4115,7 @@ void get_slabinfo(struct kmem_cache *cac +@@ -4115,7 +4115,7 @@ void get_slabinfo(struct kmem_cache *cachep, struct slabinfo *sinfo) if (n->shared) shared_avail += n->shared->avail; @@ -366,7 +369,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } num_objs = total_slabs * cachep->num; active_slabs = total_slabs - free_slabs; -@@ -4330,13 +4330,13 @@ static int leaks_show(struct seq_file *m +@@ -4330,13 +4330,13 @@ static int leaks_show(struct seq_file *m, void *p) for_each_kmem_cache_node(cachep, node, n) { check_irq_on(); @@ -382,9 +385,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } while (!is_store_user_clean(cachep)); +diff --git a/mm/slab.h b/mm/slab.h +index 58c6c1c2a78e..e904021207f1 100644 --- a/mm/slab.h +++ b/mm/slab.h -@@ -453,7 +453,7 @@ static inline void slab_post_alloc_hook( +@@ -453,7 +453,7 @@ static inline void slab_post_alloc_hook(struct kmem_cache *s, gfp_t flags, * The slab lists for all objects. */ struct kmem_cache_node { @@ -393,9 +398,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #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 8da34a8af53d..298cd7d368de 100644 --- a/mm/slub.c +++ b/mm/slub.c -@@ -1167,7 +1167,7 @@ static noinline int free_debug_processin +@@ -1167,7 +1167,7 @@ static noinline int free_debug_processing( unsigned long uninitialized_var(flags); int ret = 0; @@ -404,7 +411,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> slab_lock(page); if (s->flags & SLAB_CONSISTENCY_CHECKS) { -@@ -1202,7 +1202,7 @@ static noinline int free_debug_processin +@@ -1202,7 +1202,7 @@ static noinline int free_debug_processing( bulk_cnt, cnt); slab_unlock(page); @@ -413,7 +420,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!ret) slab_fix(s, "Object at 0x%p not freed", object); return ret; -@@ -1802,7 +1802,7 @@ static void *get_partial_node(struct kme +@@ -1802,7 +1802,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, if (!n || !n->nr_partial) return NULL; @@ -422,7 +429,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> list_for_each_entry_safe(page, page2, &n->partial, lru) { void *t; -@@ -1827,7 +1827,7 @@ static void *get_partial_node(struct kme +@@ -1827,7 +1827,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, break; } @@ -431,7 +438,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return object; } -@@ -2073,7 +2073,7 @@ static void deactivate_slab(struct kmem_ +@@ -2073,7 +2073,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, * that acquire_slab() will see a slab page that * is frozen */ @@ -440,7 +447,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } else { m = M_FULL; -@@ -2084,7 +2084,7 @@ static void deactivate_slab(struct kmem_ +@@ -2084,7 +2084,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, * slabs from diagnostic functions will not see * any frozen slabs. */ @@ -449,7 +456,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } -@@ -2119,7 +2119,7 @@ static void deactivate_slab(struct kmem_ +@@ -2119,7 +2119,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, goto redo; if (lock) @@ -458,7 +465,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (m == M_FREE) { stat(s, DEACTIVATE_EMPTY); -@@ -2154,10 +2154,10 @@ static void unfreeze_partials(struct kme +@@ -2154,10 +2154,10 @@ static void unfreeze_partials(struct kmem_cache *s, n2 = get_node(s, page_to_nid(page)); if (n != n2) { if (n) @@ -471,7 +478,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } do { -@@ -2186,7 +2186,7 @@ static void unfreeze_partials(struct kme +@@ -2186,7 +2186,7 @@ static void unfreeze_partials(struct kmem_cache *s, } if (n) @@ -480,7 +487,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> while (discard_page) { page = discard_page; -@@ -2355,10 +2355,10 @@ static unsigned long count_partial(struc +@@ -2355,10 +2355,10 @@ static unsigned long count_partial(struct kmem_cache_node *n, unsigned long x = 0; struct page *page; @@ -493,7 +500,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return x; } #endif /* CONFIG_SLUB_DEBUG || CONFIG_SYSFS */ -@@ -2793,7 +2793,7 @@ static void __slab_free(struct kmem_cach +@@ -2793,7 +2793,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, do { if (unlikely(n)) { @@ -502,7 +509,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> n = NULL; } prior = page->freelist; -@@ -2825,7 +2825,7 @@ static void __slab_free(struct kmem_cach +@@ -2825,7 +2825,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, * Otherwise the list_lock will synchronize with * other processors updating the list of slabs. */ @@ -511,7 +518,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } -@@ -2867,7 +2867,7 @@ static void __slab_free(struct kmem_cach +@@ -2867,7 +2867,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, add_partial(n, page, DEACTIVATE_TO_TAIL); stat(s, FREE_ADD_PARTIAL); } @@ -520,7 +527,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return; slab_empty: -@@ -2882,7 +2882,7 @@ static void __slab_free(struct kmem_cach +@@ -2882,7 +2882,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, remove_full(s, n, page); } @@ -538,7 +545,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> INIT_LIST_HEAD(&n->partial); #ifdef CONFIG_SLUB_DEBUG atomic_long_set(&n->nr_slabs, 0); -@@ -3653,7 +3653,7 @@ static void free_partial(struct kmem_cac +@@ -3653,7 +3653,7 @@ static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) struct page *page, *h; BUG_ON(irqs_disabled()); @@ -547,7 +554,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> list_for_each_entry_safe(page, h, &n->partial, lru) { if (!page->inuse) { remove_partial(n, page); -@@ -3663,7 +3663,7 @@ static void free_partial(struct kmem_cac +@@ -3663,7 +3663,7 @@ static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) "Objects remaining in %s on __kmem_cache_shutdown()"); } } @@ -556,7 +563,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> list_for_each_entry_safe(page, h, &discard, lru) discard_slab(s, page); -@@ -3936,7 +3936,7 @@ int __kmem_cache_shrink(struct kmem_cach +@@ -3936,7 +3936,7 @@ int __kmem_cache_shrink(struct kmem_cache *s) for (i = 0; i < SHRINK_PROMOTE_MAX; i++) INIT_LIST_HEAD(promote + i); @@ -565,7 +572,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Build lists of slabs to discard or promote. -@@ -3967,7 +3967,7 @@ int __kmem_cache_shrink(struct kmem_cach +@@ -3967,7 +3967,7 @@ int __kmem_cache_shrink(struct kmem_cache *s) for (i = SHRINK_PROMOTE_MAX - 1; i >= 0; i--) list_splice(promote + i, &n->partial); @@ -574,7 +581,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Release empty slabs */ list_for_each_entry_safe(page, t, &discard, lru) -@@ -4381,7 +4381,7 @@ static int validate_slab_node(struct kme +@@ -4381,7 +4381,7 @@ static int validate_slab_node(struct kmem_cache *s, struct page *page; unsigned long flags; @@ -583,7 +590,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> list_for_each_entry(page, &n->partial, lru) { validate_slab_slab(s, page, map); -@@ -4403,7 +4403,7 @@ static int validate_slab_node(struct kme +@@ -4403,7 +4403,7 @@ static int validate_slab_node(struct kmem_cache *s, s->name, count, atomic_long_read(&n->nr_slabs)); out: @@ -592,7 +599,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return count; } -@@ -4593,12 +4593,12 @@ static int list_locations(struct kmem_ca +@@ -4593,12 +4593,12 @@ static int list_locations(struct kmem_cache *s, char *buf, if (!atomic_long_read(&n->nr_slabs)) continue; @@ -607,3 +614,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } for (i = 0; i < t.count; i++) { +-- +2.20.1 + diff --git a/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch b/debian/patches-rt/0077-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch index eee74fcf6..c111ef79c 100644 --- a/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch +++ b/debian/patches-rt/0077-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch @@ -1,8 +1,9 @@ +From 1fa02c36b05b392724988ddda8806f6cbf674446 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 21 Jun 2018 17:29:19 +0200 -Subject: [PATCH 4/4] mm/SLUB: delay giving back empty slubs to IRQ enabled +Subject: [PATCH 077/266] mm/SLUB: delay giving back empty slubs to IRQ enabled regions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz __free_slab() is invoked with disabled interrupts which increases the irq-off time while __free_pages() is doing the work. @@ -13,12 +14,14 @@ so it can be processed later. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - mm/slub.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- + mm/slub.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 5 deletions(-) +diff --git a/mm/slub.c b/mm/slub.c +index 298cd7d368de..224f79ee6b39 100644 --- a/mm/slub.c +++ b/mm/slub.c -@@ -1330,6 +1330,12 @@ static inline void dec_slabs_node(struct +@@ -1330,6 +1330,12 @@ static inline void dec_slabs_node(struct kmem_cache *s, int node, #endif /* CONFIG_SLUB_DEBUG */ @@ -31,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Hooks for other subsystems that check memory allocations. In a typical * production configuration these hooks all should produce no code at all. -@@ -1684,6 +1690,16 @@ static void __free_slab(struct kmem_cach +@@ -1684,6 +1690,16 @@ static void __free_slab(struct kmem_cache *s, struct page *page) __free_pages(page, order); } @@ -48,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void rcu_free_slab(struct rcu_head *h) { struct page *page = container_of(h, struct page, rcu_head); -@@ -1695,6 +1711,12 @@ static void free_slab(struct kmem_cache +@@ -1695,6 +1711,12 @@ static void free_slab(struct kmem_cache *s, struct page *page) { if (unlikely(s->flags & SLAB_TYPESAFE_BY_RCU)) { call_rcu(&page->rcu_head, rcu_free_slab); @@ -61,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } else __free_slab(s, page); } -@@ -2223,14 +2245,21 @@ static void put_cpu_partial(struct kmem_ +@@ -2223,14 +2245,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) { @@ -83,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> oldpage = NULL; pobjects = 0; pages = 0; -@@ -2300,7 +2329,22 @@ static bool has_cpu_slab(int cpu, void * +@@ -2300,7 +2329,22 @@ static bool has_cpu_slab(int cpu, void *info) static void flush_all(struct kmem_cache *s) { @@ -106,7 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -2498,8 +2542,10 @@ static inline void *get_freelist(struct +@@ -2498,8 +2542,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, @@ -118,7 +121,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void *freelist; struct page *page; -@@ -2555,6 +2601,13 @@ static void *___slab_alloc(struct kmem_c +@@ -2555,6 +2601,13 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, VM_BUG_ON(!c->page->frozen); c->freelist = get_freepointer(s, freelist); c->tid = next_tid(c->tid); @@ -132,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return freelist; new_slab: -@@ -2570,7 +2623,7 @@ static void *___slab_alloc(struct kmem_c +@@ -2570,7 +2623,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, if (unlikely(!freelist)) { slab_out_of_memory(s, gfpflags, node); @@ -141,7 +144,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } page = c->page; -@@ -2583,7 +2636,7 @@ static void *___slab_alloc(struct kmem_c +@@ -2583,7 +2636,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, goto new_slab; /* Slab failed checks. Next slab needed */ deactivate_slab(s, page, get_freepointer(s, freelist), c); @@ -150,7 +153,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -2595,6 +2648,7 @@ static void *__slab_alloc(struct kmem_ca +@@ -2595,6 +2648,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, { void *p; unsigned long flags; @@ -158,7 +161,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> local_irq_save(flags); #ifdef CONFIG_PREEMPT -@@ -2606,8 +2660,9 @@ static void *__slab_alloc(struct kmem_ca +@@ -2606,8 +2660,9 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, c = this_cpu_ptr(s->cpu_slab); #endif @@ -169,7 +172,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return p; } -@@ -3085,6 +3140,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca +@@ -3085,6 +3140,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, void **p) { struct kmem_cache_cpu *c; @@ -177,7 +180,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int i; /* memcg and kmem_cache debug support */ -@@ -3108,7 +3164,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca +@@ -3108,7 +3164,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, * of re-populating per CPU c->freelist */ p[i] = ___slab_alloc(s, flags, NUMA_NO_NODE, @@ -186,7 +189,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (unlikely(!p[i])) goto error; -@@ -3120,6 +3176,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca +@@ -3120,6 +3176,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, } c->tid = next_tid(c->tid); local_irq_enable(); @@ -194,7 +197,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Clear memory outside IRQ disabled fastpath loop */ if (unlikely(flags & __GFP_ZERO)) { -@@ -3134,6 +3191,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca +@@ -3134,6 +3191,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, return i; error: local_irq_enable(); @@ -215,3 +218,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (debug_guardpage_minorder()) slub_max_order = 0; +-- +2.20.1 + diff --git a/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch b/debian/patches-rt/0078-mm-page_alloc-rt-friendly-per-cpu-pages.patch index c22df2eb8..d98f03e84 100644 --- a/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/debian/patches-rt/0078-mm-page_alloc-rt-friendly-per-cpu-pages.patch @@ -1,7 +1,8 @@ +From 8cf680defa2721e8a3636f0d81f0ae698b532200 Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:29:37 -0500 -Subject: mm: page_alloc: rt-friendly per-cpu pages -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 078/266] mm: page_alloc: rt-friendly per-cpu pages +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz rt-friendly per-cpu pages: convert the irqs-off per-cpu locking method into a preemptible, explicit-per-cpu-locks method. @@ -13,9 +14,11 @@ Contains fixes from: Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - mm/page_alloc.c | 63 ++++++++++++++++++++++++++++++++++++++------------------ + mm/page_alloc.c | 63 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 20 deletions(-) +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index 8a96b1e6f4f4..bfbd1d6abb54 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -60,6 +60,7 @@ @@ -45,7 +48,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> int page_group_by_mobility_disabled __read_mostly; #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT -@@ -1296,10 +1309,10 @@ static void __free_pages_ok(struct page +@@ -1296,10 +1309,10 @@ static void __free_pages_ok(struct page *page, unsigned int order) return; migratetype = get_pfnblock_migratetype(page, pfn); @@ -58,7 +61,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static void __init __free_pages_boot_core(struct page *page, unsigned int order) -@@ -2560,13 +2573,13 @@ void drain_zone_pages(struct zone *zone, +@@ -2560,13 +2573,13 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) int to_drain, batch; LIST_HEAD(dst); @@ -74,7 +77,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (to_drain > 0) free_pcppages_bulk(zone, &dst, false); -@@ -2588,7 +2601,7 @@ static void drain_pages_zone(unsigned in +@@ -2588,7 +2601,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) LIST_HEAD(dst); int count; @@ -83,7 +86,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> pset = per_cpu_ptr(zone->pageset, cpu); pcp = &pset->pcp; -@@ -2596,7 +2609,7 @@ static void drain_pages_zone(unsigned in +@@ -2596,7 +2609,7 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) if (count) isolate_pcp_pages(count, pcp, &dst); @@ -92,7 +95,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (count) free_pcppages_bulk(zone, &dst, false); -@@ -2634,6 +2647,7 @@ void drain_local_pages(struct zone *zone +@@ -2634,6 +2647,7 @@ void drain_local_pages(struct zone *zone) drain_pages(cpu); } @@ -100,7 +103,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static void drain_local_pages_wq(struct work_struct *work) { /* -@@ -2647,6 +2661,7 @@ static void drain_local_pages_wq(struct +@@ -2647,6 +2661,7 @@ static void drain_local_pages_wq(struct work_struct *work) drain_local_pages(NULL); preempt_enable(); } @@ -144,7 +147,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (!list_empty(&dst)) free_pcppages_bulk(zone, &dst, false); } -@@ -2869,7 +2892,7 @@ void free_unref_page_list(struct list_he +@@ -2869,7 +2892,7 @@ void free_unref_page_list(struct list_head *list) set_page_private(page, pfn); } @@ -153,7 +156,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> list_for_each_entry_safe(page, next, list, lru) { unsigned long pfn = page_private(page); enum zone_type type; -@@ -2884,12 +2907,12 @@ void free_unref_page_list(struct list_he +@@ -2884,12 +2907,12 @@ void free_unref_page_list(struct list_head *list) * a large list of pages to free. */ if (++batch_count == SWAP_CLUSTER_MAX) { @@ -169,7 +172,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> for (i = 0; i < __MAX_NR_ZONES; ) { struct page *page; -@@ -3038,7 +3061,7 @@ static struct page *rmqueue_pcplist(stru +@@ -3038,7 +3061,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, struct page *page; unsigned long flags; @@ -178,7 +181,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> pcp = &this_cpu_ptr(zone->pageset)->pcp; list = &pcp->lists[migratetype]; page = __rmqueue_pcplist(zone, migratetype, pcp, list); -@@ -3046,7 +3069,7 @@ static struct page *rmqueue_pcplist(stru +@@ -3046,7 +3069,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); } @@ -187,7 +190,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return page; } -@@ -3073,7 +3096,7 @@ struct page *rmqueue(struct zone *prefer +@@ -3073,7 +3096,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)); @@ -196,7 +199,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> do { page = NULL; -@@ -3093,14 +3116,14 @@ struct page *rmqueue(struct zone *prefer +@@ -3093,14 +3116,14 @@ struct page *rmqueue(struct zone *preferred_zone, __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); zone_statistics(preferred_zone, zone); @@ -231,3 +234,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } #ifdef CONFIG_MEMORY_HOTREMOVE +-- +2.20.1 + diff --git a/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch b/debian/patches-rt/0079-mm-swap-Convert-to-percpu-locked.patch index 1340af54e..7679b16d6 100644 --- a/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch +++ b/debian/patches-rt/0079-mm-swap-Convert-to-percpu-locked.patch @@ -1,21 +1,23 @@ +From 3e69b8c10ef337ad55294b386473175604fac7ae Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:29:51 -0500 -Subject: mm/swap: Convert to percpu locked -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 079/266] mm/swap: Convert to percpu locked +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Replace global locks (get_cpu + local_irq_save) with "local_locks()". Currently there is one of for "rotate" and one for "swap". Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - include/linux/swap.h | 2 ++ - mm/compaction.c | 6 ++++-- - mm/page_alloc.c | 3 ++- - mm/swap.c | 38 ++++++++++++++++++++++---------------- + include/linux/swap.h | 2 ++ + mm/compaction.c | 6 ++++-- + mm/page_alloc.c | 3 ++- + mm/swap.c | 38 ++++++++++++++++++++++---------------- 4 files changed, 30 insertions(+), 19 deletions(-) +diff --git a/include/linux/swap.h b/include/linux/swap.h +index 77221c16733a..6819766b93aa 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -12,6 +12,7 @@ @@ -26,7 +28,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include <asm/page.h> struct notifier_block; -@@ -331,6 +332,7 @@ extern unsigned long nr_free_pagecache_p +@@ -331,6 +332,7 @@ extern unsigned long nr_free_pagecache_pages(void); /* linux/mm/swap.c */ @@ -34,9 +36,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern void lru_cache_add(struct page *); extern void lru_cache_add_anon(struct page *page); extern void lru_cache_add_file(struct page *page); +diff --git a/mm/compaction.c b/mm/compaction.c +index faca45ebe62d..f8ccb9d9daa3 100644 --- a/mm/compaction.c +++ b/mm/compaction.c -@@ -1657,10 +1657,12 @@ static enum compact_result compact_zone( +@@ -1657,10 +1657,12 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro block_start_pfn(cc->migrate_pfn, cc->order); if (cc->last_migrated_pfn < current_block_start) { @@ -51,9 +55,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* No more flushing until we migrate again */ cc->last_migrated_pfn = 0; } +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index bfbd1d6abb54..5af1cdd1b923 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7205,8 +7205,9 @@ void __init free_area_init(unsigned long +@@ -7205,8 +7205,9 @@ void __init free_area_init(unsigned long *zones_size) static int page_alloc_cpu_dead(unsigned int cpu) { @@ -64,6 +70,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> drain_pages(cpu); /* +diff --git a/mm/swap.c b/mm/swap.c +index a3fc028e338e..4bac22ec1328 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -33,6 +33,7 @@ @@ -74,7 +82,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include <linux/hugetlb.h> #include <linux/page_idle.h> -@@ -51,6 +52,8 @@ static DEFINE_PER_CPU(struct pagevec, lr +@@ -51,6 +52,8 @@ static DEFINE_PER_CPU(struct pagevec, lru_lazyfree_pvecs); #ifdef CONFIG_SMP static DEFINE_PER_CPU(struct pagevec, activate_page_pvecs); #endif @@ -83,7 +91,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * This path almost never happens for VM activity - pages are normally -@@ -253,11 +256,11 @@ void rotate_reclaimable_page(struct page +@@ -253,11 +256,11 @@ void rotate_reclaimable_page(struct page *page) unsigned long flags; get_page(page); @@ -113,7 +121,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } -@@ -339,7 +343,7 @@ void activate_page(struct page *page) +@@ -334,7 +338,7 @@ void activate_page(struct page *page) static void __lru_cache_activate_page(struct page *page) { @@ -122,7 +130,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> int i; /* -@@ -361,7 +365,7 @@ static void __lru_cache_activate_page(st +@@ -356,7 +360,7 @@ static void __lru_cache_activate_page(struct page *page) } } @@ -131,7 +139,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* -@@ -403,12 +407,12 @@ EXPORT_SYMBOL(mark_page_accessed); +@@ -398,12 +402,12 @@ EXPORT_SYMBOL(mark_page_accessed); static void __lru_cache_add(struct page *page) { @@ -146,7 +154,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /** -@@ -586,9 +590,9 @@ void lru_add_drain_cpu(int cpu) +@@ -581,9 +585,9 @@ void lru_add_drain_cpu(int cpu) unsigned long flags; /* No harm done if a racing interrupt already did this */ @@ -158,7 +166,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } pvec = &per_cpu(lru_deactivate_file_pvecs, cpu); -@@ -620,11 +624,12 @@ void deactivate_file_page(struct page *p +@@ -615,11 +619,12 @@ void deactivate_file_page(struct page *page) return; if (likely(get_page_unless_zero(page))) { @@ -173,7 +181,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } -@@ -639,19 +644,20 @@ void mark_page_lazyfree(struct page *pag +@@ -634,19 +639,20 @@ void mark_page_lazyfree(struct page *page) { if (PageLRU(page) && PageAnon(page) && PageSwapBacked(page) && !PageSwapCache(page) && !PageUnevictable(page)) { @@ -197,4 +205,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> + local_unlock_cpu(swapvec_lock); } - static void lru_add_drain_per_cpu(struct work_struct *dummy) + #ifdef CONFIG_SMP +-- +2.20.1 + diff --git a/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch b/debian/patches-rt/0080-mm-perform-lru_add_drain_all-remotely.patch index 977f79e92..5bc0dd779 100644 --- a/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch +++ b/debian/patches-rt/0080-mm-perform-lru_add_drain_all-remotely.patch @@ -1,7 +1,8 @@ +From ac3ff5ace2c5405df8a46847cd66757ae63d5477 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino <lcapitulino@redhat.com> Date: Fri, 27 May 2016 15:03:28 +0200 -Subject: [PATCH] mm: perform lru_add_drain_all() remotely -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 080/266] mm: perform lru_add_drain_all() remotely +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz lru_add_drain_all() works by scheduling lru_add_drain_cpu() to run on all CPUs that have non-empty LRU pagevecs and then waiting for @@ -20,12 +21,14 @@ Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - mm/swap.c | 36 ++++++++++++++++++++++++++++++------ + mm/swap.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) +diff --git a/mm/swap.c b/mm/swap.c +index 4bac22ec1328..0457927d3f0c 100644 --- a/mm/swap.c +++ b/mm/swap.c -@@ -590,9 +590,15 @@ void lru_add_drain_cpu(int cpu) +@@ -585,9 +585,15 @@ void lru_add_drain_cpu(int cpu) unsigned long flags; /* No harm done if a racing interrupt already did this */ @@ -41,9 +44,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } pvec = &per_cpu(lru_deactivate_file_pvecs, cpu); -@@ -660,6 +666,16 @@ void lru_add_drain(void) - local_unlock_cpu(swapvec_lock); - } +@@ -657,6 +663,16 @@ void lru_add_drain(void) + + #ifdef CONFIG_SMP +#ifdef CONFIG_PREEMPT_RT_BASE +static inline void remote_lru_add_drain(int cpu, struct cpumask *has_work) @@ -55,12 +58,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + +#else + + static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work); + static void lru_add_drain_per_cpu(struct work_struct *dummy) - { +@@ -664,6 +680,16 @@ static void lru_add_drain_per_cpu(struct work_struct *dummy) lru_add_drain(); -@@ -667,6 +683,16 @@ static void lru_add_drain_per_cpu(struct - - static DEFINE_PER_CPU(struct work_struct, lru_add_drain_work); + } +static inline void remote_lru_add_drain(int cpu, struct cpumask *has_work) +{ @@ -75,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Doesn't need any cpu hotplug locking because we do rely on per-cpu * kworkers being shut down before our page_alloc_cpu_dead callback is -@@ -691,21 +717,19 @@ void lru_add_drain_all(void) +@@ -688,21 +714,19 @@ void lru_add_drain_all(void) cpumask_clear(&has_work); for_each_online_cpu(cpu) { @@ -101,3 +104,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> mutex_unlock(&lock); } +-- +2.20.1 + diff --git a/debian/patches-rt/mm-make-vmstat-rt-aware.patch b/debian/patches-rt/0081-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch index b0f50e165..d76ed8c25 100644 --- a/debian/patches-rt/mm-make-vmstat-rt-aware.patch +++ b/debian/patches-rt/0081-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch @@ -1,7 +1,9 @@ +From 97d2d31ce45e742af6dc423c28ab0658114264dc Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:30:13 -0500 -Subject: mm/vmstat: Protect per cpu variables with preempt disable on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 081/266] mm/vmstat: Protect per cpu variables with preempt + disable on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Disable preemption on -RT for the vmstat code. On vanila the code runs in IRQ-off regions while on -RT it is not. "preempt_disable" ensures that the @@ -9,15 +11,16 @@ same ressources is not updated in parallel due to preemption. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - include/linux/vmstat.h | 4 ++++ - mm/vmstat.c | 12 ++++++++++++ + include/linux/vmstat.h | 4 ++++ + mm/vmstat.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) +diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h +index f25cef84b41d..febee8649220 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h -@@ -54,7 +54,9 @@ DECLARE_PER_CPU(struct vm_event_state, v +@@ -54,7 +54,9 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states); */ static inline void __count_vm_event(enum vm_event_item item) { @@ -27,7 +30,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static inline void count_vm_event(enum vm_event_item item) -@@ -64,7 +66,9 @@ static inline void count_vm_event(enum v +@@ -64,7 +66,9 @@ static inline void count_vm_event(enum vm_event_item item) static inline void __count_vm_events(enum vm_event_item item, long delta) { @@ -37,9 +40,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static inline void count_vm_events(enum vm_event_item item, long delta) +diff --git a/mm/vmstat.c b/mm/vmstat.c +index 7878da76abf2..2cfaa5075c72 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -320,6 +320,7 @@ void __mod_zone_page_state(struct zone * +@@ -320,6 +320,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item, long x; long t; @@ -47,7 +52,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> x = delta + __this_cpu_read(*p); t = __this_cpu_read(pcp->stat_threshold); -@@ -329,6 +330,7 @@ void __mod_zone_page_state(struct zone * +@@ -329,6 +330,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item, x = 0; } __this_cpu_write(*p, x); @@ -55,7 +60,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } EXPORT_SYMBOL(__mod_zone_page_state); -@@ -340,6 +342,7 @@ void __mod_node_page_state(struct pglist +@@ -340,6 +342,7 @@ void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item, long x; long t; @@ -63,7 +68,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> x = delta + __this_cpu_read(*p); t = __this_cpu_read(pcp->stat_threshold); -@@ -349,6 +352,7 @@ void __mod_node_page_state(struct pglist +@@ -349,6 +352,7 @@ void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item, x = 0; } __this_cpu_write(*p, x); @@ -71,7 +76,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } EXPORT_SYMBOL(__mod_node_page_state); -@@ -381,6 +385,7 @@ void __inc_zone_state(struct zone *zone, +@@ -381,6 +385,7 @@ void __inc_zone_state(struct zone *zone, enum zone_stat_item item) s8 __percpu *p = pcp->vm_stat_diff + item; s8 v, t; @@ -79,7 +84,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> v = __this_cpu_inc_return(*p); t = __this_cpu_read(pcp->stat_threshold); if (unlikely(v > t)) { -@@ -389,6 +394,7 @@ void __inc_zone_state(struct zone *zone, +@@ -389,6 +394,7 @@ void __inc_zone_state(struct zone *zone, enum zone_stat_item item) zone_page_state_add(v + overstep, zone, item); __this_cpu_write(*p, -overstep); } @@ -87,7 +92,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) -@@ -397,6 +403,7 @@ void __inc_node_state(struct pglist_data +@@ -397,6 +403,7 @@ void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) s8 __percpu *p = pcp->vm_node_stat_diff + item; s8 v, t; @@ -95,7 +100,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> v = __this_cpu_inc_return(*p); t = __this_cpu_read(pcp->stat_threshold); if (unlikely(v > t)) { -@@ -405,6 +412,7 @@ void __inc_node_state(struct pglist_data +@@ -405,6 +412,7 @@ void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) node_page_state_add(v + overstep, pgdat, item); __this_cpu_write(*p, -overstep); } @@ -103,7 +108,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } void __inc_zone_page_state(struct page *page, enum zone_stat_item item) -@@ -425,6 +433,7 @@ void __dec_zone_state(struct zone *zone, +@@ -425,6 +433,7 @@ void __dec_zone_state(struct zone *zone, enum zone_stat_item item) s8 __percpu *p = pcp->vm_stat_diff + item; s8 v, t; @@ -111,7 +116,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> v = __this_cpu_dec_return(*p); t = __this_cpu_read(pcp->stat_threshold); if (unlikely(v < - t)) { -@@ -433,6 +442,7 @@ void __dec_zone_state(struct zone *zone, +@@ -433,6 +442,7 @@ void __dec_zone_state(struct zone *zone, enum zone_stat_item item) zone_page_state_add(v - overstep, zone, item); __this_cpu_write(*p, overstep); } @@ -119,7 +124,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) -@@ -441,6 +451,7 @@ void __dec_node_state(struct pglist_data +@@ -441,6 +451,7 @@ void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) s8 __percpu *p = pcp->vm_node_stat_diff + item; s8 v, t; @@ -127,7 +132,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> v = __this_cpu_dec_return(*p); t = __this_cpu_read(pcp->stat_threshold); if (unlikely(v < - t)) { -@@ -449,6 +460,7 @@ void __dec_node_state(struct pglist_data +@@ -449,6 +460,7 @@ void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) node_page_state_add(v - overstep, pgdat, item); __this_cpu_write(*p, overstep); } @@ -135,3 +140,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } void __dec_zone_page_state(struct page *page, enum zone_stat_item item) +-- +2.20.1 + diff --git a/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch b/debian/patches-rt/0082-ARM-Initialize-split-page-table-locks-for-vector-pag.patch index db988e03d..3d82435ed 100644 --- a/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch +++ b/debian/patches-rt/0082-ARM-Initialize-split-page-table-locks-for-vector-pag.patch @@ -1,7 +1,9 @@ -Subject: ARM: Initialize split page table locks for vector page +From c4a52a68ff41c185a61d501c061b08ce81a2506e Mon Sep 17 00:00:00 2001 From: Frank Rowand <frank.rowand@am.sony.com> Date: Sat, 1 Oct 2011 18:58:13 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 082/266] ARM: Initialize split page table locks for vector + page +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Without this patch, ARM can not use SPLIT_PTLOCK_CPUS if PREEMPT_RT_FULL=y because vectors_user_mapping() creates a @@ -31,12 +33,14 @@ Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/4E87C535.2030907@am.sony.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/arm/kernel/process.c | 24 ++++++++++++++++++++++++ + arch/arm/kernel/process.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) +diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c +index 82ab015bf42b..8d3c7ce34c24 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c -@@ -324,6 +324,30 @@ unsigned long arch_randomize_brk(struct +@@ -324,6 +324,30 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) } #ifdef CONFIG_MMU @@ -67,3 +71,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_KUSER_HELPERS /* * The vectors page is always readable from user space for the +-- +2.20.1 + diff --git a/debian/patches-rt/mm-enable-slub.patch b/debian/patches-rt/0083-mm-Enable-SLUB-for-RT.patch index 061d68965..88178fde3 100644 --- a/debian/patches-rt/mm-enable-slub.patch +++ b/debian/patches-rt/0083-mm-Enable-SLUB-for-RT.patch @@ -1,7 +1,8 @@ -Subject: mm: Enable SLUB for RT +From e438a74270d17d8f9d68d4278b14497bc2671a07 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 25 Oct 2012 10:32:35 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 083/266] mm: Enable SLUB for RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Avoid the memory allocation in IRQ section @@ -9,12 +10,14 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> [bigeasy: factor out everything except the kcalloc() workaorund ] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - mm/slub.c | 6 ++++++ + mm/slub.c | 6 ++++++ 1 file changed, 6 insertions(+) +diff --git a/mm/slub.c b/mm/slub.c +index 224f79ee6b39..154c0eb7c28b 100644 --- a/mm/slub.c +++ b/mm/slub.c -@@ -3677,6 +3677,11 @@ static void list_slab_objects(struct kme +@@ -3677,6 +3677,11 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page, const char *text) { #ifdef CONFIG_SLUB_DEBUG @@ -26,7 +29,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void *addr = page_address(page); void *p; unsigned long *map = kcalloc(BITS_TO_LONGS(page->objects), -@@ -3698,6 +3703,7 @@ static void list_slab_objects(struct kme +@@ -3698,6 +3703,7 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page, slab_unlock(page); kfree(map); #endif @@ -34,3 +37,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* +-- +2.20.1 + diff --git a/debian/patches-rt/slub-enable-irqs-for-no-wait.patch b/debian/patches-rt/0084-slub-Enable-irqs-for-__GFP_WAIT.patch index b9f3e9aba..a78d2f626 100644 --- a/debian/patches-rt/slub-enable-irqs-for-no-wait.patch +++ b/debian/patches-rt/0084-slub-Enable-irqs-for-__GFP_WAIT.patch @@ -1,19 +1,22 @@ -Subject: slub: Enable irqs for __GFP_WAIT +From 605ec36d61e9293b08da52f9fd7edabe92f45940 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 09 Jan 2013 12:08:15 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Wed, 9 Jan 2013 12:08:15 +0100 +Subject: [PATCH 084/266] slub: Enable irqs for __GFP_WAIT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz SYSTEM_RUNNING might be too late for enabling interrupts. Allocations with GFP_WAIT can happen before that. So use this as an indicator. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - mm/slub.c | 9 ++++++++- + mm/slub.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) +diff --git a/mm/slub.c b/mm/slub.c +index 154c0eb7c28b..bcc176415952 100644 --- a/mm/slub.c +++ b/mm/slub.c -@@ -1570,10 +1570,17 @@ static struct page *allocate_slab(struct +@@ -1570,10 +1570,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) void *start, *p; int idx, order; bool shuffle; @@ -31,7 +34,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> local_irq_enable(); flags |= s->allocflags; -@@ -1632,7 +1639,7 @@ static struct page *allocate_slab(struct +@@ -1632,7 +1639,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) page->frozen = 1; out: @@ -40,3 +43,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> local_irq_disable(); if (!page) return NULL; +-- +2.20.1 + diff --git a/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch b/debian/patches-rt/0085-slub-Disable-SLUB_CPU_PARTIAL.patch index a2f91c11a..c6e0e95e9 100644 --- a/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch +++ b/debian/patches-rt/0085-slub-Disable-SLUB_CPU_PARTIAL.patch @@ -1,7 +1,8 @@ +From 41a8d11daef3a3ccbdc5af850a2de8ef30bf59f2 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 15 Apr 2015 19:00:47 +0200 -Subject: slub: Disable SLUB_CPU_PARTIAL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 085/266] slub: Disable SLUB_CPU_PARTIAL +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 87, name: rcuop/7 @@ -32,9 +33,11 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - init/Kconfig | 2 +- + init/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/init/Kconfig b/init/Kconfig +index 707ca4d49944..68b4e39e421b 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1698,7 +1698,7 @@ config SLAB_FREELIST_HARDENED @@ -46,3 +49,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> bool "SLUB per cpu partial cache" help Per cpu partial caches accellerate objects allocation and freeing +-- +2.20.1 + diff --git a/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/debian/patches-rt/0086-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch index 834760f41..b541e273e 100644 --- a/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ b/debian/patches-rt/0086-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch @@ -1,7 +1,9 @@ +From 69dc67df10975fa926d4d2a2bb0184b60f539002 Mon Sep 17 00:00:00 2001 From: Yang Shi <yang.shi@windriver.com> -Subject: mm/memcontrol: Don't call schedule_work_on in preemption disabled context Date: Wed, 30 Oct 2013 11:48:33 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 086/266] mm/memcontrol: Don't call schedule_work_on in + preemption disabled context +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The following trace is triggered when running ltp oom test cases: @@ -43,13 +45,14 @@ replace the pair of get/put_cpu() to get/put_cpu_light(). Signed-off-by: Yang Shi <yang.shi@windriver.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - - mm/memcontrol.c | 4 ++-- + mm/memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index 9518aefd8cbb..5ae52e587528 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -2052,7 +2052,7 @@ static void drain_all_stock(struct mem_c +@@ -2052,7 +2052,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. */ @@ -58,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> for_each_online_cpu(cpu) { struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu); struct mem_cgroup *memcg; -@@ -2072,7 +2072,7 @@ static void drain_all_stock(struct mem_c +@@ -2072,7 +2072,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) } css_put(&memcg->css); } @@ -67,3 +70,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> mutex_unlock(&percpu_charge_mutex); } +-- +2.20.1 + diff --git a/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch b/debian/patches-rt/0087-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch index dcf795408..bfdae0850 100644 --- a/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch +++ b/debian/patches-rt/0087-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch @@ -1,16 +1,20 @@ +From a400b856179528a4ed99bc3e9ab62c9b9f4299e3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Subject: mm/memcontrol: Replace local_irq_disable with local locks Date: Wed, 28 Jan 2015 17:14:16 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 087/266] mm/memcontrol: Replace local_irq_disable with local + locks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - mm/memcontrol.c | 24 ++++++++++++++++-------- + mm/memcontrol.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index 5ae52e587528..d0ea4e74d6fc 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -69,6 +69,7 @@ @@ -30,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Whether legacy memory+swap accounting is active */ static bool do_memsw_account(void) { -@@ -4859,12 +4862,12 @@ static int mem_cgroup_move_account(struc +@@ -4859,12 +4862,12 @@ static int mem_cgroup_move_account(struct page *page, ret = 0; @@ -45,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> out_unlock: unlock_page(page); out: -@@ -5983,10 +5986,10 @@ void mem_cgroup_commit_charge(struct pag +@@ -5983,10 +5986,10 @@ void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, commit_charge(page, memcg, lrucare); @@ -58,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (do_memsw_account() && PageSwapCache(page)) { swp_entry_t entry = { .val = page_private(page) }; -@@ -6055,7 +6058,7 @@ static void uncharge_batch(const struct +@@ -6055,7 +6058,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) memcg_oom_recover(ug->memcg); } @@ -67,7 +71,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> __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); -@@ -6063,7 +6066,7 @@ static void uncharge_batch(const struct +@@ -6063,7 +6066,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); @@ -76,7 +80,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!mem_cgroup_is_root(ug->memcg)) css_put_many(&ug->memcg->css, nr_pages); -@@ -6226,10 +6229,10 @@ void mem_cgroup_migrate(struct page *old +@@ -6226,10 +6229,10 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage) commit_charge(newpage, memcg, false); @@ -89,7 +93,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } DEFINE_STATIC_KEY_FALSE(memcg_sockets_enabled_key); -@@ -6421,6 +6424,7 @@ void mem_cgroup_swapout(struct page *pag +@@ -6421,6 +6424,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; @@ -97,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> VM_BUG_ON_PAGE(PageLRU(page), page); VM_BUG_ON_PAGE(page_count(page), page); -@@ -6466,13 +6470,17 @@ void mem_cgroup_swapout(struct page *pag +@@ -6466,13 +6470,17 @@ 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. */ @@ -115,3 +119,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /** +-- +2.20.1 + diff --git a/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch b/debian/patches-rt/0088-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch index 6de9a56d1..28a2f4722 100644 --- a/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch +++ b/debian/patches-rt/0088-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch @@ -1,7 +1,8 @@ +From e96c261e79fc523e023aedf55130eea2b4026dfb Mon Sep 17 00:00:00 2001 From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Tue, 22 Mar 2016 11:16:09 +0100 -Subject: [PATCH] mm/zsmalloc: copy with get_cpu_var() and locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 088/266] mm/zsmalloc: copy with get_cpu_var() and locking +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz get_cpu_var() disables preemption and triggers a might_sleep() splat later. This is replaced with get_locked_var(). @@ -13,9 +14,11 @@ Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> fixed the size magic] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - mm/zsmalloc.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- + mm/zsmalloc.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 6 deletions(-) +diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c +index 9da65552e7ca..63c193c1ff96 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -55,6 +55,7 @@ @@ -50,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Object location (<PFN>, <obj_idx>) is encoded as * as single (unsigned long) handle value. -@@ -320,7 +334,7 @@ static void SetZsPageMovable(struct zs_p +@@ -320,7 +334,7 @@ static void SetZsPageMovable(struct zs_pool *pool, struct zspage *zspage) {} static int create_cache(struct zs_pool *pool) { @@ -59,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> 0, 0, NULL); if (!pool->handle_cachep) return 1; -@@ -344,10 +358,27 @@ static void destroy_cache(struct zs_pool +@@ -344,10 +358,27 @@ static void destroy_cache(struct zs_pool *pool) static unsigned long cache_alloc_handle(struct zs_pool *pool, gfp_t gfp) { @@ -89,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void cache_free_handle(struct zs_pool *pool, unsigned long handle) { kmem_cache_free(pool->handle_cachep, (void *)handle); -@@ -366,12 +397,18 @@ static void cache_free_zspage(struct zs_ +@@ -366,12 +397,18 @@ static void cache_free_zspage(struct zs_pool *pool, struct zspage *zspage) static void record_obj(unsigned long handle, unsigned long obj) { @@ -116,7 +119,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static bool is_zspage_isolated(struct zspage *zspage) { -@@ -882,7 +920,13 @@ static unsigned long location_to_obj(str +@@ -882,7 +920,13 @@ static unsigned long location_to_obj(struct page *page, unsigned int obj_idx) static unsigned long handle_to_obj(unsigned long handle) { @@ -130,7 +133,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static unsigned long obj_to_head(struct page *page, void *obj) -@@ -896,22 +940,46 @@ static unsigned long obj_to_head(struct +@@ -896,22 +940,46 @@ static unsigned long obj_to_head(struct page *page, void *obj) static inline int testpin_tag(unsigned long handle) { @@ -177,7 +180,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static void reset_page(struct page *page) -@@ -1337,7 +1405,7 @@ void *zs_map_object(struct zs_pool *pool +@@ -1337,7 +1405,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle, class = pool->size_class[class_idx]; off = (class->size * obj_idx) & ~PAGE_MASK; @@ -186,7 +189,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> area->vm_mm = mm; if (off + class->size <= PAGE_SIZE) { /* this object is contained entirely within a page */ -@@ -1391,7 +1459,7 @@ void zs_unmap_object(struct zs_pool *poo +@@ -1391,7 +1459,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle) __zs_unmap_object(area, pages, off, class->size); } @@ -195,3 +198,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> migrate_read_unlock(zspage); unpin_tag(handle); +-- +2.20.1 + diff --git a/debian/patches-rt/x86-mm-pat-disable-preemption-__split_large_page-aft.patch b/debian/patches-rt/0089-x86-mm-pat-disable-preemption-__split_large_page-aft.patch index 40acd0a12..fc8bde400 100644 --- a/debian/patches-rt/x86-mm-pat-disable-preemption-__split_large_page-aft.patch +++ b/debian/patches-rt/0089-x86-mm-pat-disable-preemption-__split_large_page-aft.patch @@ -1,8 +1,9 @@ +From 245b526fa55247c1866beef0e28326ccc11214c8 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 11 Dec 2018 21:53:43 +0100 -Subject: [PATCH] x86/mm/pat: disable preemption __split_large_page() after - spin_lock() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 089/266] x86/mm/pat: disable preemption __split_large_page() + after spin_lock() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Commit "x86/mm/pat: Disable preemption around __flush_tlb_all()" added a warning if __flush_tlb_all() is invoked in preemptible context. On !RT @@ -14,20 +15,23 @@ Disable preemption to avoid the warning __flush_tlb_all(). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/mm/pageattr.c | 8 ++++++++ + arch/x86/mm/pageattr.c | 8 ++++++++ 1 file changed, 8 insertions(+) +diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c +index e2d4b25c7aa4..9626ebb9e3c8 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c -@@ -688,11 +688,17 @@ static int +@@ -687,12 +687,18 @@ __split_large_page(struct cpa_data *cpa, pte_t *kpte, unsigned long address, + pgprot_t ref_prot; spin_lock(&pgd_lock); - /* ++ /* + * Keep preemption disabled after __flush_tlb_all() which expects not be + * preempted during the flush of the local TLB. + */ + preempt_disable(); -+ /* + /* * Check for races, another CPU might have split this page * up for us already: */ @@ -37,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> spin_unlock(&pgd_lock); return 1; } -@@ -726,6 +732,7 @@ static int +@@ -726,6 +732,7 @@ __split_large_page(struct cpa_data *cpa, pte_t *kpte, unsigned long address, break; default: @@ -45,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> spin_unlock(&pgd_lock); return 1; } -@@ -764,6 +771,7 @@ static int +@@ -764,6 +771,7 @@ __split_large_page(struct cpa_data *cpa, pte_t *kpte, unsigned long address, * going on. */ __flush_tlb_all(); @@ -53,3 +57,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> spin_unlock(&pgd_lock); return 0; +-- +2.20.1 + diff --git a/debian/patches-rt/radix-tree-use-local-locks.patch b/debian/patches-rt/0090-radix-tree-use-local-locks.patch index d1fd5e1a8..b35eb8200 100644 --- a/debian/patches-rt/radix-tree-use-local-locks.patch +++ b/debian/patches-rt/0090-radix-tree-use-local-locks.patch @@ -1,7 +1,8 @@ +From 6e49e380bae22fbdbbc8ad1beaeb2b68f18bbcab Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 25 Jan 2017 16:34:27 +0100 -Subject: [PATCH] radix-tree: use local locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 090/266] radix-tree: use local locks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The preload functionality uses per-CPU variables and preempt-disable to ensure that it does not switch CPUs during its usage. This patch adds @@ -12,14 +13,16 @@ Cc: stable-rt@vger.kernel.org Reported-and-debugged-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/idr.h | 5 +---- - include/linux/radix-tree.h | 7 ++----- - lib/radix-tree.c | 32 +++++++++++++++++++++++--------- + include/linux/idr.h | 5 +---- + include/linux/radix-tree.h | 7 ++----- + lib/radix-tree.c | 32 +++++++++++++++++++++++--------- 3 files changed, 26 insertions(+), 18 deletions(-) +diff --git a/include/linux/idr.h b/include/linux/idr.h +index 3ec8628ce17f..54af68158f7d 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h -@@ -169,10 +169,7 @@ static inline bool idr_is_empty(const st +@@ -169,10 +169,7 @@ static inline bool idr_is_empty(const struct idr *idr) * Each idr_preload() should be matched with an invocation of this * function. See idr_preload() for details. */ @@ -31,9 +34,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * idr_for_each_entry() - Iterate over an IDR's elements of a given type. +diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h +index 34149e8b5f73..affb0fc4c5b6 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h -@@ -330,6 +330,8 @@ unsigned int radix_tree_gang_lookup_slot +@@ -330,6 +330,8 @@ unsigned int radix_tree_gang_lookup_slot(const struct radix_tree_root *, int radix_tree_preload(gfp_t gfp_mask); int radix_tree_maybe_preload(gfp_t gfp_mask); int radix_tree_maybe_preload_order(gfp_t gfp_mask, int order); @@ -42,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void radix_tree_init(void); void *radix_tree_tag_set(struct radix_tree_root *, unsigned long index, unsigned int tag); -@@ -349,11 +351,6 @@ unsigned int radix_tree_gang_lookup_tag_ +@@ -349,11 +351,6 @@ unsigned int radix_tree_gang_lookup_tag_slot(const struct radix_tree_root *, unsigned int max_items, unsigned int tag); int radix_tree_tagged(const struct radix_tree_root *, unsigned int tag); @@ -54,6 +59,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int radix_tree_split_preload(unsigned old_order, unsigned new_order, gfp_t); int radix_tree_split(struct radix_tree_root *, unsigned long index, unsigned new_order); +diff --git a/lib/radix-tree.c b/lib/radix-tree.c +index bc03ecc4dfd2..44257463f683 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -38,7 +38,7 @@ @@ -73,7 +80,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline struct radix_tree_node *entry_to_node(void *ptr) { -@@ -405,12 +406,13 @@ radix_tree_node_alloc(gfp_t gfp_mask, st +@@ -405,12 +406,13 @@ radix_tree_node_alloc(gfp_t gfp_mask, struct radix_tree_node *parent, * succeed in getting a node here (and never reach * kmem_cache_alloc) */ @@ -88,7 +95,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Update the allocation stack trace as this is more useful * for debugging. -@@ -476,14 +478,14 @@ static __must_check int __radix_tree_pre +@@ -476,14 +478,14 @@ static __must_check int __radix_tree_preload(gfp_t gfp_mask, unsigned nr) */ gfp_mask &= ~__GFP_ACCOUNT; @@ -106,7 +113,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rtp = this_cpu_ptr(&radix_tree_preloads); if (rtp->nr < nr) { node->parent = rtp->nodes; -@@ -525,7 +527,7 @@ int radix_tree_maybe_preload(gfp_t gfp_m +@@ -525,7 +527,7 @@ int radix_tree_maybe_preload(gfp_t gfp_mask) if (gfpflags_allow_blocking(gfp_mask)) return __radix_tree_preload(gfp_mask, RADIX_TREE_PRELOAD_SIZE); /* Preloading doesn't help anything with this gfp mask, skip it */ @@ -115,7 +122,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } EXPORT_SYMBOL(radix_tree_maybe_preload); -@@ -563,7 +565,7 @@ int radix_tree_maybe_preload_order(gfp_t +@@ -563,7 +565,7 @@ int radix_tree_maybe_preload_order(gfp_t gfp_mask, int order) /* Preloading doesn't help anything with this gfp mask, skip it */ if (!gfpflags_allow_blocking(gfp_mask)) { @@ -124,7 +131,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } -@@ -597,6 +599,12 @@ int radix_tree_maybe_preload_order(gfp_t +@@ -597,6 +599,12 @@ int radix_tree_maybe_preload_order(gfp_t gfp_mask, int order) return __radix_tree_preload(gfp_mask, nr_nodes); } @@ -155,7 +162,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int ida_pre_get(struct ida *ida, gfp_t gfp) { /* -@@ -2114,7 +2128,7 @@ int ida_pre_get(struct ida *ida, gfp_t g +@@ -2114,7 +2128,7 @@ int ida_pre_get(struct ida *ida, gfp_t gfp) * to return to the ida_pre_get() step. */ if (!__radix_tree_preload(gfp, IDA_PRELOAD_SIZE)) @@ -164,3 +171,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!this_cpu_read(ida_bitmap)) { struct ida_bitmap *bitmap = kzalloc(sizeof(*bitmap), gfp); +-- +2.20.1 + diff --git a/debian/patches-rt/timers-prepare-for-full-preemption.patch b/debian/patches-rt/0091-timers-Prepare-for-full-preemption.patch index 36c82dd8b..4d1a228d8 100644 --- a/debian/patches-rt/timers-prepare-for-full-preemption.patch +++ b/debian/patches-rt/0091-timers-Prepare-for-full-preemption.patch @@ -1,7 +1,8 @@ +From 08b09c27edd97bc659d7c41867e01fe9daa71125 Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:29:34 -0500 -Subject: timers: Prepare for full preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 091/266] timers: Prepare for full preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz When softirqs can be preempted we need to make sure that cancelling the timer from the active thread can not deadlock vs. a running timer @@ -9,16 +10,17 @@ callback. Add a waitqueue to resolve that. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - include/linux/timer.h | 2 +- - kernel/sched/core.c | 9 +++++++-- - kernel/time/timer.c | 45 +++++++++++++++++++++++++++++++++++++++++---- + include/linux/timer.h | 2 +- + kernel/sched/core.c | 9 +++++++-- + kernel/time/timer.c | 45 +++++++++++++++++++++++++++++++++++++++---- 3 files changed, 49 insertions(+), 7 deletions(-) +diff --git a/include/linux/timer.h b/include/linux/timer.h +index 7b066fd38248..54627d046b3a 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h -@@ -172,7 +172,7 @@ extern void add_timer(struct timer_list +@@ -172,7 +172,7 @@ extern void add_timer(struct timer_list *timer); extern int try_to_del_timer_sync(struct timer_list *timer); @@ -27,9 +29,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern int del_timer_sync(struct timer_list *timer); #else # define del_timer_sync(t) del_timer(t) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index f027ac73f1df..8250701ecfd7 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -496,11 +496,14 @@ void resched_cpu(int cpu) +@@ -497,11 +497,14 @@ void resched_cpu(int cpu) */ int get_nohz_timer_target(void) { @@ -46,7 +50,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> rcu_read_lock(); for_each_domain(cpu, sd) { -@@ -519,6 +522,8 @@ int get_nohz_timer_target(void) +@@ -520,6 +523,8 @@ int get_nohz_timer_target(void) cpu = housekeeping_any_cpu(HK_FLAG_TIMER); unlock: rcu_read_unlock(); @@ -55,6 +59,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return cpu; } +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index fa49cd753dea..bbe24e241643 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -44,6 +44,7 @@ @@ -75,7 +81,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> unsigned long clk; unsigned long next_expiry; unsigned int cpu; -@@ -1178,6 +1182,33 @@ void add_timer_on(struct timer_list *tim +@@ -1178,6 +1182,33 @@ void add_timer_on(struct timer_list *timer, int cpu) } EXPORT_SYMBOL_GPL(add_timer_on); @@ -109,7 +115,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /** * del_timer - deactivate a timer. * @timer: the timer to be deactivated -@@ -1233,7 +1264,7 @@ int try_to_del_timer_sync(struct timer_l +@@ -1233,7 +1264,7 @@ int try_to_del_timer_sync(struct timer_list *timer) } EXPORT_SYMBOL(try_to_del_timer_sync); @@ -118,7 +124,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /** * del_timer_sync - deactivate a timer and wait for the handler to finish. * @timer: the timer to be deactivated -@@ -1293,7 +1324,7 @@ int del_timer_sync(struct timer_list *ti +@@ -1293,7 +1324,7 @@ int del_timer_sync(struct timer_list *timer) int ret = try_to_del_timer_sync(timer); if (ret >= 0) return ret; @@ -127,7 +133,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } EXPORT_SYMBOL(del_timer_sync); -@@ -1354,13 +1385,16 @@ static void expire_timers(struct timer_b +@@ -1354,13 +1385,16 @@ static void expire_timers(struct timer_base *base, struct hlist_head *head) fn = timer->function; @@ -145,7 +151,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> raw_spin_lock_irq(&base->lock); } } -@@ -1681,8 +1715,8 @@ static inline void __run_timers(struct t +@@ -1681,8 +1715,8 @@ static inline void __run_timers(struct timer_base *base) while (levels--) expire_timers(base, heads + levels); } @@ -155,7 +161,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* -@@ -1927,6 +1961,9 @@ static void __init init_timer_cpu(int cp +@@ -1927,6 +1961,9 @@ static void __init init_timer_cpu(int cpu) base->cpu = cpu; raw_spin_lock_init(&base->lock); base->clk = jiffies; @@ -165,3 +171,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } +-- +2.20.1 + diff --git a/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch b/debian/patches-rt/0092-x86-kvm-Require-const-tsc-for-RT.patch index 3b601e815..e860353c8 100644 --- a/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch +++ b/debian/patches-rt/0092-x86-kvm-Require-const-tsc-for-RT.patch @@ -1,7 +1,8 @@ -Subject: x86: kvm Require const tsc for RT +From 72511f2c697b25d19b0a4dd298c2f7987d7cc386 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Sun, 06 Nov 2011 12:26:18 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Sun, 6 Nov 2011 12:26:18 +0100 +Subject: [PATCH 092/266] x86: kvm Require const tsc for RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Non constant TSC is a nightmare on bare metal already, but with virtualization it becomes a complete disaster because the workarounds @@ -10,9 +11,11 @@ a guest on top of a RT host. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/x86/kvm/x86.c | 7 +++++++ + arch/x86/kvm/x86.c | 7 +++++++ 1 file changed, 7 insertions(+) +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c +index 6181ec19bed2..10681ac91866 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6698,6 +6698,13 @@ int kvm_arch_init(void *opaque) @@ -29,3 +32,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> r = kvm_mmu_module_init(); if (r) goto out_free_percpu; +-- +2.20.1 + diff --git a/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch b/debian/patches-rt/0093-pci-switchtec-Don-t-use-completion-s-wait-queue.patch index f89d68b33..c48bb53cc 100644 --- a/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch +++ b/debian/patches-rt/0093-pci-switchtec-Don-t-use-completion-s-wait-queue.patch @@ -1,7 +1,8 @@ +From 7fbdd307f3cf05c50b493ea0a31f68dbd0a3ed50 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 4 Oct 2017 10:24:23 +0200 -Subject: [PATCH] pci/switchtec: Don't use completion's wait queue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 093/266] pci/switchtec: Don't use completion's wait queue +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The poll callback is using completion's wait_queue_head_t member and puts it in poll_wait() so the poll() caller gets a wakeup after command @@ -19,9 +20,11 @@ Cc: Kurt Schwemmer <kurt.schwemmer@microsemi.com> Cc: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/pci/switch/switchtec.c | 22 +++++++++++++--------- + drivers/pci/switch/switchtec.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) +diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c +index 37d0c15c9eeb..c396f3ef1852 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -43,10 +43,11 @@ struct switchtec_user { @@ -37,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> u32 cmd; u32 status; u32 return_code; -@@ -68,7 +69,7 @@ static struct switchtec_user *stuser_cre +@@ -68,7 +69,7 @@ static struct switchtec_user *stuser_create(struct switchtec_dev *stdev) stuser->stdev = stdev; kref_init(&stuser->kref); INIT_LIST_HEAD(&stuser->list); @@ -46,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> stuser->event_cnt = atomic_read(&stdev->event_cnt); dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser); -@@ -151,7 +152,7 @@ static int mrpc_queue_cmd(struct switcht +@@ -151,7 +152,7 @@ static int mrpc_queue_cmd(struct switchtec_user *stuser) kref_get(&stuser->kref); stuser->read_len = sizeof(stuser->data); stuser_set_state(stuser, MRPC_QUEUED); @@ -55,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> list_add_tail(&stuser->list, &stdev->mrpc_queue); mrpc_cmd_submit(stdev); -@@ -188,7 +189,8 @@ static void mrpc_complete_cmd(struct swi +@@ -188,7 +189,8 @@ static void mrpc_complete_cmd(struct switchtec_dev *stdev) stuser->read_len); out: @@ -65,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> list_del_init(&stuser->list); stuser_put(stuser); stdev->mrpc_busy = 0; -@@ -458,10 +460,11 @@ static ssize_t switchtec_dev_read(struct +@@ -458,10 +460,11 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data, mutex_unlock(&stdev->mrpc_mutex); if (filp->f_flags & O_NONBLOCK) { @@ -79,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (rc < 0) return rc; } -@@ -509,7 +512,7 @@ static __poll_t switchtec_dev_poll(struc +@@ -509,7 +512,7 @@ static __poll_t switchtec_dev_poll(struct file *filp, poll_table *wait) struct switchtec_dev *stdev = stuser->stdev; __poll_t ret = 0; @@ -88,7 +91,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> poll_wait(filp, &stdev->event_wq, wait); if (lock_mutex_and_test_alive(stdev)) -@@ -517,7 +520,7 @@ static __poll_t switchtec_dev_poll(struc +@@ -517,7 +520,7 @@ static __poll_t switchtec_dev_poll(struct file *filp, poll_table *wait) mutex_unlock(&stdev->mrpc_mutex); @@ -97,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ret |= EPOLLIN | EPOLLRDNORM; if (stuser->event_cnt != atomic_read(&stdev->event_cnt)) -@@ -1041,7 +1044,8 @@ static void stdev_kill(struct switchtec_ +@@ -1041,7 +1044,8 @@ static void stdev_kill(struct switchtec_dev *stdev) /* Wake up and kill any users waiting on an MRPC request */ list_for_each_entry_safe(stuser, tmpuser, &stdev->mrpc_queue, list) { @@ -107,3 +110,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> list_del_init(&stuser->list); stuser_put(stuser); } +-- +2.20.1 + diff --git a/debian/patches-rt/wait.h-include-atomic.h.patch b/debian/patches-rt/0094-wait.h-include-atomic.h.patch index c17407a86..fd2477407 100644 --- a/debian/patches-rt/wait.h-include-atomic.h.patch +++ b/debian/patches-rt/0094-wait.h-include-atomic.h.patch @@ -1,7 +1,11 @@ +From b22255c793ef483f700e31323610af55e947782b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 28 Oct 2013 12:19:57 +0100 -Subject: wait.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 094/266] wait.h: include atomic.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz | CC init/main.o |In file included from include/linux/mmzone.h:9:0, @@ -18,9 +22,11 @@ This pops up on ARM. Non-RT gets its atomic.h include from spinlock.h Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/wait.h | 1 + + include/linux/wait.h | 1 + 1 file changed, 1 insertion(+) +diff --git a/include/linux/wait.h b/include/linux/wait.h +index ed7c122cb31f..2b5ef8e94d19 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -10,6 +10,7 @@ @@ -31,3 +37,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> typedef struct wait_queue_entry wait_queue_entry_t; +-- +2.20.1 + diff --git a/debian/patches-rt/work-simple-Simple-work-queue-implemenation.patch b/debian/patches-rt/0095-work-simple-Simple-work-queue-implemenation.patch index 2176fd4bf..4d9abfbd1 100644 --- a/debian/patches-rt/work-simple-Simple-work-queue-implemenation.patch +++ b/debian/patches-rt/0095-work-simple-Simple-work-queue-implemenation.patch @@ -1,7 +1,8 @@ +From c8edd94ddadba2df66391d879cc3f73ddac3fb1d Mon Sep 17 00:00:00 2001 From: Daniel Wagner <daniel.wagner@bmw-carit.de> Date: Fri, 11 Jul 2014 15:26:11 +0200 -Subject: work-simple: Simple work queue implemenation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 095/266] work-simple: Simple work queue implemenation +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Provides a framework for enqueuing callbacks from irq context PREEMPT_RT_FULL safe. The callbacks are executed in kthread context. @@ -11,11 +12,16 @@ Bases on wait-simple. Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> --- - include/linux/swork.h | 24 ++++++ - kernel/sched/Makefile | 2 - kernel/sched/swork.c | 173 ++++++++++++++++++++++++++++++++++++++++++++++++++ + include/linux/swork.h | 24 ++++++ + kernel/sched/Makefile | 2 +- + kernel/sched/swork.c | 173 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 198 insertions(+), 1 deletion(-) + create mode 100644 include/linux/swork.h + create mode 100644 kernel/sched/swork.c +diff --git a/include/linux/swork.h b/include/linux/swork.h +new file mode 100644 +index 000000000000..f175fa9a6016 --- /dev/null +++ b/include/linux/swork.h @@ -0,0 +1,24 @@ @@ -43,6 +49,8 @@ Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> +void swork_put(void); + +#endif /* _LINUX_SWORK_H */ +diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile +index 7fe183404c38..2b765aa4e2c4 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile @@ -18,7 +18,7 @@ endif @@ -54,6 +62,9 @@ Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o topology.o stop_task.o pelt.o obj-$(CONFIG_SCHED_AUTOGROUP) += autogroup.o +diff --git a/kernel/sched/swork.c b/kernel/sched/swork.c +new file mode 100644 +index 000000000000..a5b89fdacf19 --- /dev/null +++ b/kernel/sched/swork.c @@ -0,0 +1,173 @@ @@ -230,3 +241,6 @@ Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> + mutex_unlock(&worker_mutex); +} +EXPORT_SYMBOL_GPL(swork_put); +-- +2.20.1 + diff --git a/debian/patches-rt/work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch b/debian/patches-rt/0096-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch index 143a5b629..4611b801a 100644 --- a/debian/patches-rt/work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch +++ b/debian/patches-rt/0096-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch @@ -1,7 +1,9 @@ +From 9b018413a45c8182c7ddfe274e127f723ceb35d8 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 10 Sep 2018 18:00:31 +0200 -Subject: [PATCH] work-simple: drop a shit statement in SWORK_EVENT_PENDING -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 096/266] work-simple: drop a shit statement in + SWORK_EVENT_PENDING +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Dan Carpenter reported | smatch warnings: @@ -14,9 +16,11 @@ Nevertheless I'm dropping that shift by zero to keep smatch quiet. Cc: Daniel Wagner <daniel.wagner@siemens.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/sched/swork.c | 2 +- + kernel/sched/swork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/sched/swork.c b/kernel/sched/swork.c +index a5b89fdacf19..c90d14b9b126 100644 --- a/kernel/sched/swork.c +++ b/kernel/sched/swork.c @@ -12,7 +12,7 @@ @@ -28,3 +32,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static DEFINE_MUTEX(worker_mutex); static struct sworker *glob_worker; +-- +2.20.1 + diff --git a/debian/patches-rt/completion-use-simple-wait-queues.patch b/debian/patches-rt/0097-completion-Use-simple-wait-queues.patch index 23ea30c58..885e99b38 100644 --- a/debian/patches-rt/completion-use-simple-wait-queues.patch +++ b/debian/patches-rt/0097-completion-Use-simple-wait-queues.patch @@ -1,7 +1,8 @@ -Subject: completion: Use simple wait queues +From c2beaeff146ca9f454afd0da8cadea8fbfdf6c84 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 11 Jan 2013 11:23:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 097/266] completion: Use simple wait queues +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Completions have no long lasting callbacks and therefor do not need the complex waitqueue variant. Use simple waitqueues which reduces the @@ -9,23 +10,25 @@ contention on the waitqueue lock. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/powerpc/platforms/ps3/device-init.c | 4 +- - drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 4 +- - drivers/usb/gadget/function/f_fs.c | 2 - - drivers/usb/gadget/legacy/inode.c | 4 +- - include/linux/completion.h | 8 ++-- - include/linux/suspend.h | 6 +++ - include/linux/swait.h | 2 + - kernel/power/hibernate.c | 7 ++++ - kernel/power/suspend.c | 4 ++ - kernel/sched/completion.c | 34 ++++++++++---------- - kernel/sched/core.c | 10 ++++- - kernel/sched/swait.c | 21 +++++++++++- + arch/powerpc/platforms/ps3/device-init.c | 4 +-- + .../wireless/intersil/orinoco/orinoco_usb.c | 4 +-- + drivers/usb/gadget/function/f_fs.c | 2 +- + drivers/usb/gadget/legacy/inode.c | 4 +-- + include/linux/completion.h | 8 ++--- + include/linux/suspend.h | 6 ++++ + include/linux/swait.h | 2 ++ + kernel/power/hibernate.c | 7 ++++ + kernel/power/suspend.c | 4 +++ + kernel/sched/completion.c | 34 +++++++++---------- + kernel/sched/core.c | 10 ++++-- + kernel/sched/swait.c | 21 +++++++++++- 12 files changed, 75 insertions(+), 31 deletions(-) +diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c +index e7075aaff1bb..1580464a9d5b 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c -@@ -752,8 +752,8 @@ static int ps3_notification_read_write(s +@@ -752,8 +752,8 @@ static int ps3_notification_read_write(struct ps3_notification_device *dev, } pr_debug("%s:%u: notification %s issued\n", __func__, __LINE__, op); @@ -36,9 +39,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (kthread_should_stop()) res = -EINTR; if (res) { +diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +index 94ad6fe29e69..52a49f0bbc19 100644 --- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c -@@ -697,8 +697,8 @@ static void ezusb_req_ctx_wait(struct ez +@@ -697,8 +697,8 @@ static void ezusb_req_ctx_wait(struct ezusb_priv *upriv, while (!ctx->done.done && msecs--) udelay(1000); } else { @@ -49,9 +54,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } break; default: +diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c +index 31e8bf3578c8..4d6741a54dd0 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c -@@ -1623,7 +1623,7 @@ static void ffs_data_put(struct ffs_data +@@ -1623,7 +1623,7 @@ static void ffs_data_put(struct ffs_data *ffs) pr_info("%s(): freeing\n", __func__); ffs_data_clear(ffs); BUG_ON(waitqueue_active(&ffs->ev.waitq) || @@ -60,9 +67,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> waitqueue_active(&ffs->wait)); destroy_workqueue(ffs->io_completion_wq); kfree(ffs->dev_name); +diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c +index 37ca0e669bd8..56a16587b221 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c -@@ -343,7 +343,7 @@ ep_io (struct ep_data *epdata, void *buf +@@ -343,7 +343,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len) spin_unlock_irq (&epdata->dev->lock); if (likely (value == 0)) { @@ -71,7 +80,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (value != 0) { spin_lock_irq (&epdata->dev->lock); if (likely (epdata->ep != NULL)) { -@@ -352,7 +352,7 @@ ep_io (struct ep_data *epdata, void *buf +@@ -352,7 +352,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len) usb_ep_dequeue (epdata->ep, epdata->req); spin_unlock_irq (&epdata->dev->lock); @@ -80,6 +89,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (epdata->status == -ECONNRESET) epdata->status = -EINTR; } else { +diff --git a/include/linux/completion.h b/include/linux/completion.h +index 519e94915d18..bf8e77001f18 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -9,7 +9,7 @@ @@ -100,7 +111,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> }; #define init_completion_map(x, m) __init_completion(x) -@@ -34,7 +34,7 @@ static inline void complete_acquire(stru +@@ -34,7 +34,7 @@ static inline void complete_acquire(struct completion *x) {} static inline void complete_release(struct completion *x) {} #define COMPLETION_INITIALIZER(work) \ @@ -109,7 +120,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define COMPLETION_INITIALIZER_ONSTACK_MAP(work, map) \ (*({ init_completion_map(&(work), &(map)); &(work); })) -@@ -85,7 +85,7 @@ static inline void complete_release(stru +@@ -85,7 +85,7 @@ static inline void complete_release(struct completion *x) {} static inline void __init_completion(struct completion *x) { x->done = 0; @@ -118,6 +129,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /** +diff --git a/include/linux/suspend.h b/include/linux/suspend.h +index 3f529ad9a9d2..328439ce71f5 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -196,6 +196,12 @@ struct platform_s2idle_ops { @@ -133,9 +146,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_SUSPEND extern suspend_state_t mem_sleep_current; extern suspend_state_t mem_sleep_default; +diff --git a/include/linux/swait.h b/include/linux/swait.h +index 73e06e9986d4..f426a0661aa0 100644 --- a/include/linux/swait.h +++ b/include/linux/swait.h -@@ -160,7 +160,9 @@ static inline bool swq_has_sleeper(struc +@@ -160,7 +160,9 @@ static inline bool swq_has_sleeper(struct swait_queue_head *wq) extern void swake_up_one(struct swait_queue_head *q); extern void swake_up_all(struct swait_queue_head *q); extern void swake_up_locked(struct swait_queue_head *q); @@ -145,6 +160,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern void prepare_to_swait_exclusive(struct swait_queue_head *q, struct swait_queue *wait, int state); extern long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait, int state); +diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c +index abef759de7c8..69e418787f21 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -681,6 +681,10 @@ static int load_image_and_restore(void) @@ -175,9 +192,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> pr_info("hibernation exit\n"); return error; +diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c +index 0bd595a0b610..a4456772d98e 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c -@@ -600,6 +600,8 @@ static int enter_state(suspend_state_t s +@@ -600,6 +600,8 @@ static int enter_state(suspend_state_t state) return error; } @@ -202,6 +221,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return error; } EXPORT_SYMBOL(pm_suspend); +diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c +index a1ad5b7d5521..755a58084978 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -29,12 +29,12 @@ void complete(struct completion *x) @@ -260,7 +281,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (!x->done) return timeout; } -@@ -100,9 +100,9 @@ static inline long __sched +@@ -100,9 +100,9 @@ __wait_for_common(struct completion *x, complete_acquire(x); @@ -272,7 +293,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> complete_release(x); -@@ -291,12 +291,12 @@ bool try_wait_for_completion(struct comp +@@ -291,12 +291,12 @@ bool try_wait_for_completion(struct completion *x) if (!READ_ONCE(x->done)) return false; @@ -287,7 +308,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return ret; } EXPORT_SYMBOL(try_wait_for_completion); -@@ -322,8 +322,8 @@ bool completion_done(struct completion * +@@ -322,8 +322,8 @@ bool completion_done(struct completion *x) * otherwise we can end up freeing the completion before complete() * is done referencing it. */ @@ -298,9 +319,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return true; } EXPORT_SYMBOL(completion_done); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 8250701ecfd7..714f5617fe1f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7107,7 +7107,10 @@ void migrate_disable(void) +@@ -7108,7 +7108,10 @@ void migrate_disable(void) return; } #ifdef CONFIG_SCHED_DEBUG @@ -312,7 +335,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif if (p->migrate_disable) { -@@ -7137,7 +7140,10 @@ void migrate_enable(void) +@@ -7138,7 +7141,10 @@ void migrate_enable(void) } #ifdef CONFIG_SCHED_DEBUG @@ -324,9 +347,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif WARN_ON_ONCE(p->migrate_disable <= 0); +diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c +index 66b59ac77c22..c7cb30cdd1b7 100644 --- a/kernel/sched/swait.c +++ b/kernel/sched/swait.c -@@ -32,6 +32,25 @@ void swake_up_locked(struct swait_queue_ +@@ -32,6 +32,25 @@ void swake_up_locked(struct swait_queue_head *q) } EXPORT_SYMBOL(swake_up_locked); @@ -352,7 +377,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void swake_up_one(struct swait_queue_head *q) { unsigned long flags; -@@ -69,7 +88,7 @@ void swake_up_all(struct swait_queue_hea +@@ -69,7 +88,7 @@ void swake_up_all(struct swait_queue_head *q) } EXPORT_SYMBOL(swake_up_all); @@ -361,3 +386,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> { wait->task = current; if (list_empty(&wait->task_list)) +-- +2.20.1 + diff --git a/debian/patches-rt/fs-aio-simple-simple-work.patch b/debian/patches-rt/0098-fs-aio-simple-simple-work.patch index a9e45d091..e339b70a4 100644 --- a/debian/patches-rt/fs-aio-simple-simple-work.patch +++ b/debian/patches-rt/0098-fs-aio-simple-simple-work.patch @@ -1,7 +1,8 @@ +From afe56dc247199dfab44e763d2b7d384b8a27a028 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 16 Feb 2015 18:49:10 +0100 -Subject: fs/aio: simple simple work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 098/266] fs/aio: simple simple work +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:768 |in_atomic(): 1, irqs_disabled(): 0, pid: 26, name: rcuos/2 @@ -25,9 +26,11 @@ Reported-By: Mike Galbraith <umgwanakikbuti@gmail.com> Suggested-by: Benjamin LaHaise <bcrl@kvack.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - fs/aio.c | 15 +++++++++++++-- + fs/aio.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) +diff --git a/fs/aio.c b/fs/aio.c +index 45d5ef8dd0a8..7db10b87c9bc 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -42,6 +42,7 @@ @@ -54,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> aio_mnt = kern_mount(&aio_fs); if (IS_ERR(aio_mnt)) panic("Failed to create aio fs mount."); -@@ -596,9 +599,9 @@ static void free_ioctx_reqs(struct percp +@@ -596,9 +599,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. */ @@ -66,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct aio_kiocb *req; spin_lock_irq(&ctx->ctx_lock); -@@ -616,6 +619,14 @@ static void free_ioctx_users(struct perc +@@ -616,6 +619,14 @@ static void free_ioctx_users(struct percpu_ref *ref) percpu_ref_put(&ctx->reqs); } @@ -81,3 +84,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm) { unsigned i, new_nr; +-- +2.20.1 + diff --git a/debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch b/debian/patches-rt/0099-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch index 4abd3ed16..17df55565 100644 --- a/debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch +++ b/debian/patches-rt/0099-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch @@ -1,7 +1,9 @@ +From 2241ac7c8cc88110d42529596fd90f272387fd00 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 21 Aug 2013 17:48:46 +0200 -Subject: genirq: Do not invoke the affinity callback via a workqueue on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 099/266] genirq: Do not invoke the affinity callback via a + workqueue on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Joe Korty reported, that __irq_set_affinity_locked() schedules a workqueue while holding a rawlock which results in a might_sleep() @@ -10,10 +12,12 @@ This patch uses swork_queue() instead. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/interrupt.h | 6 ++++++ - kernel/irq/manage.c | 43 ++++++++++++++++++++++++++++++++++++++++--- + include/linux/interrupt.h | 6 ++++++ + kernel/irq/manage.c | 43 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 3 deletions(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 315f852b4981..a943c07b54ba 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -13,6 +13,7 @@ @@ -44,9 +48,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask); void (*release)(struct kref *ref); }; +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index 94a18cf54293..d2270f61d335 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -259,7 +259,12 @@ int irq_set_affinity_locked(struct irq_d +@@ -259,7 +259,12 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, if (desc->affinity_notify) { kref_get(&desc->affinity_notify->kref); @@ -59,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } irqd_set(data, IRQD_AFFINITY_SET); -@@ -297,10 +302,8 @@ int irq_set_affinity_hint(unsigned int i +@@ -297,10 +302,8 @@ int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) } EXPORT_SYMBOL_GPL(irq_set_affinity_hint); @@ -71,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct irq_desc *desc = irq_to_desc(notify->irq); cpumask_var_t cpumask; unsigned long flags; -@@ -322,6 +325,35 @@ static void irq_affinity_notify(struct w +@@ -322,6 +325,35 @@ static void irq_affinity_notify(struct work_struct *work) kref_put(¬ify->kref, notify->release); } @@ -107,7 +113,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * irq_set_affinity_notifier - control notification of IRQ affinity changes * @irq: Interrupt for which to enable/disable notification -@@ -350,7 +382,12 @@ irq_set_affinity_notifier(unsigned int i +@@ -350,7 +382,12 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) if (notify) { notify->irq = irq; kref_init(¬ify->kref); @@ -120,3 +126,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } raw_spin_lock_irqsave(&desc->lock, flags); +-- +2.20.1 + diff --git a/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch b/debian/patches-rt/0100-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch index f53264a82..fa7c3043e 100644 --- a/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch +++ b/debian/patches-rt/0100-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch @@ -1,19 +1,23 @@ +From d14b54f5a857ad006ce9a339e8ddea5b0580db2b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 15 Nov 2017 17:29:51 +0100 -Subject: [PATCH] time/hrtimer: avoid schedule_work() with interrupts disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 100/266] time/hrtimer: avoid schedule_work() with interrupts + disabled +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The NOHZ code tries to schedule a workqueue with interrupts disabled. Since this does not work -RT I am switching it to swork instead. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/time/timer.c | 15 +++++++++++---- + kernel/time/timer.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index bbe24e241643..696e7583137c 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -217,8 +217,7 @@ static DEFINE_PER_CPU(struct timer_base, +@@ -217,8 +217,7 @@ static DEFINE_PER_CPU(struct timer_base, timer_bases[NR_BASES]); static DEFINE_STATIC_KEY_FALSE(timers_nohz_active); static DEFINE_MUTEX(timer_keys_mutex); @@ -23,7 +27,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_SMP unsigned int sysctl_timer_migration = 1; -@@ -236,7 +235,7 @@ static void timers_update_migration(void +@@ -236,7 +235,7 @@ static void timers_update_migration(void) static inline void timers_update_migration(void) { } #endif /* !CONFIG_SMP */ @@ -32,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { mutex_lock(&timer_keys_mutex); timers_update_migration(); -@@ -246,9 +245,17 @@ static void timer_update_keys(struct wor +@@ -246,9 +245,17 @@ static void timer_update_keys(struct work_struct *work) void timers_update_nohz(void) { @@ -51,3 +55,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int timer_migration_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) +-- +2.20.1 + diff --git a/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch b/debian/patches-rt/0101-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch index b10ae5280..e3f4ad3ff 100644 --- a/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch +++ b/debian/patches-rt/0101-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch @@ -1,7 +1,9 @@ +From 5a01e5b6e3930af282fc1ad4c52348c2863b6d80 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 3 Jul 2018 11:25:41 +0200 -Subject: [PATCH v2] hrtimer: consolidate hrtimer_init() + hrtimer_init_sleeper() calls -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Tue, 3 Jul 2018 11:25:41 +0200 +Subject: [PATCH 101/266] hrtimer: consolidate hrtimer_init() + + hrtimer_init_sleeper() calls +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz hrtimer_init_sleeper() calls require a prior initialisation of the hrtimer object with hrtimer_init(). Lets make the initialisation of @@ -16,18 +18,20 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> [anna-maria: Updating the commit message, add staging/android/vsoc.c] Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> --- - block/blk-mq.c | 3 -- - drivers/staging/android/vsoc.c | 6 +---- - include/linux/hrtimer.h | 19 ++++++++++++++-- - include/linux/wait.h | 4 +-- - kernel/futex.c | 19 +++++++--------- - kernel/time/hrtimer.c | 46 ++++++++++++++++++++++++++++++++--------- - net/core/pktgen.c | 4 +-- + block/blk-mq.c | 3 +-- + drivers/staging/android/vsoc.c | 6 ++--- + include/linux/hrtimer.h | 19 +++++++++++--- + include/linux/wait.h | 4 +-- + kernel/futex.c | 19 ++++++-------- + kernel/time/hrtimer.c | 46 ++++++++++++++++++++++++++-------- + net/core/pktgen.c | 4 +-- 7 files changed, 67 insertions(+), 34 deletions(-) +diff --git a/block/blk-mq.c b/block/blk-mq.c +index 7d53f2314d7c..b0d0b74cf5a6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c -@@ -3116,10 +3116,9 @@ static bool blk_mq_poll_hybrid_sleep(str +@@ -3124,10 +3124,9 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q, kt = nsecs; mode = HRTIMER_MODE_REL; @@ -39,9 +43,11 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> do { if (blk_mq_rq_state(rq) == MQ_RQ_COMPLETE) break; +diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c +index 22571abcaa4e..78a529d363f3 100644 --- a/drivers/staging/android/vsoc.c +++ b/drivers/staging/android/vsoc.c -@@ -437,12 +437,10 @@ static int handle_vsoc_cond_wait(struct +@@ -437,12 +437,10 @@ static int handle_vsoc_cond_wait(struct file *filp, struct vsoc_cond_wait *arg) return -EINVAL; wake_time = ktime_set(arg->wake_time_sec, arg->wake_time_nsec); @@ -56,9 +62,11 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> } while (1) { +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 3892e9c8b2de..b8bbaabd5aff 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h -@@ -364,10 +364,17 @@ DECLARE_PER_CPU(struct tick_device, tick +@@ -364,10 +364,17 @@ DECLARE_PER_CPU(struct tick_device, tick_cpu_device); /* Initialize timers: */ extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, enum hrtimer_mode mode); @@ -76,7 +84,7 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> extern void destroy_hrtimer_on_stack(struct hrtimer *timer); #else -@@ -377,6 +384,15 @@ static inline void hrtimer_init_on_stack +@@ -377,6 +384,15 @@ static inline void hrtimer_init_on_stack(struct hrtimer *timer, { hrtimer_init(timer, which_clock, mode); } @@ -92,7 +100,7 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { } #endif -@@ -480,9 +496,6 @@ extern long hrtimer_nanosleep(const stru +@@ -480,9 +496,6 @@ extern long hrtimer_nanosleep(const struct timespec64 *rqtp, const enum hrtimer_mode mode, const clockid_t clockid); @@ -102,6 +110,8 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> extern int schedule_hrtimeout_range(ktime_t *expires, u64 delta, const enum hrtimer_mode mode); extern int schedule_hrtimeout_range_clock(ktime_t *expires, +diff --git a/include/linux/wait.h b/include/linux/wait.h +index 2b5ef8e94d19..94bd2e841de6 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -489,8 +489,8 @@ do { \ @@ -115,9 +125,11 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> if ((timeout) != KTIME_MAX) \ hrtimer_start_range_ns(&__t.timer, timeout, \ current->timer_slack_ns, \ +diff --git a/kernel/futex.c b/kernel/futex.c +index cea098efd12e..2b3eb43ba3fd 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2681,10 +2681,9 @@ static int futex_wait(u32 __user *uaddr, +@@ -2684,10 +2684,9 @@ static int futex_wait(u32 __user *uaddr, unsigned int flags, u32 val, if (abs_time) { to = &timeout; @@ -131,7 +143,7 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> hrtimer_set_expires_range_ns(&to->timer, *abs_time, current->timer_slack_ns); } -@@ -2783,9 +2782,8 @@ static int futex_lock_pi(u32 __user *uad +@@ -2786,9 +2785,8 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, if (time) { to = &timeout; @@ -143,7 +155,7 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> hrtimer_set_expires(&to->timer, *time); } -@@ -3209,10 +3207,9 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3212,10 +3210,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, if (abs_time) { to = &timeout; @@ -157,9 +169,11 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> hrtimer_set_expires_range_ns(&to->timer, *abs_time, current->timer_slack_ns); } +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index e1a549c9e399..4f43ece42f3b 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1648,13 +1648,44 @@ static enum hrtimer_restart hrtimer_wake +@@ -1648,13 +1648,44 @@ static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer) return HRTIMER_NORESTART; } @@ -205,7 +219,7 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) { switch(restart->nanosleep.type) { -@@ -1678,8 +1709,6 @@ static int __sched do_nanosleep(struct h +@@ -1678,8 +1709,6 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod { struct restart_block *restart; @@ -214,7 +228,7 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> do { set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t->timer, mode); -@@ -1716,10 +1745,9 @@ static long __sched hrtimer_nanosleep_re +@@ -1716,10 +1745,9 @@ static long __sched hrtimer_nanosleep_restart(struct restart_block *restart) struct hrtimer_sleeper t; int ret; @@ -227,7 +241,7 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> ret = do_nanosleep(&t, HRTIMER_MODE_ABS); destroy_hrtimer_on_stack(&t.timer); return ret; -@@ -1737,7 +1765,7 @@ long hrtimer_nanosleep(const struct time +@@ -1737,7 +1765,7 @@ long hrtimer_nanosleep(const struct timespec64 *rqtp, if (dl_task(current) || rt_task(current)) slack = 0; @@ -236,7 +250,7 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> hrtimer_set_expires_range_ns(&t.timer, timespec64_to_ktime(*rqtp), slack); ret = do_nanosleep(&t, mode); if (ret != -ERESTART_RESTARTBLOCK) -@@ -1936,11 +1964,9 @@ schedule_hrtimeout_range_clock(ktime_t * +@@ -1936,11 +1964,9 @@ schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, return -EINTR; } @@ -249,9 +263,11 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> hrtimer_start_expires(&t.timer, mode); if (likely(t.task)) +diff --git a/net/core/pktgen.c b/net/core/pktgen.c +index 7f6938405fa1..b71d9eef334e 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c -@@ -2160,7 +2160,8 @@ static void spin(struct pktgen_dev *pkt_ +@@ -2160,7 +2160,8 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until) s64 remaining; struct hrtimer_sleeper t; @@ -261,7 +277,7 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> hrtimer_set_expires(&t.timer, spin_until); remaining = ktime_to_ns(hrtimer_expires_remaining(&t.timer)); -@@ -2175,7 +2176,6 @@ static void spin(struct pktgen_dev *pkt_ +@@ -2175,7 +2176,6 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until) } while (ktime_compare(end_time, spin_until) < 0); } else { /* see do_nanosleep */ @@ -269,3 +285,6 @@ Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> do { set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS); +-- +2.20.1 + diff --git a/debian/patches-rt/hrtimers-prepare-full-preemption.patch b/debian/patches-rt/0102-hrtimers-Prepare-full-preemption.patch index 001327dbd..525884e94 100644 --- a/debian/patches-rt/hrtimers-prepare-full-preemption.patch +++ b/debian/patches-rt/0102-hrtimers-Prepare-full-preemption.patch @@ -1,27 +1,29 @@ +From 3ef6906fafdfc41d1ed2eb6a520c5a0024718306 Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> Date: Fri, 3 Jul 2009 08:29:34 -0500 -Subject: hrtimers: Prepare full preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 102/266] hrtimers: Prepare full preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Make cancellation of a running callback in softirq context safe against preemption. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - fs/timerfd.c | 5 ++++- - include/linux/hrtimer.h | 13 ++++++++++++- - include/linux/posix-timers.h | 2 +- - kernel/time/alarmtimer.c | 2 +- - kernel/time/hrtimer.c | 33 ++++++++++++++++++++++++++++++++- - kernel/time/itimer.c | 1 + - kernel/time/posix-timers.c | 39 +++++++++++++++++++++++++++++++++++++-- + fs/timerfd.c | 5 ++++- + include/linux/hrtimer.h | 13 +++++++++++- + include/linux/posix-timers.h | 2 +- + kernel/time/alarmtimer.c | 2 +- + kernel/time/hrtimer.c | 33 +++++++++++++++++++++++++++++- + kernel/time/itimer.c | 1 + + kernel/time/posix-timers.c | 39 ++++++++++++++++++++++++++++++++++-- 7 files changed, 88 insertions(+), 7 deletions(-) +diff --git a/fs/timerfd.c b/fs/timerfd.c +index d69ad801eb80..82d0f52414a6 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c -@@ -471,7 +471,10 @@ static int do_timerfd_settime(int ufd, i +@@ -471,7 +471,10 @@ static int do_timerfd_settime(int ufd, int flags, break; } spin_unlock_irq(&ctx->wqh.lock); @@ -33,6 +35,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index b8bbaabd5aff..73ad7309436a 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -22,6 +22,7 @@ @@ -53,7 +57,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> struct hrtimer *softirq_next_timer; struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; } ____cacheline_aligned; -@@ -433,6 +437,13 @@ static inline void hrtimer_restart(struc +@@ -433,6 +437,13 @@ static inline void hrtimer_restart(struct hrtimer *timer) hrtimer_start_expires(timer, HRTIMER_MODE_ABS); } @@ -67,7 +71,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* Query timers: */ extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust); -@@ -458,7 +469,7 @@ static inline int hrtimer_is_queued(stru +@@ -458,7 +469,7 @@ static inline int hrtimer_is_queued(struct hrtimer *timer) * Helper function to check, whether the timer is running the callback * function */ @@ -76,6 +80,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> { return timer->base->running == timer; } +diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h +index ee7e987ea1b4..0571b498db73 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h @@ -114,8 +114,8 @@ struct k_itimer { @@ -88,6 +94,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> }; void run_posix_cpu_timers(struct task_struct *task); +diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c +index fa5de5e8de61..6020ee66e517 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -436,7 +436,7 @@ int alarm_cancel(struct alarm *alarm) @@ -99,9 +107,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } EXPORT_SYMBOL_GPL(alarm_cancel); +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 4f43ece42f3b..923a650e5c35 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -939,6 +939,33 @@ u64 hrtimer_forward(struct hrtimer *time +@@ -939,6 +939,33 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) } EXPORT_SYMBOL_GPL(hrtimer_forward); @@ -135,7 +145,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * enqueue_hrtimer - internal function to (re)start a timer * -@@ -1171,7 +1198,7 @@ int hrtimer_cancel(struct hrtimer *timer +@@ -1171,7 +1198,7 @@ int hrtimer_cancel(struct hrtimer *timer) if (ret >= 0) return ret; @@ -144,7 +154,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } EXPORT_SYMBOL_GPL(hrtimer_cancel); -@@ -1477,6 +1504,7 @@ static __latent_entropy void hrtimer_run +@@ -1477,6 +1504,7 @@ static __latent_entropy void hrtimer_run_softirq(struct softirq_action *h) hrtimer_update_softirq_timer(cpu_base, true); raw_spin_unlock_irqrestore(&cpu_base->lock, flags); @@ -152,7 +162,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } #ifdef CONFIG_HIGH_RES_TIMERS -@@ -1846,6 +1874,9 @@ int hrtimers_prepare_cpu(unsigned int cp +@@ -1846,6 +1874,9 @@ 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; @@ -162,9 +172,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return 0; } +diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c +index 9a65713c8309..55b0e58368bf 100644 --- a/kernel/time/itimer.c +++ b/kernel/time/itimer.c -@@ -215,6 +215,7 @@ int do_setitimer(int which, struct itime +@@ -215,6 +215,7 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue) /* We are sharing ->siglock with it_real_fn() */ if (hrtimer_try_to_cancel(timer) < 0) { spin_unlock_irq(&tsk->sighand->siglock); @@ -172,9 +184,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> goto again; } expires = timeval_to_ktime(value->it_value); +diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c +index 5a01c4fdbfef..a5ec421e3437 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c -@@ -463,7 +463,7 @@ static struct k_itimer * alloc_posix_tim +@@ -463,7 +463,7 @@ static struct k_itimer * alloc_posix_timer(void) static void k_itimer_rcu_free(struct rcu_head *head) { @@ -183,7 +197,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> kmem_cache_free(posix_timers_cache, tmr); } -@@ -480,7 +480,7 @@ static void release_posix_timer(struct k +@@ -480,7 +480,7 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set) } put_pid(tmr->it_pid); sigqueue_free(tmr->sigq); @@ -192,7 +206,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static int common_timer_create(struct k_itimer *new_timer) -@@ -821,6 +821,22 @@ static void common_hrtimer_arm(struct k_ +@@ -821,6 +821,22 @@ static void common_hrtimer_arm(struct k_itimer *timr, ktime_t expires, hrtimer_start_expires(timer, HRTIMER_MODE_ABS); } @@ -215,7 +229,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static int common_hrtimer_try_to_cancel(struct k_itimer *timr) { return hrtimer_try_to_cancel(&timr->it.real.timer); -@@ -885,6 +901,7 @@ static int do_timer_settime(timer_t time +@@ -885,6 +901,7 @@ static int do_timer_settime(timer_t timer_id, int flags, if (!timr) return -EINVAL; @@ -223,7 +237,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> kc = timr->kclock; if (WARN_ON_ONCE(!kc || !kc->timer_set)) error = -EINVAL; -@@ -893,9 +910,12 @@ static int do_timer_settime(timer_t time +@@ -893,9 +910,12 @@ static int do_timer_settime(timer_t timer_id, int flags, unlock_timer(timr, flag); if (error == TIMER_RETRY) { @@ -236,7 +250,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return error; } -@@ -977,10 +997,15 @@ SYSCALL_DEFINE1(timer_delete, timer_t, t +@@ -977,10 +997,15 @@ SYSCALL_DEFINE1(timer_delete, timer_t, timer_id) if (!timer) return -EINVAL; @@ -252,7 +266,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> spin_lock(¤t->sighand->siglock); list_del(&timer->list); -@@ -1006,8 +1031,18 @@ static void itimer_delete(struct k_itime +@@ -1006,8 +1031,18 @@ static void itimer_delete(struct k_itimer *timer) retry_delete: spin_lock_irqsave(&timer->it_lock, flags); @@ -271,3 +285,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> goto retry_delete; } list_del(&timer->list); +-- +2.20.1 + diff --git a/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch b/debian/patches-rt/0103-hrtimer-by-timers-by-default-into-the-softirq-contex.patch index 15d6df221..e7307dfbb 100644 --- a/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch +++ b/debian/patches-rt/0103-hrtimer-by-timers-by-default-into-the-softirq-contex.patch @@ -1,7 +1,9 @@ +From 889614d308523d73fb2fdc097bbbd60984bfb155 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 3 Jul 2009 08:44:31 -0500 -Subject: hrtimer: by timers by default into the softirq context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 103/266] hrtimer: by timers by default into the softirq + context +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz We can't have hrtimers callbacks running in hardirq context on RT. Therefore the timers are deferred to the softirq context by default. @@ -13,22 +15,24 @@ Those are: Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/kvm/lapic.c | 2 +- - include/linux/hrtimer.h | 6 ++++++ - kernel/events/core.c | 4 ++-- - kernel/sched/core.c | 2 +- - kernel/sched/deadline.c | 2 +- - kernel/sched/fair.c | 4 ++-- - kernel/sched/rt.c | 4 ++-- - kernel/time/hrtimer.c | 21 +++++++++++++++++++-- - kernel/time/tick-broadcast-hrtimer.c | 2 +- - kernel/time/tick-sched.c | 2 +- - kernel/watchdog.c | 2 +- + arch/x86/kvm/lapic.c | 2 +- + include/linux/hrtimer.h | 6 ++++++ + kernel/events/core.c | 4 ++-- + kernel/sched/core.c | 2 +- + kernel/sched/deadline.c | 2 +- + kernel/sched/fair.c | 4 ++-- + kernel/sched/rt.c | 4 ++-- + kernel/time/hrtimer.c | 21 +++++++++++++++++++-- + kernel/time/tick-broadcast-hrtimer.c | 2 +- + kernel/time/tick-sched.c | 2 +- + kernel/watchdog.c | 2 +- 11 files changed, 37 insertions(+), 14 deletions(-) +diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c +index 3692de84c420..e3c95654b0d1 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c -@@ -2250,7 +2250,7 @@ int kvm_create_lapic(struct kvm_vcpu *vc +@@ -2250,7 +2250,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu) apic->vcpu = vcpu; hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC, @@ -37,6 +41,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> apic->lapic_timer.timer.function = apic_timer_fn; /* +diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h +index 73ad7309436a..2bdb047c7656 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -42,6 +42,7 @@ enum hrtimer_mode { @@ -59,9 +65,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> }; /* +diff --git a/kernel/events/core.c b/kernel/events/core.c +index aa996a0854b9..e30d437229da 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c -@@ -1102,7 +1102,7 @@ static void __perf_mux_hrtimer_init(stru +@@ -1102,7 +1102,7 @@ static void __perf_mux_hrtimer_init(struct perf_cpu_context *cpuctx, int cpu) cpuctx->hrtimer_interval = ns_to_ktime(NSEC_PER_MSEC * interval); raw_spin_lock_init(&cpuctx->hrtimer_lock); @@ -70,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> timer->function = perf_mux_hrtimer_handler; } -@@ -9181,7 +9181,7 @@ static void perf_swevent_init_hrtimer(st +@@ -9181,7 +9181,7 @@ static void perf_swevent_init_hrtimer(struct perf_event *event) if (!is_sampling_event(event)) return; @@ -79,9 +87,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> hwc->hrtimer.function = perf_swevent_hrtimer; /* +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 714f5617fe1f..45fd27df22ef 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -314,7 +314,7 @@ static void hrtick_rq_init(struct rq *rq +@@ -314,7 +314,7 @@ static void hrtick_rq_init(struct rq *rq) rq->hrtick_csd.info = rq; #endif @@ -90,9 +100,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rq->hrtick_timer.function = hrtick; } #else /* CONFIG_SCHED_HRTICK */ +diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c +index f927b1f45474..ad2a793a912b 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c -@@ -1054,7 +1054,7 @@ void init_dl_task_timer(struct sched_dl_ +@@ -1054,7 +1054,7 @@ void init_dl_task_timer(struct sched_dl_entity *dl_se) { struct hrtimer *timer = &dl_se->dl_timer; @@ -101,9 +113,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> timer->function = dl_task_timer; } +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index 09a1e32c366f..53831b858a41 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4879,9 +4879,9 @@ void init_cfs_bandwidth(struct cfs_bandw +@@ -4879,9 +4879,9 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) cfs_b->period = ns_to_ktime(default_cfs_period()); INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq); @@ -115,9 +129,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cfs_b->slack_timer.function = sched_cfs_slack_timer; cfs_b->distribute_running = 0; } +diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c +index 4857ca145119..32c9a9f54495 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c -@@ -45,8 +45,8 @@ void init_rt_bandwidth(struct rt_bandwid +@@ -45,8 +45,8 @@ void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime) raw_spin_lock_init(&rt_b->rt_runtime_lock); @@ -128,9 +144,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rt_b->rt_period_timer.function = sched_rt_period_timer; } +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 923a650e5c35..abf24e60b6e8 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1135,7 +1135,9 @@ void hrtimer_start_range_ns(struct hrtim +@@ -1135,7 +1135,9 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft * match. */ @@ -140,7 +158,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> base = lock_hrtimer_base(timer, &flags); -@@ -1295,10 +1297,17 @@ static inline int hrtimer_clockid_to_bas +@@ -1295,10 +1297,17 @@ static inline int hrtimer_clockid_to_base(clockid_t clock_id) static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, enum hrtimer_mode mode) { @@ -160,7 +178,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> memset(timer, 0, sizeof(struct hrtimer)); cpu_base = raw_cpu_ptr(&hrtimer_bases); -@@ -1681,6 +1690,14 @@ static void __hrtimer_init_sleeper(struc +@@ -1681,6 +1690,14 @@ static void __hrtimer_init_sleeper(struct hrtimer_sleeper *sl, enum hrtimer_mode mode, struct task_struct *task) { @@ -175,9 +193,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> __hrtimer_init(&sl->timer, clock_id, mode); sl->timer.function = hrtimer_wakeup; sl->task = task; +diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c +index a59641fb88b6..52649fdea3b5 100644 --- a/kernel/time/tick-broadcast-hrtimer.c +++ b/kernel/time/tick-broadcast-hrtimer.c -@@ -106,7 +106,7 @@ static enum hrtimer_restart bc_handler(s +@@ -106,7 +106,7 @@ static enum hrtimer_restart bc_handler(struct hrtimer *t) void tick_setup_hrtimer_broadcast(void) { @@ -186,6 +206,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> bctimer.function = bc_handler; clockevents_register_device(&ce_broadcast_hrtimer); } +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index 54fd344ef973..c217af74dddf 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1310,7 +1310,7 @@ void tick_setup_sched_timer(void) @@ -197,9 +219,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ts->sched_timer.function = tick_sched_timer; /* Get the next period (per-CPU) */ +diff --git a/kernel/watchdog.c b/kernel/watchdog.c +index 977918d5d350..6062f03bf9dc 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c -@@ -483,7 +483,7 @@ static void watchdog_enable(unsigned int +@@ -483,7 +483,7 @@ static void watchdog_enable(unsigned int cpu) * Start the timer first to prevent the NMI watchdog triggering * before the timer has a chance to fire. */ @@ -208,3 +232,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> hrtimer->function = watchdog_timer_fn; hrtimer_start(hrtimer, ns_to_ktime(sample_period), HRTIMER_MODE_REL_PINNED); +-- +2.20.1 + diff --git a/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch b/debian/patches-rt/0104-sched-fair-Make-the-hrtimers-non-hard-again.patch index db7259638..63c21468c 100644 --- a/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch +++ b/debian/patches-rt/0104-sched-fair-Make-the-hrtimers-non-hard-again.patch @@ -1,7 +1,8 @@ +From 73d6f2c019741cbc8070a6696215f4cb00d76b34 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 8 Jan 2019 12:31:06 +0100 -Subject: [PATCH] sched/fair: Make the hrtimers non-hard again -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 104/266] sched/fair: Make the hrtimers non-hard again +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Since commit "sched/fair: Robustify CFS-bandwidth timer locking" both hrtimer can run in softirq context because now interrupts are disabled @@ -9,12 +10,14 @@ as part of the locking procedure. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/sched/fair.c | 4 ++-- + kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index 53831b858a41..09a1e32c366f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4879,9 +4879,9 @@ void init_cfs_bandwidth(struct cfs_bandw +@@ -4879,9 +4879,9 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) cfs_b->period = ns_to_ktime(default_cfs_period()); INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq); @@ -26,3 +29,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cfs_b->slack_timer.function = sched_cfs_slack_timer; cfs_b->distribute_running = 0; } +-- +2.20.1 + diff --git a/debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch b/debian/patches-rt/0105-hrtimer-Move-schedule_work-call-to-helper-thread.patch index 76498c447..3804456f9 100644 --- a/debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch +++ b/debian/patches-rt/0105-hrtimer-Move-schedule_work-call-to-helper-thread.patch @@ -1,7 +1,8 @@ +From 110886b47449ae5d499c1173c95bca9a01e056a2 Mon Sep 17 00:00:00 2001 From: Yang Shi <yang.shi@windriver.com> Date: Mon, 16 Sep 2013 14:09:19 -0700 -Subject: hrtimer: Move schedule_work call to helper thread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 105/266] hrtimer: Move schedule_work call to helper thread +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz When run ltp leapsec_timer test, the following call trace is caught: @@ -47,9 +48,11 @@ Signed-off-by: Yang Shi <yang.shi@windriver.com> [bigeasy: use swork_queue() instead a helper thread] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/time/hrtimer.c | 24 ++++++++++++++++++++++++ + kernel/time/hrtimer.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index abf24e60b6e8..c72eb8bfc471 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -730,6 +730,29 @@ static void hrtimer_switch_to_hres(void) @@ -90,3 +93,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #else +-- +2.20.1 + diff --git a/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch b/debian/patches-rt/0106-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch index 5aeec3560..01c785b63 100644 --- a/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch +++ b/debian/patches-rt/0106-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch @@ -1,8 +1,9 @@ +From 94f946ca35aeadcc93631f6821bfa58557b83f3d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 6 Dec 2018 10:15:13 +0100 -Subject: [PATCH] hrtimer: move state change before hrtimer_cancel in +Subject: [PATCH 106/266] hrtimer: move state change before hrtimer_cancel in do_nanosleep() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz There is a small window between setting t->task to NULL and waking the task up (which would set TASK_RUNNING). So the timer would fire, run and @@ -24,12 +25,14 @@ Cc: stable-rt@vger.kernel.org Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/time/hrtimer.c | 2 +- + kernel/time/hrtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index c72eb8bfc471..cfa3599fa789 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1785,12 +1785,12 @@ static int __sched do_nanosleep(struct h +@@ -1785,12 +1785,12 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod if (likely(t->task)) freezable_schedule(); @@ -43,3 +46,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!t->task) return 0; +-- +2.20.1 + diff --git a/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch b/debian/patches-rt/0107-posix-timers-Thread-posix-cpu-timers-on-rt.patch index 4991f1413..fc727f085 100644 --- a/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch +++ b/debian/patches-rt/0107-posix-timers-Thread-posix-cpu-timers-on-rt.patch @@ -1,7 +1,8 @@ +From e9383ea076df7a79a03d8f96cecd6677d1f5f8df Mon Sep 17 00:00:00 2001 From: John Stultz <johnstul@us.ibm.com> Date: Fri, 3 Jul 2009 08:29:58 -0500 -Subject: posix-timers: Thread posix-cpu-timers on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 107/266] posix-timers: Thread posix-cpu-timers on -rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz posix-cpu-timer code takes non -rt safe locks in hard irq context. Move it to a thread. @@ -10,14 +11,15 @@ context. Move it to a thread. Signed-off-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - include/linux/sched.h | 3 - init/init_task.c | 7 + - kernel/fork.c | 3 - kernel/time/posix-cpu-timers.c | 154 ++++++++++++++++++++++++++++++++++++++++- + include/linux/sched.h | 3 + + init/init_task.c | 7 ++ + kernel/fork.c | 3 + + kernel/time/posix-cpu-timers.c | 154 ++++++++++++++++++++++++++++++++- 4 files changed, 164 insertions(+), 3 deletions(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index daa99f3b7c78..4b1994fd819b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -832,6 +832,9 @@ struct task_struct { @@ -30,9 +32,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif /* Process credentials: */ +diff --git a/init/init_task.c b/init/init_task.c +index 0b49b9cf5571..9e3362748214 100644 --- a/init/init_task.c +++ b/init/init_task.c -@@ -50,6 +50,12 @@ static struct sighand_struct init_sighan +@@ -50,6 +50,12 @@ static struct sighand_struct init_sighand = { .signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(init_sighand.signalfd_wqh), }; @@ -53,9 +57,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> .thread_pid = &init_struct_pid, .thread_group = LIST_HEAD_INIT(init_task.thread_group), .thread_node = LIST_HEAD_INIT(init_signals.thread_head), +diff --git a/kernel/fork.c b/kernel/fork.c +index bfe9c5c3eb88..1b8ac523aa99 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1575,6 +1575,9 @@ static void rt_mutex_init_task(struct ta +@@ -1575,6 +1575,9 @@ static void rt_mutex_init_task(struct task_struct *p) */ static void posix_cpu_timers_init(struct task_struct *tsk) { @@ -65,6 +71,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> tsk->cputime_expires.prof_exp = 0; tsk->cputime_expires.virt_exp = 0; tsk->cputime_expires.sched_exp = 0; +diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c +index 76801b9b481e..baeeaef3b721 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -3,8 +3,10 @@ @@ -86,7 +94,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include "posix-timers.h" -@@ -1136,14 +1139,12 @@ static inline int fastpath_timer_check(s +@@ -1136,14 +1139,12 @@ static inline int fastpath_timer_check(struct task_struct *tsk) * already updated our counts. We need to check if any timers fire now. * Interrupts are disabled. */ @@ -102,7 +110,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * The fast path checks that there are no expired thread or thread * group timers. If that's so, just return. -@@ -1196,6 +1197,153 @@ void run_posix_cpu_timers(struct task_st +@@ -1196,6 +1197,153 @@ void run_posix_cpu_timers(struct task_struct *tsk) } } @@ -256,3 +264,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Set one of the process-wide special case CPU timers or RLIMIT_CPU. * The tsk->sighand->siglock must be held by the caller. +-- +2.20.1 + diff --git a/debian/patches-rt/sched-delay-put-task.patch b/debian/patches-rt/0108-sched-Move-task_struct-cleanup-to-RCU.patch index e57e04cb3..a0c284e7f 100644 --- a/debian/patches-rt/sched-delay-put-task.patch +++ b/debian/patches-rt/0108-sched-Move-task_struct-cleanup-to-RCU.patch @@ -1,18 +1,21 @@ -Subject: sched: Move task_struct cleanup to RCU +From 62ffbb5ae0b46393d64612f452c170360a7dd7d6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 31 May 2011 16:59:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 108/266] sched: Move task_struct cleanup to RCU +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz __put_task_struct() does quite some expensive work. We don't want to burden random tasks with that. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/sched.h | 3 +++ - include/linux/sched/task.h | 11 ++++++++++- - kernel/fork.c | 15 ++++++++++++++- + include/linux/sched.h | 3 +++ + include/linux/sched/task.h | 11 ++++++++++- + kernel/fork.c | 15 ++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 4b1994fd819b..fe3bb4313329 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1186,6 +1186,9 @@ struct task_struct { @@ -25,6 +28,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_DEBUG_ATOMIC_SLEEP unsigned long task_state_change; #endif +diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h +index 108ede99e533..bb98c5b43f81 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h @@ -88,6 +88,15 @@ extern void sched_exec(void); @@ -43,7 +48,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern void __put_task_struct(struct task_struct *t); static inline void put_task_struct(struct task_struct *t) -@@ -95,7 +104,7 @@ static inline void put_task_struct(struc +@@ -95,7 +104,7 @@ static inline void put_task_struct(struct task_struct *t) if (atomic_dec_and_test(&t->usage)) __put_task_struct(t); } @@ -52,9 +57,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> struct task_struct *task_rcu_dereference(struct task_struct **ptask); #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT +diff --git a/kernel/fork.c b/kernel/fork.c +index 1b8ac523aa99..b7e0aac93ee5 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -671,7 +671,9 @@ static inline void put_signal_struct(str +@@ -671,7 +671,9 @@ static inline void put_signal_struct(struct signal_struct *sig) if (atomic_dec_and_test(&sig->sigcnt)) free_signal_struct(sig); } @@ -65,7 +72,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void __put_task_struct(struct task_struct *tsk) { WARN_ON(!tsk->exit_state); -@@ -688,7 +690,18 @@ void __put_task_struct(struct task_struc +@@ -688,7 +690,18 @@ void __put_task_struct(struct task_struct *tsk) if (!profile_handoff_task(tsk)) free_task(tsk); } @@ -84,3 +91,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void __init __weak arch_task_cache_init(void) { } +-- +2.20.1 + diff --git a/debian/patches-rt/sched-limit-nr-migrate.patch b/debian/patches-rt/0109-sched-Limit-the-number-of-task-migrations-per-batch.patch index 50d0b9cc7..a41d339bd 100644 --- a/debian/patches-rt/sched-limit-nr-migrate.patch +++ b/debian/patches-rt/0109-sched-Limit-the-number-of-task-migrations-per-batch.patch @@ -1,19 +1,22 @@ -Subject: sched: Limit the number of task migrations per batch +From c0699f51c272869f78f1d7915212cc431703057a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Mon, 06 Jun 2011 12:12:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Mon, 6 Jun 2011 12:12:51 +0200 +Subject: [PATCH 109/266] sched: Limit the number of task migrations per batch +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Put an upper limit on the number of tasks which are migrated per batch to avoid large latencies. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/sched/core.c | 4 ++++ + kernel/sched/core.c | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 45fd27df22ef..b9c91231d19d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -44,7 +44,11 @@ const_debug unsigned int sysctl_sched_fe +@@ -44,7 +44,11 @@ const_debug unsigned int sysctl_sched_features = * Number of tasks to iterate in a single balance run. * Limited because this is done with IRQs disabled. */ @@ -25,3 +28,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * period over which we measure -rt task CPU usage in us. +-- +2.20.1 + diff --git a/debian/patches-rt/sched-mmdrop-delayed.patch b/debian/patches-rt/0110-sched-Move-mmdrop-to-RCU-on-RT.patch index 83b82f549..bf41a102e 100644 --- a/debian/patches-rt/sched-mmdrop-delayed.patch +++ b/debian/patches-rt/0110-sched-Move-mmdrop-to-RCU-on-RT.patch @@ -1,19 +1,22 @@ -Subject: sched: Move mmdrop to RCU on RT +From 7af1b0bc40a20c1a44e4298081eaa2db43e5dac9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Mon, 06 Jun 2011 12:20:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Mon, 6 Jun 2011 12:20:33 +0200 +Subject: [PATCH 110/266] sched: Move mmdrop to RCU on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Takes sleeping locks and calls into the memory allocator, so nothing we want to do in task switch and oder atomic contexts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/mm_types.h | 4 ++++ - include/linux/sched/mm.h | 11 +++++++++++ - kernel/fork.c | 13 +++++++++++++ - kernel/sched/core.c | 18 ++++++++++++++++-- + include/linux/mm_types.h | 4 ++++ + include/linux/sched/mm.h | 11 +++++++++++ + kernel/fork.c | 13 +++++++++++++ + kernel/sched/core.c | 18 ++++++++++++++++-- 4 files changed, 44 insertions(+), 2 deletions(-) +diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h +index 5ed8f6292a53..f430cf0a377e 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -12,6 +12,7 @@ @@ -34,9 +37,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_HUGETLB_PAGE atomic_long_t hugetlb_usage; #endif +diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h +index aebb370a0006..d3db98d1fc49 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h -@@ -49,6 +49,17 @@ static inline void mmdrop(struct mm_stru +@@ -49,6 +49,17 @@ static inline void mmdrop(struct mm_struct *mm) __mmdrop(mm); } @@ -54,6 +59,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /** * mmget() - Pin the address space associated with a &struct mm_struct. * @mm: The address space to pin. +diff --git a/kernel/fork.c b/kernel/fork.c +index b7e0aac93ee5..857ce1a7269f 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -637,6 +637,19 @@ void __mmdrop(struct mm_struct *mm) @@ -76,9 +83,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static void mmdrop_async_fn(struct work_struct *work) { struct mm_struct *mm; +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index b9c91231d19d..1c791181915d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2727,9 +2727,13 @@ static struct rq *finish_task_switch(str +@@ -2728,9 +2728,13 @@ static struct rq *finish_task_switch(struct task_struct *prev) * provided by mmdrop(), * - a sync_core for SYNC_CORE. */ @@ -93,7 +102,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } if (unlikely(prev_state == TASK_DEAD)) { if (prev->sched_class->task_dead) -@@ -5557,6 +5561,8 @@ void sched_setnuma(struct task_struct *p +@@ -5558,6 +5562,8 @@ void sched_setnuma(struct task_struct *p, int nid) #endif /* CONFIG_NUMA_BALANCING */ #ifdef CONFIG_HOTPLUG_CPU @@ -102,7 +111,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Ensure that the idle task is using init_mm right before its CPU goes * offline. -@@ -5572,7 +5578,11 @@ void idle_task_exit(void) +@@ -5573,7 +5579,11 @@ void idle_task_exit(void) current->active_mm = &init_mm; finish_arch_post_lock_switch(); } @@ -115,7 +124,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* -@@ -5884,6 +5894,10 @@ int sched_cpu_dying(unsigned int cpu) +@@ -5885,6 +5895,10 @@ int sched_cpu_dying(unsigned int cpu) update_max_interval(); nohz_balance_exit_idle(rq); hrtick_clear(rq); @@ -126,3 +135,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return 0; } #endif +-- +2.20.1 + diff --git a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/debian/patches-rt/0111-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index 29b1bc04d..b673b3c92 100644 --- a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/debian/patches-rt/0111-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -1,8 +1,9 @@ +From 790c45b2ab27b4fa98e76408a4f7dd80311ea9c3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 21 Nov 2016 19:31:08 +0100 -Subject: [PATCH] kernel/sched: move stack + kprobe clean up to +Subject: [PATCH 111/266] kernel/sched: move stack + kprobe clean up to __put_task_struct() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz There is no need to free the stack before the task struct (except for reasons mentioned in commit 68f24b08ee89 ("sched/core: Free the stack early if @@ -12,10 +13,12 @@ free memory in preempt disabled region. Cc: stable-rt@vger.kernel.org #for kprobe_flush_task() Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/fork.c | 10 ++++++++++ - kernel/sched/core.c | 9 --------- + kernel/fork.c | 10 ++++++++++ + kernel/sched/core.c | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-) +diff --git a/kernel/fork.c b/kernel/fork.c +index 857ce1a7269f..8a9241afefb0 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -40,6 +40,7 @@ @@ -26,7 +29,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <linux/vmacache.h> #include <linux/nsproxy.h> #include <linux/capability.h> -@@ -693,6 +694,15 @@ void __put_task_struct(struct task_struc +@@ -693,6 +694,15 @@ void __put_task_struct(struct task_struct *tsk) WARN_ON(atomic_read(&tsk->usage)); WARN_ON(tsk == current); @@ -42,9 +45,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cgroup_free(tsk); task_numa_free(tsk); security_task_free(tsk); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 1c791181915d..5d784f3d839b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2739,15 +2739,6 @@ static struct rq *finish_task_switch(str +@@ -2740,15 +2740,6 @@ static struct rq *finish_task_switch(struct task_struct *prev) if (prev->sched_class->task_dead) prev->sched_class->task_dead(prev); @@ -60,3 +65,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> put_task_struct(prev); } +-- +2.20.1 + diff --git a/debian/patches-rt/sched-rt-mutex-wakeup.patch b/debian/patches-rt/0112-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch index 2d1c73314..51c1cc96e 100644 --- a/debian/patches-rt/sched-rt-mutex-wakeup.patch +++ b/debian/patches-rt/0112-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch @@ -1,7 +1,9 @@ -Subject: sched: Add saved_state for tasks blocked on sleeping locks +From b5d18ac7ad46783e45412e4c8f6623416c22f17c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sat, 25 Jun 2011 09:21:04 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 112/266] sched: Add saved_state for tasks blocked on sleeping + locks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Spinlocks are state preserving in !RT. RT changes the state when a task gets blocked on a lock. So we need to remember the state before @@ -11,11 +13,13 @@ sleep is done, the saved state is restored. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/sched.h | 3 +++ - kernel/sched/core.c | 33 ++++++++++++++++++++++++++++++++- - kernel/sched/sched.h | 1 + + include/linux/sched.h | 3 +++ + kernel/sched/core.c | 33 ++++++++++++++++++++++++++++++++- + kernel/sched/sched.h | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index fe3bb4313329..5c7dbe3cfe35 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -600,6 +600,8 @@ struct task_struct { @@ -27,7 +31,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * This begins the randomizable portion of task_struct. Only -@@ -1613,6 +1615,7 @@ extern struct task_struct *find_get_task +@@ -1613,6 +1615,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); @@ -35,9 +39,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern void wake_up_new_task(struct task_struct *tsk); #ifdef CONFIG_SMP +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 5d784f3d839b..c2b801adcff0 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1997,8 +1997,27 @@ try_to_wake_up(struct task_struct *p, un +@@ -1998,8 +1998,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(); @@ -66,7 +72,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> trace_sched_waking(p); -@@ -2162,6 +2181,18 @@ int wake_up_process(struct task_struct * +@@ -2163,6 +2182,18 @@ int wake_up_process(struct task_struct *p) } EXPORT_SYMBOL(wake_up_process); @@ -85,9 +91,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> int wake_up_state(struct task_struct *p, unsigned int state) { return try_to_wake_up(p, state, 0); +diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h +index b63172288f7b..74750997b061 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h -@@ -1443,6 +1443,7 @@ static inline int task_on_rq_migrating(s +@@ -1443,6 +1443,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 */ @@ -95,3 +103,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * To aid in avoiding the subversion of "niceness" due to uneven distribution +-- +2.20.1 + diff --git a/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch b/debian/patches-rt/0113-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch index f309adbbd..2b2af6f99 100644 --- a/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch +++ b/debian/patches-rt/0113-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch @@ -1,17 +1,21 @@ -Subject: sched: Do not account rcu_preempt_depth on RT in might_sleep() +From 46a347593cfdb52cf9f6de548c4921cbeb0f719e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 07 Jun 2011 09:19:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Tue, 7 Jun 2011 09:19:06 +0200 +Subject: [PATCH 113/266] sched: Do not account rcu_preempt_depth on RT in + might_sleep() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz RT changes the rcu_preempt_depth semantics, so we cannot check for it in might_sleep(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/rcupdate.h | 7 +++++++ - kernel/sched/core.c | 2 +- + include/linux/rcupdate.h | 7 +++++++ + kernel/sched/core.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) +diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h +index 75e5b393cf44..0539f55bf7b3 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -73,6 +73,11 @@ void synchronize_rcu(void); @@ -26,7 +30,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #else /* #ifdef CONFIG_PREEMPT_RCU */ -@@ -98,6 +103,8 @@ static inline int rcu_preempt_depth(void +@@ -98,6 +103,8 @@ static inline int rcu_preempt_depth(void) return 0; } @@ -35,9 +39,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ /* Internal to kernel */ +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index c2b801adcff0..14db9abb5c2d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -6154,7 +6154,7 @@ void __init sched_init(void) +@@ -6155,7 +6155,7 @@ void __init sched_init(void) #ifdef CONFIG_DEBUG_ATOMIC_SLEEP static inline int preempt_count_equals(int preempt_offset) { @@ -46,3 +52,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return (nested == preempt_offset); } +-- +2.20.1 + diff --git a/debian/patches-rt/cond-resched-lock-rt-tweak.patch b/debian/patches-rt/0114-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch index 92a62f187..9c827f03d 100644 --- a/debian/patches-rt/cond-resched-lock-rt-tweak.patch +++ b/debian/patches-rt/0114-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch @@ -1,16 +1,19 @@ -Subject: sched: Use the proper LOCK_OFFSET for cond_resched() +From 0b9b20aa2fcb870dea7357331f91f976225c5ff1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 17 Jul 2011 22:51:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 114/266] sched: Use the proper LOCK_OFFSET for cond_resched() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz RT does not increment preempt count when a 'sleeping' spinlock is locked. Update PREEMPT_LOCK_OFFSET for that case. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/preempt.h | 4 ++++ + include/linux/preempt.h | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index f7a17fcc3fec..b7fe717eb1f4 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -118,7 +118,11 @@ @@ -25,3 +28,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * The preempt_count offset needed for things like: +-- +2.20.1 + diff --git a/debian/patches-rt/sched-disable-ttwu-queue.patch b/debian/patches-rt/0115-sched-Disable-TTWU_QUEUE-on-RT.patch index dd2a96542..592526600 100644 --- a/debian/patches-rt/sched-disable-ttwu-queue.patch +++ b/debian/patches-rt/0115-sched-Disable-TTWU_QUEUE-on-RT.patch @@ -1,16 +1,19 @@ -Subject: sched: Disable TTWU_QUEUE on RT +From f824506bd5287df43be5c5d54673c1bb78bab657 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 13 Sep 2011 16:42:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 115/266] sched: Disable TTWU_QUEUE on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The queued remote wakeup mechanism can introduce rather large latencies if the number of migrated tasks is high. Disable it for RT. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/sched/features.h | 5 +++++ + kernel/sched/features.h | 5 +++++ 1 file changed, 5 insertions(+) +diff --git a/kernel/sched/features.h b/kernel/sched/features.h +index 85ae8488039c..68de18405857 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -46,11 +46,16 @@ SCHED_FEAT(LB_BIAS, true) @@ -30,3 +33,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * When doing wakeups, attempt to limit superfluous scans of the LLC domain. +-- +2.20.1 + diff --git a/debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch b/debian/patches-rt/0116-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch index f3ba3897e..46d1f2981 100644 --- a/debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch +++ b/debian/patches-rt/0116-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch @@ -1,7 +1,9 @@ +From e264e8af1908fcc71779f78c18628393bf10d315 Mon Sep 17 00:00:00 2001 From: Steven Rostedt <rostedt@goodmis.org> Date: Mon, 18 Mar 2013 15:12:49 -0400 -Subject: sched/workqueue: Only wake up idle workers if not blocked on sleeping spin lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 116/266] sched/workqueue: Only wake up idle workers if not + blocked on sleeping spin lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In -rt, most spin_locks() turn into mutexes. One of these spin_lock conversions is performed on the workqueue gcwq->lock. When the idle @@ -19,12 +21,14 @@ Check the saved_state too before waking up new workers. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/sched/core.c | 4 +++- + kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 14db9abb5c2d..8c06e227f8eb 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -3496,8 +3496,10 @@ static void __sched notrace __schedule(b +@@ -3497,8 +3497,10 @@ static void __sched notrace __schedule(bool preempt) * If a worker went to sleep, notify and ask workqueue * whether it wants to wake up a task to maintain * concurrency. @@ -36,3 +40,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct task_struct *to_wakeup; to_wakeup = wq_worker_sleeping(prev); +-- +2.20.1 + diff --git a/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch b/debian/patches-rt/0117-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch index 071e7940d..f7ee5bbd9 100644 --- a/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch +++ b/debian/patches-rt/0117-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch @@ -1,7 +1,9 @@ +From e86c2bf7d5f40db496d640ca4900373d42d40340 Mon Sep 17 00:00:00 2001 From: Daniel Bristot de Oliveira <bristot@redhat.com> Date: Mon, 26 Jun 2017 17:07:15 +0200 -Subject: rt: Increase/decrease the nr of migratory tasks when enabling/disabling migration -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 117/266] rt: Increase/decrease the nr of migratory tasks when + enabling/disabling migration +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz There is a problem in the migrate_disable()/enable() implementation regarding the number of migratory tasks in the rt/dl RQs. The problem @@ -76,12 +78,14 @@ Cc: LKML <linux-kernel@vger.kernel.org> Cc: linux-rt-users <linux-rt-users@vger.kernel.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/sched/core.c | 49 ++++++++++++++++++++++++++++++++++++++++++++----- + kernel/sched/core.c | 49 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 5 deletions(-) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 8c06e227f8eb..18cadbb57e8c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7138,6 +7138,47 @@ const u32 sched_prio_to_wmult[40] = { +@@ -7139,6 +7139,47 @@ const u32 sched_prio_to_wmult[40] = { #if defined(CONFIG_PREEMPT_COUNT) && defined(CONFIG_SMP) @@ -129,7 +133,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void migrate_disable(void) { struct task_struct *p = current; -@@ -7161,10 +7202,9 @@ void migrate_disable(void) +@@ -7162,10 +7203,9 @@ void migrate_disable(void) } preempt_disable(); @@ -142,7 +146,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> preempt_enable(); } -@@ -7196,9 +7236,8 @@ void migrate_enable(void) +@@ -7197,9 +7237,8 @@ void migrate_enable(void) preempt_disable(); @@ -153,3 +157,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (p->migrate_disable_update) { struct rq *rq; +-- +2.20.1 + diff --git a/debian/patches-rt/hotplug-light-get-online-cpus.patch b/debian/patches-rt/0118-hotplug-Lightweight-get-online-cpus.patch index 984f3ba51..5fe783352 100644 --- a/debian/patches-rt/hotplug-light-get-online-cpus.patch +++ b/debian/patches-rt/0118-hotplug-Lightweight-get-online-cpus.patch @@ -1,7 +1,8 @@ -Subject: hotplug: Lightweight get online cpus +From b91d1b4efca990372f45adff4e6b56626a943a24 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 15 Jun 2011 12:36:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 118/266] hotplug: Lightweight get online cpus +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz get_online_cpus() is a heavy weight function which involves a global mutex. migrate_disable() wants a simpler construct which prevents only @@ -13,11 +14,13 @@ tasks on the cpu which should be brought down. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/cpu.h | 5 +++++ - kernel/cpu.c | 15 +++++++++++++++ - kernel/sched/core.c | 4 ++++ + include/linux/cpu.h | 5 +++++ + kernel/cpu.c | 15 +++++++++++++++ + kernel/sched/core.c | 4 ++++ 3 files changed, 24 insertions(+) +diff --git a/include/linux/cpu.h b/include/linux/cpu.h +index 5041357d0297..3403eab853b7 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -111,6 +111,8 @@ extern void cpu_hotplug_disable(void); @@ -29,7 +32,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #else /* CONFIG_HOTPLUG_CPU */ -@@ -122,6 +124,9 @@ static inline int cpus_read_trylock(voi +@@ -122,6 +124,9 @@ 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) { } @@ -39,6 +42,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif /* !CONFIG_HOTPLUG_CPU */ /* Wrappers which go away once all code is converted */ +diff --git a/kernel/cpu.c b/kernel/cpu.c +index 56f657adcf03..e244bc4d2157 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -281,6 +281,21 @@ static int cpu_hotplug_disabled; @@ -63,9 +68,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> DEFINE_STATIC_PERCPU_RWSEM(cpu_hotplug_lock); void cpus_read_lock(void) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 18cadbb57e8c..0f4594130f85 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7202,6 +7202,7 @@ void migrate_disable(void) +@@ -7203,6 +7203,7 @@ void migrate_disable(void) } preempt_disable(); @@ -73,7 +80,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> migrate_disable_update_cpus_allowed(p); p->migrate_disable = 1; -@@ -7267,12 +7268,15 @@ void migrate_enable(void) +@@ -7268,12 +7269,15 @@ void migrate_enable(void) arg.task = p; arg.dest_cpu = dest_cpu; @@ -89,3 +96,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> preempt_enable(); } EXPORT_SYMBOL(migrate_enable); +-- +2.20.1 + diff --git a/debian/patches-rt/ftrace-migrate-disable-tracing.patch b/debian/patches-rt/0119-trace-Add-migrate-disabled-counter-to-tracing-output.patch index 9ad94877d..e092e5ad5 100644 --- a/debian/patches-rt/ftrace-migrate-disable-tracing.patch +++ b/debian/patches-rt/0119-trace-Add-migrate-disabled-counter-to-tracing-output.patch @@ -1,16 +1,19 @@ +From 70e38da108c215d935f7f0541e46df700d2ceef7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 17 Jul 2011 21:56:42 +0200 -Subject: trace: Add migrate-disabled counter to tracing output -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 119/266] trace: Add migrate-disabled counter to tracing output +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/trace_events.h | 2 ++ - kernel/trace/trace.c | 9 ++++++--- - kernel/trace/trace_events.c | 2 ++ - kernel/trace/trace_output.c | 5 +++++ + include/linux/trace_events.h | 2 ++ + kernel/trace/trace.c | 9 ++++++--- + kernel/trace/trace_events.c | 2 ++ + kernel/trace/trace_output.c | 5 +++++ 4 files changed, 15 insertions(+), 3 deletions(-) +diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h +index 78a010e19ed4..0403d9696944 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -62,6 +62,8 @@ struct trace_entry { @@ -22,9 +25,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> }; #define TRACE_EVENT_TYPE_MAX \ +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 1f96b292df31..ff041c26dbb4 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -2146,6 +2146,8 @@ tracing_generic_entry_update(struct trac +@@ -2146,6 +2146,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, ((pc & SOFTIRQ_OFFSET) ? TRACE_FLAG_SOFTIRQ : 0) | (tif_need_resched() ? TRACE_FLAG_NEED_RESCHED : 0) | (test_preempt_need_resched() ? TRACE_FLAG_PREEMPT_RESCHED : 0); @@ -33,7 +38,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } EXPORT_SYMBOL_GPL(tracing_generic_entry_update); -@@ -3349,9 +3351,10 @@ static void print_lat_help_header(struct +@@ -3349,9 +3351,10 @@ static void print_lat_help_header(struct seq_file *m) "# | / _----=> need-resched \n" "# || / _---=> hardirq/softirq \n" "# ||| / _--=> preempt-depth \n" @@ -47,9 +52,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static void print_event_info(struct trace_buffer *buf, struct seq_file *m) +diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c +index f94be0c2827b..acdb2c2067c6 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c -@@ -188,6 +188,8 @@ static int trace_define_common_fields(vo +@@ -188,6 +188,8 @@ static int trace_define_common_fields(void) __common_field(unsigned char, flags); __common_field(unsigned char, preempt_count); __common_field(int, pid); @@ -58,9 +65,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return ret; } +diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c +index 6e6cc64faa38..46c96744f09d 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c -@@ -494,6 +494,11 @@ int trace_print_lat_fmt(struct trace_seq +@@ -494,6 +494,11 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) else trace_seq_putc(s, '.'); @@ -72,3 +81,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return !trace_seq_has_overflowed(s); } +-- +2.20.1 + diff --git a/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch b/debian/patches-rt/0120-lockdep-Make-it-RT-aware.patch index c56e43b55..db4d0a952 100644 --- a/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch +++ b/debian/patches-rt/0120-lockdep-Make-it-RT-aware.patch @@ -1,16 +1,19 @@ -Subject: lockdep: Make it RT aware +From 1703879feabe16cfd6f95e2413e90f30dd21d57f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 17 Jul 2011 18:51:23 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 120/266] lockdep: Make it RT aware +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz teach lockdep that we don't really do softirqs on -RT. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/irqflags.h | 23 +++++++++++++++-------- - kernel/locking/lockdep.c | 2 ++ + include/linux/irqflags.h | 23 +++++++++++++++-------- + kernel/locking/lockdep.c | 2 ++ 2 files changed, 17 insertions(+), 8 deletions(-) +diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h +index 21619c92c377..b20eeb25e9fa 100644 --- a/include/linux/irqflags.h +++ b/include/linux/irqflags.h @@ -43,14 +43,6 @@ do { \ @@ -28,11 +31,10 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #else # define trace_hardirqs_on() do { } while (0) # define trace_hardirqs_off() do { } while (0) -@@ -63,6 +55,21 @@ do { \ - # define lockdep_softirq_enter() do { } while (0) +@@ -64,6 +56,21 @@ do { \ # define lockdep_softirq_exit() do { } while (0) #endif -+ + +#if defined(CONFIG_TRACE_IRQFLAGS) && !defined(CONFIG_PREEMPT_RT_FULL) +# define lockdep_softirq_enter() \ +do { \ @@ -47,12 +49,15 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +# define lockdep_softirq_enter() do { } while (0) +# define lockdep_softirq_exit() do { } while (0) +#endif - ++ #if defined(CONFIG_IRQSOFF_TRACER) || \ defined(CONFIG_PREEMPT_TRACER) + extern void stop_critical_timings(void); +diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c +index 26b57e24476f..6daeb369f691 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c -@@ -3823,6 +3823,7 @@ static void check_flags(unsigned long fl +@@ -3823,6 +3823,7 @@ static void check_flags(unsigned long flags) } } @@ -60,7 +65,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * We dont accurately track softirq state in e.g. * hardirq contexts (such as on 4KSTACKS), so only -@@ -3837,6 +3838,7 @@ static void check_flags(unsigned long fl +@@ -3837,6 +3838,7 @@ static void check_flags(unsigned long flags) DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled); } } @@ -68,3 +73,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (!debug_locks) print_irqtrace_events(current); +-- +2.20.1 + diff --git a/debian/patches-rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch b/debian/patches-rt/0121-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch index fc7fc9907..90c67c4da 100644 --- a/debian/patches-rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch +++ b/debian/patches-rt/0121-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch @@ -1,7 +1,9 @@ -Subject: tasklet: Prevent tasklets from going into infinite spin in RT +From 3b3d2e35d8bfcd45b0a7cfd749704562563b4385 Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> -Date: Tue Nov 29 20:18:22 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Tue, 29 Nov 2011 20:18:22 -0500 +Subject: [PATCH 121/266] tasklet: Prevent tasklets from going into infinite + spin in RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads, and spinlocks turn are mutexes. But this can cause issues with @@ -10,21 +12,21 @@ if a tasklets are disabled with tasklet_disable(), the tasklet count is increased. When a tasklet runs, it checks this counter and if it is set, it adds itself back on the softirq queue and returns. - + The problem arises in RT because ksoftirq will see that a softirq is ready to run (the tasklet softirq just re-armed itself), and will not sleep, but instead run the softirqs again. The tasklet softirq will still see that the count is non-zero and will not execute the tasklet and requeue itself on the softirq again, which will cause ksoftirqd to run it again and again and again. - + It gets worse because ksoftirqd runs as a real-time thread. If it preempted the task that disabled tasklets, and that task has migration disabled, or can't run for other reasons, the tasklet softirq will never run because the count will never be zero, and ksoftirqd will go into an infinite loop. As an RT task, it this becomes a big problem. - + This is a hack solution to have tasklet_disable stop tasklets, and when a tasklet runs, instead of requeueing the tasklet softirqd it delays it. When tasklet_enable() is called, and tasklets are @@ -32,19 +34,20 @@ waiting, then the tasklet_enable() will kick the tasklets to continue. This prevents the lock up from ksoftirq going into an infinite loop. [ rostedt@goodmis.org: ported to 3.0-rt ] - + Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - include/linux/interrupt.h | 33 ++++++------ - kernel/softirq.c | 126 ++++++++++++++++++++++++++++++++++++++-------- + include/linux/interrupt.h | 33 +++++----- + kernel/softirq.c | 126 ++++++++++++++++++++++++++++++++------ 2 files changed, 125 insertions(+), 34 deletions(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index a943c07b54ba..e74936c7be48 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -542,8 +542,9 @@ static inline struct task_struct *this_c +@@ -542,8 +542,9 @@ static inline struct task_struct *this_cpu_ksoftirqd(void) to be executed on some cpu at least once after this. * If the tasklet is already scheduled, but its execution is still not started, it will be executed only once. @@ -56,7 +59,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> * Tasklet is strictly serialized wrt itself, but not wrt another tasklets. If client needs some intertask synchronization, he makes it with spinlocks. -@@ -568,27 +569,36 @@ struct tasklet_struct name = { NULL, 0, +@@ -568,27 +569,36 @@ struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data } enum { TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */ @@ -99,7 +102,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define tasklet_unlock_wait(t) do { } while (0) #define tasklet_unlock(t) do { } while (0) #endif -@@ -622,12 +632,7 @@ static inline void tasklet_disable(struc +@@ -622,12 +632,7 @@ static inline void tasklet_disable(struct tasklet_struct *t) smp_mb(); } @@ -113,6 +116,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern void tasklet_kill(struct tasklet_struct *t); extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); extern void tasklet_init(struct tasklet_struct *t, +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 6f584861d329..1d3a482246cc 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -21,6 +21,7 @@ @@ -123,7 +128,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include <linux/ftrace.h> #include <linux/smp.h> #include <linux/smpboot.h> -@@ -475,11 +476,38 @@ static void __tasklet_schedule_common(st +@@ -475,11 +476,38 @@ static void __tasklet_schedule_common(struct tasklet_struct *t, unsigned long flags; local_irq_save(flags); @@ -166,7 +171,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> local_irq_restore(flags); } -@@ -497,11 +525,21 @@ void __tasklet_hi_schedule(struct taskle +@@ -497,11 +525,21 @@ void __tasklet_hi_schedule(struct tasklet_struct *t) } EXPORT_SYMBOL(__tasklet_hi_schedule); @@ -188,7 +193,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> local_irq_disable(); list = tl_head->head; -@@ -513,25 +551,56 @@ static void tasklet_action_common(struct +@@ -513,25 +551,56 @@ static void tasklet_action_common(struct softirq_action *a, struct tasklet_struct *t = list; list = list->next; @@ -260,7 +265,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } -@@ -563,7 +632,7 @@ void tasklet_kill(struct tasklet_struct +@@ -563,7 +632,7 @@ void tasklet_kill(struct tasklet_struct *t) while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { do { @@ -293,3 +298,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static int ksoftirqd_should_run(unsigned int cpu) { return local_softirq_pending(); +-- +2.20.1 + diff --git a/debian/patches-rt/softirq-preempt-fix-3-re.patch b/debian/patches-rt/0122-softirq-Check-preemption-after-reenabling-interrupts.patch index 521f79f20..6a3144123 100644 --- a/debian/patches-rt/softirq-preempt-fix-3-re.patch +++ b/debian/patches-rt/0122-softirq-Check-preemption-after-reenabling-interrupts.patch @@ -1,7 +1,8 @@ -Subject: softirq: Check preemption after reenabling interrupts +From 687c6e5b4f0aed2ed2830235293d180a7f512225 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Sun, 13 Nov 2011 17:17:09 +0100 (CET) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Sun, 13 Nov 2011 17:17:09 +0100 +Subject: [PATCH 122/266] softirq: Check preemption after reenabling interrupts +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz raise_softirq_irqoff() disables interrupts and wakes the softirq daemon, but after reenabling interrupts there is no preemption check, @@ -13,14 +14,15 @@ ones which show this behaviour. Reported-by: Carsten Emde <cbe@osadl.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - block/blk-softirq.c | 3 +++ - include/linux/preempt.h | 3 +++ - lib/irq_poll.c | 5 +++++ - net/core/dev.c | 7 +++++++ + block/blk-softirq.c | 3 +++ + include/linux/preempt.h | 3 +++ + lib/irq_poll.c | 5 +++++ + net/core/dev.c | 7 +++++++ 4 files changed, 18 insertions(+) +diff --git a/block/blk-softirq.c b/block/blk-softirq.c +index 15c1f5e12eb8..1628277885a1 100644 --- a/block/blk-softirq.c +++ b/block/blk-softirq.c @@ -53,6 +53,7 @@ static void trigger_softirq(void *data) @@ -31,7 +33,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* -@@ -91,6 +92,7 @@ static int blk_softirq_cpu_dead(unsigned +@@ -91,6 +92,7 @@ static int blk_softirq_cpu_dead(unsigned int cpu) this_cpu_ptr(&blk_cpu_done)); raise_softirq_irqoff(BLOCK_SOFTIRQ); local_irq_enable(); @@ -39,7 +41,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return 0; } -@@ -143,6 +145,7 @@ void __blk_complete_request(struct reque +@@ -143,6 +145,7 @@ void __blk_complete_request(struct request *req) goto do_local; local_irq_restore(flags); @@ -47,6 +49,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } EXPORT_SYMBOL(__blk_complete_request); +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index b7fe717eb1f4..9984f2b75b73 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -187,8 +187,10 @@ do { \ @@ -68,9 +72,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define preemptible() 0 #define migrate_disable() barrier() +diff --git a/lib/irq_poll.c b/lib/irq_poll.c +index 86a709954f5a..9c069ef83d6d 100644 --- a/lib/irq_poll.c +++ b/lib/irq_poll.c -@@ -37,6 +37,7 @@ void irq_poll_sched(struct irq_poll *iop +@@ -37,6 +37,7 @@ void irq_poll_sched(struct irq_poll *iop) list_add_tail(&iop->list, this_cpu_ptr(&blk_cpu_iopoll)); __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); local_irq_restore(flags); @@ -78,7 +84,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } EXPORT_SYMBOL(irq_poll_sched); -@@ -72,6 +73,7 @@ void irq_poll_complete(struct irq_poll * +@@ -72,6 +73,7 @@ void irq_poll_complete(struct irq_poll *iop) local_irq_save(flags); __irq_poll_complete(iop); local_irq_restore(flags); @@ -86,7 +92,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } EXPORT_SYMBOL(irq_poll_complete); -@@ -96,6 +98,7 @@ static void __latent_entropy irq_poll_so +@@ -96,6 +98,7 @@ static void __latent_entropy irq_poll_softirq(struct softirq_action *h) } local_irq_enable(); @@ -94,7 +100,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* Even though interrupts have been re-enabled, this * access is safe because interrupts can only add new -@@ -133,6 +136,7 @@ static void __latent_entropy irq_poll_so +@@ -133,6 +136,7 @@ static void __latent_entropy irq_poll_softirq(struct softirq_action *h) __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); local_irq_enable(); @@ -102,7 +108,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /** -@@ -196,6 +200,7 @@ static int irq_poll_cpu_dead(unsigned in +@@ -196,6 +200,7 @@ static int irq_poll_cpu_dead(unsigned int cpu) this_cpu_ptr(&blk_cpu_iopoll)); __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); local_irq_enable(); @@ -110,9 +116,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return 0; } +diff --git a/net/core/dev.c b/net/core/dev.c +index 5c8c0a572ee9..7f8beb5e4d2d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2712,6 +2712,7 @@ static void __netif_reschedule(struct Qd +@@ -2712,6 +2712,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); @@ -120,7 +128,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } void __netif_schedule(struct Qdisc *q) -@@ -2774,6 +2775,7 @@ void __dev_kfree_skb_irq(struct sk_buff +@@ -2774,6 +2775,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); @@ -128,7 +136,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } EXPORT_SYMBOL(__dev_kfree_skb_irq); -@@ -4246,6 +4248,7 @@ static int enqueue_to_backlog(struct sk_ +@@ -4246,6 +4248,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, rps_unlock(sd); local_irq_restore(flags); @@ -136,7 +144,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> atomic_long_inc(&skb->dev->rx_dropped); kfree_skb(skb); -@@ -5799,12 +5802,14 @@ static void net_rps_action_and_irq_enabl +@@ -5799,12 +5802,14 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd) sd->rps_ipi_list = NULL; local_irq_enable(); @@ -151,7 +159,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) -@@ -5882,6 +5887,7 @@ void __napi_schedule(struct napi_struct +@@ -5882,6 +5887,7 @@ void __napi_schedule(struct napi_struct *n) local_irq_save(flags); ____napi_schedule(this_cpu_ptr(&softnet_data), n); local_irq_restore(flags); @@ -159,7 +167,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } EXPORT_SYMBOL(__napi_schedule); -@@ -9289,6 +9295,7 @@ static int dev_cpu_dead(unsigned int old +@@ -9289,6 +9295,7 @@ static int dev_cpu_dead(unsigned int oldcpu) raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); @@ -167,3 +175,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_RPS remsd = oldsd->rps_ipi_list; +-- +2.20.1 + diff --git a/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch b/debian/patches-rt/0123-softirq-Disable-softirq-stacks-for-RT.patch index b77c261f5..0babf73a1 100644 --- a/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch +++ b/debian/patches-rt/0123-softirq-Disable-softirq-stacks-for-RT.patch @@ -1,23 +1,26 @@ -Subject: softirq: Disable softirq stacks for RT +From 8017d265ca47b1720b9054891b5491ba52e06f65 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Mon, 18 Jul 2011 13:59:17 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 123/266] softirq: Disable softirq stacks for RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/powerpc/kernel/irq.c | 2 ++ - arch/powerpc/kernel/misc_32.S | 2 ++ - arch/powerpc/kernel/misc_64.S | 2 ++ - arch/sh/kernel/irq.c | 2 ++ - arch/sparc/kernel/irq_64.c | 2 ++ - arch/x86/entry/entry_64.S | 2 ++ - arch/x86/kernel/irq_32.c | 2 ++ - include/linux/interrupt.h | 2 +- + arch/powerpc/kernel/irq.c | 2 ++ + arch/powerpc/kernel/misc_32.S | 2 ++ + arch/powerpc/kernel/misc_64.S | 2 ++ + arch/sh/kernel/irq.c | 2 ++ + arch/sparc/kernel/irq_64.c | 2 ++ + arch/x86/entry/entry_64.S | 2 ++ + arch/x86/kernel/irq_32.c | 2 ++ + include/linux/interrupt.h | 2 +- 8 files changed, 15 insertions(+), 1 deletion(-) +diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c +index 916ddc4aac44..833d27f85aea 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -766,6 +766,7 @@ void irq_ctx_init(void) @@ -36,6 +39,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> irq_hw_number_t virq_to_hw(unsigned int virq) { +diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S +index 695b24a2d954..032ada21b7bd 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S @@ -42,6 +42,7 @@ @@ -46,7 +51,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> _GLOBAL(call_do_softirq) mflr r0 stw r0,4(r1) -@@ -58,6 +59,7 @@ +@@ -58,6 +59,7 @@ _GLOBAL(call_do_softirq) stw r10,THREAD+KSP_LIMIT(r2) mtlr r0 blr @@ -54,6 +59,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * void call_do_irq(struct pt_regs *regs, struct thread_info *irqtp); +diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S +index 262ba9481781..4935ef9a142e 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S @@ -32,6 +32,7 @@ @@ -64,7 +71,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> _GLOBAL(call_do_softirq) mflr r0 std r0,16(r1) -@@ -42,6 +43,7 @@ +@@ -42,6 +43,7 @@ _GLOBAL(call_do_softirq) ld r0,16(r1) mtlr r0 blr @@ -72,6 +79,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> _GLOBAL(call_do_irq) mflr r0 +diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c +index 5717c7cbdd97..66dd399b2007 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c @@ -148,6 +148,7 @@ void irq_ctx_exit(int cpu) @@ -90,9 +99,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #else static inline void handle_one_irq(unsigned int irq) { +diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c +index 713670e6d13d..5dfc715343f9 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c -@@ -854,6 +854,7 @@ void __irq_entry handler_irq(int pil, st +@@ -854,6 +854,7 @@ void __irq_entry handler_irq(int pil, struct pt_regs *regs) set_irq_regs(old_regs); } @@ -108,9 +119,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_HOTPLUG_CPU void fixup_irqs(void) +diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S +index f95dcb209fdf..fbbf9ce28af1 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -1039,6 +1039,7 @@ EXPORT_SYMBOL(native_load_gs_index) +@@ -1039,6 +1039,7 @@ bad_gs: jmp 2b .previous @@ -126,6 +139,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_XEN idtentry hypervisor_callback xen_do_hypervisor_callback has_error_code=0 +diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c +index 95600a99ae93..9192d76085ba 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c @@ -130,6 +130,7 @@ void irq_ctx_init(int cpu) @@ -144,6 +159,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> bool handle_irq(struct irq_desc *desc, struct pt_regs *regs) { +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index e74936c7be48..cb2d1384cb0d 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -506,7 +506,7 @@ struct softirq_action @@ -155,3 +172,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void do_softirq_own_stack(void); #else static inline void do_softirq_own_stack(void) +-- +2.20.1 + diff --git a/debian/patches-rt/softirq-split-locks.patch b/debian/patches-rt/0124-softirq-Split-softirq-locks.patch index df2ad6cab..64fcbcad7 100644 --- a/debian/patches-rt/softirq-split-locks.patch +++ b/debian/patches-rt/0124-softirq-Split-softirq-locks.patch @@ -1,7 +1,8 @@ +From 6d00cc510df8cc473c6cc08ffd0782efb5dd7725 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 04 Oct 2012 14:20:47 +0100 -Subject: softirq: Split softirq locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Thu, 4 Oct 2012 14:20:47 +0100 +Subject: [PATCH 124/266] softirq: Split softirq locks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The 3.x RT series removed the split softirq implementation in favour of pushing softirq processing into the context of the thread which @@ -25,15 +26,17 @@ threads. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/bottom_half.h | 34 +++ - include/linux/interrupt.h | 15 + - include/linux/preempt.h | 15 + - include/linux/sched.h | 3 - init/main.c | 1 - kernel/softirq.c | 491 +++++++++++++++++++++++++++++++++++++------- - kernel/time/tick-sched.c | 9 + include/linux/bottom_half.h | 34 +++ + include/linux/interrupt.h | 15 +- + include/linux/preempt.h | 15 +- + include/linux/sched.h | 3 + + init/main.c | 1 + + kernel/softirq.c | 491 ++++++++++++++++++++++++++++++------ + kernel/time/tick-sched.c | 9 +- 7 files changed, 478 insertions(+), 90 deletions(-) +diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h +index a19519f4241d..40dd5ef9c154 100644 --- a/include/linux/bottom_half.h +++ b/include/linux/bottom_half.h @@ -4,6 +4,39 @@ @@ -83,6 +86,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +#endif #endif /* _LINUX_BH_H */ +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index cb2d1384cb0d..6c25b962ba89 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -503,10 +503,11 @@ struct softirq_action @@ -99,7 +104,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void do_softirq_own_stack(void); #else static inline void do_softirq_own_stack(void) -@@ -514,6 +515,9 @@ static inline void do_softirq_own_stack( +@@ -514,6 +515,9 @@ static inline void do_softirq_own_stack(void) __do_softirq(); } #endif @@ -109,7 +114,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern void open_softirq(int nr, void (*action)(struct softirq_action *)); extern void softirq_init(void); -@@ -521,6 +525,7 @@ extern void __raise_softirq_irqoff(unsig +@@ -521,6 +525,7 @@ extern void __raise_softirq_irqoff(unsigned int nr); extern void raise_softirq_irqoff(unsigned int nr); extern void raise_softirq(unsigned int nr); @@ -117,7 +122,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> DECLARE_PER_CPU(struct task_struct *, ksoftirqd); -@@ -638,6 +643,12 @@ extern void tasklet_kill_immediate(struc +@@ -638,6 +643,12 @@ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); extern void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data); @@ -130,6 +135,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> struct tasklet_hrtimer { struct hrtimer timer; struct tasklet_struct tasklet; +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 9984f2b75b73..27c3176d88d2 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -51,7 +51,11 @@ @@ -170,6 +177,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define in_nmi() (preempt_count() & NMI_MASK) #define in_task() (!(preempt_count() & \ (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET))) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 5c7dbe3cfe35..e9e0e8add76b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1190,6 +1190,8 @@ struct task_struct { @@ -189,9 +198,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define PF_IDLE 0x00000002 /* I am an IDLE thread */ #define PF_EXITING 0x00000004 /* Getting shut down */ #define PF_EXITPIDONE 0x00000008 /* PI exit done on shut down */ +diff --git a/init/main.c b/init/main.c +index e083fac08aed..1647cb052be5 100644 --- a/init/main.c +++ b/init/main.c -@@ -561,6 +561,7 @@ asmlinkage __visible void __init start_k +@@ -561,6 +561,7 @@ asmlinkage __visible void __init start_kernel(void) setup_command_line(command_line); setup_nr_cpu_ids(); setup_per_cpu_areas(); @@ -199,6 +210,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ boot_cpu_hotplug_init(); +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 1d3a482246cc..fd89f8ab85ac 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -26,7 +26,9 @@ @@ -211,7 +224,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define CREATE_TRACE_POINTS #include <trace/events/irq.h> -@@ -63,6 +65,98 @@ const char * const softirq_to_name[NR_SO +@@ -63,6 +65,98 @@ const char * const softirq_to_name[NR_SOFTIRQS] = { "TASKLET", "SCHED", "HRTIMER", "RCU" }; @@ -338,7 +351,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * If ksoftirqd is scheduled, we do not want to process pending softirqs * right now. Let ksoftirqd handle this at its own rate, to get fairness, -@@ -93,6 +208,47 @@ static bool ksoftirqd_running(unsigned l +@@ -93,6 +208,47 @@ static bool ksoftirqd_running(unsigned long pending) return tsk && (tsk->state == TASK_RUNNING); } @@ -386,7 +399,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * preempt_count and SOFTIRQ_OFFSET usage: * - preempt_count is changed by SOFTIRQ_OFFSET on entering or leaving -@@ -252,10 +408,8 @@ asmlinkage __visible void __softirq_entr +@@ -252,10 +408,8 @@ asmlinkage __visible void __softirq_entry __do_softirq(void) unsigned long end = jiffies + MAX_SOFTIRQ_TIME; unsigned long old_flags = current->flags; int max_restart = MAX_SOFTIRQ_RESTART; @@ -397,7 +410,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Mask out PF_MEMALLOC s current task context is borrowed for the -@@ -274,36 +428,7 @@ asmlinkage __visible void __softirq_entr +@@ -274,36 +428,7 @@ asmlinkage __visible void __softirq_entry __do_softirq(void) /* Reset the pending bitmask before enabling irqs */ set_softirq_pending(0); @@ -435,10 +448,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> pending = local_softirq_pending(); if (pending) { -@@ -340,6 +465,248 @@ asmlinkage __visible void do_softirq(voi +@@ -339,6 +464,248 @@ asmlinkage __visible void do_softirq(void) + local_irq_restore(flags); } - /* ++/* + * This function must run with irqs disabled! + */ +void raise_softirq_irqoff(unsigned int nr) @@ -680,10 +694,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +} + +#endif /* PREEMPT_RT_FULL */ -+/* + /* * Enter an interrupt context. */ - void irq_enter(void) @@ -350,9 +717,9 @@ void irq_enter(void) * Prevent raise_softirq from needlessly waking up ksoftirqd * here, as softirq will be serviced on return from interrupt. @@ -785,7 +798,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } #ifdef CONFIG_HOTPLUG_CPU -@@ -808,6 +1143,8 @@ static int takeover_tasklets(unsigned in +@@ -808,6 +1143,8 @@ static int takeover_tasklets(unsigned int cpu) static struct smp_hotplug_thread softirq_threads = { .store = &ksoftirqd, @@ -794,9 +807,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> .thread_should_run = ksoftirqd_should_run, .thread_fn = run_ksoftirqd, .thread_comm = "ksoftirqd/%u", +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index c217af74dddf..6482945f8ae8 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -891,14 +891,7 @@ static bool can_stop_idle_tick(int cpu, +@@ -891,14 +891,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) return false; if (unlikely(local_softirq_pending() && cpu_online(cpu))) { @@ -812,3 +827,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return false; } +-- +2.20.1 + diff --git a/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch b/debian/patches-rt/0125-net-core-use-local_bh_disable-in-netif_rx_ni.patch index fc8524c0d..f45290d4c 100644 --- a/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch +++ b/debian/patches-rt/0125-net-core-use-local_bh_disable-in-netif_rx_ni.patch @@ -1,7 +1,8 @@ +From 5c498b9e99322199a2b4a42b1abeed613b701e61 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 16 Jun 2017 19:03:16 +0200 -Subject: [PATCH] net/core: use local_bh_disable() in netif_rx_ni() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 125/266] net/core: use local_bh_disable() in netif_rx_ni() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In 2004 netif_rx_ni() gained a preempt_disable() section around netif_rx() and its do_softirq() + testing for it. The do_softirq() part @@ -14,9 +15,11 @@ required. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - net/core/dev.c | 6 ++---- + net/core/dev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) +diff --git a/net/core/dev.c b/net/core/dev.c +index 7f8beb5e4d2d..b7fbababf836 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4512,11 +4512,9 @@ int netif_rx_ni(struct sk_buff *skb) @@ -33,3 +36,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return err; } +-- +2.20.1 + diff --git a/debian/patches-rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch b/debian/patches-rt/0126-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch index 93e4f5b8b..c060e2f73 100644 --- a/debian/patches-rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch +++ b/debian/patches-rt/0126-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch @@ -1,7 +1,9 @@ -Subject: genirq: Allow disabling of softirq processing in irq thread context +From 71f5db69f4ad03364b9cffdf30d191ad9105f990 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 31 Jan 2012 13:01:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 126/266] genirq: Allow disabling of softirq processing in irq + thread context +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The processing of softirqs in irq thread context is a performance gain for the non-rt workloads of a system, but it's counterproductive for @@ -10,15 +12,16 @@ workload. Allow such interrupts to prevent softirq processing in their thread context. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - include/linux/interrupt.h | 2 ++ - include/linux/irq.h | 4 +++- - kernel/irq/manage.c | 13 ++++++++++++- - kernel/irq/settings.h | 12 ++++++++++++ - kernel/softirq.c | 9 +++++++++ + include/linux/interrupt.h | 2 ++ + include/linux/irq.h | 4 +++- + kernel/irq/manage.c | 13 ++++++++++++- + kernel/irq/settings.h | 12 ++++++++++++ + kernel/softirq.c | 9 +++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 6c25b962ba89..99f8b7ace7c9 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -62,6 +62,7 @@ @@ -37,6 +40,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD) +diff --git a/include/linux/irq.h b/include/linux/irq.h +index c9bffda04a45..73d3146db74d 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -69,6 +69,7 @@ enum irqchip_irq_state; @@ -63,9 +68,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index d2270f61d335..ba5bba5f1ffd 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -970,7 +970,15 @@ irq_forced_thread_fn(struct irq_desc *de +@@ -973,7 +973,15 @@ irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) atomic_inc(&desc->threads_handled); irq_finalize_oneshot(desc, action); @@ -82,7 +89,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return ret; } -@@ -1480,6 +1488,9 @@ static int +@@ -1483,6 +1491,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) irqd_set(&desc->irq_data, IRQD_NO_BALANCING); } @@ -92,6 +99,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (irq_settings_can_autoenable(desc)) { irq_startup(desc, IRQ_RESEND, IRQ_START_COND); } else { +diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h +index e43795cd2ccf..47e2f9e23586 100644 --- a/kernel/irq/settings.h +++ b/kernel/irq/settings.h @@ -17,6 +17,7 @@ enum { @@ -110,7 +119,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #undef IRQF_MODIFY_MASK #define IRQF_MODIFY_MASK GOT_YOU_MORON -@@ -41,6 +43,16 @@ irq_settings_clr_and_set(struct irq_desc +@@ -41,6 +43,16 @@ irq_settings_clr_and_set(struct irq_desc *desc, u32 clr, u32 set) desc->status_use_accessors |= (set & _IRQF_MODIFY_MASK); } @@ -127,6 +136,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static inline bool irq_settings_is_per_cpu(struct irq_desc *desc) { return desc->status_use_accessors & _IRQ_PER_CPU; +diff --git a/kernel/softirq.c b/kernel/softirq.c +index fd89f8ab85ac..3e9333d148ad 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -598,6 +598,15 @@ void __local_bh_enable(void) @@ -145,3 +156,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> int in_serving_softirq(void) { return current->flags & PF_IN_SOFTIRQ; +-- +2.20.1 + diff --git a/debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch b/debian/patches-rt/0127-softirq-split-timer-softirqs-out-of-ksoftirqd.patch index ddaaefcb9..818177467 100644 --- a/debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch +++ b/debian/patches-rt/0127-softirq-split-timer-softirqs-out-of-ksoftirqd.patch @@ -1,7 +1,8 @@ +From b599dd4ecbc0a25a6ed3cb22c8d7e134fef79273 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 20 Jan 2016 16:34:17 +0100 -Subject: softirq: split timer softirqs out of ksoftirqd -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 127/266] softirq: split timer softirqs out of ksoftirqd +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The softirqd runs in -RT with SCHED_FIFO (prio 1) and deals mostly with timer wakeup which can not happen in hardirq context. The prio has been @@ -23,9 +24,11 @@ SCHED_OTHER priority and it won't defer RCU anymore. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/softirq.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++-------- + kernel/softirq.c | 85 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 12 deletions(-) +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 3e9333d148ad..fe4e59c80a08 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -59,6 +59,10 @@ EXPORT_PER_CPU_SYMBOL(irq_stat); @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void handle_softirq(unsigned int vec_nr) { struct softirq_action *h = softirq_vec + vec_nr; -@@ -493,7 +508,6 @@ void __raise_softirq_irqoff(unsigned int +@@ -493,7 +508,6 @@ void __raise_softirq_irqoff(unsigned int nr) static inline void local_bh_disable_nort(void) { local_bh_disable(); } static inline void _local_bh_enable_nort(void) { _local_bh_enable(); } static void ksoftirqd_set_sched_params(unsigned int cpu) { } @@ -79,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * If we are not in a hard interrupt and inside a bh disabled -@@ -650,16 +668,29 @@ static void do_raise_softirq_irqoff(unsi +@@ -650,16 +668,29 @@ static void do_raise_softirq_irqoff(unsigned int nr) * delegate it to ksoftirqd. */ if (!in_irq() && current->softirq_nestcnt) @@ -113,7 +116,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -685,7 +716,7 @@ void raise_softirq_irqoff(unsigned int n +@@ -685,7 +716,7 @@ void raise_softirq_irqoff(unsigned int nr) * raise a WARN() if the condition is met. */ if (!current->softirq_nestcnt) @@ -122,10 +125,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static inline int ksoftirqd_softirq_pending(void) -@@ -698,22 +729,37 @@ static inline void _local_bh_enable_nort +@@ -697,23 +728,38 @@ static inline void local_bh_disable_nort(void) { } + static inline void _local_bh_enable_nort(void) { } static inline void ksoftirqd_set_sched_params(unsigned int cpu) - { ++{ + /* Take over all but timer pending softirqs when starting */ + local_irq_disable(); + current->softirqs_raised = local_softirq_pending() & ~TIMER_SOFTIRQS; @@ -133,7 +137,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +} + +static inline void ktimer_softirqd_set_sched_params(unsigned int cpu) -+{ + { struct sched_param param = { .sched_priority = 1 }; sched_setscheduler(current, SCHED_FIFO, ¶m); @@ -173,7 +177,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> local_irq_restore(flags); #endif } -@@ -1153,18 +1202,30 @@ static int takeover_tasklets(unsigned in +@@ -1153,18 +1202,30 @@ static int takeover_tasklets(unsigned int cpu) static struct smp_hotplug_thread softirq_threads = { .store = &ksoftirqd, .setup = ksoftirqd_set_sched_params, @@ -206,3 +210,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } early_initcall(spawn_ksoftirqd); +-- +2.20.1 + diff --git a/debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-ksof.patch b/debian/patches-rt/0128-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch index 737571f93..0c428f469 100644 --- a/debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-ksof.patch +++ b/debian/patches-rt/0128-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch @@ -1,8 +1,9 @@ +From 11af1b8e331124f698e5bdc717b6073f1be73a89 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 18 Feb 2019 13:19:59 +0100 -Subject: [PATCH] softirq: Avoid "local_softirq_pending" messages if +Subject: [PATCH 128/266] softirq: Avoid "local_softirq_pending" messages if ksoftirqd is blocked -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz If the ksoftirqd thread has a softirq pending and is blocked on the `local_softirq_locks' lock then softirq_check_pending_idle() won't @@ -19,12 +20,14 @@ Cc: stable-rt@vger.kernel.org Tested-by: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/softirq.c | 57 +++++++++++++++++++++++++++++++++++++++---------------- + kernel/softirq.c | 57 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 16 deletions(-) +diff --git a/kernel/softirq.c b/kernel/softirq.c +index fe4e59c80a08..1920985eeb09 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c -@@ -92,6 +92,31 @@ static inline void softirq_clr_runner(un +@@ -92,6 +92,31 @@ static inline void softirq_clr_runner(unsigned int sirq) sr->runner[sirq] = NULL; } @@ -56,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * On preempt-rt a softirq running context might be blocked on a * lock. There might be no other runnable task on this CPU because the -@@ -104,6 +129,7 @@ static inline void softirq_clr_runner(un +@@ -104,6 +129,7 @@ static inline void softirq_clr_runner(unsigned int sirq) */ void softirq_check_pending_idle(void) { @@ -73,10 +76,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> for (i = 0; i < NR_SOFTIRQS; i++) { - struct task_struct *tsk = sr->runner[i]; + tsk = sr->runner[i]; -+ -+ if (softirq_check_runner_tsk(tsk, &warnpending)) -+ warnpending &= ~(1 << i); -+ } - /* - * The wakeup code in rtmutex.c wakes up the task @@ -93,6 +92,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - } - raw_spin_unlock(&tsk->pi_lock); - } ++ if (softirq_check_runner_tsk(tsk, &warnpending)) ++ warnpending &= ~(1 << i); ++ } ++ + if (warnpending) { + tsk = __this_cpu_read(ksoftirqd); + softirq_check_runner_tsk(tsk, &warnpending); @@ -104,3 +107,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } if (warnpending) { +-- +2.20.1 + diff --git a/debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-task.patch b/debian/patches-rt/0129-softirq-Avoid-local_softirq_pending-messages-if-task.patch index 22426dd95..622229406 100644 --- a/debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-task.patch +++ b/debian/patches-rt/0129-softirq-Avoid-local_softirq_pending-messages-if-task.patch @@ -1,8 +1,9 @@ +From 3d0ff8b7d6f589be93fcc6e875937ca27bf88960 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 19 Feb 2019 16:49:29 +0100 -Subject: [PATCH] softirq: Avoid "local_softirq_pending" messages if task - is in cpu_chill() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 129/266] softirq: Avoid "local_softirq_pending" messages if + task is in cpu_chill() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz If the softirq thread enters cpu_chill() then ->state is UNINTERRUPTIBLE and has no ->pi_blocked_on set and so its mask is not taken into account. @@ -14,12 +15,14 @@ is held. Use the same mechanism for the softirq-pending check. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/softirq.c | 5 ++++- + kernel/softirq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 1920985eeb09..27a4bb2303d0 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c -@@ -105,9 +105,12 @@ static bool softirq_check_runner_tsk(str +@@ -105,9 +105,12 @@ static bool softirq_check_runner_tsk(struct task_struct *tsk, * _before_ it sets pi_blocked_on to NULL under * tsk->pi_lock. So we need to check for both: state * and pi_blocked_on. @@ -33,3 +36,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Clear all bits pending in that task */ *pending &= ~(tsk->softirqs_raised); ret = true; +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch b/debian/patches-rt/0130-rtmutex-trylock-is-okay-on-RT.patch index 7204f5b20..f9e01bb2a 100644 --- a/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch +++ b/debian/patches-rt/0130-rtmutex-trylock-is-okay-on-RT.patch @@ -1,7 +1,8 @@ +From 4e4c957bf31499b5a66c72751e3d9f0247f441fa Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed 02 Dec 2015 11:34:07 +0100 -Subject: rtmutex: trylock is okay on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Wed, 2 Dec 2015 11:34:07 +0100 +Subject: [PATCH 130/266] rtmutex: trylock is okay on -RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz non-RT kernel could deadlock on rt_mutex_trylock() in softirq context. On -RT we don't run softirqs in IRQ context but in thread context so it is @@ -9,12 +10,14 @@ not a issue here. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/locking/rtmutex.c | 4 ++++ + kernel/locking/rtmutex.c | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 9562aaa2afdc..72abe7c121fa 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1583,7 +1583,11 @@ int __sched rt_mutex_trylock(struct rt_m +@@ -1583,7 +1583,11 @@ int __sched rt_mutex_trylock(struct rt_mutex *lock) { int ret; @@ -26,3 +29,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; ret = rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock); +-- +2.20.1 + diff --git a/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch b/debian/patches-rt/0131-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch index 64909e2ae..34f41612c 100644 --- a/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch +++ b/debian/patches-rt/0131-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch @@ -1,7 +1,8 @@ +From ba58c2b7821218d77e2c849cb4a9f638de69f4b1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 15 Sep 2016 10:51:27 +0200 -Subject: [PATCH] fs/nfs: turn rmdir_sem into a semaphore -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 131/266] fs/nfs: turn rmdir_sem into a semaphore +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The RW semaphore had a reader side which used the _non_owner version because it most likely took the reader lock in one thread and released it @@ -14,15 +15,17 @@ multiple readers anyway so that is not a loss. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - fs/nfs/dir.c | 8 ++++++++ - fs/nfs/inode.c | 4 ++++ - fs/nfs/unlink.c | 31 +++++++++++++++++++++++++++---- - include/linux/nfs_fs.h | 4 ++++ + fs/nfs/dir.c | 8 ++++++++ + fs/nfs/inode.c | 4 ++++ + fs/nfs/unlink.c | 31 +++++++++++++++++++++++++++---- + include/linux/nfs_fs.h | 4 ++++ 4 files changed, 43 insertions(+), 4 deletions(-) +diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c +index 8bfaa658b2c1..62afe8ca1e36 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c -@@ -1786,7 +1786,11 @@ int nfs_rmdir(struct inode *dir, struct +@@ -1786,7 +1786,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) trace_nfs_rmdir_enter(dir, dentry); if (d_really_is_positive(dentry)) { @@ -34,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); /* Ensure the VFS deletes this inode */ switch (error) { -@@ -1796,7 +1800,11 @@ int nfs_rmdir(struct inode *dir, struct +@@ -1796,7 +1800,11 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) case -ENOENT: nfs_dentry_handle_enoent(dentry); } @@ -46,6 +49,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } else 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 b65aee481d13..110ee6f78c31 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -2103,7 +2103,11 @@ static void init_once(void *foo) @@ -60,9 +65,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> mutex_init(&nfsi->commit_mutex); nfs4_init_once(nfsi); } +diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c +index fd61bf0fce63..ce9100b5604d 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c -@@ -52,6 +52,29 @@ static void nfs_async_unlink_done(struct +@@ -52,6 +52,29 @@ static void nfs_async_unlink_done(struct rpc_task *task, void *calldata) rpc_restart_call_prepare(task); } @@ -92,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * nfs_async_unlink_release - Release the sillydelete data. * @task: rpc_task of the sillydelete -@@ -65,7 +88,7 @@ static void nfs_async_unlink_release(voi +@@ -65,7 +88,7 @@ static void nfs_async_unlink_release(void *calldata) struct dentry *dentry = data->dentry; struct super_block *sb = dentry->d_sb; @@ -101,7 +108,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> d_lookup_done(dentry); nfs_free_unlinkdata(data); dput(dentry); -@@ -118,10 +141,10 @@ static int nfs_call_unlink(struct dentry +@@ -118,10 +141,10 @@ static int nfs_call_unlink(struct dentry *dentry, struct inode *inode, struct nf struct inode *dir = d_inode(dentry->d_parent); struct dentry *alias; @@ -114,7 +121,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } if (!d_in_lookup(alias)) { -@@ -143,7 +166,7 @@ static int nfs_call_unlink(struct dentry +@@ -143,7 +166,7 @@ static int nfs_call_unlink(struct dentry *dentry, struct inode *inode, struct nf ret = 0; spin_unlock(&alias->d_lock); dput(alias); @@ -123,6 +130,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * If we'd displaced old cached devname, free it. At that * point dentry is definitely not a root, so we won't need +diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h +index a0831e9d19c9..94b6fefd90b0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -163,7 +163,11 @@ struct nfs_inode { @@ -137,3 +146,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct mutex commit_mutex; #if IS_ENABLED(CONFIG_NFS_V4) +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-futex-prepare-rt.patch b/debian/patches-rt/0132-rtmutex-Handle-the-various-new-futex-race-conditions.patch index 7cc99053c..946e7b1ff 100644 --- a/debian/patches-rt/rtmutex-futex-prepare-rt.patch +++ b/debian/patches-rt/0132-rtmutex-Handle-the-various-new-futex-race-conditions.patch @@ -1,7 +1,8 @@ -Subject: rtmutex: Handle the various new futex race conditions +From 6773936dddf122a487785ab10dfe5a55f1702a86 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 10 Jun 2011 11:04:15 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 132/266] rtmutex: Handle the various new futex race conditions +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz RT opens a few new interesting race conditions in the rtmutex/futex combo due to futex hash bucket lock being a 'sleeping' spinlock and @@ -9,14 +10,16 @@ therefor not disabling preemption. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/futex.c | 77 ++++++++++++++++++++++++++++++++-------- - kernel/locking/rtmutex.c | 36 +++++++++++++++--- - kernel/locking/rtmutex_common.h | 2 + + kernel/futex.c | 77 ++++++++++++++++++++++++++------- + kernel/locking/rtmutex.c | 36 ++++++++++++--- + kernel/locking/rtmutex_common.h | 2 + 3 files changed, 94 insertions(+), 21 deletions(-) +diff --git a/kernel/futex.c b/kernel/futex.c +index 2b3eb43ba3fd..a59202dd2c3f 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2143,6 +2143,16 @@ static int futex_requeue(u32 __user *uad +@@ -2146,6 +2146,16 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, requeue_pi_wake_futex(this, &key2, hb2); drop_count++; continue; @@ -33,7 +36,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } else if (ret) { /* * rt_mutex_start_proxy_lock() detected a -@@ -3191,7 +3201,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3194,7 +3204,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, struct hrtimer_sleeper timeout, *to = NULL; struct futex_pi_state *pi_state = NULL; struct rt_mutex_waiter rt_waiter; @@ -42,7 +45,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> union futex_key key2 = FUTEX_KEY_INIT; struct futex_q q = futex_q_init; int res, ret; -@@ -3249,20 +3259,55 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3252,20 +3262,55 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, /* Queue the futex_q, drop the hb lock, wait for wakeup. */ futex_wait_queue_me(hb, &q, to); @@ -109,7 +112,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* Check if the requeue code acquired the second futex for us. */ if (!q.rt_waiter) { -@@ -3271,7 +3316,8 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3274,7 +3319,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, * did a lock-steal - fix up the PI-state in that case. */ if (q.pi_state && (q.pi_state->owner != current)) { @@ -119,7 +122,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ret = fixup_pi_state_owner(uaddr2, &q, current); if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) { pi_state = q.pi_state; -@@ -3282,7 +3328,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3285,7 +3331,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, * the requeue_pi() code acquired for us. */ put_pi_state(q.pi_state); @@ -128,7 +131,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } else { struct rt_mutex *pi_mutex; -@@ -3296,7 +3342,8 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3299,7 +3345,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, pi_mutex = &q.pi_state->pi_mutex; ret = rt_mutex_wait_proxy_lock(pi_mutex, to, &rt_waiter); @@ -138,9 +141,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (ret && !rt_mutex_cleanup_proxy_lock(pi_mutex, &rt_waiter)) ret = 0; +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 72abe7c121fa..71d161c93b98 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -135,6 +135,11 @@ static void fixup_rt_mutex_waiters(struc +@@ -135,6 +135,11 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock) WRITE_ONCE(*p, owner & ~RT_MUTEX_HAS_WAITERS); } @@ -162,7 +167,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* -@@ -515,7 +521,7 @@ static int rt_mutex_adjust_prio_chain(st +@@ -515,7 +521,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, * reached or the state of the chain has changed while we * dropped the locks. */ @@ -171,7 +176,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> goto out_unlock_pi; /* -@@ -951,6 +957,22 @@ static int task_blocks_on_rt_mutex(struc +@@ -951,6 +957,22 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, return -EDEADLK; raw_spin_lock(&task->pi_lock); @@ -194,7 +199,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> waiter->task = task; waiter->lock = lock; waiter->prio = task->prio; -@@ -974,7 +996,7 @@ static int task_blocks_on_rt_mutex(struc +@@ -974,7 +996,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, rt_mutex_enqueue_pi(owner, waiter); rt_mutex_adjust_prio(owner); @@ -203,7 +208,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> chain_walk = 1; } else if (rt_mutex_cond_detect_deadlock(waiter, chwalk)) { chain_walk = 1; -@@ -1070,7 +1092,7 @@ static void remove_waiter(struct rt_mute +@@ -1070,7 +1092,7 @@ static void remove_waiter(struct rt_mutex *lock, { bool is_top_waiter = (waiter == rt_mutex_top_waiter(lock)); struct task_struct *owner = rt_mutex_owner(lock); @@ -212,7 +217,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> lockdep_assert_held(&lock->wait_lock); -@@ -1096,7 +1118,8 @@ static void remove_waiter(struct rt_mute +@@ -1096,7 +1118,8 @@ static void remove_waiter(struct rt_mutex *lock, rt_mutex_adjust_prio(owner); /* Store the lock on which owner is blocked or NULL */ @@ -222,7 +227,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> raw_spin_unlock(&owner->pi_lock); -@@ -1132,7 +1155,8 @@ void rt_mutex_adjust_pi(struct task_stru +@@ -1132,7 +1155,8 @@ void rt_mutex_adjust_pi(struct task_struct *task) raw_spin_lock_irqsave(&task->pi_lock, flags); waiter = task->pi_blocked_on; @@ -232,6 +237,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> raw_spin_unlock_irqrestore(&task->pi_lock, flags); return; } +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index d1d62f942be2..f4b6596d224a 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h @@ -130,6 +130,8 @@ enum rtmutex_chainwalk { @@ -243,3 +250,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock); extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, struct task_struct *proxy_owner); +-- +2.20.1 + diff --git a/debian/patches-rt/futex-requeue-pi-fix.patch b/debian/patches-rt/0133-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch index cfcdf41ab..63a627359 100644 --- a/debian/patches-rt/futex-requeue-pi-fix.patch +++ b/debian/patches-rt/0133-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch @@ -1,7 +1,8 @@ +From 4986899d985b4b50ae2ecad6ce66bb8cca2a4047 Mon Sep 17 00:00:00 2001 From: Steven Rostedt <rostedt@goodmis.org> Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: futex: Fix bug on when a requeued RT task times out -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 133/266] futex: Fix bug on when a requeued RT task times out +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Requeue with timeout causes a bug with PREEMPT_RT_FULL. @@ -17,7 +18,7 @@ The bug comes from a timed out condition. double_lock_hb(); raw_spin_lock(pi_lock); - if (current->pi_blocked_on) { + if (current->pi_blocked_on) { } else { current->pi_blocked_on = PI_WAKE_INPROGRESS; run_spin_unlock(pi_lock); @@ -50,13 +51,15 @@ appropriately. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/locking/rtmutex.c | 31 ++++++++++++++++++++++++++++++- - kernel/locking/rtmutex_common.h | 1 + + kernel/locking/rtmutex.c | 31 ++++++++++++++++++++++++++++++- + kernel/locking/rtmutex_common.h | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 71d161c93b98..1c3f56d3d9b6 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -137,7 +137,8 @@ static void fixup_rt_mutex_waiters(struc +@@ -137,7 +137,8 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock) static int rt_mutex_real_waiter(struct rt_mutex_waiter *waiter) { @@ -66,7 +69,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* -@@ -1784,6 +1785,34 @@ int __rt_mutex_start_proxy_lock(struct r +@@ -1784,6 +1785,34 @@ int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, if (try_to_take_rt_mutex(lock, task, NULL)) return 1; @@ -101,6 +104,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* We enforce deadlock detection for futexes */ ret = task_blocks_on_rt_mutex(lock, waiter, task, RT_MUTEX_FULL_CHAINWALK); +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index f4b6596d224a..461527f3f7af 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h @@ -131,6 +131,7 @@ enum rtmutex_chainwalk { @@ -111,3 +116,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock); extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, +-- +2.20.1 + diff --git a/debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/debian/patches-rt/0134-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch index ae7a823dd..0e96aae65 100644 --- a/debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch +++ b/debian/patches-rt/0134-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch @@ -1,7 +1,9 @@ +From b9aa9db48ab0cf192b26cafb81de88fa671b1bac Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 1 Mar 2013 11:17:42 +0100 -Subject: futex: Ensure lock/unlock symetry versus pi_lock and hash bucket lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 134/266] futex: Ensure lock/unlock symetry versus pi_lock and + hash bucket lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In exit_pi_state_list() we have the following locking construct: @@ -26,12 +28,14 @@ Reported-by: Yong Zhang <yong.zhang@windriver.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/futex.c | 2 ++ + kernel/futex.c | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/kernel/futex.c b/kernel/futex.c +index a59202dd2c3f..8f58ce04bebf 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -918,7 +918,9 @@ void exit_pi_state_list(struct task_stru +@@ -918,7 +918,9 @@ void exit_pi_state_list(struct task_struct *curr) if (head->next != next) { /* retain curr->pi_lock for the loop invariant */ raw_spin_unlock(&pi_state->pi_mutex.wait_lock); @@ -41,3 +45,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> put_pi_state(pi_state); continue; } +-- +2.20.1 + diff --git a/debian/patches-rt/pid.h-include-atomic.h.patch b/debian/patches-rt/0135-pid.h-include-atomic.h.patch index 87ea9fd89..7bfca5cf3 100644 --- a/debian/patches-rt/pid.h-include-atomic.h.patch +++ b/debian/patches-rt/0135-pid.h-include-atomic.h.patch @@ -1,7 +1,8 @@ +From fc467ae64b036ce803d358440d7255281e9a5023 Mon Sep 17 00:00:00 2001 From: Grygorii Strashko <Grygorii.Strashko@linaro.org> Date: Tue, 21 Jul 2015 19:43:56 +0300 -Subject: pid.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 135/266] pid.h: include atomic.h +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz This patch fixes build error: CC kernel/pid_namespace.o @@ -22,9 +23,11 @@ Vanilla gets this via spinlock.h. Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/pid.h | 1 + + include/linux/pid.h | 1 + 1 file changed, 1 insertion(+) +diff --git a/include/linux/pid.h b/include/linux/pid.h +index 14a9a39da9c7..a9026a5da196 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -3,6 +3,7 @@ @@ -35,3 +38,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> enum pid_type { +-- +2.20.1 + diff --git a/debian/patches-rt/arm-include-definition-for-cpumask_t.patch b/debian/patches-rt/0136-arm-include-definition-for-cpumask_t.patch index 125134d8d..149b97f68 100644 --- a/debian/patches-rt/arm-include-definition-for-cpumask_t.patch +++ b/debian/patches-rt/0136-arm-include-definition-for-cpumask_t.patch @@ -1,7 +1,8 @@ +From f5433b699e63eb406b6fb5816f59ff6ee5f39d3d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 22 Dec 2016 17:28:33 +0100 -Subject: [PATCH] arm: include definition for cpumask_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 136/266] arm: include definition for cpumask_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz This definition gets pulled in by other files. With the (later) split of RCU and spinlock.h it won't compile anymore. @@ -9,9 +10,11 @@ The split is done in ("rbtree: don't include the rcu header"). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm/include/asm/irq.h | 2 ++ + arch/arm/include/asm/irq.h | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h +index 46d41140df27..c421b5b81946 100644 --- a/arch/arm/include/asm/irq.h +++ b/arch/arm/include/asm/irq.h @@ -23,6 +23,8 @@ @@ -22,4 +25,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + struct irqaction; struct pt_regs; - extern void migrate_irqs(void); + +-- +2.20.1 + diff --git a/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch b/debian/patches-rt/0137-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch index 2a3d5874b..d902a35cf 100644 --- a/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch +++ b/debian/patches-rt/0137-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch @@ -1,7 +1,9 @@ +From c7751dabfa3dd161c53b1b84eb47a02b0e7b4aef Mon Sep 17 00:00:00 2001 From: "Wolfgang M. Reimer" <linuxball@gmail.com> Date: Tue, 21 Jul 2015 16:20:07 +0200 -Subject: locking: locktorture: Do NOT include rwlock.h directly -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 137/266] locking: locktorture: Do NOT include rwlock.h + directly +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Including rwlock.h directly will cause kernel builds to fail if CONFIG_PREEMPT_RT_FULL is defined. The correct header file @@ -12,9 +14,11 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Wolfgang M. Reimer <linuxball@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/locking/locktorture.c | 1 - + kernel/locking/locktorture.c | 1 - 1 file changed, 1 deletion(-) +diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c +index 7d0b0ed74404..a81e6ef33a04 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -29,7 +29,6 @@ @@ -25,3 +29,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <linux/mutex.h> #include <linux/rwsem.h> #include <linux/smp.h> +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-lock-killable.patch b/debian/patches-rt/0138-rtmutex-Add-rtmutex_lock_killable.patch index 6d9d7a669..24ccdf610 100644 --- a/debian/patches-rt/rtmutex-lock-killable.patch +++ b/debian/patches-rt/0138-rtmutex-Add-rtmutex_lock_killable.patch @@ -1,20 +1,23 @@ -Subject: rtmutex: Add rtmutex_lock_killable() +From 317ebab8dd59c91207d43671ac61a3921b8b3192 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 09 Jun 2011 11:43:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Thu, 9 Jun 2011 11:43:52 +0200 +Subject: [PATCH 138/266] rtmutex: Add rtmutex_lock_killable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Add "killable" type to rtmutex. We need this since rtmutex are used as "normal" mutexes which do use this type. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/rtmutex.h | 1 + - kernel/locking/rtmutex.c | 19 +++++++++++++++++++ + include/linux/rtmutex.h | 1 + + kernel/locking/rtmutex.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) +diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h +index 6fd615a0eea9..81ece6a8291a 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h -@@ -115,6 +115,7 @@ extern void rt_mutex_lock(struct rt_mute +@@ -115,6 +115,7 @@ extern void rt_mutex_lock(struct rt_mutex *lock); #endif extern int rt_mutex_lock_interruptible(struct rt_mutex *lock); @@ -22,12 +25,15 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern int rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout); +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 1c3f56d3d9b6..a4b2af7718f8 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1563,6 +1563,25 @@ int __sched __rt_mutex_futex_trylock(str +@@ -1562,6 +1562,25 @@ int __sched __rt_mutex_futex_trylock(struct rt_mutex *lock) + return __rt_mutex_slowtrylock(lock); } - /** ++/** + * rt_mutex_lock_killable - lock a rt_mutex killable + * + * @lock: the rt_mutex to be locked @@ -46,7 +52,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +} +EXPORT_SYMBOL_GPL(rt_mutex_lock_killable); + -+/** + /** * rt_mutex_timed_lock - lock a rt_mutex interruptible * the timeout structure is provided - * by the caller +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-Make-lock_killable-work.patch b/debian/patches-rt/0139-rtmutex-Make-lock_killable-work.patch index 88ab19581..f785ec7e2 100644 --- a/debian/patches-rt/rtmutex-Make-lock_killable-work.patch +++ b/debian/patches-rt/0139-rtmutex-Make-lock_killable-work.patch @@ -1,7 +1,8 @@ +From c90a8e8b7a889b34b395cec28fc59fc2bf3487e6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sat, 1 Apr 2017 12:50:59 +0200 -Subject: [PATCH] rtmutex: Make lock_killable work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 139/266] rtmutex: Make lock_killable work +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. @@ -12,12 +13,14 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/locking/rtmutex.c | 19 +++++++------------ + kernel/locking/rtmutex.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index a4b2af7718f8..f058bb976212 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1201,18 +1201,13 @@ static int __sched +@@ -1201,18 +1201,13 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state, if (try_to_take_rt_mutex(lock, current, waiter)) break; @@ -43,3 +46,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } raw_spin_unlock_irq(&lock->wait_lock); +-- +2.20.1 + diff --git a/debian/patches-rt/spinlock-types-separate-raw.patch b/debian/patches-rt/0140-spinlock-Split-the-lock-types-header.patch index 7f5ab53f3..2700d35f7 100644 --- a/debian/patches-rt/spinlock-types-separate-raw.patch +++ b/debian/patches-rt/0140-spinlock-Split-the-lock-types-header.patch @@ -1,7 +1,8 @@ -Subject: spinlock: Split the lock types header +From 5f8b853599e755b01265397ba1cadf28f3d3d99b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 29 Jun 2011 19:34:01 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 140/266] spinlock: Split the lock types header +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Split raw_spinlock into its own file and the remaining spinlock_t into its own non-RT header. The non-RT header will be replaced later by sleeping @@ -9,12 +10,16 @@ spinlocks. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/rwlock_types.h | 4 ++ - include/linux/spinlock_types.h | 71 +----------------------------------- - include/linux/spinlock_types_nort.h | 33 ++++++++++++++++ - include/linux/spinlock_types_raw.h | 55 +++++++++++++++++++++++++++ + include/linux/rwlock_types.h | 4 ++ + include/linux/spinlock_types.h | 71 +---------------------------- + include/linux/spinlock_types_nort.h | 33 ++++++++++++++ + include/linux/spinlock_types_raw.h | 55 ++++++++++++++++++++++ 4 files changed, 94 insertions(+), 69 deletions(-) + create mode 100644 include/linux/spinlock_types_nort.h + create mode 100644 include/linux/spinlock_types_raw.h +diff --git a/include/linux/rwlock_types.h b/include/linux/rwlock_types.h +index 857a72ceb794..c21683f3e14a 100644 --- a/include/linux/rwlock_types.h +++ b/include/linux/rwlock_types.h @@ -1,6 +1,10 @@ @@ -28,6 +33,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * include/linux/rwlock_types.h - generic rwlock type definitions * and initializers +diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h +index 24b4e6f2c1a2..5c8664d57fb8 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h @@ -9,76 +9,9 @@ @@ -109,6 +116,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include <linux/rwlock_types.h> +diff --git a/include/linux/spinlock_types_nort.h b/include/linux/spinlock_types_nort.h +new file mode 100644 +index 000000000000..f1dac1fb1d6a --- /dev/null +++ b/include/linux/spinlock_types_nort.h @@ -0,0 +1,33 @@ @@ -145,6 +155,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) + +#endif +diff --git a/include/linux/spinlock_types_raw.h b/include/linux/spinlock_types_raw.h +new file mode 100644 +index 000000000000..822bf64a61d3 --- /dev/null +++ b/include/linux/spinlock_types_raw.h @@ -0,0 +1,55 @@ @@ -203,3 +216,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +#define DEFINE_RAW_SPINLOCK(x) raw_spinlock_t x = __RAW_SPIN_LOCK_UNLOCKED(x) + +#endif +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-avoid-include-hell.patch b/debian/patches-rt/0141-rtmutex-Avoid-include-hell.patch index a72c441fe..b29d30663 100644 --- a/debian/patches-rt/rtmutex-avoid-include-hell.patch +++ b/debian/patches-rt/0141-rtmutex-Avoid-include-hell.patch @@ -1,16 +1,19 @@ -Subject: rtmutex: Avoid include hell +From 2e65dfa1c3ba7751f6138973ac0dcef5ed9c60ad Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 29 Jun 2011 20:06:39 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 141/266] rtmutex: Avoid include hell +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Include only the required raw types. This avoids pulling in the complete spinlock header which in turn requires rtmutex.h at some point. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/rtmutex.h | 2 +- + include/linux/rtmutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h +index 81ece6a8291a..a355289b1fa1 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h @@ -15,7 +15,7 @@ @@ -22,3 +25,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern int max_lock_depth; /* for sysctl */ +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex_dont_include_rcu.patch b/debian/patches-rt/0142-rbtree-don-t-include-the-rcu-header.patch index 3d474536e..b7d0e3c4a 100644 --- a/debian/patches-rt/rtmutex_dont_include_rcu.patch +++ b/debian/patches-rt/0142-rbtree-don-t-include-the-rcu-header.patch @@ -1,6 +1,11 @@ +From 1091be35cd6c1ba408770043808adc04dd2c2804 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Subject: rbtree: don't include the rcu header -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Tue, 26 Feb 2019 16:56:02 +0100 +Subject: [PATCH 142/266] rbtree: don't include the rcu header +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The RCU header pulls in spinlock.h and fails due not yet defined types: @@ -19,11 +24,14 @@ a new header file which can be included by both users. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/rbtree.h | 2 - - include/linux/rcu_assign_pointer.h | 54 +++++++++++++++++++++++++++++++++++++ - include/linux/rcupdate.h | 49 --------------------------------- + include/linux/rbtree.h | 2 +- + include/linux/rcu_assign_pointer.h | 54 ++++++++++++++++++++++++++++++ + include/linux/rcupdate.h | 49 +-------------------------- 3 files changed, 56 insertions(+), 49 deletions(-) + create mode 100644 include/linux/rcu_assign_pointer.h +diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h +index fcbeed4053ef..2aa2aec354c2 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h @@ -31,7 +31,7 @@ @@ -35,6 +43,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct rb_node { unsigned long __rb_parent_color; +diff --git a/include/linux/rcu_assign_pointer.h b/include/linux/rcu_assign_pointer.h +new file mode 100644 +index 000000000000..7066962a4379 --- /dev/null +++ b/include/linux/rcu_assign_pointer.h @@ -0,0 +1,54 @@ @@ -92,6 +103,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +}) + +#endif +diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h +index 0539f55bf7b3..63cd0a1a99a0 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -42,6 +42,7 @@ @@ -102,10 +115,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) #define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) -@@ -372,54 +373,6 @@ static inline void rcu_preempt_sleep_che +@@ -371,54 +372,6 @@ static inline void rcu_preempt_sleep_check(void) { } + ((typeof(*p) __force __kernel *)(________p1)); \ }) - /** +-/** - * RCU_INITIALIZER() - statically initialize an RCU-protected global variable - * @v: The value to statically initialize with. - */ @@ -153,7 +167,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - _r_a_p__v; \ -}) - --/** + /** * rcu_swap_protected() - swap an RCU and a regular pointer * @rcu_ptr: RCU pointer - * @ptr: regular pointer +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch b/debian/patches-rt/0143-rtmutex-Provide-rt_mutex_slowlock_locked.patch index 97db9479a..894dbf5db 100644 --- a/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ b/debian/patches-rt/0143-rtmutex-Provide-rt_mutex_slowlock_locked.patch @@ -1,20 +1,23 @@ +From da0c8fe4e80d462e6a33749415917f001ef5aeef Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 16:14:22 +0200 -Subject: rtmutex: Provide rt_mutex_slowlock_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 143/266] rtmutex: Provide rt_mutex_slowlock_locked() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/locking/rtmutex.c | 67 ++++++++++++++++++++++------------------ - kernel/locking/rtmutex_common.h | 7 ++++ + kernel/locking/rtmutex.c | 67 +++++++++++++++++++-------------- + kernel/locking/rtmutex_common.h | 7 ++++ 2 files changed, 45 insertions(+), 29 deletions(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index f058bb976212..921345c31161 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1244,35 +1244,16 @@ static void rt_mutex_handle_deadlock(int +@@ -1244,35 +1244,16 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock, } } @@ -56,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> set_current_state(state); -@@ -1280,16 +1261,16 @@ rt_mutex_slowlock(struct rt_mutex *lock, +@@ -1280,16 +1261,16 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, if (unlikely(timeout)) hrtimer_start_expires(&timeout->timer, HRTIMER_MODE_ABS); @@ -77,7 +80,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -1297,6 +1278,34 @@ rt_mutex_slowlock(struct rt_mutex *lock, +@@ -1297,6 +1278,34 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, * unconditionally. We might have to fix that up. */ fixup_rt_mutex_waiters(lock); @@ -112,6 +115,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock_irqrestore(&lock->wait_lock, flags); +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index 461527f3f7af..cb9815f0c766 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h @@ -15,6 +15,7 @@ @@ -122,7 +127,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * This is the control structure for tasks blocked on a rt_mutex, -@@ -159,6 +160,12 @@ extern bool __rt_mutex_futex_unlock(stru +@@ -159,6 +160,12 @@ extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, struct wake_q_head *wqh); extern void rt_mutex_postunlock(struct wake_q_head *wake_q); @@ -135,3 +140,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_DEBUG_RT_MUTEXES # include "rtmutex-debug.h" +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch b/debian/patches-rt/0144-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch index 3e1a81b09..5b31de958 100644 --- a/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch +++ b/debian/patches-rt/0144-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch @@ -1,21 +1,24 @@ +From 82e51212994aa107e9151f83db13a866e63e3eab Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 16:36:39 +0200 -Subject: rtmutex: export lockdep-less version of rt_mutex's lock, - trylock and unlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 144/266] rtmutex: export lockdep-less version of rt_mutex's + lock, trylock and unlock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Required for lock implementation ontop of rtmutex. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/locking/rtmutex.c | 67 +++++++++++++++++++++++++--------------- - kernel/locking/rtmutex_common.h | 3 + + kernel/locking/rtmutex.c | 67 +++++++++++++++++++++------------ + kernel/locking/rtmutex_common.h | 3 ++ 2 files changed, 46 insertions(+), 24 deletions(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 921345c31161..d732976d0f05 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1494,12 +1494,33 @@ rt_mutex_fastunlock(struct rt_mutex *loc +@@ -1494,12 +1494,33 @@ rt_mutex_fastunlock(struct rt_mutex *lock, rt_mutex_postunlock(&wake_q); } @@ -69,7 +72,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL_GPL(rt_mutex_lock_interruptible); -@@ -1575,13 +1587,10 @@ int __sched __rt_mutex_futex_trylock(str +@@ -1575,13 +1587,10 @@ int __sched __rt_mutex_futex_trylock(struct rt_mutex *lock) * Returns: * 0 on success * -EINTR when interrupted by a signal @@ -84,7 +87,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL_GPL(rt_mutex_lock_killable); -@@ -1616,6 +1625,18 @@ rt_mutex_timed_lock(struct rt_mutex *loc +@@ -1616,6 +1625,18 @@ rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout) } EXPORT_SYMBOL_GPL(rt_mutex_timed_lock); @@ -103,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * rt_mutex_trylock - try to lock a rt_mutex * -@@ -1631,14 +1652,7 @@ int __sched rt_mutex_trylock(struct rt_m +@@ -1631,14 +1652,7 @@ int __sched rt_mutex_trylock(struct rt_mutex *lock) { int ret; @@ -119,7 +122,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (ret) mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); -@@ -1646,6 +1660,11 @@ int __sched rt_mutex_trylock(struct rt_m +@@ -1646,6 +1660,11 @@ int __sched rt_mutex_trylock(struct rt_mutex *lock) } EXPORT_SYMBOL_GPL(rt_mutex_trylock); @@ -131,9 +134,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * rt_mutex_unlock - unlock a rt_mutex * +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index cb9815f0c766..5955ad2aa2a8 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h -@@ -162,6 +162,9 @@ extern bool __rt_mutex_futex_unlock(stru +@@ -162,6 +162,9 @@ extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, extern void rt_mutex_postunlock(struct wake_q_head *wake_q); /* RW semaphore special interface */ @@ -143,3 +148,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk, +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch b/debian/patches-rt/0145-rtmutex-add-sleeping-lock-implementation.patch index 8f72cc874..44de7c431 100644 --- a/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch +++ b/debian/patches-rt/0145-rtmutex-add-sleeping-lock-implementation.patch @@ -1,26 +1,29 @@ +From 12101e1de5938dc8ae633cde473c46afa3a93f51 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:11:19 +0200 -Subject: rtmutex: add sleeping lock implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 145/266] rtmutex: add sleeping lock implementation +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/kernel.h | 4 - include/linux/rtmutex.h | 21 + - include/linux/sched.h | 8 - include/linux/sched/wake_q.h | 27 ++ - include/linux/spinlock_rt.h | 156 +++++++++++++ - include/linux/spinlock_types_rt.h | 48 ++++ - kernel/fork.c | 1 - kernel/futex.c | 11 - kernel/locking/rtmutex.c | 436 ++++++++++++++++++++++++++++++++++---- - kernel/locking/rtmutex_common.h | 14 - - kernel/sched/core.c | 28 +- + include/linux/kernel.h | 4 + + include/linux/rtmutex.h | 21 +- + include/linux/sched.h | 8 + + include/linux/sched/wake_q.h | 27 +- + include/linux/spinlock_rt.h | 156 +++++++++++ + include/linux/spinlock_types_rt.h | 48 ++++ + kernel/fork.c | 1 + + kernel/futex.c | 11 +- + kernel/locking/rtmutex.c | 436 +++++++++++++++++++++++++++--- + kernel/locking/rtmutex_common.h | 14 +- + kernel/sched/core.c | 28 +- 11 files changed, 695 insertions(+), 59 deletions(-) create mode 100644 include/linux/spinlock_rt.h create mode 100644 include/linux/spinlock_types_rt.h +diff --git a/include/linux/kernel.h b/include/linux/kernel.h +index d6aac75b51ba..e3f1a7c3b953 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -259,6 +259,9 @@ extern int _cond_resched(void); @@ -41,6 +44,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> # define sched_annotate_sleep() do { } while (0) #endif +diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h +index a355289b1fa1..138bd1e183e0 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h @@ -14,11 +14,15 @@ @@ -97,6 +102,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * rt_mutex_is_locked - is the mutex locked * @lock: the mutex to be queried +diff --git a/include/linux/sched.h b/include/linux/sched.h +index e9e0e8add76b..50c1c498284d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -134,6 +134,9 @@ struct task_group; @@ -135,9 +142,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_RT_MUTEXES /* PI waiters blocked on a rt_mutex held by this task: */ +diff --git a/include/linux/sched/wake_q.h b/include/linux/sched/wake_q.h +index 10b19a192b2d..ce3ccff3d9d8 100644 --- a/include/linux/sched/wake_q.h +++ b/include/linux/sched/wake_q.h -@@ -47,8 +47,29 @@ static inline void wake_q_init(struct wa +@@ -47,8 +47,29 @@ static inline void wake_q_init(struct wake_q_head *head) head->lastp = &head->first; } @@ -170,6 +179,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +} #endif /* _LINUX_SCHED_WAKE_Q_H */ +diff --git a/include/linux/spinlock_rt.h b/include/linux/spinlock_rt.h +new file mode 100644 +index 000000000000..3696a77fa77d --- /dev/null +++ b/include/linux/spinlock_rt.h @@ -0,0 +1,156 @@ @@ -329,6 +341,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +} + +#endif +diff --git a/include/linux/spinlock_types_rt.h b/include/linux/spinlock_types_rt.h +new file mode 100644 +index 000000000000..3e3d8c5f7a9a --- /dev/null +++ b/include/linux/spinlock_types_rt.h @@ -0,0 +1,48 @@ @@ -380,9 +395,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + spinlock_t name = __SPIN_LOCK_UNLOCKED(name) + +#endif +diff --git a/kernel/fork.c b/kernel/fork.c +index 8a9241afefb0..f62ae61064c7 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -895,6 +895,7 @@ static struct task_struct *dup_task_stru +@@ -895,6 +895,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; @@ -390,9 +407,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> account_kernel_stack(tsk, 1); +diff --git a/kernel/futex.c b/kernel/futex.c +index 8f58ce04bebf..3ae815cba677 100644 --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -1471,6 +1471,7 @@ static int wake_futex_pi(u32 __user *uad +@@ -1474,6 +1474,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_ struct task_struct *new_owner; bool postunlock = false; DEFINE_WAKE_Q(wake_q); @@ -400,7 +419,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int ret = 0; new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); -@@ -1532,13 +1533,13 @@ static int wake_futex_pi(u32 __user *uad +@@ -1535,13 +1536,13 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_ pi_state->owner = new_owner; raw_spin_unlock(&new_owner->pi_lock); @@ -417,7 +436,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } -@@ -2850,7 +2851,7 @@ static int futex_lock_pi(u32 __user *uad +@@ -2853,7 +2854,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, goto no_block; } @@ -426,7 +445,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * On PREEMPT_RT_FULL, when hb->lock becomes an rt_mutex, we must not -@@ -3230,7 +3231,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3233,7 +3234,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, * The waiter is allocated on our stack, manipulated by the requeue * code while we sleep on uaddr. */ @@ -435,6 +454,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ret = get_futex_key(uaddr2, flags & FLAGS_SHARED, &key2, VERIFY_WRITE); if (unlikely(ret != 0)) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index d732976d0f05..88df1ff7ca2d 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -7,6 +7,11 @@ @@ -449,7 +470,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * * See Documentation/locking/rt-mutex-design.txt for details. */ -@@ -234,7 +239,7 @@ static inline bool unlock_rt_mutex_safe( +@@ -234,7 +239,7 @@ static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock, * Only use with rt_mutex_waiter_{less,equal}() */ #define task_to_waiter(p) \ @@ -458,7 +479,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline int rt_mutex_waiter_less(struct rt_mutex_waiter *left, -@@ -274,6 +279,27 @@ rt_mutex_waiter_equal(struct rt_mutex_wa +@@ -274,6 +279,27 @@ rt_mutex_waiter_equal(struct rt_mutex_waiter *left, return 1; } @@ -486,7 +507,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void rt_mutex_enqueue(struct rt_mutex *lock, struct rt_mutex_waiter *waiter) { -@@ -378,6 +404,14 @@ static bool rt_mutex_cond_detect_deadloc +@@ -378,6 +404,14 @@ static bool rt_mutex_cond_detect_deadlock(struct rt_mutex_waiter *waiter, return debug_rt_mutex_detect_deadlock(waiter, chwalk); } @@ -501,7 +522,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Max number of times we'll walk the boosting chain: */ -@@ -703,13 +737,16 @@ static int rt_mutex_adjust_prio_chain(st +@@ -703,13 +737,16 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, * follow here. This is the end of the chain we are walking. */ if (!rt_mutex_owner(lock)) { @@ -520,7 +541,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock_irq(&lock->wait_lock); return 0; } -@@ -811,9 +848,11 @@ static int rt_mutex_adjust_prio_chain(st +@@ -811,9 +848,11 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, * @task: The task which wants to acquire the lock * @waiter: The waiter that is queued to the lock's wait tree if the * callsite called task_blocked_on_lock(), otherwise NULL @@ -534,7 +555,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { lockdep_assert_held(&lock->wait_lock); -@@ -849,12 +888,11 @@ static int try_to_take_rt_mutex(struct r +@@ -849,12 +888,11 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, */ if (waiter) { /* @@ -550,7 +571,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * We can acquire the lock. Remove the waiter from the * lock waiters tree. -@@ -872,14 +910,12 @@ static int try_to_take_rt_mutex(struct r +@@ -872,14 +910,12 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, */ if (rt_mutex_has_waiters(lock)) { /* @@ -569,7 +590,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * The current top waiter stays enqueued. We * don't have to change anything in the lock -@@ -926,6 +962,296 @@ static int try_to_take_rt_mutex(struct r +@@ -926,6 +962,296 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, return 1; } @@ -866,7 +887,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Task blocks on lock. * -@@ -1039,6 +1365,7 @@ static int task_blocks_on_rt_mutex(struc +@@ -1039,6 +1365,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, * Called with lock->wait_lock held and interrupts disabled. */ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, @@ -874,7 +895,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct rt_mutex *lock) { struct rt_mutex_waiter *waiter; -@@ -1078,7 +1405,10 @@ static void mark_wakeup_next_waiter(stru +@@ -1078,7 +1405,10 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, * Pairs with preempt_enable() in rt_mutex_postunlock(); */ preempt_disable(); @@ -886,7 +907,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock(¤t->pi_lock); } -@@ -1162,21 +1492,22 @@ void rt_mutex_adjust_pi(struct task_stru +@@ -1162,21 +1492,22 @@ void rt_mutex_adjust_pi(struct task_struct *task) return; } next_lock = waiter->lock; @@ -911,7 +932,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /** -@@ -1293,7 +1624,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, +@@ -1293,7 +1624,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, unsigned long flags; int ret = 0; @@ -920,7 +941,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Technically we could use raw_spin_[un]lock_irq() here, but this can -@@ -1366,7 +1697,8 @@ static inline int rt_mutex_slowtrylock(s +@@ -1366,7 +1697,8 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) * Return whether the current task needs to call rt_mutex_postunlock(). */ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, @@ -930,7 +951,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { unsigned long flags; -@@ -1420,7 +1752,7 @@ static bool __sched rt_mutex_slowunlock( +@@ -1420,7 +1752,7 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, * * Queue the next waiter for wakeup once we release the wait_lock. */ @@ -939,7 +960,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock_irqrestore(&lock->wait_lock, flags); return true; /* call rt_mutex_postunlock() */ -@@ -1472,9 +1804,11 @@ rt_mutex_fasttrylock(struct rt_mutex *lo +@@ -1472,9 +1804,11 @@ rt_mutex_fasttrylock(struct rt_mutex *lock, /* * Performs the wakeup of the the top-waiter and re-enables preemption. */ @@ -952,7 +973,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Pairs with preempt_disable() in rt_mutex_slowunlock() */ preempt_enable(); -@@ -1483,15 +1817,17 @@ void rt_mutex_postunlock(struct wake_q_h +@@ -1483,15 +1817,17 @@ void rt_mutex_postunlock(struct wake_q_head *wake_q) static inline void rt_mutex_fastunlock(struct rt_mutex *lock, bool (*slowfn)(struct rt_mutex *lock, @@ -973,7 +994,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } int __sched __rt_mutex_lock_state(struct rt_mutex *lock, int state) -@@ -1673,16 +2009,13 @@ void __sched __rt_mutex_unlock(struct rt +@@ -1673,16 +2009,13 @@ void __sched __rt_mutex_unlock(struct rt_mutex *lock) void __sched rt_mutex_unlock(struct rt_mutex *lock) { mutex_release(&lock->dep_map, 1, _RET_IP_); @@ -994,7 +1015,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { lockdep_assert_held(&lock->wait_lock); -@@ -1699,23 +2032,35 @@ bool __sched __rt_mutex_futex_unlock(str +@@ -1699,23 +2032,35 @@ bool __sched __rt_mutex_futex_unlock(struct rt_mutex *lock, * avoid inversion prior to the wakeup. preempt_disable() * therein pairs with rt_mutex_postunlock(). */ @@ -1033,7 +1054,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /** -@@ -1754,7 +2099,7 @@ void __rt_mutex_init(struct rt_mutex *lo +@@ -1754,7 +2099,7 @@ void __rt_mutex_init(struct rt_mutex *lock, const char *name, if (name && key) debug_rt_mutex_init(lock, name, key); } @@ -1042,7 +1063,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * rt_mutex_init_proxy_locked - initialize and lock a rt_mutex on behalf of a -@@ -1949,6 +2294,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -1949,6 +2294,7 @@ int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, struct hrtimer_sleeper *to, struct rt_mutex_waiter *waiter) { @@ -1050,7 +1071,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int ret; raw_spin_lock_irq(&lock->wait_lock); -@@ -1960,6 +2306,24 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -1960,6 +2306,24 @@ int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, * have to fix that up. */ fixup_rt_mutex_waiters(lock); @@ -1075,6 +1096,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock_irq(&lock->wait_lock); return ret; +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index 5955ad2aa2a8..6fcf0a3e180d 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h @@ -30,6 +30,7 @@ struct rt_mutex_waiter { @@ -1085,7 +1108,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_DEBUG_RT_MUTEXES unsigned long ip; struct pid *deadlock_task_pid; -@@ -139,7 +140,7 @@ extern void rt_mutex_init_proxy_locked(s +@@ -139,7 +140,7 @@ extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, struct task_struct *proxy_owner); extern void rt_mutex_proxy_unlock(struct rt_mutex *lock, struct task_struct *proxy_owner); @@ -1094,7 +1117,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> extern int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, struct rt_mutex_waiter *waiter, struct task_struct *task); -@@ -157,9 +158,12 @@ extern int __rt_mutex_futex_trylock(stru +@@ -157,9 +158,12 @@ extern int __rt_mutex_futex_trylock(struct rt_mutex *l); extern void rt_mutex_futex_unlock(struct rt_mutex *lock); extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, @@ -1109,7 +1132,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* RW semaphore special interface */ extern int __rt_mutex_lock_state(struct rt_mutex *lock, int state); -@@ -169,6 +173,10 @@ int __sched rt_mutex_slowlock_locked(str +@@ -169,6 +173,10 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk, struct rt_mutex_waiter *waiter); @@ -1120,9 +1143,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_DEBUG_RT_MUTEXES # include "rtmutex-debug.h" +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 0f4594130f85..e1ac20ada353 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -400,9 +400,15 @@ static bool set_nr_if_polling(struct tas +@@ -400,9 +400,15 @@ static bool set_nr_if_polling(struct task_struct *p) #endif #endif @@ -1140,7 +1165,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Atomically grab the task, if ->wake_q is !nil already it means -@@ -424,24 +430,32 @@ void wake_q_add(struct wake_q_head *head +@@ -425,24 +431,32 @@ void wake_q_add(struct wake_q_head *head, struct task_struct *task) head->lastp = &node->next; } @@ -1178,3 +1203,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> put_task_struct(task); } } +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch b/debian/patches-rt/0146-rtmutex-add-mutex-implementation-based-on-rtmutex.patch index 50f39f0a1..53f93931b 100644 --- a/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/0146-rtmutex-add-mutex-implementation-based-on-rtmutex.patch @@ -1,17 +1,21 @@ +From f7a01ca80315d2d8df004bdc999eee46341c9206 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:17:03 +0200 -Subject: rtmutex: add mutex implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 146/266] rtmutex: add mutex implementation based on rtmutex +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/mutex_rt.h | 130 ++++++++++++++++++++++++++ - kernel/locking/mutex-rt.c | 223 ++++++++++++++++++++++++++++++++++++++++++++++ + include/linux/mutex_rt.h | 130 ++++++++++++++++++++++ + kernel/locking/mutex-rt.c | 223 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 353 insertions(+) create mode 100644 include/linux/mutex_rt.h create mode 100644 kernel/locking/mutex-rt.c +diff --git a/include/linux/mutex_rt.h b/include/linux/mutex_rt.h +new file mode 100644 +index 000000000000..3fcb5edb1d2b --- /dev/null +++ b/include/linux/mutex_rt.h @@ -0,0 +1,130 @@ @@ -145,6 +149,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); + +#endif +diff --git a/kernel/locking/mutex-rt.c b/kernel/locking/mutex-rt.c +new file mode 100644 +index 000000000000..4f81595c0f52 --- /dev/null +++ b/kernel/locking/mutex-rt.c @@ -0,0 +1,223 @@ @@ -371,3 +378,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + return 1; +} +EXPORT_SYMBOL(atomic_dec_and_mutex_lock); +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch b/debian/patches-rt/0147-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch index 92dfe7722..8cc7793f6 100644 --- a/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/0147-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch @@ -1,7 +1,8 @@ +From fc7abcdbdc3e90275825a91ec4ed00d65b530bbf Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:28:34 +0200 -Subject: rtmutex: add rwsem implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 147/266] rtmutex: add rwsem implementation based on rtmutex +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The RT specific R/W semaphore implementation restricts the number of readers to one because a writer cannot block on multiple readers and inherit its @@ -42,12 +43,15 @@ the approach. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/rwsem_rt.h | 68 ++++++++++ - kernel/locking/rwsem-rt.c | 293 ++++++++++++++++++++++++++++++++++++++++++++++ + include/linux/rwsem_rt.h | 68 +++++++++ + kernel/locking/rwsem-rt.c | 293 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 361 insertions(+) create mode 100644 include/linux/rwsem_rt.h create mode 100644 kernel/locking/rwsem-rt.c +diff --git a/include/linux/rwsem_rt.h b/include/linux/rwsem_rt.h +new file mode 100644 +index 000000000000..2018ff77904a --- /dev/null +++ b/include/linux/rwsem_rt.h @@ -0,0 +1,68 @@ @@ -119,6 +123,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +extern void __downgrade_write(struct rw_semaphore *sem); + +#endif +diff --git a/kernel/locking/rwsem-rt.c b/kernel/locking/rwsem-rt.c +new file mode 100644 +index 000000000000..7d3c5cf3d23d --- /dev/null +++ b/kernel/locking/rwsem-rt.c @@ -0,0 +1,293 @@ @@ -415,3 +422,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + /* Release it and account current as reader */ + __up_write_unlock(sem, WRITER_BIAS - 1, flags); +} +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch b/debian/patches-rt/0148-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch index 253bf7be4..bd36751ec 100644 --- a/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/0148-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch @@ -1,21 +1,25 @@ +From acc07c5cb3fa39f0c7fa8e85cebcdb991ce4e8b3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:18:06 +0200 -Subject: rtmutex: add rwlock implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 148/266] rtmutex: add rwlock implementation based on rtmutex +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The implementation is bias-based, similar to the rwsem implementation. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/rwlock_rt.h | 119 ++++++++++++ - include/linux/rwlock_types_rt.h | 55 +++++ - kernel/locking/rwlock-rt.c | 368 ++++++++++++++++++++++++++++++++++++++++ + include/linux/rwlock_rt.h | 119 +++++++++++ + include/linux/rwlock_types_rt.h | 55 +++++ + kernel/locking/rwlock-rt.c | 368 ++++++++++++++++++++++++++++++++ 3 files changed, 542 insertions(+) create mode 100644 include/linux/rwlock_rt.h create mode 100644 include/linux/rwlock_types_rt.h create mode 100644 kernel/locking/rwlock-rt.c +diff --git a/include/linux/rwlock_rt.h b/include/linux/rwlock_rt.h +new file mode 100644 +index 000000000000..a9c4c2ac4d1f --- /dev/null +++ b/include/linux/rwlock_rt.h @@ -0,0 +1,119 @@ @@ -138,6 +142,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +void __write_rt_unlock(struct rt_rw_lock *lock); + +#endif +diff --git a/include/linux/rwlock_types_rt.h b/include/linux/rwlock_types_rt.h +new file mode 100644 +index 000000000000..546a1f8f1274 --- /dev/null +++ b/include/linux/rwlock_types_rt.h @@ -0,0 +1,55 @@ @@ -196,6 +203,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + } while (0) + +#endif +diff --git a/kernel/locking/rwlock-rt.c b/kernel/locking/rwlock-rt.c +new file mode 100644 +index 000000000000..aebb7ce25bc6 --- /dev/null +++ b/kernel/locking/rwlock-rt.c @@ -0,0 +1,368 @@ @@ -567,3 +577,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + do_rwlock_rt_init(rwlock, name, key); +} +EXPORT_SYMBOL(__rt_rwlock_init); +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch b/debian/patches-rt/0149-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch index 00b6166da..c38295068 100644 --- a/debian/patches-rt/rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch +++ b/debian/patches-rt/0149-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch @@ -1,7 +1,8 @@ +From a41d31d3376d02abc89addebb2fba03b5df121e4 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 11 Jan 2019 21:16:31 +0100 -Subject: [PATCH] rtmutex/rwlock: preserve state like a sleeping lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 149/266] rtmutex/rwlock: preserve state like a sleeping lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The rwlock is spinning while acquiring a lock. Therefore it must become a sleeping lock on RT and preserve its task state while sleeping and @@ -11,12 +12,14 @@ Reported-by: Joe Korty <Joe.Korty@concurrent-rt.com> Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/locking/rwlock-rt.c | 2 +- + kernel/locking/rwlock-rt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/locking/rwlock-rt.c b/kernel/locking/rwlock-rt.c +index aebb7ce25bc6..8f90afe111ce 100644 --- a/kernel/locking/rwlock-rt.c +++ b/kernel/locking/rwlock-rt.c -@@ -128,7 +128,7 @@ void __sched __read_rt_lock(struct rt_rw +@@ -128,7 +128,7 @@ void __sched __read_rt_lock(struct rt_rw_lock *lock) * That would put Reader1 behind the writer waiting on * Reader2 to call read_unlock() which might be unbound. */ @@ -25,3 +28,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rt_spin_lock_slowlock_locked(m, &waiter, flags); /* * The slowlock() above is guaranteed to return with the rtmutex is +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch b/debian/patches-rt/0150-rtmutex-wire-up-RT-s-locking.patch index 1119da9f0..a9c21386c 100644 --- a/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch +++ b/debian/patches-rt/0150-rtmutex-wire-up-RT-s-locking.patch @@ -1,21 +1,24 @@ +From d32229387d83bbad7273b5e77458d802dccb8f75 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:31:14 +0200 -Subject: rtmutex: wire up RT's locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 150/266] rtmutex: wire up RT's locking +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/mutex.h | 20 +++++++++++++------- - include/linux/rwsem.h | 11 +++++++++++ - include/linux/spinlock.h | 12 +++++++++++- - include/linux/spinlock_api_smp.h | 4 +++- - include/linux/spinlock_types.h | 11 ++++++++--- - kernel/locking/Makefile | 9 ++++++++- - kernel/locking/spinlock.c | 7 +++++++ - kernel/locking/spinlock_debug.c | 5 +++++ + include/linux/mutex.h | 20 +++++++++++++------- + include/linux/rwsem.h | 11 +++++++++++ + include/linux/spinlock.h | 12 +++++++++++- + include/linux/spinlock_api_smp.h | 4 +++- + include/linux/spinlock_types.h | 11 ++++++++--- + kernel/locking/Makefile | 9 ++++++++- + kernel/locking/spinlock.c | 7 +++++++ + kernel/locking/spinlock_debug.c | 5 +++++ 8 files changed, 66 insertions(+), 13 deletions(-) +diff --git a/include/linux/mutex.h b/include/linux/mutex.h +index 3093dd162424..cad906f54d0a 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -22,6 +22,17 @@ @@ -50,13 +53,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define __MUTEX_INITIALIZER(lockname) \ { .owner = ATOMIC_LONG_INIT(0) \ , .wait_lock = __SPIN_LOCK_UNLOCKED(lockname.wait_lock) \ -@@ -229,4 +233,6 @@ mutex_trylock_recursive(struct mutex *lo +@@ -229,4 +233,6 @@ mutex_trylock_recursive(struct mutex *lock) return mutex_trylock(lock); } +#endif /* !PREEMPT_RT_FULL */ + #endif /* __LINUX_MUTEX_H */ +diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h +index ab93b6eae696..b1e32373f44f 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -20,6 +20,10 @@ @@ -70,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct rw_semaphore; #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK -@@ -114,6 +118,13 @@ static inline int rwsem_is_contended(str +@@ -114,6 +118,13 @@ static inline int rwsem_is_contended(struct rw_semaphore *sem) return !list_empty(&sem->wait_list); } @@ -84,9 +89,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * lock for reading */ +diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h +index e089157dcf97..5f5ad0630a26 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h -@@ -298,7 +298,11 @@ static inline void do_raw_spin_unlock(ra +@@ -298,7 +298,11 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) }) /* Include rwlock functions */ @@ -99,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Pull the _spin_*()/_read_*()/_write_*() functions/declarations: -@@ -309,6 +313,10 @@ static inline void do_raw_spin_unlock(ra +@@ -309,6 +313,10 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) # include <linux/spinlock_api_up.h> #endif @@ -110,7 +117,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Map the spin_lock functions to the raw variants for PREEMPT_RT=n */ -@@ -429,6 +437,8 @@ static __always_inline int spin_is_conte +@@ -429,6 +437,8 @@ static __always_inline int spin_is_contended(spinlock_t *lock) #define assert_spin_locked(lock) assert_raw_spin_locked(&(lock)->rlock) @@ -119,9 +126,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Pull the atomic_t declaration: * (asm-mips/atomic.h needs above definitions) +diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h +index 42dfab89e740..29d99ae5a8ab 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h -@@ -187,6 +187,8 @@ static inline int __raw_spin_trylock_bh( +@@ -187,6 +187,8 @@ static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) return 0; } @@ -131,6 +140,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +#endif #endif /* __LINUX_SPINLOCK_API_SMP_H */ +diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h +index 5c8664d57fb8..10bac715ea96 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h @@ -11,8 +11,13 @@ @@ -150,6 +161,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +#endif #endif /* __LINUX_SPINLOCK_TYPES_H */ +diff --git a/kernel/locking/Makefile b/kernel/locking/Makefile +index 392c7f23af76..c0bf04b6b965 100644 --- a/kernel/locking/Makefile +++ b/kernel/locking/Makefile @@ -3,7 +3,7 @@ @@ -161,7 +174,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ifdef CONFIG_FUNCTION_TRACER CFLAGS_REMOVE_lockdep.o = $(CC_FLAGS_FTRACE) -@@ -12,7 +12,11 @@ CFLAGS_REMOVE_mutex-debug.o = $(CC_FLAGS +@@ -12,7 +12,11 @@ CFLAGS_REMOVE_mutex-debug.o = $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_rtmutex-debug.o = $(CC_FLAGS_FTRACE) endif @@ -185,9 +198,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> obj-$(CONFIG_QUEUED_RWLOCKS) += qrwlock.o obj-$(CONFIG_LOCK_TORTURE_TEST) += locktorture.o obj-$(CONFIG_WW_MUTEX_SELFTEST) += test-ww_mutex.o +diff --git a/kernel/locking/spinlock.c b/kernel/locking/spinlock.c +index 936f3d14dd6b..e89b70f474af 100644 --- a/kernel/locking/spinlock.c +++ b/kernel/locking/spinlock.c -@@ -117,8 +117,11 @@ void __lockfunc __raw_##op##_lock_bh(loc +@@ -117,8 +117,11 @@ void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \ * __[spin|read|write]_lock_bh() */ BUILD_LOCK_OPS(spin, raw_spinlock); @@ -199,7 +214,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #endif -@@ -202,6 +205,8 @@ void __lockfunc _raw_spin_unlock_bh(raw_ +@@ -202,6 +205,8 @@ void __lockfunc _raw_spin_unlock_bh(raw_spinlock_t *lock) EXPORT_SYMBOL(_raw_spin_unlock_bh); #endif @@ -208,7 +223,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifndef CONFIG_INLINE_READ_TRYLOCK int __lockfunc _raw_read_trylock(rwlock_t *lock) { -@@ -346,6 +351,8 @@ void __lockfunc _raw_write_unlock_bh(rwl +@@ -346,6 +351,8 @@ void __lockfunc _raw_write_unlock_bh(rwlock_t *lock) EXPORT_SYMBOL(_raw_write_unlock_bh); #endif @@ -217,9 +232,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_DEBUG_LOCK_ALLOC void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) +diff --git a/kernel/locking/spinlock_debug.c b/kernel/locking/spinlock_debug.c +index 9aa0fccd5d43..76d0b40d9193 100644 --- a/kernel/locking/spinlock_debug.c +++ b/kernel/locking/spinlock_debug.c -@@ -31,6 +31,7 @@ void __raw_spin_lock_init(raw_spinlock_t +@@ -31,6 +31,7 @@ void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, EXPORT_SYMBOL(__raw_spin_lock_init); @@ -227,7 +244,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void __rwlock_init(rwlock_t *lock, const char *name, struct lock_class_key *key) { -@@ -48,6 +49,7 @@ void __rwlock_init(rwlock_t *lock, const +@@ -48,6 +49,7 @@ void __rwlock_init(rwlock_t *lock, const char *name, } EXPORT_SYMBOL(__rwlock_init); @@ -235,7 +252,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void spin_dump(raw_spinlock_t *lock, const char *msg) { -@@ -135,6 +137,7 @@ void do_raw_spin_unlock(raw_spinlock_t * +@@ -135,6 +137,7 @@ void do_raw_spin_unlock(raw_spinlock_t *lock) arch_spin_unlock(&lock->raw_lock); } @@ -249,3 +266,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } + +#endif +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/debian/patches-rt/0151-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch index f1b8f90d4..8420a6198 100644 --- a/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ b/debian/patches-rt/0151-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch @@ -1,15 +1,18 @@ +From 20c592a758fb9c0ba36cd914cd959e9d3333ab25 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 12 Oct 2017 17:34:38 +0200 -Subject: rtmutex: add ww_mutex addon for mutex-rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 151/266] rtmutex: add ww_mutex addon for mutex-rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/locking/rtmutex.c | 271 ++++++++++++++++++++++++++++++++++++++-- - kernel/locking/rtmutex_common.h | 2 - kernel/locking/rwsem-rt.c | 2 + kernel/locking/rtmutex.c | 271 ++++++++++++++++++++++++++++++-- + kernel/locking/rtmutex_common.h | 2 + + kernel/locking/rwsem-rt.c | 2 +- 3 files changed, 261 insertions(+), 14 deletions(-) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 88df1ff7ca2d..1f2dc2dfe2e7 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -23,6 +23,7 @@ @@ -61,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, struct rt_mutex_waiter *waiter) -@@ -1523,7 +1558,8 @@ void rt_mutex_init_waiter(struct rt_mute +@@ -1523,7 +1558,8 @@ void rt_mutex_init_waiter(struct rt_mutex_waiter *waiter, bool savestate) static int __sched __rt_mutex_slowlock(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, @@ -71,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { int ret = 0; -@@ -1541,6 +1577,12 @@ static int __sched +@@ -1541,6 +1577,12 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state, break; } @@ -84,7 +87,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock_irq(&lock->wait_lock); debug_rt_mutex_print_deadlock(waiter); -@@ -1575,16 +1617,106 @@ static void rt_mutex_handle_deadlock(int +@@ -1575,16 +1617,106 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock, } } @@ -192,7 +195,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> set_current_state(state); -@@ -1594,14 +1726,24 @@ int __sched rt_mutex_slowlock_locked(str +@@ -1594,14 +1726,24 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, ret = task_blocks_on_rt_mutex(lock, waiter, current, chwalk); @@ -220,7 +223,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -1618,7 +1760,8 @@ int __sched rt_mutex_slowlock_locked(str +@@ -1618,7 +1760,8 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, static int __sched rt_mutex_slowlock(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, @@ -230,7 +233,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { struct rt_mutex_waiter waiter; unsigned long flags; -@@ -1636,7 +1779,8 @@ rt_mutex_slowlock(struct rt_mutex *lock, +@@ -1636,7 +1779,8 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, */ raw_spin_lock_irqsave(&lock->wait_lock, flags); @@ -240,7 +243,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_unlock_irqrestore(&lock->wait_lock, flags); -@@ -1766,29 +1910,33 @@ static bool __sched rt_mutex_slowunlock( +@@ -1766,29 +1910,33 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, */ static inline int rt_mutex_fastlock(struct rt_mutex *lock, int state, @@ -278,7 +281,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static inline int -@@ -1833,7 +1981,7 @@ rt_mutex_fastunlock(struct rt_mutex *loc +@@ -1833,7 +1981,7 @@ rt_mutex_fastunlock(struct rt_mutex *lock, int __sched __rt_mutex_lock_state(struct rt_mutex *lock, int state) { might_sleep(); @@ -287,7 +290,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /** -@@ -1953,6 +2101,7 @@ rt_mutex_timed_lock(struct rt_mutex *loc +@@ -1953,6 +2101,7 @@ rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout) mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); ret = rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout, RT_MUTEX_MIN_CHAINWALK, @@ -295,7 +298,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rt_mutex_slowlock); if (ret) mutex_release(&lock->dep_map, 1, _RET_IP_); -@@ -2300,7 +2449,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -2300,7 +2449,7 @@ int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, raw_spin_lock_irq(&lock->wait_lock); /* sleep on the mutex */ set_current_state(TASK_INTERRUPTIBLE); @@ -304,7 +307,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * try_to_take_rt_mutex() sets the waiter bit unconditionally. We might * have to fix that up. -@@ -2385,3 +2534,99 @@ bool rt_mutex_cleanup_proxy_lock(struct +@@ -2385,3 +2534,99 @@ bool rt_mutex_cleanup_proxy_lock(struct rt_mutex *lock, return cleanup; } @@ -404,9 +407,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +} +EXPORT_SYMBOL(__rt_mutex_owner_current); +#endif +diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h +index 6fcf0a3e180d..546aaf058b9e 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h -@@ -165,6 +165,7 @@ extern void rt_mutex_postunlock(struct w +@@ -165,6 +165,7 @@ extern void rt_mutex_postunlock(struct wake_q_head *wake_q, struct wake_q_head *wake_sleeper_q); /* RW semaphore special interface */ @@ -414,7 +419,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> extern int __rt_mutex_lock_state(struct rt_mutex *lock, int state); extern int __rt_mutex_trylock(struct rt_mutex *lock); -@@ -172,6 +173,7 @@ extern void __rt_mutex_unlock(struct rt_ +@@ -172,6 +173,7 @@ extern void __rt_mutex_unlock(struct rt_mutex *lock); int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk, @@ -422,9 +427,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct rt_mutex_waiter *waiter); void __sched rt_spin_lock_slowlock_locked(struct rt_mutex *lock, struct rt_mutex_waiter *waiter, +diff --git a/kernel/locking/rwsem-rt.c b/kernel/locking/rwsem-rt.c +index 7d3c5cf3d23d..660e22caf709 100644 --- a/kernel/locking/rwsem-rt.c +++ b/kernel/locking/rwsem-rt.c -@@ -131,7 +131,7 @@ static int __sched __down_read_common(st +@@ -131,7 +131,7 @@ static int __sched __down_read_common(struct rw_semaphore *sem, int state) */ rt_mutex_init_waiter(&waiter, false); ret = rt_mutex_slowlock_locked(m, state, NULL, RT_MUTEX_MIN_CHAINWALK, @@ -433,3 +440,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * The slowlock() above is guaranteed to return with the rtmutex (for * ret = 0) is now held, so there can't be a writer active. Increment +-- +2.20.1 + diff --git a/debian/patches-rt/kconfig-preempt-rt-full.patch b/debian/patches-rt/0152-kconfig-Add-PREEMPT_RT_FULL.patch index b0b5ff986..24143c667 100644 --- a/debian/patches-rt/kconfig-preempt-rt-full.patch +++ b/debian/patches-rt/0152-kconfig-Add-PREEMPT_RT_FULL.patch @@ -1,25 +1,30 @@ -Subject: kconfig: Add PREEMPT_RT_FULL +From 7f8d53956c9bfe7b7ec4cb4457859c31b590a0d4 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 29 Jun 2011 14:58:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 152/266] kconfig: Add PREEMPT_RT_FULL +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Introduce the final symbol for PREEMPT_RT_FULL. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - init/Makefile | 2 +- - kernel/Kconfig.preempt | 8 ++++++++ - scripts/mkcompile_h | 4 +++- + init/Makefile | 2 +- + kernel/Kconfig.preempt | 8 ++++++++ + scripts/mkcompile_h | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) +diff --git a/init/Makefile b/init/Makefile +index a3e5ce2bcf08..7779232563ae 100644 --- a/init/Makefile +++ b/init/Makefile -@@ -34,4 +34,4 @@ mounts-$(CONFIG_BLK_DEV_MD) += do_mounts +@@ -34,4 +34,4 @@ silent_chk_compile.h = : include/generated/compile.h: FORCE @$($(quiet)chk_compile.h) $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ - "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)" + "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CONFIG_PREEMPT_RT_FULL)" "$(CC) $(KBUILD_CFLAGS)" +diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt +index 027db5976c2f..907d72b3ba95 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -69,6 +69,14 @@ config PREEMPT_RTB @@ -37,6 +42,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> endchoice config PREEMPT_COUNT +diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h +index 87f1fc9801d7..f67b15236936 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h @@ -5,7 +5,8 @@ TARGET=$1 @@ -57,3 +64,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP" # Truncate to maximum length +-- +2.20.1 + diff --git a/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch b/debian/patches-rt/0153-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch index a1f577b71..53dd5f515 100644 --- a/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch +++ b/debian/patches-rt/0153-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch @@ -1,7 +1,9 @@ +From a3f1ea501d0a88c91a226ab5abfd1426fd6d0d03 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka <mpatocka@redhat.com> Date: Mon, 13 Nov 2017 12:56:53 -0500 -Subject: [PATCH] locking/rt-mutex: fix deadlock in device mapper / block-IO -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 153/266] locking/rt-mutex: fix deadlock in device mapper / + block-IO +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz When some block device driver creates a bio and submits it to another block device driver, the bio is added to current->bio_list (in order to @@ -33,9 +35,11 @@ CC: stable-rt@vger.kernel.org Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/locking/rtmutex.c | 13 +++++++++++++ + kernel/locking/rtmutex.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 1f2dc2dfe2e7..b38c3a92dce8 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -24,6 +24,7 @@ @@ -46,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "rtmutex_common.h" -@@ -1919,6 +1920,15 @@ rt_mutex_fastlock(struct rt_mutex *lock, +@@ -1919,6 +1920,15 @@ rt_mutex_fastlock(struct rt_mutex *lock, int state, if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) return 0; @@ -62,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK, ww_ctx); } -@@ -1936,6 +1946,9 @@ rt_mutex_timed_fastlock(struct rt_mutex +@@ -1936,6 +1946,9 @@ rt_mutex_timed_fastlock(struct rt_mutex *lock, int state, likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) return 0; @@ -72,3 +76,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return slowfn(lock, state, timeout, chwalk, ww_ctx); } +-- +2.20.1 + diff --git a/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch b/debian/patches-rt/0154-locking-rt-mutex-Flush-block-plug-on-__down_read.patch index 6966fd07a..ffca4e533 100644 --- a/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch +++ b/debian/patches-rt/0154-locking-rt-mutex-Flush-block-plug-on-__down_read.patch @@ -1,7 +1,8 @@ +From 3766a1ad7f39dee4d0904e695dbce0e5b57c2793 Mon Sep 17 00:00:00 2001 From: Scott Wood <swood@redhat.com> Date: Fri, 4 Jan 2019 15:33:21 -0500 -Subject: [PATCH] locking/rt-mutex: Flush block plug on __down_read() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 154/266] locking/rt-mutex: Flush block plug on __down_read() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz __down_read() bypasses the rtmutex frontend to call rt_mutex_slowlock_locked() directly, and thus it needs to call @@ -11,9 +12,11 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Scott Wood <swood@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/locking/rwsem-rt.c | 9 +++++++++ + kernel/locking/rwsem-rt.c | 9 +++++++++ 1 file changed, 9 insertions(+) +diff --git a/kernel/locking/rwsem-rt.c b/kernel/locking/rwsem-rt.c +index 660e22caf709..f518495bd6cc 100644 --- a/kernel/locking/rwsem-rt.c +++ b/kernel/locking/rwsem-rt.c @@ -1,5 +1,6 @@ @@ -23,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <linux/rwsem.h> #include <linux/sched/debug.h> #include <linux/sched/signal.h> -@@ -87,6 +88,14 @@ static int __sched __down_read_common(st +@@ -87,6 +88,14 @@ static int __sched __down_read_common(struct rw_semaphore *sem, int state) if (__down_read_trylock(sem)) return 0; @@ -38,3 +41,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> might_sleep(); raw_spin_lock_irq(&m->wait_lock); +-- +2.20.1 + diff --git a/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch b/debian/patches-rt/0155-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch index 52b3b0348..e5dd7cf8e 100644 --- a/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch +++ b/debian/patches-rt/0155-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch @@ -1,8 +1,9 @@ +From 4a2ad275c5119a9642537809ba478fadb723f17b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 16 Nov 2017 16:48:48 +0100 -Subject: [PATCH] locking/rtmutex: re-init the wait_lock in +Subject: [PATCH 155/266] locking/rtmutex: re-init the wait_lock in rt_mutex_init_proxy_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz We could provide a key-class for the lockdep (and fixup all callers) or move the init to all callers (like it was) in order to avoid lockdep @@ -11,12 +12,14 @@ seeing a double-lock of the wait_lock. Reported-by: Fernando Lopez-Lezcano <nando@ccrma.Stanford.EDU> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/locking/rtmutex.c | 8 ++++++++ + kernel/locking/rtmutex.c | 8 ++++++++ 1 file changed, 8 insertions(+) +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index b38c3a92dce8..94788662b2f2 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -2281,6 +2281,14 @@ void rt_mutex_init_proxy_locked(struct r +@@ -2281,6 +2281,14 @@ void rt_mutex_init_proxy_locked(struct rt_mutex *lock, struct task_struct *proxy_owner) { __rt_mutex_init(lock, NULL, NULL); @@ -31,3 +34,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> debug_rt_mutex_proxy_lock(lock, proxy_owner); rt_mutex_set_owner(lock, proxy_owner); } +-- +2.20.1 + diff --git a/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/debian/patches-rt/0156-ptrace-fix-ptrace-vs-tasklist_lock-race.patch index ca4d2b18e..57d7198d8 100644 --- a/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ b/debian/patches-rt/0156-ptrace-fix-ptrace-vs-tasklist_lock-race.patch @@ -1,7 +1,8 @@ +From 7877aa7d4dadcb60285a6e0399bac95709519f5f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 29 Aug 2013 18:21:04 +0200 -Subject: ptrace: fix ptrace vs tasklist_lock race -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 156/266] ptrace: fix ptrace vs tasklist_lock race +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz As explained by Alexander Fyodorov <halcy@yandex.ru>: @@ -24,11 +25,13 @@ taken in case the caller is interrupted between looking into ->state and Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/sched.h | 49 +++++++++++++++++++++++++++++++++++++++++++++---- - kernel/ptrace.c | 9 ++++++++- - kernel/sched/core.c | 17 +++++++++++++++-- + include/linux/sched.h | 49 +++++++++++++++++++++++++++++++++++++++---- + kernel/ptrace.c | 9 +++++++- + kernel/sched/core.c | 17 +++++++++++++-- 3 files changed, 68 insertions(+), 7 deletions(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 50c1c498284d..d16eaae0b381 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -101,12 +101,8 @@ struct task_group; @@ -44,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define task_contributes_to_load(task) ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ (task->flags & PF_FROZEN) == 0 && \ (task->state & TASK_NOLOAD) == 0) -@@ -1709,6 +1705,51 @@ static inline int test_tsk_need_resched( +@@ -1709,6 +1705,51 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); } @@ -96,9 +99,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * cond_resched() and cond_resched_lock(): latency reduction via * explicit rescheduling in places that are safe. The return +diff --git a/kernel/ptrace.c b/kernel/ptrace.c +index 21fec73d45d4..9c8d6f9f3a3a 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c -@@ -175,7 +175,14 @@ static bool ptrace_freeze_traced(struct +@@ -175,7 +175,14 @@ static bool ptrace_freeze_traced(struct task_struct *task) spin_lock_irq(&task->sighand->siglock); if (task_is_traced(task) && !__fatal_signal_pending(task)) { @@ -114,9 +119,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ret = true; } spin_unlock_irq(&task->sighand->siglock); +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index e1ac20ada353..64524f66c559 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1347,6 +1347,18 @@ int migrate_swap(struct task_struct *cur +@@ -1348,6 +1348,18 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p, } #endif /* CONFIG_NUMA_BALANCING */ @@ -135,7 +142,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * wait_task_inactive - wait for a thread to unschedule. * -@@ -1391,7 +1403,7 @@ unsigned long wait_task_inactive(struct +@@ -1392,7 +1404,7 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state) * is actually now running somewhere else! */ while (task_running(rq, p)) { @@ -144,7 +151,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; cpu_relax(); } -@@ -1406,7 +1418,8 @@ unsigned long wait_task_inactive(struct +@@ -1407,7 +1419,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; @@ -154,3 +161,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ncsw = p->nvcsw | LONG_MIN; /* sets MSB */ task_rq_unlock(rq, p, &rf); +-- +2.20.1 + diff --git a/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch b/debian/patches-rt/0157-rtmutex-annotate-sleeping-lock-context.patch index e5d2c3017..6f4e4a9d9 100644 --- a/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch +++ b/debian/patches-rt/0157-rtmutex-annotate-sleeping-lock-context.patch @@ -1,7 +1,8 @@ +From f9b4e68860fd0bdd4d304242f7157d827b6704bd Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 21 Sep 2017 14:25:13 +0200 -Subject: [PATCH] rtmutex: annotate sleeping lock context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 157/266] rtmutex: annotate sleeping lock context +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The RCU code complains on schedule() within a rcu_readlock() section. The valid scenario on -RT is if a sleeping is held. In order to suppress @@ -24,14 +25,16 @@ cpu_chill() to avoid the RCU warning from there. Reported-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/preempt.h | 9 +++++++++ - include/linux/sched.h | 26 ++++++++++++++++++++++++++ - kernel/locking/rtmutex.c | 12 ++++++++++-- - kernel/locking/rwlock-rt.c | 18 ++++++++++++++---- - kernel/rcu/tree_plugin.h | 6 +++++- - kernel/sched/core.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ + include/linux/preempt.h | 9 ++++++++ + include/linux/sched.h | 26 ++++++++++++++++++++++ + kernel/locking/rtmutex.c | 12 ++++++++-- + kernel/locking/rwlock-rt.c | 18 +++++++++++---- + kernel/rcu/tree_plugin.h | 6 ++++- + kernel/sched/core.c | 45 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 109 insertions(+), 7 deletions(-) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 27c3176d88d2..9eafc34898b4 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -211,6 +211,15 @@ extern void migrate_enable(void); @@ -50,6 +53,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #else #define migrate_disable() barrier() #define migrate_enable() barrier() +diff --git a/include/linux/sched.h b/include/linux/sched.h +index d16eaae0b381..9c40729f268b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -673,6 +673,15 @@ struct task_struct { @@ -68,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #endif #ifdef CONFIG_PREEMPT_RCU -@@ -1802,6 +1811,23 @@ static __always_inline bool need_resched +@@ -1802,6 +1811,23 @@ static __always_inline bool need_resched(void) return unlikely(tif_need_resched()); } @@ -92,9 +97,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Wrappers for p->thread_info->cpu access. No-op on UP. */ +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 94788662b2f2..2a9bf2443acc 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1141,6 +1141,7 @@ void __sched rt_spin_lock_slowunlock(str +@@ -1141,6 +1141,7 @@ void __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) void __lockfunc rt_spin_lock(spinlock_t *lock) { @@ -102,7 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> migrate_disable(); spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -@@ -1155,6 +1156,7 @@ void __lockfunc __rt_spin_lock(struct rt +@@ -1155,6 +1156,7 @@ void __lockfunc __rt_spin_lock(struct rt_mutex *lock) #ifdef CONFIG_DEBUG_LOCK_ALLOC void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass) { @@ -110,7 +117,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> migrate_disable(); spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -@@ -1168,6 +1170,7 @@ void __lockfunc rt_spin_unlock(spinlock_ +@@ -1168,6 +1170,7 @@ void __lockfunc rt_spin_unlock(spinlock_t *lock) spin_release(&lock->dep_map, 1, _RET_IP_); rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); migrate_enable(); @@ -118,7 +125,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL(rt_spin_unlock); -@@ -1193,12 +1196,15 @@ int __lockfunc rt_spin_trylock(spinlock_ +@@ -1193,12 +1196,15 @@ int __lockfunc rt_spin_trylock(spinlock_t *lock) { int ret; @@ -136,7 +143,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } EXPORT_SYMBOL(rt_spin_trylock); -@@ -1210,6 +1216,7 @@ int __lockfunc rt_spin_trylock_bh(spinlo +@@ -1210,6 +1216,7 @@ int __lockfunc rt_spin_trylock_bh(spinlock_t *lock) local_bh_disable(); ret = __rt_mutex_trylock(&lock->lock); if (ret) { @@ -144,7 +151,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> migrate_disable(); spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); } else -@@ -1225,6 +1232,7 @@ int __lockfunc rt_spin_trylock_irqsave(s +@@ -1225,6 +1232,7 @@ int __lockfunc rt_spin_trylock_irqsave(spinlock_t *lock, unsigned long *flags) *flags = 0; ret = __rt_mutex_trylock(&lock->lock); if (ret) { @@ -152,9 +159,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> migrate_disable(); spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); } +diff --git a/kernel/locking/rwlock-rt.c b/kernel/locking/rwlock-rt.c +index 8f90afe111ce..c3b91205161c 100644 --- a/kernel/locking/rwlock-rt.c +++ b/kernel/locking/rwlock-rt.c -@@ -305,12 +305,15 @@ int __lockfunc rt_read_trylock(rwlock_t +@@ -305,12 +305,15 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock) { int ret; @@ -172,7 +181,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } EXPORT_SYMBOL(rt_read_trylock); -@@ -319,18 +322,22 @@ int __lockfunc rt_write_trylock(rwlock_t +@@ -319,18 +322,22 @@ int __lockfunc rt_write_trylock(rwlock_t *rwlock) { int ret; @@ -205,7 +214,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> migrate_disable(); rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); do_write_rt_lock(rwlock); -@@ -350,6 +358,7 @@ void __lockfunc rt_read_unlock(rwlock_t +@@ -350,6 +358,7 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock) rwlock_release(&rwlock->dep_map, 1, _RET_IP_); do_read_rt_unlock(rwlock); migrate_enable(); @@ -213,7 +222,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL(rt_read_unlock); -@@ -358,6 +367,7 @@ void __lockfunc rt_write_unlock(rwlock_t +@@ -358,6 +367,7 @@ void __lockfunc rt_write_unlock(rwlock_t *rwlock) rwlock_release(&rwlock->dep_map, 1, _RET_IP_); do_write_rt_unlock(rwlock); migrate_enable(); @@ -221,9 +230,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL(rt_write_unlock); +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index a97c20ea9bce..564e3927e7b0 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h -@@ -337,9 +337,13 @@ static void rcu_preempt_note_context_swi +@@ -337,9 +337,13 @@ static void rcu_preempt_note_context_switch(bool preempt) struct task_struct *t = current; struct rcu_data *rdp; struct rcu_node *rnp; @@ -238,9 +249,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (t->rcu_read_lock_nesting > 0 && !t->rcu_read_unlock_special.b.blocked) { +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 64524f66c559..719b41d6525c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -7307,4 +7307,49 @@ void migrate_enable(void) +@@ -7308,4 +7308,49 @@ void migrate_enable(void) preempt_enable(); } EXPORT_SYMBOL(migrate_enable); @@ -290,3 +303,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +} +EXPORT_SYMBOL(migrate_enable); #endif +-- +2.20.1 + diff --git a/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch b/debian/patches-rt/0158-sched-migrate_disable-fallback-to-preempt_disable-in.patch index ddb277c93..cecf44cbf 100644 --- a/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch +++ b/debian/patches-rt/0158-sched-migrate_disable-fallback-to-preempt_disable-in.patch @@ -1,8 +1,9 @@ +From d26947b7516fd68bec9e5f63c62e710bd13c44f3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 5 Jul 2018 14:44:51 +0200 -Subject: [PATCH] sched/migrate_disable: fallback to preempt_disable() instead - barrier() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 158/266] sched/migrate_disable: fallback to preempt_disable() + instead barrier() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On SMP + !RT migrate_disable() is still around. It is not part of spin_lock() anymore so it has almost no users. However the futex code has a workaround for @@ -39,12 +40,14 @@ Cc: stable-rt@vger.kernel.org Reported-by: joe.korty@concurrent-rt.com Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/preempt.h | 6 +++--- - include/linux/sched.h | 4 ++-- - kernel/sched/core.c | 23 +++++++++++------------ - kernel/sched/debug.c | 2 +- + include/linux/preempt.h | 6 +++--- + include/linux/sched.h | 4 ++-- + kernel/sched/core.c | 23 +++++++++++------------ + kernel/sched/debug.c | 2 +- 4 files changed, 17 insertions(+), 18 deletions(-) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 9eafc34898b4..ed8413e7140f 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -204,7 +204,7 @@ do { \ @@ -56,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> extern void migrate_disable(void); extern void migrate_enable(void); -@@ -221,8 +221,8 @@ static inline int __migrate_disabled(str +@@ -221,8 +221,8 @@ static inline int __migrate_disabled(struct task_struct *p) } #else @@ -67,6 +70,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline int __migrate_disabled(struct task_struct *p) { return 0; +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 9c40729f268b..7cbef398ac48 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -667,7 +667,7 @@ struct task_struct { @@ -88,9 +93,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int migrate_disable_atomic; # endif #endif +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 719b41d6525c..1ba8ec17992e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1029,7 +1029,7 @@ void set_cpus_allowed_common(struct task +@@ -1030,7 +1030,7 @@ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_ma p->nr_cpus_allowed = cpumask_weight(new_mask); } @@ -99,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int __migrate_disabled(struct task_struct *p) { return p->migrate_disable; -@@ -1069,7 +1069,7 @@ static void __do_set_cpus_allowed_tail(s +@@ -1070,7 +1070,7 @@ static void __do_set_cpus_allowed_tail(struct task_struct *p, void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) { @@ -108,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (__migrate_disabled(p)) { lockdep_assert_held(&p->pi_lock); -@@ -1142,7 +1142,7 @@ static int __set_cpus_allowed_ptr(struct +@@ -1143,7 +1143,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, if (cpumask_test_cpu(task_cpu(p), new_mask) || __migrate_disabled(p)) goto out; @@ -117,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (__migrate_disabled(p)) { p->migrate_disable_update = 1; goto out; -@@ -7163,7 +7163,7 @@ const u32 sched_prio_to_wmult[40] = { +@@ -7164,7 +7164,7 @@ const u32 sched_prio_to_wmult[40] = { #undef CREATE_TRACE_POINTS @@ -126,7 +133,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline void update_nr_migratory(struct task_struct *p, long delta) -@@ -7311,45 +7311,44 @@ EXPORT_SYMBOL(migrate_enable); +@@ -7312,45 +7312,44 @@ EXPORT_SYMBOL(migrate_enable); #elif !defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE) void migrate_disable(void) { @@ -179,9 +186,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL(migrate_enable); #endif +diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c +index a719e44debdf..429078602ed7 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c -@@ -978,7 +978,7 @@ void proc_sched_show_task(struct task_st +@@ -978,7 +978,7 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, P(dl.runtime); P(dl.deadline); } @@ -190,3 +199,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> P(migrate_disable); #endif P(nr_cpus_allowed); +-- +2.20.1 + diff --git a/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/debian/patches-rt/0159-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch index 15b595f98..175ef88f8 100644 --- a/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ b/debian/patches-rt/0159-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch @@ -1,8 +1,9 @@ +From 5777bab1456912686ec85f494201ea7b509af1c7 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 4 Aug 2017 17:40:42 +0200 -Subject: [PATCH 1/2] locking: don't check for __LINUX_SPINLOCK_TYPES_H on -RT - archs -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 159/266] locking: don't check for __LINUX_SPINLOCK_TYPES_H on + -RT archs +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Upstream uses arch_spinlock_t within spinlock_t and requests that spinlock_types.h header file is included first. @@ -14,18 +15,20 @@ Therefore I am dropping that check. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/alpha/include/asm/spinlock_types.h | 4 ---- - arch/arm/include/asm/spinlock_types.h | 4 ---- - arch/arm64/include/asm/spinlock_types.h | 4 ---- - arch/hexagon/include/asm/spinlock_types.h | 4 ---- - arch/ia64/include/asm/spinlock_types.h | 4 ---- - arch/powerpc/include/asm/spinlock_types.h | 4 ---- - arch/s390/include/asm/spinlock_types.h | 4 ---- - arch/sh/include/asm/spinlock_types.h | 4 ---- - arch/xtensa/include/asm/spinlock_types.h | 4 ---- - include/linux/spinlock_types_up.h | 4 ---- + arch/alpha/include/asm/spinlock_types.h | 4 ---- + arch/arm/include/asm/spinlock_types.h | 4 ---- + arch/arm64/include/asm/spinlock_types.h | 4 ---- + arch/hexagon/include/asm/spinlock_types.h | 4 ---- + arch/ia64/include/asm/spinlock_types.h | 4 ---- + arch/powerpc/include/asm/spinlock_types.h | 4 ---- + arch/s390/include/asm/spinlock_types.h | 4 ---- + arch/sh/include/asm/spinlock_types.h | 4 ---- + arch/xtensa/include/asm/spinlock_types.h | 4 ---- + include/linux/spinlock_types_up.h | 4 ---- 10 files changed, 40 deletions(-) +diff --git a/arch/alpha/include/asm/spinlock_types.h b/arch/alpha/include/asm/spinlock_types.h +index 1d5716bc060b..6883bc952d22 100644 --- a/arch/alpha/include/asm/spinlock_types.h +++ b/arch/alpha/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -39,6 +42,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> typedef struct { volatile unsigned int lock; } arch_spinlock_t; +diff --git a/arch/arm/include/asm/spinlock_types.h b/arch/arm/include/asm/spinlock_types.h +index 5976958647fe..a37c0803954b 100644 --- a/arch/arm/include/asm/spinlock_types.h +++ b/arch/arm/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -52,6 +57,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define TICKET_SHIFT 16 typedef struct { +diff --git a/arch/arm64/include/asm/spinlock_types.h b/arch/arm64/include/asm/spinlock_types.h +index a157ff465e27..f952fdda8346 100644 --- a/arch/arm64/include/asm/spinlock_types.h +++ b/arch/arm64/include/asm/spinlock_types.h @@ -16,10 +16,6 @@ @@ -65,6 +72,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <asm-generic/qspinlock_types.h> #include <asm-generic/qrwlock_types.h> +diff --git a/arch/hexagon/include/asm/spinlock_types.h b/arch/hexagon/include/asm/spinlock_types.h +index 7a906b5214a4..d8f596fec022 100644 --- a/arch/hexagon/include/asm/spinlock_types.h +++ b/arch/hexagon/include/asm/spinlock_types.h @@ -21,10 +21,6 @@ @@ -78,6 +87,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> typedef struct { volatile unsigned int lock; } arch_spinlock_t; +diff --git a/arch/ia64/include/asm/spinlock_types.h b/arch/ia64/include/asm/spinlock_types.h +index 6e345fefcdca..681408d6816f 100644 --- a/arch/ia64/include/asm/spinlock_types.h +++ b/arch/ia64/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -91,6 +102,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> typedef struct { volatile unsigned int lock; } arch_spinlock_t; +diff --git a/arch/powerpc/include/asm/spinlock_types.h b/arch/powerpc/include/asm/spinlock_types.h +index 87adaf13b7e8..7305cb6a53e4 100644 --- a/arch/powerpc/include/asm/spinlock_types.h +++ b/arch/powerpc/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -104,6 +117,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> typedef struct { volatile unsigned int slock; } arch_spinlock_t; +diff --git a/arch/s390/include/asm/spinlock_types.h b/arch/s390/include/asm/spinlock_types.h +index cfed272e4fd5..8e28e8176ec8 100644 --- a/arch/s390/include/asm/spinlock_types.h +++ b/arch/s390/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -117,6 +132,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> typedef struct { int lock; } __attribute__ ((aligned (4))) arch_spinlock_t; +diff --git a/arch/sh/include/asm/spinlock_types.h b/arch/sh/include/asm/spinlock_types.h +index e82369f286a2..22ca9a98bbb8 100644 --- a/arch/sh/include/asm/spinlock_types.h +++ b/arch/sh/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -130,6 +147,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> typedef struct { volatile unsigned int lock; } arch_spinlock_t; +diff --git a/arch/xtensa/include/asm/spinlock_types.h b/arch/xtensa/include/asm/spinlock_types.h +index bb1fe6c1816e..8a22f1e7b6c9 100644 --- a/arch/xtensa/include/asm/spinlock_types.h +++ b/arch/xtensa/include/asm/spinlock_types.h @@ -2,10 +2,6 @@ @@ -143,6 +162,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> typedef struct { volatile unsigned int slock; } arch_spinlock_t; +diff --git a/include/linux/spinlock_types_up.h b/include/linux/spinlock_types_up.h +index c09b6407ae1b..b0243ba07fb7 100644 --- a/include/linux/spinlock_types_up.h +++ b/include/linux/spinlock_types_up.h @@ -1,10 +1,6 @@ @@ -156,3 +177,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * include/linux/spinlock_types_up.h - spinlock type definitions for UP * +-- +2.20.1 + diff --git a/debian/patches-rt/peter_zijlstra-frob-rcu.patch b/debian/patches-rt/0160-rcu-Frob-softirq-test.patch index 06a3c9ece..41e5836dc 100644 --- a/debian/patches-rt/peter_zijlstra-frob-rcu.patch +++ b/debian/patches-rt/0160-rcu-Frob-softirq-test.patch @@ -1,7 +1,8 @@ -Subject: rcu: Frob softirq test +From 6e7032191391320f2f2552f9833a0ac23652174a Mon Sep 17 00:00:00 2001 From: Peter Zijlstra <a.p.zijlstra@chello.nl> -Date: Sat Aug 13 00:23:17 CEST 2011 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Sat, 13 Aug 2011 00:23:17 +0200 +Subject: [PATCH 160/266] rcu: Frob softirq test +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz With RT_FULL we get the below wreckage: @@ -11,15 +12,15 @@ With RT_FULL we get the below wreckage: [ 126.060490] ------------------------------------------------------- [ 126.060492] irq/24-eth0/1235 is trying to acquire lock: [ 126.060495] (&(lock)->wait_lock#2){+.+...}, at: [<ffffffff81501c81>] rt_mutex_slowunlock+0x16/0x55 -[ 126.060503] +[ 126.060503] [ 126.060504] but task is already holding lock: [ 126.060506] (&p->pi_lock){-...-.}, at: [<ffffffff81074fdc>] try_to_wake_up+0x35/0x429 -[ 126.060511] +[ 126.060511] [ 126.060511] which lock already depends on the new lock. -[ 126.060513] -[ 126.060514] +[ 126.060513] +[ 126.060514] [ 126.060514] the existing dependency chain (in reverse order) is: -[ 126.060516] +[ 126.060516] [ 126.060516] -> #1 (&p->pi_lock){-...-.}: [ 126.060519] [<ffffffff810afe9e>] lock_acquire+0x145/0x18a [ 126.060524] [<ffffffff8150291e>] _raw_spin_lock_irqsave+0x4b/0x85 @@ -30,7 +31,7 @@ With RT_FULL we get the below wreckage: [ 126.060541] [<ffffffff810d90ce>] rcu_boost_kthread+0x7d/0x9b [ 126.060544] [<ffffffff8109a760>] kthread+0x99/0xa1 [ 126.060547] [<ffffffff81509b14>] kernel_thread_helper+0x4/0x10 -[ 126.060551] +[ 126.060551] [ 126.060552] -> #0 (&(lock)->wait_lock#2){+.+...}: [ 126.060555] [<ffffffff810af1b8>] __lock_acquire+0x1157/0x1816 [ 126.060558] [<ffffffff810afe9e>] lock_acquire+0x145/0x18a @@ -50,23 +51,23 @@ With RT_FULL we get the below wreckage: [ 126.060603] [<ffffffff810d582c>] irq_thread+0xde/0x1af [ 126.060606] [<ffffffff8109a760>] kthread+0x99/0xa1 [ 126.060608] [<ffffffff81509b14>] kernel_thread_helper+0x4/0x10 -[ 126.060611] +[ 126.060611] [ 126.060612] other info that might help us debug this: -[ 126.060614] +[ 126.060614] [ 126.060615] Possible unsafe locking scenario: -[ 126.060616] +[ 126.060616] [ 126.060617] CPU0 CPU1 [ 126.060619] ---- ---- [ 126.060620] lock(&p->pi_lock); [ 126.060623] lock(&(lock)->wait_lock); [ 126.060625] lock(&p->pi_lock); [ 126.060627] lock(&(lock)->wait_lock); -[ 126.060629] +[ 126.060629] [ 126.060629] *** DEADLOCK *** -[ 126.060630] +[ 126.060630] [ 126.060632] 1 lock held by irq/24-eth0/1235: [ 126.060633] #0: (&p->pi_lock){-...-.}, at: [<ffffffff81074fdc>] try_to_wake_up+0x35/0x429 -[ 126.060638] +[ 126.060638] [ 126.060638] stack backtrace: [ 126.060641] Pid: 1235, comm: irq/24-eth0 Not tainted 3.0.1-rt10+ #30 [ 126.060643] Call Trace: @@ -151,12 +152,14 @@ here... so this is very likely a bandaid and more thought is required. Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> --- - kernel/rcu/tree_plugin.h | 2 +- + kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index 564e3927e7b0..429a2f144e19 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h -@@ -524,7 +524,7 @@ static void rcu_read_unlock_special(stru +@@ -524,7 +524,7 @@ static void rcu_read_unlock_special(struct task_struct *t) } /* Hardware IRQ handlers cannot block, complain if they get here. */ @@ -165,3 +168,6 @@ Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> lockdep_rcu_suspicious(__FILE__, __LINE__, "rcu_read_unlock() from irq or softirq with blocking in critical section!!!\n"); pr_alert("->rcu_read_unlock_special: %#x (b: %d, enq: %d nq: %d)\n", +-- +2.20.1 + diff --git a/debian/patches-rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch b/debian/patches-rt/0161-rcu-Merge-RCU-bh-into-RCU-preempt.patch index d257c6a51..f2a874f8a 100644 --- a/debian/patches-rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch +++ b/debian/patches-rt/0161-rcu-Merge-RCU-bh-into-RCU-preempt.patch @@ -1,7 +1,8 @@ -Subject: rcu: Merge RCU-bh into RCU-preempt -Date: Wed, 5 Oct 2011 11:59:38 -0700 +From f0420dc53c66d266f674ee85f7f9e81057057d7d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Wed, 5 Oct 2011 11:59:38 -0700 +Subject: [PATCH 161/266] rcu: Merge RCU-bh into RCU-preempt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The Linux kernel has long RCU-bh read-side critical sections that intolerably increase scheduling latency under mainline's RCU-bh rules, @@ -23,20 +24,21 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/20111005185938.GA20403@linux.vnet.ibm.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - include/linux/rcupdate.h | 19 +++++++++++++++++++ - include/linux/rcutree.h | 8 ++++++++ - kernel/rcu/rcu.h | 11 +++++++++-- - kernel/rcu/rcutorture.c | 7 +++++++ - kernel/rcu/tree.c | 26 ++++++++++++++++++++++++++ - kernel/rcu/tree.h | 2 ++ - kernel/rcu/update.c | 2 ++ + include/linux/rcupdate.h | 19 +++++++++++++++++++ + include/linux/rcutree.h | 8 ++++++++ + kernel/rcu/rcu.h | 11 +++++++++-- + kernel/rcu/rcutorture.c | 7 +++++++ + kernel/rcu/tree.c | 26 ++++++++++++++++++++++++++ + kernel/rcu/tree.h | 2 ++ + kernel/rcu/update.c | 2 ++ 7 files changed, 73 insertions(+), 2 deletions(-) +diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h +index 63cd0a1a99a0..60a9b5feefe2 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h -@@ -56,7 +56,11 @@ void call_rcu(struct rcu_head *head, rcu +@@ -56,7 +56,11 @@ void call_rcu(struct rcu_head *head, rcu_callback_t func); #define call_rcu call_rcu_sched #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ @@ -48,7 +50,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void call_rcu_sched(struct rcu_head *head, rcu_callback_t func); void synchronize_sched(void); void rcu_barrier_tasks(void); -@@ -263,7 +267,14 @@ extern struct lockdep_map rcu_sched_lock +@@ -263,7 +267,14 @@ extern struct lockdep_map rcu_sched_lock_map; extern struct lockdep_map rcu_callback_map; int debug_lockdep_rcu_enabled(void); int rcu_read_lock_held(void); @@ -78,7 +80,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* -@@ -676,10 +691,14 @@ static inline void rcu_read_lock_bh(void +@@ -676,10 +691,14 @@ static inline void rcu_read_lock_bh(void) */ static inline void rcu_read_unlock_bh(void) { @@ -93,9 +95,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> local_bh_enable(); } +diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h +index 914655848ef6..462ce061bac7 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h -@@ -44,7 +44,11 @@ static inline void rcu_virt_note_context +@@ -44,7 +44,11 @@ static inline void rcu_virt_note_context_switch(int cpu) rcu_note_context_switch(false); } @@ -107,7 +111,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void synchronize_sched_expedited(void); void synchronize_rcu_expedited(void); -@@ -72,7 +76,11 @@ static inline void synchronize_rcu_bh_ex +@@ -72,7 +76,11 @@ static inline void synchronize_rcu_bh_expedited(void) } void rcu_barrier(void); @@ -119,9 +123,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void rcu_barrier_sched(void); bool rcu_eqs_special_set(int cpu); unsigned long get_state_synchronize_rcu(void); +diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h +index 4d04683c31b2..808cce9a5d43 100644 --- a/kernel/rcu/rcu.h +++ b/kernel/rcu/rcu.h -@@ -528,7 +528,6 @@ static inline void show_rcu_gp_kthreads( +@@ -528,7 +528,6 @@ static inline void show_rcu_gp_kthreads(void) { } static inline int rcu_get_gp_kthreads_prio(void) { return 0; } #else /* #ifdef CONFIG_TINY_RCU */ unsigned long rcu_get_gp_seq(void); @@ -129,7 +135,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> unsigned long rcu_sched_get_gp_seq(void); unsigned long rcu_exp_batches_completed(void); unsigned long rcu_exp_batches_completed_sched(void); -@@ -536,10 +535,18 @@ unsigned long srcu_batches_completed(str +@@ -536,10 +535,18 @@ unsigned long srcu_batches_completed(struct srcu_struct *sp); void show_rcu_gp_kthreads(void); int rcu_get_gp_kthreads_prio(void); void rcu_force_quiescent_state(void); @@ -149,9 +155,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif /* #else #ifdef CONFIG_TINY_RCU */ #ifdef CONFIG_RCU_NOCB_CPU +diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c +index c596c6f1e457..7d2a615601e7 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c -@@ -434,6 +434,7 @@ static struct rcu_torture_ops rcu_ops = +@@ -434,6 +434,7 @@ static struct rcu_torture_ops rcu_ops = { .name = "rcu" }; @@ -159,7 +167,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Definitions for rcu_bh torture testing. */ -@@ -475,6 +476,12 @@ static struct rcu_torture_ops rcu_bh_ops +@@ -475,6 +476,12 @@ static struct rcu_torture_ops rcu_bh_ops = { .name = "rcu_bh" }; @@ -172,6 +180,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Don't even think about trying any of these in real life!!! * The names includes "busted", and they really means it! +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index f7e89c989df7..1456a3d97971 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -244,6 +244,7 @@ void rcu_sched_qs(void) @@ -210,7 +220,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Return the number of RCU expedited batches completed thus far for -@@ -599,6 +607,7 @@ unsigned long rcu_exp_batches_completed_ +@@ -599,6 +607,7 @@ unsigned long rcu_exp_batches_completed_sched(void) } EXPORT_SYMBOL_GPL(rcu_exp_batches_completed_sched); @@ -232,7 +242,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Force a quiescent state for RCU-sched. */ -@@ -674,9 +690,11 @@ void rcutorture_get_gp_data(enum rcutort +@@ -674,9 +690,11 @@ void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, case RCU_FLAVOR: rsp = rcu_state_p; break; @@ -244,7 +254,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> case RCU_SCHED_FLAVOR: rsp = &rcu_sched_state; break; -@@ -3049,6 +3067,7 @@ void call_rcu_sched(struct rcu_head *hea +@@ -3057,6 +3075,7 @@ void call_rcu_sched(struct rcu_head *head, rcu_callback_t func) } EXPORT_SYMBOL_GPL(call_rcu_sched); @@ -252,7 +262,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /** * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period. * @head: structure to be used for queueing the RCU updates. -@@ -3076,6 +3095,7 @@ void call_rcu_bh(struct rcu_head *head, +@@ -3084,6 +3103,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); @@ -260,7 +270,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Queue an RCU callback for lazy invocation after a grace period. -@@ -3161,6 +3181,7 @@ void synchronize_sched(void) +@@ -3169,6 +3189,7 @@ void synchronize_sched(void) } EXPORT_SYMBOL_GPL(synchronize_sched); @@ -268,7 +278,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /** * synchronize_rcu_bh - wait until an rcu_bh grace period has elapsed. * -@@ -3187,6 +3208,7 @@ void synchronize_rcu_bh(void) +@@ -3195,6 +3216,7 @@ void synchronize_rcu_bh(void) wait_rcu_gp(call_rcu_bh); } EXPORT_SYMBOL_GPL(synchronize_rcu_bh); @@ -276,7 +286,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /** * get_state_synchronize_rcu - Snapshot current RCU state -@@ -3494,6 +3516,7 @@ static void _rcu_barrier(struct rcu_stat +@@ -3502,6 +3524,7 @@ static void _rcu_barrier(struct rcu_state *rsp) mutex_unlock(&rsp->barrier_mutex); } @@ -284,7 +294,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /** * rcu_barrier_bh - Wait until all in-flight call_rcu_bh() callbacks complete. */ -@@ -3502,6 +3525,7 @@ void rcu_barrier_bh(void) +@@ -3510,6 +3533,7 @@ void rcu_barrier_bh(void) _rcu_barrier(&rcu_bh_state); } EXPORT_SYMBOL_GPL(rcu_barrier_bh); @@ -292,7 +302,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /** * rcu_barrier_sched - Wait for in-flight call_rcu_sched() callbacks. -@@ -4149,7 +4173,9 @@ void __init rcu_init(void) +@@ -4157,7 +4181,9 @@ void __init rcu_init(void) rcu_bootup_announce(); rcu_init_geometry(); @@ -302,9 +312,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> rcu_init_one(&rcu_sched_state); if (dump_tree) rcu_dump_rcu_node_tree(&rcu_sched_state); +diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h +index 4e74df768c57..fbbff7c21148 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h -@@ -413,7 +413,9 @@ extern struct list_head rcu_struct_flavo +@@ -413,7 +413,9 @@ extern struct list_head rcu_struct_flavors; */ extern struct rcu_state rcu_sched_state; @@ -314,6 +326,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_PREEMPT_RCU extern struct rcu_state rcu_preempt_state; +diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c +index 39cb23d22109..f56c0fbdf22e 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -286,6 +286,7 @@ int rcu_read_lock_held(void) @@ -332,3 +346,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ +-- +2.20.1 + diff --git a/debian/patches-rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch b/debian/patches-rt/0162-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch index 76a2326ee..628b336c4 100644 --- a/debian/patches-rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch +++ b/debian/patches-rt/0162-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch @@ -1,7 +1,8 @@ -Subject: rcu: Make ksoftirqd do RCU quiescent states +From e393ca6c12969b914302fe67fa8c30fc55cb990f Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Date: Wed, 5 Oct 2011 11:45:18 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 162/266] rcu: Make ksoftirqd do RCU quiescent states +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Implementing RCU-bh in terms of RCU-preempt makes the system vulnerable to network-based denial-of-service attacks. This patch therefore @@ -22,12 +23,13 @@ in cases where __do_softirq() is invoked directly from ksoftirqd. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/20111005184518.GA21601@linux.vnet.ibm.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - kernel/rcu/tree.c | 18 +++++++++++++----- - kernel/rcu/tree_plugin.h | 8 +++++++- + kernel/rcu/tree.c | 18 +++++++++++++----- + kernel/rcu/tree_plugin.h | 8 +++++++- 2 files changed, 20 insertions(+), 6 deletions(-) +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index 1456a3d97971..1a40e3d44cb8 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -244,7 +244,19 @@ void rcu_sched_qs(void) @@ -62,6 +64,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif /* +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index 429a2f144e19..bee9bffeb0ce 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -29,6 +29,7 @@ @@ -72,7 +76,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include <linux/sched/isolation.h> #include <uapi/linux/sched/types.h> #include "../time/tick-internal.h" -@@ -1407,7 +1408,7 @@ static void rcu_prepare_kthreads(int cpu +@@ -1407,7 +1408,7 @@ static void rcu_prepare_kthreads(int cpu) #endif /* #else #ifdef CONFIG_RCU_BOOST */ @@ -81,7 +85,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Check to see if any future RCU-related work will need to be done -@@ -1423,7 +1424,9 @@ int rcu_needs_cpu(u64 basemono, u64 *nex +@@ -1423,7 +1424,9 @@ int rcu_needs_cpu(u64 basemono, u64 *nextevt) *nextevt = KTIME_MAX; return rcu_cpu_has_callbacks(NULL); } @@ -91,7 +95,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Because we do not have RCU_FAST_NO_HZ, don't bother cleaning up * after it. -@@ -1520,6 +1523,8 @@ static bool __maybe_unused rcu_try_advan +@@ -1520,6 +1523,8 @@ static bool __maybe_unused rcu_try_advance_all_cbs(void) return cbs_ready; } @@ -100,7 +104,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Allow the CPU to enter dyntick-idle mode unless it has callbacks ready * to invoke. If the CPU has callbacks, try to advance them. Tell the -@@ -1562,6 +1567,7 @@ int rcu_needs_cpu(u64 basemono, u64 *nex +@@ -1562,6 +1567,7 @@ int rcu_needs_cpu(u64 basemono, u64 *nextevt) *nextevt = basemono + dj * TICK_NSEC; return 0; } @@ -108,3 +112,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Prepare a CPU for idle from an RCU perspective. The first major task +-- +2.20.1 + diff --git a/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch b/debian/patches-rt/0163-rcu-Eliminate-softirq-processing-from-rcutree.patch index 2381b28e4..11ebd8937 100644 --- a/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch +++ b/debian/patches-rt/0163-rcu-Eliminate-softirq-processing-from-rcutree.patch @@ -1,7 +1,8 @@ +From 3f1fa9e4254eb009516d3b0558bbaf02d212a731 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Date: Mon, 4 Nov 2013 13:21:10 -0800 -Subject: rcu: Eliminate softirq processing from rcutree -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 163/266] rcu: Eliminate softirq processing from rcutree +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Running RCU out of softirq is a problem for some workloads that would like to manage RCU core processing independently of other softirq work, @@ -17,11 +18,13 @@ Tested-by: Mike Galbraith <bitbucket@online.de> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/rcu/tree.c | 112 +++++++++++++++++++++++++++++++++---- - kernel/rcu/tree.h | 4 - - kernel/rcu/tree_plugin.h | 142 +++-------------------------------------------- - 3 files changed, 114 insertions(+), 144 deletions(-) + kernel/rcu/tree.c | 114 ++++++++++++++++++++++++++++--- + kernel/rcu/tree.h | 4 +- + kernel/rcu/tree_plugin.h | 142 +++------------------------------------ + 3 files changed, 115 insertions(+), 145 deletions(-) +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index 1a40e3d44cb8..ae716ca783bc 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -61,6 +61,13 @@ @@ -38,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "tree.h" #include "rcu.h" -@@ -2888,18 +2895,17 @@ static void +@@ -2896,18 +2903,17 @@ __rcu_process_callbacks(struct rcu_state *rsp) /* * Do RCU core processing for the current CPU. */ @@ -59,12 +62,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Schedule RCU callback invocation. If the specified type of RCU * does not support RCU priority boosting, just do a direct call, -@@ -2911,18 +2917,105 @@ static void invoke_rcu_callbacks(struct +@@ -2919,18 +2925,105 @@ static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp) { if (unlikely(!READ_ONCE(rcu_scheduler_fully_active))) return; - if (likely(!rsp->boost)) { - rcu_do_batch(rsp, rdp); +- return; +- } +- invoke_rcu_callbacks_kthread(); + rcu_do_batch(rsp, rdp); +} + @@ -76,18 +82,20 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + */ + if (t && (status != RCU_KTHREAD_YIELDING || is_idle_task(current))) + wake_up_process(t); -+} -+ + } + +/* + * Wake up this CPU's rcuc kthread to do RCU core processing. + */ -+static void invoke_rcu_core(void) -+{ + static void invoke_rcu_core(void) + { +- if (cpu_online(smp_processor_id())) +- raise_softirq(RCU_SOFTIRQ); + unsigned long flags; + struct task_struct *t; + + if (!cpu_online(smp_processor_id())) - return; ++ return; + local_irq_save(flags); + __this_cpu_write(rcu_cpu_has_work, 1); + t = __this_cpu_read(rcu_cpu_kthread_task); @@ -134,16 +142,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + *statusp = RCU_KTHREAD_WAITING; + return; + } - } -- invoke_rcu_callbacks_kthread(); ++ } + *statusp = RCU_KTHREAD_YIELDING; + trace_rcu_utilization(TPS("Start CPU kthread@rcu_yield")); + schedule_timeout_interruptible(2); + trace_rcu_utilization(TPS("End CPU kthread@rcu_yield")); + *statusp = RCU_KTHREAD_WAITING; - } - --static void invoke_rcu_core(void) ++} ++ +static struct smp_hotplug_thread rcu_cpu_thread_spec = { + .store = &rcu_cpu_kthread_task, + .thread_should_run = rcu_cpu_kthread_should_run, @@ -157,9 +163,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + * Spawn per-CPU RCU core processing kthreads. + */ +static int __init rcu_spawn_core_kthreads(void) - { -- if (cpu_online(smp_processor_id())) -- raise_softirq(RCU_SOFTIRQ); ++{ + int cpu; + + for_each_possible_cpu(cpu) @@ -171,7 +175,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Handle any core-RCU processing required by a call_rcu() invocation. -@@ -4188,7 +4281,6 @@ void __init rcu_init(void) +@@ -4196,7 +4289,6 @@ void __init rcu_init(void) if (dump_tree) rcu_dump_rcu_node_tree(&rcu_sched_state); __rcu_init_preempt(); @@ -179,9 +183,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * We don't need protection against CPU-hotplug here because +diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h +index fbbff7c21148..98257d20feb2 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h -@@ -423,12 +423,10 @@ extern struct rcu_state rcu_preempt_stat +@@ -423,12 +423,10 @@ extern struct rcu_state rcu_preempt_state; int rcu_dynticks_snap(struct rcu_dynticks *rdtp); @@ -194,7 +200,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifndef RCU_TREE_NONCORE -@@ -451,8 +449,8 @@ static void dump_blkd_tasks(struct rcu_s +@@ -451,8 +449,8 @@ static void dump_blkd_tasks(struct rcu_state *rsp, struct rcu_node *rnp, int ncheck); static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags); static void rcu_preempt_boost_start_gp(struct rcu_node *rnp); @@ -204,6 +210,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_RCU_BOOST static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, struct rcu_node *rnp); +diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h +index bee9bffeb0ce..2e8737f1010f 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -24,42 +24,16 @@ @@ -249,7 +257,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_RCU_NOCB_CPU static cpumask_var_t rcu_nocb_mask; /* CPUs to have callbacks offloaded. */ static bool __read_mostly rcu_nocb_poll; /* Offload kthread are to poll. */ -@@ -1027,18 +1001,21 @@ dump_blkd_tasks(struct rcu_state *rsp, s +@@ -1027,18 +1001,21 @@ dump_blkd_tasks(struct rcu_state *rsp, struct rcu_node *rnp, int ncheck) #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ @@ -279,10 +287,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Carry out RCU priority boosting on the task indicated by ->exp_tasks * or ->boost_tasks, advancing the pointer to the next task in the -@@ -1177,23 +1154,6 @@ static void rcu_initiate_boost(struct rc +@@ -1176,23 +1153,6 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags) + } } - /* +-/* - * Wake up the per-CPU kthread to invoke RCU callbacks. - */ -static void invoke_rcu_callbacks_kthread(void) @@ -299,11 +308,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - local_irq_restore(flags); -} - --/* + /* * Is the current CPU running the RCU-callbacks kthread? * Caller must have preemption disabled. - */ -@@ -1247,67 +1207,6 @@ static int rcu_spawn_one_boost_kthread(s +@@ -1247,67 +1207,6 @@ static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp, return 0; } @@ -371,7 +379,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Set the per-rcu_node kthread's affinity to cover all CPUs that are * served by the rcu_node in question. The CPU hotplug lock is still -@@ -1338,26 +1237,12 @@ static void rcu_boost_kthread_setaffinit +@@ -1338,26 +1237,12 @@ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu) free_cpumask_var(cm); } @@ -398,7 +406,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rcu_for_each_leaf_node(rcu_state_p, rnp) (void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp); } -@@ -1380,11 +1265,6 @@ static void rcu_initiate_boost(struct rc +@@ -1380,11 +1265,6 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags) raw_spin_unlock_irqrestore_rcu_node(rnp, flags); } @@ -410,3 +418,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static bool rcu_is_callbacks_kthread(void) { return false; +-- +2.20.1 + diff --git a/debian/patches-rt/srcu-use-cpu_online-instead-custom-check.patch b/debian/patches-rt/0164-srcu-use-cpu_online-instead-custom-check.patch index d3e30bba6..9eb7891e7 100644 --- a/debian/patches-rt/srcu-use-cpu_online-instead-custom-check.patch +++ b/debian/patches-rt/0164-srcu-use-cpu_online-instead-custom-check.patch @@ -1,7 +1,8 @@ +From 933f666204c4c7d4ed2af0102e69fa58cc7d9a6b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 13 Sep 2017 14:43:41 +0200 -Subject: [PATCH] srcu: use cpu_online() instead custom check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 164/266] srcu: use cpu_online() instead custom check +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The current check via srcu_online is slightly racy because after looking at srcu_online there could be an interrupt that interrupted us long @@ -14,10 +15,12 @@ CPU won't fire until the CPU is back online. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/rcu/srcutree.c | 22 ++++------------------ - kernel/rcu/tree.c | 4 ---- + kernel/rcu/srcutree.c | 22 ++++------------------ + kernel/rcu/tree.c | 4 ---- 2 files changed, 4 insertions(+), 22 deletions(-) +diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c +index 1ff17e297f0c..df0375453ba1 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -38,6 +38,7 @@ @@ -28,10 +31,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "rcu.h" #include "rcu_segcblist.h" -@@ -461,21 +462,6 @@ static void srcu_gp_start(struct srcu_st +@@ -460,21 +461,6 @@ static void srcu_gp_start(struct srcu_struct *sp) + WARN_ON_ONCE(state != SRCU_STATE_SCAN1); } - /* +-/* - * Track online CPUs to guide callback workqueue placement. - */ -DEFINE_PER_CPU(bool, srcu_online); @@ -46,11 +50,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - WRITE_ONCE(per_cpu(srcu_online, cpu), false); -} - --/* + /* * Place the workqueue handler on the specified CPU if online, otherwise * just run it whereever. This is useful for placing workqueue handlers - * that are to invoke the specified CPU's callbacks. -@@ -486,12 +472,12 @@ static bool srcu_queue_delayed_work_on(i +@@ -486,12 +472,12 @@ static bool srcu_queue_delayed_work_on(int cpu, struct workqueue_struct *wq, { bool ret; @@ -66,9 +69,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index ae716ca783bc..f162a4f54b05 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c -@@ -3776,8 +3776,6 @@ int rcutree_online_cpu(unsigned int cpu) +@@ -3784,8 +3784,6 @@ int rcutree_online_cpu(unsigned int cpu) rnp->ffmask |= rdp->grpmask; raw_spin_unlock_irqrestore_rcu_node(rnp, flags); } @@ -77,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (rcu_scheduler_active == RCU_SCHEDULER_INACTIVE) return 0; /* Too early in boot for scheduler work. */ sync_sched_exp_online_cleanup(cpu); -@@ -3805,8 +3803,6 @@ int rcutree_offline_cpu(unsigned int cpu +@@ -3813,8 +3811,6 @@ int rcutree_offline_cpu(unsigned int cpu) } rcutree_affinity_setting(cpu, cpu); @@ -86,3 +91,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } +-- +2.20.1 + diff --git a/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch b/debian/patches-rt/0165-srcu-replace-local_irqsave-with-a-locallock.patch index 5c8f3f3e6..8f763734a 100644 --- a/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch +++ b/debian/patches-rt/0165-srcu-replace-local_irqsave-with-a-locallock.patch @@ -1,7 +1,8 @@ +From 6ca5ffc1b215c6c71dca70fd1d04b8bea1b3eea5 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 12 Oct 2017 18:37:12 +0200 -Subject: [PATCH] srcu: replace local_irqsave() with a locallock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 165/266] srcu: replace local_irqsave() with a locallock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz There are two instances which disable interrupts in order to become a stable this_cpu_ptr() pointer. The restore part is coupled with @@ -11,9 +12,11 @@ version of it. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/rcu/srcutree.c | 14 +++++++++----- + kernel/rcu/srcutree.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) +diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c +index df0375453ba1..0f09a1a9e17c 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -39,6 +39,7 @@ @@ -24,7 +27,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "rcu.h" #include "rcu_segcblist.h" -@@ -760,6 +761,8 @@ static void srcu_flip(struct srcu_struct +@@ -760,6 +761,8 @@ static void srcu_flip(struct srcu_struct *sp) * negligible when amoritized over that time period, and the extra latency * of a needlessly non-expedited grace period is similarly negligible. */ @@ -33,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static bool srcu_might_be_idle(struct srcu_struct *sp) { unsigned long curseq; -@@ -768,13 +771,13 @@ static bool srcu_might_be_idle(struct sr +@@ -768,13 +771,13 @@ static bool srcu_might_be_idle(struct srcu_struct *sp) unsigned long t; /* If the local srcu_data structure has callbacks, not idle. */ @@ -50,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * No local callbacks, so probabalistically probe global state. -@@ -852,7 +855,7 @@ void __call_srcu(struct srcu_struct *sp, +@@ -852,7 +855,7 @@ void __call_srcu(struct srcu_struct *sp, struct rcu_head *rhp, return; } rhp->func = func; @@ -59,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> sdp = this_cpu_ptr(sp->sda); spin_lock_rcu_node(sdp); rcu_segcblist_enqueue(&sdp->srcu_cblist, rhp, false); -@@ -868,7 +871,8 @@ void __call_srcu(struct srcu_struct *sp, +@@ -868,7 +871,8 @@ void __call_srcu(struct srcu_struct *sp, struct rcu_head *rhp, sdp->srcu_gp_seq_needed_exp = s; needexp = true; } @@ -69,3 +72,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (needgp) srcu_funnel_gp_start(sp, sdp, s, do_norm); else if (needexp) +-- +2.20.1 + diff --git a/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch b/debian/patches-rt/0166-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch index e528eb568..fb316b735 100644 --- a/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch +++ b/debian/patches-rt/0166-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch @@ -1,7 +1,8 @@ +From 903eaab8f96d6e2333946ce5360686e1dfd5f857 Mon Sep 17 00:00:00 2001 From: Julia Cartwright <julia@ni.com> Date: Wed, 12 Oct 2016 11:21:14 -0500 -Subject: [PATCH] rcu: enable rcu_normal_after_boot by default for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 166/266] rcu: enable rcu_normal_after_boot by default for RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The forcing of an expedited grace period is an expensive and very RT-application unfriendly operation, as it forcibly preempts all running @@ -15,12 +16,14 @@ Acked-by: Paul E. McKenney <paulmck@linux.ibm.com> Signed-off-by: Julia Cartwright <julia@ni.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/rcu/update.c | 2 +- + kernel/rcu/update.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c +index f56c0fbdf22e..12027723abaf 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c -@@ -67,7 +67,7 @@ extern int rcu_expedited; /* from sysctl +@@ -67,7 +67,7 @@ extern int rcu_expedited; /* from sysctl */ module_param(rcu_expedited, int, 0); extern int rcu_normal; /* from sysctl */ module_param(rcu_normal, int, 0); @@ -29,3 +32,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> module_param(rcu_normal_after_boot, int, 0); #endif /* #ifndef CONFIG_TINY_RCU */ +-- +2.20.1 + diff --git a/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch b/debian/patches-rt/0167-tty-serial-omap-Make-the-locking-RT-aware.patch index 888fc0fbe..c41d2b409 100644 --- a/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch +++ b/debian/patches-rt/0167-tty-serial-omap-Make-the-locking-RT-aware.patch @@ -1,7 +1,8 @@ -Subject: tty/serial/omap: Make the locking RT aware +From 3e89f2fefa0c427d8352c05bc3fe185d86957e11 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 28 Jul 2011 13:32:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 167/266] tty/serial/omap: Make the locking RT aware +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and @@ -9,12 +10,14 @@ non-RT. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - drivers/tty/serial/omap-serial.c | 12 ++++-------- + drivers/tty/serial/omap-serial.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) +diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c +index 6420ae581a80..0f4f41ed9ffa 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c -@@ -1307,13 +1307,10 @@ serial_omap_console_write(struct console +@@ -1307,13 +1307,10 @@ serial_omap_console_write(struct console *co, const char *s, pm_runtime_get_sync(up->dev); @@ -31,7 +34,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * First save the IER then disable the interrupts -@@ -1342,8 +1339,7 @@ serial_omap_console_write(struct console +@@ -1342,8 +1339,7 @@ serial_omap_console_write(struct console *co, const char *s, pm_runtime_mark_last_busy(up->dev); pm_runtime_put_autosuspend(up->dev); if (locked) @@ -41,3 +44,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static int __init +-- +2.20.1 + diff --git a/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch b/debian/patches-rt/0168-tty-serial-pl011-Make-the-locking-work-on-RT.patch index 560303b16..8dde3bc64 100644 --- a/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch +++ b/debian/patches-rt/0168-tty-serial-pl011-Make-the-locking-work-on-RT.patch @@ -1,19 +1,22 @@ -Subject: tty/serial/pl011: Make the locking work on RT +From b0bbc7b28e21b82de5daa31813dfe25e5cbdea2d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 08 Jan 2013 21:36:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Tue, 8 Jan 2013 21:36:51 +0100 +Subject: [PATCH 168/266] tty/serial/pl011: Make the locking work on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and non-RT. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - drivers/tty/serial/amba-pl011.c | 15 ++++++++++----- + drivers/tty/serial/amba-pl011.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) +diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c +index 89ade213a1a9..6be86f8c7e6a 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2216,13 +2216,19 @@ pl011_console_write(struct console *co, +@@ -2216,13 +2216,19 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) clk_enable(uap->clk); @@ -36,7 +39,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * First save the CR then disable the interrupts -@@ -2248,8 +2254,7 @@ pl011_console_write(struct console *co, +@@ -2248,8 +2254,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) pl011_write(old_cr, uap, REG_CR); if (locked) @@ -46,3 +49,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> clk_disable(uap->clk); } +-- +2.20.1 + diff --git a/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch b/debian/patches-rt/0169-tty-serial-pl011-explicitly-initialize-the-flags-var.patch index 730815778..bd4ea327b 100644 --- a/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch +++ b/debian/patches-rt/0169-tty-serial-pl011-explicitly-initialize-the-flags-var.patch @@ -1,10 +1,12 @@ +From 53d73fabf979b11317aedc2e68db2a3be9fbc60d Mon Sep 17 00:00:00 2001 From: Kurt Kanzenbach <kurt@linutronix.de> Date: Mon, 24 Sep 2018 10:29:01 +0200 -Subject: [PATCH] tty: serial: pl011: explicitly initialize the flags variable +Subject: [PATCH 169/266] tty: serial: pl011: explicitly initialize the flags + variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Silence the following gcc warning: @@ -22,12 +24,14 @@ behavior and resolves the warning. Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/tty/serial/amba-pl011.c | 2 +- + drivers/tty/serial/amba-pl011.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c +index 6be86f8c7e6a..59b4ab7b50bf 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2211,7 +2211,7 @@ pl011_console_write(struct console *co, +@@ -2211,7 +2211,7 @@ 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; @@ -36,3 +40,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int locked = 1; clk_enable(uap->clk); +-- +2.20.1 + diff --git a/debian/patches-rt/rt-serial-warn-fix.patch b/debian/patches-rt/0170-rt-Improve-the-serial-console-PASS_LIMIT.patch index b5153a6ce..695b0648b 100644 --- a/debian/patches-rt/rt-serial-warn-fix.patch +++ b/debian/patches-rt/0170-rt-Improve-the-serial-console-PASS_LIMIT.patch @@ -1,7 +1,11 @@ -Subject: rt: Improve the serial console PASS_LIMIT +From 5046f18cfab42c6ee735c6fe50bde26b9c959918 Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> -Date: Wed Dec 14 13:05:54 CET 2011 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Wed, 14 Dec 2011 13:05:54 +0100 +Subject: [PATCH 170/266] rt: Improve the serial console PASS_LIMIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Beyond the warning: @@ -13,12 +17,14 @@ give it a chance to continue in some really ugly situation. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - drivers/tty/serial/8250/8250_core.c | 11 ++++++++++- + drivers/tty/serial/8250/8250_core.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) +diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c +index 8fe3d0ed229e..a2baac4c8b63 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 +@@ -54,7 +54,16 @@ static struct uart_driver serial8250_reg; static unsigned int skip_txen_test; /* force skip of txen test at init time */ @@ -36,3 +42,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include <asm/serial.h> /* +-- +2.20.1 + diff --git a/debian/patches-rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch b/debian/patches-rt/0171-tty-serial-8250-don-t-take-the-trylock-during-oops.patch index 1f5b83cf2..dee19c0c7 100644 --- a/debian/patches-rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch +++ b/debian/patches-rt/0171-tty-serial-8250-don-t-take-the-trylock-during-oops.patch @@ -1,7 +1,8 @@ +From d956c57b51d17a4a3fc42e271aa670f8f076fd72 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 11 Apr 2016 16:55:02 +0200 -Subject: [PATCH] tty: serial: 8250: don't take the trylock during oops -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 171/266] tty: serial: 8250: don't take the trylock during oops +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz An oops with irqs off (panic() from irqsafe hrtimer like the watchdog timer) will lead to a lockdep warning on each invocation and as such @@ -10,12 +11,14 @@ Therefore we skip the trylock in the oops case. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/tty/serial/8250/8250_port.c | 4 +--- + drivers/tty/serial/8250/8250_port.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c +index 3f779d25ec0c..851d7f6046a4 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -3239,10 +3239,8 @@ void serial8250_console_write(struct uar +@@ -3239,10 +3239,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, serial8250_rpm_get(up); @@ -27,3 +30,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> else spin_lock_irqsave(&port->lock, flags); +-- +2.20.1 + diff --git a/debian/patches-rt/peterz-percpu-rwsem-rt.patch b/debian/patches-rt/0172-locking-percpu-rwsem-Remove-preempt_disable-variants.patch index 98d53655d..4ba0f289e 100644 --- a/debian/patches-rt/peterz-percpu-rwsem-rt.patch +++ b/debian/patches-rt/0172-locking-percpu-rwsem-Remove-preempt_disable-variants.patch @@ -1,7 +1,8 @@ -Subject: locking/percpu-rwsem: Remove preempt_disable variants +From 4ef6395c9615037a1654ca08d336023210c7ca62 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra <peterz@infradead.org> -Date: Wed Nov 23 16:29:32 CET 2016 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Wed, 23 Nov 2016 16:29:32 +0100 +Subject: [PATCH 172/266] locking/percpu-rwsem: Remove preempt_disable variants +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Effective revert commit: @@ -12,14 +13,15 @@ performance issue for PREEMPT=y. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> --- ---- - fs/locks.c | 32 ++++++++++++++++---------------- - include/linux/percpu-rwsem.h | 24 ++++-------------------- + fs/locks.c | 32 ++++++++++++++++---------------- + include/linux/percpu-rwsem.h | 24 ++++-------------------- 2 files changed, 20 insertions(+), 36 deletions(-) +diff --git a/fs/locks.c b/fs/locks.c +index 2ecb4db8c840..8259b7c7b5d2 100644 --- a/fs/locks.c +++ b/fs/locks.c -@@ -936,7 +936,7 @@ static int flock_lock_inode(struct inode +@@ -936,7 +936,7 @@ static int flock_lock_inode(struct inode *inode, struct file_lock *request) return -ENOMEM; } @@ -28,7 +30,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> spin_lock(&ctx->flc_lock); if (request->fl_flags & FL_ACCESS) goto find_conflict; -@@ -977,7 +977,7 @@ static int flock_lock_inode(struct inode +@@ -977,7 +977,7 @@ static int flock_lock_inode(struct inode *inode, struct file_lock *request) out: spin_unlock(&ctx->flc_lock); @@ -37,7 +39,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> if (new_fl) locks_free_lock(new_fl); locks_dispose_list(&dispose); -@@ -1015,7 +1015,7 @@ static int posix_lock_inode(struct inode +@@ -1015,7 +1015,7 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request, new_fl2 = locks_alloc_lock(); } @@ -46,7 +48,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> spin_lock(&ctx->flc_lock); /* * New lock request. Walk all POSIX locks and look for conflicts. If -@@ -1187,7 +1187,7 @@ static int posix_lock_inode(struct inode +@@ -1187,7 +1187,7 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request, } out: spin_unlock(&ctx->flc_lock); @@ -55,7 +57,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> /* * Free any unused locks. */ -@@ -1462,7 +1462,7 @@ int __break_lease(struct inode *inode, u +@@ -1462,7 +1462,7 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) return error; } @@ -64,7 +66,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> spin_lock(&ctx->flc_lock); time_out_leases(inode, &dispose); -@@ -1514,13 +1514,13 @@ int __break_lease(struct inode *inode, u +@@ -1514,13 +1514,13 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) locks_insert_block(fl, new_fl); trace_break_lease_block(inode, new_fl); spin_unlock(&ctx->flc_lock); @@ -80,7 +82,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> spin_lock(&ctx->flc_lock); trace_break_lease_unblock(inode, new_fl); locks_delete_block(new_fl); -@@ -1537,7 +1537,7 @@ int __break_lease(struct inode *inode, u +@@ -1537,7 +1537,7 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) } out: spin_unlock(&ctx->flc_lock); @@ -107,7 +109,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> locks_dispose_list(&dispose); } -@@ -1693,7 +1693,7 @@ generic_add_lease(struct file *filp, lon +@@ -1693,7 +1693,7 @@ generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **pr return -EINVAL; } @@ -116,7 +118,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> spin_lock(&ctx->flc_lock); time_out_leases(inode, &dispose); error = check_conflicting_open(dentry, arg, lease->fl_flags); -@@ -1764,7 +1764,7 @@ generic_add_lease(struct file *filp, lon +@@ -1764,7 +1764,7 @@ generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **pr lease->fl_lmops->lm_setup(lease, priv); out: spin_unlock(&ctx->flc_lock); @@ -125,7 +127,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> locks_dispose_list(&dispose); if (is_deleg) inode_unlock(inode); -@@ -1787,7 +1787,7 @@ static int generic_delete_lease(struct f +@@ -1787,7 +1787,7 @@ static int generic_delete_lease(struct file *filp, void *owner) return error; } @@ -134,7 +136,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> spin_lock(&ctx->flc_lock); list_for_each_entry(fl, &ctx->flc_lease, fl_list) { if (fl->fl_file == filp && -@@ -1800,7 +1800,7 @@ static int generic_delete_lease(struct f +@@ -1800,7 +1800,7 @@ static int generic_delete_lease(struct file *filp, void *owner) if (victim) error = fl->fl_lmops->lm_change(victim, F_UNLCK, &dispose); spin_unlock(&ctx->flc_lock); @@ -143,7 +145,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> locks_dispose_list(&dispose); return error; } -@@ -2531,13 +2531,13 @@ locks_remove_lease(struct file *filp, st +@@ -2531,13 +2531,13 @@ locks_remove_lease(struct file *filp, struct file_lock_context *ctx) if (list_empty(&ctx->flc_lease)) return; @@ -159,9 +161,11 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> locks_dispose_list(&dispose); } +diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h +index 79b99d653e03..fb44e237316d 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h -@@ -29,7 +29,7 @@ static struct percpu_rw_semaphore name = +@@ -29,7 +29,7 @@ static struct percpu_rw_semaphore name = { \ extern int __percpu_down_read(struct percpu_rw_semaphore *, int); extern void __percpu_up_read(struct percpu_rw_semaphore *); @@ -170,7 +174,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> { might_sleep(); -@@ -47,16 +47,10 @@ static inline void percpu_down_read_pree +@@ -47,16 +47,10 @@ static inline void percpu_down_read_preempt_disable(struct percpu_rw_semaphore * __this_cpu_inc(*sem->read_count); if (unlikely(!rcu_sync_is_idle(&sem->rss))) __percpu_down_read(sem, false); /* Unconditional memory barrier */ @@ -188,7 +192,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> preempt_enable(); } -@@ -83,13 +77,9 @@ static inline int percpu_down_read_trylo +@@ -83,13 +77,9 @@ static inline int percpu_down_read_trylock(struct percpu_rw_semaphore *sem) return ret; } @@ -204,7 +208,7 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> /* * Same as in percpu_down_read(). */ -@@ -102,12 +92,6 @@ static inline void percpu_up_read_preemp +@@ -102,12 +92,6 @@ static inline void percpu_up_read_preempt_enable(struct percpu_rw_semaphore *sem rwsem_release(&sem->rw_sem.dep_map, 1, _RET_IP_); } @@ -217,3 +221,6 @@ Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> extern void percpu_down_write(struct percpu_rw_semaphore *); extern void percpu_up_write(struct percpu_rw_semaphore *); +-- +2.20.1 + diff --git a/debian/patches-rt/mm-protect-activate-switch-mm.patch b/debian/patches-rt/0173-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch index 9fd7b9813..ce86f2212 100644 --- a/debian/patches-rt/mm-protect-activate-switch-mm.patch +++ b/debian/patches-rt/0173-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch @@ -1,7 +1,9 @@ +From f549a8681f1ce87de0c057d6c79a7fdd7c4379df Mon Sep 17 00:00:00 2001 From: Yong Zhang <yong.zhang0@gmail.com> Date: Tue, 15 May 2012 13:53:56 +0800 -Subject: mm: Protect activate_mm() by preempt_[disable&enable]_rt() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 173/266] mm: Protect activate_mm() by + preempt_[disable&enable]_rt() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz User preempt_*_rt instead of local_irq_*_rt or otherwise there will be warning on ARM like below: @@ -31,13 +33,15 @@ Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1337061236-1766-1-git-send-email-yong.zhang0@gmail.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - fs/exec.c | 2 ++ - mm/mmu_context.c | 2 ++ + fs/exec.c | 2 ++ + mm/mmu_context.c | 2 ++ 2 files changed, 4 insertions(+) +diff --git a/fs/exec.c b/fs/exec.c +index 433b1257694a..352c1a6fa6a9 100644 --- a/fs/exec.c +++ b/fs/exec.c -@@ -1028,12 +1028,14 @@ static int exec_mmap(struct mm_struct *m +@@ -1028,12 +1028,14 @@ static int exec_mmap(struct mm_struct *mm) } } task_lock(tsk); @@ -52,6 +56,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> task_unlock(tsk); if (old_mm) { up_read(&old_mm->mmap_sem); +diff --git a/mm/mmu_context.c b/mm/mmu_context.c +index 3e612ae748e9..d0ccc070979f 100644 --- a/mm/mmu_context.c +++ b/mm/mmu_context.c @@ -25,6 +25,7 @@ void use_mm(struct mm_struct *mm) @@ -70,3 +76,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> task_unlock(tsk); #ifdef finish_arch_post_lock_switch finish_arch_post_lock_switch(); +-- +2.20.1 + diff --git a/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch b/debian/patches-rt/0174-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch index 7cb7878c1..dc4e4e045 100644 --- a/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch +++ b/debian/patches-rt/0174-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch @@ -1,7 +1,9 @@ +From ebbb9a9f03e351cb225715bdea5290ad500ee122 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 13 Sep 2017 12:32:34 +0200 -Subject: [PATCH] fs/dcache: bring back explicit INIT_HLIST_BL_HEAD init -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 174/266] fs/dcache: bring back explicit INIT_HLIST_BL_HEAD + init +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Commit 3d375d78593c ("mm: update callers to use HASH_ZERO flag") removed INIT_HLIST_BL_HEAD and uses the ZERO flag instead for the init. However @@ -10,12 +12,14 @@ that. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - fs/dcache.c | 11 +++++++++++ + fs/dcache.c | 11 +++++++++++ 1 file changed, 11 insertions(+) +diff --git a/fs/dcache.c b/fs/dcache.c +index cb515f183482..7e15f1bff5ea 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -3058,6 +3058,8 @@ static int __init set_dhash_entries(char +@@ -3058,6 +3058,8 @@ __setup("dhash_entries=", set_dhash_entries); static void __init dcache_init_early(void) { @@ -24,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* If hashes are distributed across NUMA nodes, defer * hash allocation until vmalloc space is available. */ -@@ -3074,11 +3076,16 @@ static void __init dcache_init_early(voi +@@ -3074,11 +3076,16 @@ static void __init dcache_init_early(void) NULL, 0, 0); @@ -52,3 +56,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> d_hash_shift = 32 - d_hash_shift; } +-- +2.20.1 + diff --git a/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/debian/patches-rt/0175-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch index f33779619..e66e6fb28 100644 --- a/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ b/debian/patches-rt/0175-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch @@ -1,7 +1,9 @@ +From f89292fdb56a9f4814ba63be4e9406535a7d73ee Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 20 Oct 2017 11:29:53 +0200 -Subject: [PATCH] fs/dcache: disable preemption on i_dir_seq's write side -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 175/266] fs/dcache: disable preemption on i_dir_seq's write + side +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz i_dir_seq is an opencoded seqcounter. Based on the code it looks like we could have two writers in parallel despite the fact that the d_lock is @@ -16,12 +18,14 @@ Cc: stable-rt@vger.kernel.org Reported-by: Oleg.Karfich@wago.com Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - fs/dcache.c | 12 +++++++----- - fs/inode.c | 2 +- - fs/libfs.c | 6 ++++-- - include/linux/fs.h | 2 +- + fs/dcache.c | 12 +++++++----- + fs/inode.c | 2 +- + fs/libfs.c | 6 ++++-- + include/linux/fs.h | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) +diff --git a/fs/dcache.c b/fs/dcache.c +index 7e15f1bff5ea..173b53b536f0 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2400,9 +2400,10 @@ EXPORT_SYMBOL(d_rehash); @@ -37,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return n; cpu_relax(); } -@@ -2410,7 +2411,8 @@ static inline unsigned start_dir_add(str +@@ -2410,7 +2411,8 @@ static inline unsigned start_dir_add(struct inode *dir) static inline void end_dir_add(struct inode *dir, unsigned n) { @@ -47,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static void d_wait_lookup(struct dentry *dentry) -@@ -2443,7 +2445,7 @@ struct dentry *d_alloc_parallel(struct d +@@ -2443,7 +2445,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, retry: rcu_read_lock(); @@ -56,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> r_seq = read_seqbegin(&rename_lock); dentry = __d_lookup_rcu(parent, name, &d_seq); if (unlikely(dentry)) { -@@ -2471,7 +2473,7 @@ struct dentry *d_alloc_parallel(struct d +@@ -2471,7 +2473,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, } hlist_bl_lock(b); @@ -65,9 +69,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> hlist_bl_unlock(b); rcu_read_unlock(); goto retry; +diff --git a/fs/inode.c b/fs/inode.c +index 42f6d25f32a5..97f11df6ca6a 100644 --- a/fs/inode.c +++ b/fs/inode.c -@@ -155,7 +155,7 @@ int inode_init_always(struct super_block +@@ -155,7 +155,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) inode->i_bdev = NULL; inode->i_cdev = NULL; inode->i_link = NULL; @@ -76,9 +82,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> inode->i_rdev = 0; inode->dirtied_when = 0; +diff --git a/fs/libfs.c b/fs/libfs.c +index 0fb590d79f30..cd95874a1952 100644 --- a/fs/libfs.c +++ b/fs/libfs.c -@@ -90,7 +90,7 @@ static struct dentry *next_positive(stru +@@ -90,7 +90,7 @@ static struct dentry *next_positive(struct dentry *parent, struct list_head *from, int count) { @@ -87,7 +95,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct dentry *res; struct list_head *p; bool skipped; -@@ -123,8 +123,9 @@ static struct dentry *next_positive(stru +@@ -123,8 +123,9 @@ static struct dentry *next_positive(struct dentry *parent, static void move_cursor(struct dentry *cursor, struct list_head *after) { struct dentry *parent = cursor->d_parent; @@ -98,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> for (;;) { n = *seq; if (!(n & 1) && cmpxchg(seq, n, n + 1) == n) -@@ -137,6 +138,7 @@ static void move_cursor(struct dentry *c +@@ -137,6 +138,7 @@ static void move_cursor(struct dentry *cursor, struct list_head *after) else list_add_tail(&cursor->d_child, &parent->d_subdirs); smp_store_release(seq, n + 2); @@ -106,6 +114,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> spin_unlock(&parent->d_lock); } +diff --git a/include/linux/fs.h b/include/linux/fs.h +index 7b6084854bfe..6782a83a8d4f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -669,7 +669,7 @@ struct inode { @@ -117,3 +127,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> }; __u32 i_generation; +-- +2.20.1 + diff --git a/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch b/debian/patches-rt/0176-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch index 46cd252ba..a04a24cb5 100644 --- a/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch +++ b/debian/patches-rt/0176-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch @@ -1,8 +1,9 @@ +From 00b3c613749d2d91319d2889aba0cdec40ebccbc Mon Sep 17 00:00:00 2001 From: Julia Cartwright <julia@ni.com> Date: Mon, 7 May 2018 08:58:57 -0500 -Subject: [PATCH] squashfs: make use of local lock in multi_cpu +Subject: [PATCH 176/266] squashfs: make use of local lock in multi_cpu decompressor -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Currently, the squashfs multi_cpu decompressor makes use of get_cpu_ptr()/put_cpu_ptr(), which unconditionally disable preemption @@ -22,9 +23,11 @@ Tested-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Julia Cartwright <julia@ni.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - fs/squashfs/decompressor_multi_percpu.c | 16 ++++++++++++---- + fs/squashfs/decompressor_multi_percpu.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) +diff --git a/fs/squashfs/decompressor_multi_percpu.c b/fs/squashfs/decompressor_multi_percpu.c +index 23a9c28ad8ea..6a73c4fa88e7 100644 --- a/fs/squashfs/decompressor_multi_percpu.c +++ b/fs/squashfs/decompressor_multi_percpu.c @@ -10,6 +10,7 @@ @@ -44,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> void *squashfs_decompressor_create(struct squashfs_sb_info *msblk, void *comp_opts) { -@@ -79,10 +82,15 @@ int squashfs_decompress(struct squashfs_ +@@ -79,10 +82,15 @@ int squashfs_decompress(struct squashfs_sb_info *msblk, struct buffer_head **bh, { struct squashfs_stream __percpu *percpu = (struct squashfs_stream __percpu *) msblk->stream; @@ -64,3 +67,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (res < 0) ERROR("%s decompression failed, data probably corrupt\n", +-- +2.20.1 + diff --git a/debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch b/debian/patches-rt/0177-thermal-Defer-thermal-wakups-to-threads.patch index a5faf5dce..d6a7b8f37 100644 --- a/debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch +++ b/debian/patches-rt/0177-thermal-Defer-thermal-wakups-to-threads.patch @@ -1,7 +1,8 @@ +From f5c77040bd15f792f0fa071f4952d2e0a9dabdb5 Mon Sep 17 00:00:00 2001 From: Daniel Wagner <wagi@monom.org> Date: Tue, 17 Feb 2015 09:37:44 +0100 -Subject: thermal: Defer thermal wakups to threads -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 177/266] thermal: Defer thermal wakups to threads +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On RT the spin lock in pkg_temp_thermal_platfrom_thermal_notify will call schedule while we run in irq context. @@ -24,9 +25,11 @@ Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> [bigeasy: reoder init/denit position. TODO: flush swork on exit] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/thermal/x86_pkg_temp_thermal.c | 52 +++++++++++++++++++++++++++++++-- + drivers/thermal/x86_pkg_temp_thermal.c | 52 ++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) +diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c +index 1ef937d799e4..a5991cbb408f 100644 --- a/drivers/thermal/x86_pkg_temp_thermal.c +++ b/drivers/thermal/x86_pkg_temp_thermal.c @@ -29,6 +29,7 @@ @@ -37,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <asm/cpu_device_id.h> #include <asm/mce.h> -@@ -329,7 +330,7 @@ static void pkg_thermal_schedule_work(in +@@ -329,7 +330,7 @@ static void pkg_thermal_schedule_work(int cpu, struct delayed_work *work) schedule_delayed_work_on(cpu, work, ms); } @@ -46,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { int cpu = smp_processor_id(); struct pkg_device *pkgdev; -@@ -348,9 +349,47 @@ static int pkg_thermal_notify(u64 msr_va +@@ -348,9 +349,47 @@ static int pkg_thermal_notify(u64 msr_val) } spin_unlock_irqrestore(&pkg_temp_lock, flags); @@ -94,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static int pkg_temp_thermal_device_add(unsigned int cpu) { int pkgid = topology_logical_package_id(cpu); -@@ -515,11 +554,16 @@ static int __init pkg_temp_thermal_init( +@@ -515,11 +554,16 @@ static int __init pkg_temp_thermal_init(void) if (!x86_match_cpu(pkg_temp_thermal_ids)) return -ENODEV; @@ -113,7 +116,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "thermal/x86_pkg:online", pkg_thermal_cpu_online, pkg_thermal_cpu_offline); -@@ -537,6 +581,7 @@ static int __init pkg_temp_thermal_init( +@@ -537,6 +581,7 @@ static int __init pkg_temp_thermal_init(void) return 0; err: @@ -121,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> kfree(packages); return ret; } -@@ -550,6 +595,7 @@ static void __exit pkg_temp_thermal_exit +@@ -550,6 +595,7 @@ static void __exit pkg_temp_thermal_exit(void) cpuhp_remove_state(pkg_thermal_hp_state); debugfs_remove_recursive(debugfs); kfree(packages); @@ -129,3 +132,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } module_exit(pkg_temp_thermal_exit) +-- +2.20.1 + diff --git a/debian/patches-rt/x86-fpu-Disable-preemption-around-local_bh_disable.patch b/debian/patches-rt/0178-x86-fpu-Disable-preemption-around-local_bh_disable.patch index facdc2765..c62323915 100644 --- a/debian/patches-rt/x86-fpu-Disable-preemption-around-local_bh_disable.patch +++ b/debian/patches-rt/0178-x86-fpu-Disable-preemption-around-local_bh_disable.patch @@ -1,7 +1,8 @@ +From 482c1d809f42cca299aab151b70a6bd10aaef96c Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 11 Dec 2018 15:10:33 +0100 -Subject: [PATCH] x86/fpu: Disable preemption around local_bh_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 178/266] x86/fpu: Disable preemption around local_bh_disable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz __fpu__restore_sig() restores the content of the FPU state in the CPUs and in order to avoid concurency it disbles BH. On !RT it also disables @@ -12,12 +13,14 @@ Add preempt_disable() while the FPU state is restored. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/kernel/fpu/signal.c | 2 ++ + arch/x86/kernel/fpu/signal.c | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c +index d99a8ee9e185..5e0274a94133 100644 --- a/arch/x86/kernel/fpu/signal.c +++ b/arch/x86/kernel/fpu/signal.c -@@ -344,10 +344,12 @@ static int __fpu__restore_sig(void __use +@@ -344,10 +344,12 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size) sanitize_restored_xstate(tsk, &env, xfeatures, fx_only); } @@ -30,3 +33,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return err; } else { +-- +2.20.1 + diff --git a/debian/patches-rt/epoll-use-get-cpu-light.patch b/debian/patches-rt/0179-fs-epoll-Do-not-disable-preemption-on-RT.patch index 2230da3c2..10424be86 100644 --- a/debian/patches-rt/epoll-use-get-cpu-light.patch +++ b/debian/patches-rt/0179-fs-epoll-Do-not-disable-preemption-on-RT.patch @@ -1,7 +1,8 @@ -Subject: fs/epoll: Do not disable preemption on RT +From 39b0991fe910916dc29605b766be44eb0dae1026 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Fri, 08 Jul 2011 16:35:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Fri, 8 Jul 2011 16:35:35 +0200 +Subject: [PATCH 179/266] fs/epoll: Do not disable preemption on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz ep_call_nested() takes a sleeping lock so we can't disable preemption. The light version is enough since ep_call_nested() doesn't mind beeing @@ -9,12 +10,14 @@ invoked twice on the same CPU. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - fs/eventpoll.c | 4 ++-- + fs/eventpoll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/fs/eventpoll.c b/fs/eventpoll.c +index 58f48ea0db23..a41120a34e6d 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c -@@ -571,12 +571,12 @@ static int ep_poll_wakeup_proc(void *pri +@@ -571,12 +571,12 @@ static int ep_poll_wakeup_proc(void *priv, void *cookie, int call_nests) static void ep_poll_safewake(wait_queue_head_t *wq) { @@ -29,3 +32,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } #else +-- +2.20.1 + diff --git a/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch b/debian/patches-rt/0180-mm-vmalloc-Another-preempt-disable-region-which-suck.patch index 4d57a6a20..4b23ece53 100644 --- a/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch +++ b/debian/patches-rt/0180-mm-vmalloc-Another-preempt-disable-region-which-suck.patch @@ -1,19 +1,23 @@ -Subject: mm/vmalloc: Another preempt disable region which sucks +From 66324075b4c64550ab72d8947287bfa8f04e1c88 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 12 Jul 2011 11:39:36 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 180/266] mm/vmalloc: Another preempt disable region which + sucks +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Avoid the preempt disable version of get_cpu_var(). The inner-lock should provide enough serialisation. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - mm/vmalloc.c | 13 ++++++++----- + mm/vmalloc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) +diff --git a/mm/vmalloc.c b/mm/vmalloc.c +index 91a789a46b12..32e43ad5bbdb 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c -@@ -848,7 +848,7 @@ static void *new_vmap_block(unsigned int +@@ -848,7 +848,7 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask) struct vmap_block *vb; struct vmap_area *va; unsigned long vb_idx; @@ -22,7 +26,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void *vaddr; node = numa_node_id(); -@@ -891,11 +891,12 @@ static void *new_vmap_block(unsigned int +@@ -891,11 +891,12 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask) BUG_ON(err); radix_tree_preload_end(); @@ -37,7 +41,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return vaddr; } -@@ -964,6 +965,7 @@ static void *vb_alloc(unsigned long size +@@ -964,6 +965,7 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask) struct vmap_block *vb; void *vaddr = NULL; unsigned int order; @@ -45,7 +49,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> BUG_ON(offset_in_page(size)); BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC); -@@ -978,7 +980,8 @@ static void *vb_alloc(unsigned long size +@@ -978,7 +980,8 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask) order = get_order(size); rcu_read_lock(); @@ -55,7 +59,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> list_for_each_entry_rcu(vb, &vbq->free, free_list) { unsigned long pages_off; -@@ -1001,7 +1004,7 @@ static void *vb_alloc(unsigned long size +@@ -1001,7 +1004,7 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask) break; } @@ -64,3 +68,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> rcu_read_unlock(); /* Allocate new block if nothing was found */ +-- +2.20.1 + diff --git a/debian/patches-rt/block-mq-use-cpu_light.patch b/debian/patches-rt/0181-block-mq-use-cpu_light.patch index 1ad6a2df8..0ce49efd1 100644 --- a/debian/patches-rt/block-mq-use-cpu_light.patch +++ b/debian/patches-rt/0181-block-mq-use-cpu_light.patch @@ -1,19 +1,22 @@ +From a3476724b95cfe5022254b5f370fe1aa2ed83a1e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 9 Apr 2014 10:37:23 +0200 -Subject: block: mq: use cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 181/266] block: mq: use cpu_light() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz there is a might sleep splat because get_cpu() disables preemption and later we grab a lock. As a workaround for this we use get_cpu_light(). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - block/blk-mq.h | 4 ++-- + block/blk-mq.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/block/blk-mq.h b/block/blk-mq.h +index 9497b47e2526..e55c8599b90b 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h -@@ -113,12 +113,12 @@ static inline struct blk_mq_ctx *__blk_m +@@ -113,12 +113,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) { @@ -28,3 +31,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } struct blk_mq_alloc_data { +-- +2.20.1 + diff --git a/debian/patches-rt/block-mq-drop-preempt-disable.patch b/debian/patches-rt/0182-block-mq-do-not-invoke-preempt_disable.patch index 520a7e221..f90b40da8 100644 --- a/debian/patches-rt/block-mq-drop-preempt-disable.patch +++ b/debian/patches-rt/0182-block-mq-do-not-invoke-preempt_disable.patch @@ -1,7 +1,8 @@ +From 8ab35120c61aacf96969ec11474e7eaa1e9f8acd Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: block/mq: do not invoke preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 182/266] block/mq: do not invoke preempt_disable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz preempt_disable() and get_cpu() don't play well together with the sleeping locks it tries to allocate later. @@ -9,12 +10,14 @@ It seems to be enough to replace it with get_cpu_light() and migrate_disable(). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - block/blk-mq.c | 10 +++++----- + block/blk-mq.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) +diff --git a/block/blk-mq.c b/block/blk-mq.c +index b0d0b74cf5a6..430037cda971 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c -@@ -570,7 +570,7 @@ static void __blk_mq_complete_request(st +@@ -570,7 +570,7 @@ static void __blk_mq_complete_request(struct request *rq) return; } @@ -23,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!test_bit(QUEUE_FLAG_SAME_FORCE, &rq->q->queue_flags)) shared = cpus_share_cache(cpu, ctx->cpu); -@@ -582,7 +582,7 @@ static void __blk_mq_complete_request(st +@@ -582,7 +582,7 @@ static void __blk_mq_complete_request(struct request *rq) } else { rq->q->softirq_done_fn(rq); } @@ -32,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static void hctx_unlock(struct blk_mq_hw_ctx *hctx, int srcu_idx) -@@ -1360,14 +1360,14 @@ static void __blk_mq_delay_run_hw_queue( +@@ -1368,14 +1368,14 @@ static void __blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async, return; if (!async && !(hctx->flags & BLK_MQ_F_BLOCKING)) { @@ -50,3 +53,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } kblockd_mod_delayed_work_on(blk_mq_hctx_next_cpu(hctx), &hctx->run_work, +-- +2.20.1 + diff --git a/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch b/debian/patches-rt/0183-block-mq-don-t-complete-requests-via-IPI.patch index cab933645..ca0dac020 100644 --- a/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch +++ b/debian/patches-rt/0183-block-mq-don-t-complete-requests-via-IPI.patch @@ -1,22 +1,25 @@ +From 45847d8391ade61ca033a1232bb42bd67290576e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 29 Jan 2015 15:10:08 +0100 -Subject: block/mq: don't complete requests via IPI -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 183/266] block/mq: don't complete requests via IPI +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The IPI runs in hardirq context and there are sleeping locks. This patch moves the completion into a workqueue. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - block/blk-core.c | 3 +++ - block/blk-mq.c | 23 +++++++++++++++++++++++ - include/linux/blk-mq.h | 2 +- - include/linux/blkdev.h | 3 +++ + block/blk-core.c | 3 +++ + block/blk-mq.c | 23 +++++++++++++++++++++++ + include/linux/blk-mq.h | 2 +- + include/linux/blkdev.h | 3 +++ 4 files changed, 30 insertions(+), 1 deletion(-) +diff --git a/block/blk-core.c b/block/blk-core.c +index eb8b52241453..581bf704154a 100644 --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -189,6 +189,9 @@ void blk_rq_init(struct request_queue *q +@@ -189,6 +189,9 @@ void blk_rq_init(struct request_queue *q, struct request *rq) INIT_LIST_HEAD(&rq->queuelist); INIT_LIST_HEAD(&rq->timeout_list); @@ -26,9 +29,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rq->cpu = -1; rq->q = q; rq->__sector = (sector_t) -1; +diff --git a/block/blk-mq.c b/block/blk-mq.c +index 430037cda971..9560ebae322d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c -@@ -320,6 +320,9 @@ static struct request *blk_mq_rq_ctx_ini +@@ -320,6 +320,9 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, rq->extra_len = 0; rq->__deadline = 0; @@ -38,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> INIT_LIST_HEAD(&rq->timeout_list); rq->timeout = 0; -@@ -547,12 +550,24 @@ void blk_mq_end_request(struct request * +@@ -547,12 +550,24 @@ void blk_mq_end_request(struct request *rq, blk_status_t error) } EXPORT_SYMBOL(blk_mq_end_request); @@ -63,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void __blk_mq_complete_request(struct request *rq) { -@@ -575,10 +590,18 @@ static void __blk_mq_complete_request(st +@@ -575,10 +590,18 @@ static void __blk_mq_complete_request(struct request *rq) shared = cpus_share_cache(cpu, ctx->cpu); if (cpu != ctx->cpu && !shared && cpu_online(ctx->cpu)) { @@ -82,9 +87,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } else { rq->q->softirq_done_fn(rq); } +diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h +index 1da59c16f637..04c15b5ca76c 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h -@@ -249,7 +249,7 @@ static inline u16 blk_mq_unique_tag_to_t +@@ -249,7 +249,7 @@ static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag) return unique_tag & BLK_MQ_UNIQUE_TAG_MASK; } @@ -93,6 +100,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> int blk_mq_request_started(struct request *rq); void blk_mq_start_request(struct request *rq); void blk_mq_end_request(struct request *rq, blk_status_t error); +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h +index 6980014357d4..f93ae914abda 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -149,6 +149,9 @@ enum mq_rq_state { @@ -105,3 +114,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct blk_mq_ctx *mq_ctx; int cpu; +-- +2.20.1 + diff --git a/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch b/debian/patches-rt/0184-md-raid5-Make-raid5_percpu-handling-RT-aware.patch index 10941b8e6..e1e67697b 100644 --- a/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch +++ b/debian/patches-rt/0184-md-raid5-Make-raid5_percpu-handling-RT-aware.patch @@ -1,7 +1,8 @@ +From e4d91b9abed3e9b3c02750eaec73c6f1175dd775 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 6 Apr 2010 16:51:31 +0200 -Subject: md: raid5: Make raid5_percpu handling RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 184/266] md: raid5: Make raid5_percpu handling RT aware +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz __raid_run_ops() disables preemption with get_cpu() around the access to the raid5_percpu variables. That causes scheduling while atomic @@ -13,15 +14,16 @@ preemptible. Reported-by: Udo van den Heuvel <udovdh@xs4all.nl> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Udo van den Heuvel <udovdh@xs4all.nl> - --- - drivers/md/raid5.c | 8 +++++--- - drivers/md/raid5.h | 1 + + drivers/md/raid5.c | 8 +++++--- + drivers/md/raid5.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) +diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c +index ae38895c44b2..abc559dc516f 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c -@@ -2069,8 +2069,9 @@ static void raid_run_ops(struct stripe_h +@@ -2069,8 +2069,9 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request) struct raid5_percpu *percpu; unsigned long cpu; @@ -32,7 +34,7 @@ Tested-by: Udo van den Heuvel <udovdh@xs4all.nl> if (test_bit(STRIPE_OP_BIOFILL, &ops_request)) { ops_run_biofill(sh); overlap_clear++; -@@ -2129,7 +2130,8 @@ static void raid_run_ops(struct stripe_h +@@ -2129,7 +2130,8 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request) if (test_and_clear_bit(R5_Overlap, &dev->flags)) wake_up(&sh->raid_conf->wait_for_overlap); } @@ -42,7 +44,7 @@ Tested-by: Udo van den Heuvel <udovdh@xs4all.nl> } static void free_stripe(struct kmem_cache *sc, struct stripe_head *sh) -@@ -6803,6 +6805,7 @@ static int raid456_cpu_up_prepare(unsign +@@ -6803,6 +6805,7 @@ static int raid456_cpu_up_prepare(unsigned int cpu, struct hlist_node *node) __func__, cpu); return -ENOMEM; } @@ -50,7 +52,7 @@ Tested-by: Udo van den Heuvel <udovdh@xs4all.nl> return 0; } -@@ -6813,7 +6816,6 @@ static int raid5_alloc_percpu(struct r5c +@@ -6813,7 +6816,6 @@ static int raid5_alloc_percpu(struct r5conf *conf) conf->percpu = alloc_percpu(struct raid5_percpu); if (!conf->percpu) return -ENOMEM; @@ -58,6 +60,8 @@ Tested-by: Udo van den Heuvel <udovdh@xs4all.nl> err = cpuhp_state_add_instance(CPUHP_MD_RAID5_PREPARE, &conf->node); if (!err) { conf->scribble_disks = max(conf->raid_disks, +diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h +index 8474c224127b..a3bf907ab2af 100644 --- a/drivers/md/raid5.h +++ b/drivers/md/raid5.h @@ -637,6 +637,7 @@ struct r5conf { @@ -68,3 +72,6 @@ Tested-by: Udo van den Heuvel <udovdh@xs4all.nl> struct page *spare_page; /* Used when checking P/Q in raid6 */ struct flex_array *scribble; /* space for constructing buffer * lists and performing address +-- +2.20.1 + diff --git a/debian/patches-rt/rt-introduce-cpu-chill.patch b/debian/patches-rt/0185-rt-Introduce-cpu_chill.patch index 222b6ff51..b079c7eff 100644 --- a/debian/patches-rt/rt-introduce-cpu-chill.patch +++ b/debian/patches-rt/0185-rt-Introduce-cpu_chill.patch @@ -1,7 +1,8 @@ -Subject: rt: Introduce cpu_chill() +From 336adb234fa01301ae7d8c0d70ebad5554a5eca4 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 07 Mar 2012 20:51:03 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Wed, 7 Mar 2012 20:51:03 +0100 +Subject: [PATCH 185/266] rt: Introduce cpu_chill() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() @@ -56,13 +57,15 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/delay.h | 6 ++++++ - kernel/time/hrtimer.c | 21 +++++++++++++++++++++ + include/linux/delay.h | 6 ++++++ + kernel/time/hrtimer.c | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) +diff --git a/include/linux/delay.h b/include/linux/delay.h +index b78bab4395d8..7c4bc414a504 100644 --- a/include/linux/delay.h +++ b/include/linux/delay.h -@@ -64,4 +64,10 @@ static inline void ssleep(unsigned int s +@@ -64,4 +64,10 @@ static inline void ssleep(unsigned int seconds) msleep(seconds * 1000); } @@ -73,9 +76,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +#endif + #endif /* defined(_LINUX_DELAY_H) */ +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index cfa3599fa789..851b2134e77f 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1894,6 +1894,27 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct +@@ -1894,6 +1894,27 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, } #endif @@ -103,3 +108,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Functions related to boot-time initialization: */ +-- +2.20.1 + diff --git a/debian/patches-rt/hrtimer-Don-t-lose-state-in-cpu_chill.patch b/debian/patches-rt/0186-hrtimer-Don-t-lose-state-in-cpu_chill.patch index e6cdcf071..acfafd5bf 100644 --- a/debian/patches-rt/hrtimer-Don-t-lose-state-in-cpu_chill.patch +++ b/debian/patches-rt/0186-hrtimer-Don-t-lose-state-in-cpu_chill.patch @@ -1,7 +1,8 @@ +From 4f09277700f2c83eddc6b233065946c0ee7237d3 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 19 Feb 2019 16:59:15 +0100 -Subject: [PATCH] hrtimer: Don't lose state in cpu_chill() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 186/266] hrtimer: Don't lose state in cpu_chill() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In cpu_chill() the state is set to TASK_UNINTERRUPTIBLE and a timer is programmed. On return the state is always TASK_RUNNING which means we @@ -15,9 +16,11 @@ state in order to avoid updating ->task_state_change. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/time/hrtimer.c | 5 ++++- + kernel/time/hrtimer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 851b2134e77f..6f2736ec4b8e 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1902,15 +1902,18 @@ void cpu_chill(void) @@ -40,3 +43,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL(cpu_chill); #endif +-- +2.20.1 + diff --git a/debian/patches-rt/hrtimer-cpu_chill-save-task-state-in-saved_state.patch b/debian/patches-rt/0187-hrtimer-cpu_chill-save-task-state-in-saved_state.patch index 2eadcd7f9..e8792b4de 100644 --- a/debian/patches-rt/hrtimer-cpu_chill-save-task-state-in-saved_state.patch +++ b/debian/patches-rt/0187-hrtimer-cpu_chill-save-task-state-in-saved_state.patch @@ -1,7 +1,9 @@ +From fd7d956a5a4f34ccd0a91b2fbd37367e8d666bec Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 26 Feb 2019 12:31:10 +0100 -Subject: [PATCH] hrtimer: cpu_chill(): save task state in ->saved_state() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 187/266] hrtimer: cpu_chill(): save task state in + ->saved_state() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In the previous change I saved the current task state on stack. This was bad because while the task is scheduled-out it might receive a wake-up. @@ -15,12 +17,14 @@ Reported-by: Mike Galbraith <efault@gmx.de> Tested-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/time/hrtimer.c | 18 +++++++++++++----- + kernel/time/hrtimer.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index 6f2736ec4b8e..e1040b80362c 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1900,20 +1900,28 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct +@@ -1900,20 +1900,28 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, */ void cpu_chill(void) { @@ -54,3 +58,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL(cpu_chill); #endif +-- +2.20.1 + diff --git a/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch b/debian/patches-rt/0188-block-blk-mq-move-blk_queue_usage_counter_release-in.patch index a0bccbbb8..4de02495a 100644 --- a/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch +++ b/debian/patches-rt/0188-block-blk-mq-move-blk_queue_usage_counter_release-in.patch @@ -1,8 +1,9 @@ +From e08fb0c66c4fd6b8cfad1f3a8211699472b97f5b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 13 Mar 2018 13:49:16 +0100 -Subject: [PATCH] block: blk-mq: move blk_queue_usage_counter_release() +Subject: [PATCH 188/266] block: blk-mq: move blk_queue_usage_counter_release() into process context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 | in_atomic(): 1, irqs_disabled(): 0, pid: 255, name: kworker/u257:6 @@ -46,13 +47,15 @@ The wq_has_sleeper() check has been suggested by Peter Zijlstra. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - block/blk-core.c | 14 +++++++++++++- - include/linux/blkdev.h | 2 ++ + block/blk-core.c | 14 +++++++++++++- + include/linux/blkdev.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) +diff --git a/block/blk-core.c b/block/blk-core.c +index 581bf704154a..0a651b442cec 100644 --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -968,12 +968,21 @@ void blk_queue_exit(struct request_queue +@@ -968,12 +968,21 @@ void blk_queue_exit(struct request_queue *q) percpu_ref_put(&q->q_usage_counter); } @@ -75,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static void blk_rq_timed_out_timer(struct timer_list *t) -@@ -1066,6 +1075,7 @@ struct request_queue *blk_alloc_queue_no +@@ -1066,6 +1075,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); @@ -92,6 +95,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> request_cachep = kmem_cache_create("blkdev_requests", sizeof(struct request), 0, SLAB_PANIC, NULL); +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h +index f93ae914abda..940c794042ae 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -27,6 +27,7 @@ @@ -110,3 +115,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct percpu_ref q_usage_counter; struct list_head all_q_node; +-- +2.20.1 + diff --git a/debian/patches-rt/block-use-cpu-chill.patch b/debian/patches-rt/0189-block-Use-cpu_chill-for-retry-loops.patch index b8087aabd..74139a608 100644 --- a/debian/patches-rt/block-use-cpu-chill.patch +++ b/debian/patches-rt/0189-block-Use-cpu_chill-for-retry-loops.patch @@ -1,7 +1,8 @@ -Subject: block: Use cpu_chill() for retry loops +From 5012d2406de9f26b056bf87baa45c7b278fa1fbd Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 20 Dec 2012 18:28:26 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 189/266] block: Use cpu_chill() for retry loops +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Steven also observed a live lock when there was a @@ -11,11 +12,12 @@ Use cpu_chill() instead of cpu_relax() to let the system make progress. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - block/blk-ioc.c | 5 +++-- + block/blk-ioc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) +diff --git a/block/blk-ioc.c b/block/blk-ioc.c +index 01580f88fcb3..98d87e52ccdc 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c @@ -9,6 +9,7 @@ @@ -26,7 +28,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include "blk.h" -@@ -118,7 +119,7 @@ static void ioc_release_fn(struct work_s +@@ -118,7 +119,7 @@ static void ioc_release_fn(struct work_struct *work) spin_unlock(q->queue_lock); } else { spin_unlock_irqrestore(&ioc->lock, flags); @@ -35,7 +37,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> spin_lock_irqsave_nested(&ioc->lock, flags, 1); } } -@@ -202,7 +203,7 @@ void put_io_context_active(struct io_con +@@ -202,7 +203,7 @@ void put_io_context_active(struct io_context *ioc) spin_unlock(icq->q->queue_lock); } else { spin_unlock_irqrestore(&ioc->lock, flags); @@ -44,3 +46,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> goto retry; } } +-- +2.20.1 + diff --git a/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch b/debian/patches-rt/0190-fs-dcache-Use-cpu_chill-in-trylock-loops.patch index d9c23bc84..603052e99 100644 --- a/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch +++ b/debian/patches-rt/0190-fs-dcache-Use-cpu_chill-in-trylock-loops.patch @@ -1,19 +1,21 @@ -Subject: fs: dcache: Use cpu_chill() in trylock loops +From 945dddbc331ba33e6ba9826125e5752a99cb752d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 07 Mar 2012 21:00:34 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Wed, 7 Mar 2012 21:00:34 +0100 +Subject: [PATCH 190/266] fs: dcache: Use cpu_chill() in trylock loops +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system make progress. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - fs/autofs/expire.c | 3 ++- - fs/namespace.c | 8 ++++++-- + fs/autofs/expire.c | 3 ++- + fs/namespace.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) +diff --git a/fs/autofs/expire.c b/fs/autofs/expire.c +index 28d9c2b1b3bb..354b7147cead 100644 --- a/fs/autofs/expire.c +++ b/fs/autofs/expire.c @@ -8,6 +8,7 @@ @@ -24,7 +26,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include "autofs_i.h" /* Check if a dentry can be expired */ -@@ -153,7 +154,7 @@ static struct dentry *get_next_positive_ +@@ -153,7 +154,7 @@ static struct dentry *get_next_positive_dentry(struct dentry *prev, parent = p->d_parent; if (!spin_trylock(&parent->d_lock)) { spin_unlock(&p->d_lock); @@ -33,6 +35,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> goto relock; } spin_unlock(&p->d_lock); +diff --git a/fs/namespace.c b/fs/namespace.c +index 1fce41ba3535..5dc970027e30 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -14,6 +14,7 @@ @@ -57,3 +61,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * After the slowpath clears MNT_WRITE_HOLD, mnt_is_readonly will * be set to match its requirements. So we must not load that until +-- +2.20.1 + diff --git a/debian/patches-rt/net-use-cpu-chill.patch b/debian/patches-rt/0191-net-Use-cpu_chill-instead-of-cpu_relax.patch index e5f2eacc8..cf1f48b02 100644 --- a/debian/patches-rt/net-use-cpu-chill.patch +++ b/debian/patches-rt/0191-net-Use-cpu_chill-instead-of-cpu_relax.patch @@ -1,19 +1,21 @@ -Subject: net: Use cpu_chill() instead of cpu_relax() +From 762e21beb30e7fe62bc3aaa3af8a593576a60251 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 07 Mar 2012 21:10:04 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Wed, 7 Mar 2012 21:10:04 +0100 +Subject: [PATCH 191/266] net: Use cpu_chill() instead of cpu_relax() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system make progress. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - net/packet/af_packet.c | 5 +++-- - net/rds/ib_rdma.c | 3 ++- + net/packet/af_packet.c | 5 +++-- + net/rds/ib_rdma.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c +index fd16fb836df2..52b97a25a979 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -63,6 +63,7 @@ @@ -24,7 +26,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include <linux/kmod.h> #include <linux/slab.h> #include <linux/vmalloc.h> -@@ -667,7 +668,7 @@ static void prb_retire_rx_blk_timer_expi +@@ -667,7 +668,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... */ @@ -33,7 +35,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } -@@ -929,7 +930,7 @@ static void prb_retire_current_block(str +@@ -929,7 +930,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... */ @@ -42,6 +44,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } prb_close_block(pkc, pbd, po, status); +diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c +index 63c8d107adcf..671f8ad38864 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -34,6 +34,7 @@ @@ -52,7 +56,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include "rds_single_path.h" #include "ib_mr.h" -@@ -222,7 +223,7 @@ static inline void wait_clean_list_grace +@@ -222,7 +223,7 @@ static inline void wait_clean_list_grace(void) for_each_online_cpu(cpu) { flag = &per_cpu(clean_list_grace, cpu); while (test_bit(CLEAN_LIST_BUSY_BIT, flag)) @@ -61,3 +65,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } +-- +2.20.1 + diff --git a/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/debian/patches-rt/0192-fs-dcache-use-swait_queue-instead-of-waitqueue.patch index 9a7c97859..7d5cb1de0 100644 --- a/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ b/debian/patches-rt/0192-fs-dcache-use-swait_queue-instead-of-waitqueue.patch @@ -1,29 +1,32 @@ +From d6e169768be2b9d8769000195c06013127ccc4ec Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 14 Sep 2016 14:35:49 +0200 -Subject: [PATCH] fs/dcache: use swait_queue instead of waitqueue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 192/266] fs/dcache: use swait_queue instead of waitqueue +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz __d_lookup_done() invokes wake_up_all() while holding a hlist_bl_lock() which disables preemption. As a workaround convert it to swait. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - fs/cifs/readdir.c | 2 +- - fs/dcache.c | 27 +++++++++++++++------------ - fs/fuse/dir.c | 2 +- - fs/namei.c | 4 ++-- - fs/nfs/dir.c | 4 ++-- - fs/nfs/unlink.c | 4 ++-- - fs/proc/base.c | 2 +- - fs/proc/proc_sysctl.c | 2 +- - include/linux/dcache.h | 4 ++-- - include/linux/nfs_xdr.h | 2 +- - kernel/sched/swait.c | 1 + + fs/cifs/readdir.c | 2 +- + fs/dcache.c | 27 +++++++++++++++------------ + fs/fuse/dir.c | 2 +- + fs/namei.c | 4 ++-- + fs/nfs/dir.c | 4 ++-- + fs/nfs/unlink.c | 4 ++-- + fs/proc/base.c | 2 +- + fs/proc/proc_sysctl.c | 2 +- + include/linux/dcache.h | 4 ++-- + include/linux/nfs_xdr.h | 2 +- + kernel/sched/swait.c | 1 + 11 files changed, 29 insertions(+), 25 deletions(-) +diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c +index 3925a7bfc74d..33f7723fb83e 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c -@@ -80,7 +80,7 @@ cifs_prime_dcache(struct dentry *parent, +@@ -80,7 +80,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name, struct inode *inode; struct super_block *sb = parent->d_sb; struct cifs_sb_info *cifs_sb = CIFS_SB(sb); @@ -32,9 +35,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cifs_dbg(FYI, "%s: for %s\n", __func__, name->name); +diff --git a/fs/dcache.c b/fs/dcache.c +index 173b53b536f0..7cb44c7218a4 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -2417,21 +2417,24 @@ static inline void end_dir_add(struct in +@@ -2417,21 +2417,24 @@ static inline void end_dir_add(struct inode *dir, unsigned n) static void d_wait_lookup(struct dentry *dentry) { @@ -70,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { unsigned int hash = name->hash; struct hlist_bl_head *b = in_lookup_hash(parent, hash); -@@ -2546,7 +2549,7 @@ void __d_lookup_done(struct dentry *dent +@@ -2546,7 +2549,7 @@ void __d_lookup_done(struct dentry *dentry) hlist_bl_lock(b); dentry->d_flags &= ~DCACHE_PAR_LOOKUP; __hlist_bl_del(&dentry->d_u.d_in_lookup_hash); @@ -79,9 +84,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> dentry->d_wait = NULL; hlist_bl_unlock(b); INIT_HLIST_NODE(&dentry->d_u.d_alias); +diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c +index 82a13221775e..58324a93e3c0 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c -@@ -1203,7 +1203,7 @@ static int fuse_direntplus_link(struct f +@@ -1203,7 +1203,7 @@ static int fuse_direntplus_link(struct file *file, struct inode *dir = d_inode(parent); struct fuse_conn *fc; struct inode *inode; @@ -90,9 +97,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!o->nodeid) { /* +diff --git a/fs/namei.c b/fs/namei.c +index 914178cdbe94..2a8c41bc227f 100644 --- a/fs/namei.c +++ b/fs/namei.c -@@ -1645,7 +1645,7 @@ static struct dentry *__lookup_slow(cons +@@ -1645,7 +1645,7 @@ static struct dentry *__lookup_slow(const struct qstr *name, { struct dentry *dentry, *old; struct inode *inode = dir->d_inode; @@ -101,7 +110,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Don't go there if it's already dead */ if (unlikely(IS_DEADDIR(inode))) -@@ -3135,7 +3135,7 @@ static int lookup_open(struct nameidata +@@ -3135,7 +3135,7 @@ static int lookup_open(struct nameidata *nd, struct path *path, struct dentry *dentry; int error, create_error = 0; umode_t mode = op->mode; @@ -110,6 +119,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (unlikely(IS_DEADDIR(dir_inode))) return -ENOENT; +diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c +index 62afe8ca1e36..9818a5dfb472 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -445,7 +445,7 @@ static @@ -121,7 +132,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct dentry *dentry; struct dentry *alias; struct inode *dir = d_inode(parent); -@@ -1459,7 +1459,7 @@ int nfs_atomic_open(struct inode *dir, s +@@ -1459,7 +1459,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, struct file *file, unsigned open_flags, umode_t mode) { @@ -130,6 +141,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct nfs_open_context *ctx; struct dentry *res; struct iattr attr = { .ia_valid = ATTR_OPEN }; +diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c +index ce9100b5604d..839bfa76f41e 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c @@ -13,7 +13,7 @@ @@ -141,7 +154,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <linux/namei.h> #include <linux/fsnotify.h> -@@ -206,7 +206,7 @@ nfs_async_unlink(struct dentry *dentry, +@@ -206,7 +206,7 @@ nfs_async_unlink(struct dentry *dentry, const struct qstr *name) goto out_free_name; } data->res.dir_attr = &data->dir_attr; @@ -150,9 +163,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> status = -EBUSY; spin_lock(&dentry->d_lock); +diff --git a/fs/proc/base.c b/fs/proc/base.c +index 81d77b15b347..2c0ac4338e17 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c -@@ -1876,7 +1876,7 @@ bool proc_fill_cache(struct file *file, +@@ -1872,7 +1872,7 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, child = d_hash_and_lookup(dir, &qname); if (!child) { @@ -161,9 +176,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> child = d_alloc_parallel(dir, &qname, &wq); if (IS_ERR(child)) goto end_instantiate; +diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c +index 4d598a399bbf..2d8c5cd1a8c3 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c -@@ -677,7 +677,7 @@ static bool proc_sys_fill_cache(struct f +@@ -677,7 +677,7 @@ static bool proc_sys_fill_cache(struct file *file, child = d_lookup(dir, &qname); if (!child) { @@ -172,6 +189,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> child = d_alloc_parallel(dir, &qname, &wq); if (IS_ERR(child)) return false; +diff --git a/include/linux/dcache.h b/include/linux/dcache.h +index ef4b70f64f33..be6ab83705aa 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -105,7 +105,7 @@ struct dentry { @@ -183,7 +202,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> }; struct list_head d_child; /* child of parent list */ struct list_head d_subdirs; /* our children */ -@@ -236,7 +236,7 @@ extern struct dentry * d_alloc(struct de +@@ -236,7 +236,7 @@ extern struct dentry * d_alloc(struct dentry *, const struct qstr *); extern struct dentry * d_alloc_anon(struct super_block *); extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *); extern struct dentry * d_alloc_parallel(struct dentry *, const struct qstr *, @@ -192,6 +211,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> extern struct dentry * d_splice_alias(struct inode *, struct dentry *); extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); extern struct dentry * d_exact_alias(struct dentry *, struct inode *); +diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h +index bd1c889a9ed9..1fc27eb1f021 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -1549,7 +1549,7 @@ struct nfs_unlinkdata { @@ -203,9 +224,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct rpc_cred *cred; struct nfs_fattr dir_attr; long timeout; +diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c +index c7cb30cdd1b7..119a56d7f739 100644 --- a/kernel/sched/swait.c +++ b/kernel/sched/swait.c -@@ -70,6 +70,7 @@ void swake_up_all(struct swait_queue_hea +@@ -70,6 +70,7 @@ void swake_up_all(struct swait_queue_head *q) struct swait_queue *curr; LIST_HEAD(tmp); @@ -213,3 +236,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> raw_spin_lock_irq(&q->lock); list_splice_init(&q->task_list, &tmp); while (!list_empty(&tmp)) { +-- +2.20.1 + diff --git a/debian/patches-rt/workqueue-use-rcu.patch b/debian/patches-rt/0193-workqueue-Use-normal-rcu.patch index 66c6f9986..7ffdf67cf 100644 --- a/debian/patches-rt/workqueue-use-rcu.patch +++ b/debian/patches-rt/0193-workqueue-Use-normal-rcu.patch @@ -1,7 +1,8 @@ -Subject: workqueue: Use normal rcu +From 98fc72ef0aa784748c91a7cf3694a3a0d71849e7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 24 Jul 2013 15:26:54 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 193/266] workqueue: Use normal rcu +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz There is no need for sched_rcu. The undocumented reason why sched_rcu is used is to avoid a few explicit rcu_read_lock()/unlock() pairs by @@ -10,9 +11,11 @@ protected by preempt or irq disabled regions. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/workqueue.c | 95 +++++++++++++++++++++++++++++------------------------ + kernel/workqueue.c | 95 +++++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 43 deletions(-) +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index 0280deac392e..ca8014edaa84 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -127,7 +127,7 @@ enum { @@ -51,7 +54,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> * determined without grabbing wq->mutex. */ struct work_struct unbound_release_work; -@@ -357,20 +357,20 @@ static void workqueue_sysfs_unregister(s +@@ -357,20 +357,20 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); #include <trace/events/workqueue.h> #define assert_rcu_or_pool_mutex() \ @@ -78,7 +81,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define for_each_cpu_worker_pool(pool, cpu) \ for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; \ -@@ -382,7 +382,7 @@ static void workqueue_sysfs_unregister(s +@@ -382,7 +382,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); * @pool: iteration cursor * @pi: integer used for iteration * @@ -87,7 +90,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> * locked. If the pool needs to be used beyond the locking in effect, the * caller is responsible for guaranteeing that the pool stays online. * -@@ -414,7 +414,7 @@ static void workqueue_sysfs_unregister(s +@@ -414,7 +414,7 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); * @pwq: iteration cursor * @wq: the target workqueue * @@ -96,7 +99,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> * If the pwq needs to be used beyond the locking in effect, the caller is * responsible for guaranteeing that the pwq stays online. * -@@ -550,7 +550,7 @@ static int worker_pool_assign_id(struct +@@ -550,7 +550,7 @@ static int worker_pool_assign_id(struct worker_pool *pool) * @wq: the target workqueue * @node: the node ID * @@ -105,7 +108,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> * 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. -@@ -694,8 +694,8 @@ static struct pool_workqueue *get_work_p +@@ -694,8 +694,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 @@ -116,7 +119,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> * * 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 -@@ -1100,7 +1100,7 @@ static void put_pwq_unlocked(struct pool +@@ -1100,7 +1100,7 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq) { if (pwq) { /* @@ -125,7 +128,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> * following lock operations are safe. */ spin_lock_irq(&pwq->pool->lock); -@@ -1228,6 +1228,7 @@ static int try_to_grab_pending(struct wo +@@ -1228,6 +1228,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; @@ -133,7 +136,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * The queueing is in progress, or it is already queued. Try to * steal it from ->worklist without clearing WORK_STRUCT_PENDING. -@@ -1266,10 +1267,12 @@ static int try_to_grab_pending(struct wo +@@ -1266,10 +1267,12 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, set_work_pool_and_keep_pending(work, pool->id); spin_unlock(&pool->lock); @@ -146,7 +149,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> local_irq_restore(*flags); if (work_is_canceling(work)) return -ENOENT; -@@ -1383,6 +1386,7 @@ static void __queue_work(int cpu, struct +@@ -1383,6 +1386,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; @@ -154,7 +157,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> retry: if (req_cpu == WORK_CPU_UNBOUND) cpu = wq_select_unbound_cpu(raw_smp_processor_id()); -@@ -1439,10 +1443,8 @@ static void __queue_work(int cpu, struct +@@ -1439,10 +1443,8 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, /* pwq determined, queue */ trace_workqueue_queue_work(req_cpu, pwq, work); @@ -167,7 +170,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> pwq->nr_in_flight[pwq->work_color]++; work_flags = work_color_to_flags(pwq->work_color); -@@ -1460,7 +1462,9 @@ static void __queue_work(int cpu, struct +@@ -1460,7 +1462,9 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, insert_work(pwq, work, worklist, work_flags); @@ -177,7 +180,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /** -@@ -2855,14 +2859,14 @@ static bool start_flush_work(struct work +@@ -2855,14 +2859,14 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr, might_sleep(); @@ -195,7 +198,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* see the comment in try_to_grab_pending() with the same code */ pwq = get_work_pwq(work); if (pwq) { -@@ -2894,10 +2898,11 @@ static bool start_flush_work(struct work +@@ -2894,10 +2898,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); } @@ -208,7 +211,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return false; } -@@ -3341,7 +3346,7 @@ static void rcu_free_pool(struct rcu_hea +@@ -3341,7 +3346,7 @@ static void rcu_free_pool(struct rcu_head *rcu) * put_unbound_pool - put a worker_pool * @pool: worker_pool to put * @@ -217,7 +220,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> * 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(). -@@ -3395,8 +3400,8 @@ static void put_unbound_pool(struct work +@@ -3395,8 +3400,8 @@ static void put_unbound_pool(struct worker_pool *pool) del_timer_sync(&pool->idle_timer); del_timer_sync(&pool->mayday_timer); @@ -228,7 +231,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /** -@@ -3503,14 +3508,14 @@ static void pwq_unbound_release_workfn(s +@@ -3503,14 +3508,14 @@ static void pwq_unbound_release_workfn(struct work_struct *work) put_unbound_pool(pool); mutex_unlock(&wq_pool_mutex); @@ -245,7 +248,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /** -@@ -4195,7 +4200,7 @@ void destroy_workqueue(struct workqueue_ +@@ -4195,7 +4200,7 @@ void destroy_workqueue(struct workqueue_struct *wq) * The base ref is never dropped on per-cpu pwqs. Directly * schedule RCU free. */ @@ -254,7 +257,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } else { /* * We're the sole accessor of @wq at this point. Directly -@@ -4305,7 +4310,8 @@ bool workqueue_congested(int cpu, struct +@@ -4305,7 +4310,8 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) struct pool_workqueue *pwq; bool ret; @@ -264,7 +267,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (cpu == WORK_CPU_UNBOUND) cpu = smp_processor_id(); -@@ -4316,7 +4322,8 @@ bool workqueue_congested(int cpu, struct +@@ -4316,7 +4322,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); @@ -274,7 +277,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return ret; } -@@ -4342,15 +4349,15 @@ unsigned int work_busy(struct work_struc +@@ -4342,15 +4349,15 @@ unsigned int work_busy(struct work_struct *work) if (work_pending(work)) ret |= WORK_BUSY_PENDING; @@ -332,7 +335,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } out_unlock: mutex_unlock(&wq_pool_mutex); -@@ -5190,7 +5197,8 @@ static ssize_t wq_pool_ids_show(struct d +@@ -5190,7 +5197,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, const char *delim = ""; int node, written = 0; @@ -342,7 +345,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> for_each_node(node) { written += scnprintf(buf + written, PAGE_SIZE - written, "%s%d:%d", delim, node, -@@ -5198,7 +5206,8 @@ static ssize_t wq_pool_ids_show(struct d +@@ -5198,7 +5206,8 @@ static ssize_t wq_pool_ids_show(struct device *dev, delim = " "; } written += scnprintf(buf + written, PAGE_SIZE - written, "\n"); @@ -352,3 +355,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return written; } +-- +2.20.1 + diff --git a/debian/patches-rt/workqueue-use-locallock.patch b/debian/patches-rt/0194-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch index cddd0ab4c..b7f6cd76d 100644 --- a/debian/patches-rt/workqueue-use-locallock.patch +++ b/debian/patches-rt/0194-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch @@ -1,16 +1,20 @@ -Subject: workqueue: Use local irq lock instead of irq disable regions +From 82a41803231c15d971d06cafc3f9ba1243dde943 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 17 Jul 2011 21:42:26 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 194/266] workqueue: Use local irq lock instead of irq disable + regions +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Use a local_irq_lock as a replacement for irq off regions. We keep the semantic of irq-off in regard to the pool->lock and remain preemptible. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/workqueue.c | 45 ++++++++++++++++++++++++++++++--------------- + kernel/workqueue.c | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index ca8014edaa84..1e8b2ff804e3 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -49,6 +49,7 @@ @@ -21,7 +25,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include "workqueue_internal.h" -@@ -350,6 +351,8 @@ EXPORT_SYMBOL_GPL(system_power_efficient +@@ -350,6 +351,8 @@ EXPORT_SYMBOL_GPL(system_power_efficient_wq); struct workqueue_struct *system_freezable_power_efficient_wq __read_mostly; EXPORT_SYMBOL_GPL(system_freezable_power_efficient_wq); @@ -30,7 +34,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static int worker_thread(void *__worker); static void workqueue_sysfs_unregister(struct workqueue_struct *wq); -@@ -1103,9 +1106,11 @@ static void put_pwq_unlocked(struct pool +@@ -1103,9 +1106,11 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq) * As both pwqs and pools are RCU protected, the * following lock operations are safe. */ @@ -44,7 +48,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } } -@@ -1209,7 +1214,7 @@ static int try_to_grab_pending(struct wo +@@ -1209,7 +1214,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, struct worker_pool *pool; struct pool_workqueue *pwq; @@ -53,7 +57,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* try to steal the timer if it exists */ if (is_dwork) { -@@ -1273,7 +1278,7 @@ static int try_to_grab_pending(struct wo +@@ -1273,7 +1278,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, spin_unlock(&pool->lock); fail: rcu_read_unlock(); @@ -62,7 +66,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (work_is_canceling(work)) return -ENOENT; cpu_relax(); -@@ -1378,7 +1383,13 @@ static void __queue_work(int cpu, struct +@@ -1378,7 +1383,13 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, * queued or lose PENDING. Grabbing PENDING and queueing should * happen with IRQ disabled. */ @@ -76,7 +80,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> debug_work_activate(work); -@@ -1484,14 +1495,14 @@ bool queue_work_on(int cpu, struct workq +@@ -1484,14 +1495,14 @@ bool queue_work_on(int cpu, struct workqueue_struct *wq, bool ret = false; unsigned long flags; @@ -93,7 +97,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return ret; } EXPORT_SYMBOL(queue_work_on); -@@ -1500,8 +1511,11 @@ void delayed_work_timer_fn(struct timer_ +@@ -1500,8 +1511,11 @@ void delayed_work_timer_fn(struct timer_list *t) { struct delayed_work *dwork = from_timer(dwork, t, timer); @@ -105,7 +109,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } EXPORT_SYMBOL(delayed_work_timer_fn); -@@ -1556,14 +1570,14 @@ bool queue_delayed_work_on(int cpu, stru +@@ -1556,14 +1570,14 @@ bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq, unsigned long flags; /* read the comment in __queue_work() */ @@ -122,7 +126,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return ret; } EXPORT_SYMBOL(queue_delayed_work_on); -@@ -1598,7 +1612,7 @@ bool mod_delayed_work_on(int cpu, struct +@@ -1598,7 +1612,7 @@ bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq, if (likely(ret >= 0)) { __queue_delayed_work(cpu, wq, dwork, delay); @@ -146,7 +150,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /** -@@ -2999,7 +3014,7 @@ static bool __cancel_work_timer(struct w +@@ -2999,7 +3014,7 @@ static bool __cancel_work_timer(struct work_struct *work, bool is_dwork) /* tell other tasks trying to grab @work to back off */ mark_work_canceling(work); @@ -168,7 +172,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return flush_work(&dwork->work); } EXPORT_SYMBOL(flush_delayed_work); -@@ -3101,7 +3116,7 @@ static bool __cancel_work(struct work_st +@@ -3101,7 +3116,7 @@ static bool __cancel_work(struct work_struct *work, bool is_dwork) return false; set_work_pool_and_clear_pending(work, get_work_pool_id(work)); @@ -177,3 +181,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return ret; } +-- +2.20.1 + diff --git a/debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch b/debian/patches-rt/0195-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch index a08d3d520..09b181ade 100644 --- a/debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch +++ b/debian/patches-rt/0195-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch @@ -1,7 +1,8 @@ +From 76cb1f900f404b9f52cb08a3738c94cdfd774ae0 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Mon, 01 Jul 2013 11:02:42 +0200 -Subject: workqueue: Prevent workqueue versus ata-piix livelock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Mon, 1 Jul 2013 11:02:42 +0200 +Subject: [PATCH 195/266] workqueue: Prevent workqueue versus ata-piix livelock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz An Intel i7 system regularly detected rcu_preempt stalls after the kernel was upgraded from 3.6-rt to 3.8-rt. When the stall happened, disk I/O was no @@ -109,9 +110,11 @@ Signed-off-by: Carsten Emde <C.Emde@osadl.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/workqueue.c | 3 ++- + kernel/workqueue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index 1e8b2ff804e3..f6551d189ca4 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -50,6 +50,7 @@ @@ -122,7 +125,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "workqueue_internal.h" -@@ -1281,7 +1282,7 @@ static int try_to_grab_pending(struct wo +@@ -1281,7 +1282,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, local_unlock_irqrestore(pendingb_lock, *flags); if (work_is_canceling(work)) return -ENOENT; @@ -131,3 +134,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return -EAGAIN; } +-- +2.20.1 + diff --git a/debian/patches-rt/workqueue-distangle-from-rq-lock.patch b/debian/patches-rt/0196-sched-Distangle-worker-accounting-from-rqlock.patch index e6922d9ef..568b6a15e 100644 --- a/debian/patches-rt/workqueue-distangle-from-rq-lock.patch +++ b/debian/patches-rt/0196-sched-Distangle-worker-accounting-from-rqlock.patch @@ -1,12 +1,14 @@ +From 0586bf86bf2f1b09ef39d5af88d617b1be694afe Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed Jun 22 19:47:03 2011 +0200 -Subject: sched: Distangle worker accounting from rqlock - +Date: Wed, 22 Jun 2011 19:47:03 +0200 +Subject: [PATCH 196/266] sched: Distangle worker accounting from rqlock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz + The worker accounting for cpu bound workers is plugged into the core scheduler code and the wakeup code. This is not a hard requirement and can be avoided by keeping track of the state in the workqueue code itself. - + Keep track of the sleeping state in the worker itself and call the notifier before entering the core scheduler. There might be false positives when the task is woken between that call and actually @@ -14,7 +16,7 @@ scheduling, but that's not really different from scheduling and being woken immediately after switching away. There is also no harm from updating nr_running when the task returns from scheduling instead of accounting it in the wakeup code. - + Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> @@ -22,20 +24,20 @@ Cc: Jens Axboe <axboe@kernel.dk> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/20110622174919.135236139@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz - [bigeasy: preempt_disable() around wq_worker_sleeping() by Daniel Bristot de Oliveira] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/sched/core.c | 90 ++++++++++---------------------------------- - kernel/workqueue.c | 52 +++++++++++-------------- - kernel/workqueue_internal.h | 5 +- + kernel/sched/core.c | 90 +++++++++---------------------------- + kernel/workqueue.c | 52 ++++++++++----------- + kernel/workqueue_internal.h | 5 ++- 3 files changed, 47 insertions(+), 100 deletions(-) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 1ba8ec17992e..afae5090e573 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1702,10 +1702,6 @@ static inline void ttwu_activate(struct +@@ -1703,10 +1703,6 @@ static inline void ttwu_activate(struct rq *rq, struct task_struct *p, int en_fl { activate_task(rq, p, en_flags); p->on_rq = TASK_ON_RQ_QUEUED; @@ -46,10 +48,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -2142,56 +2138,6 @@ try_to_wake_up(struct task_struct *p, un +@@ -2142,56 +2138,6 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) + return success; } - /** +-/** - * try_to_wake_up_local - try to wake up a local task with rq lock held - * @p: the thread to be awakened - * @rf: request-queue flags for pinning @@ -99,11 +102,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - raw_spin_unlock(&p->pi_lock); -} - --/** + /** * wake_up_process - Wake up a specific process * @p: The process to be woken up. - * -@@ -3518,21 +3464,6 @@ static void __sched notrace __schedule(b +@@ -3519,21 +3465,6 @@ static void __sched notrace __schedule(bool preempt) atomic_inc(&rq->nr_iowait); delayacct_blkio_start(); } @@ -125,7 +127,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } switch_count = &prev->nvcsw; } -@@ -3592,6 +3523,20 @@ static inline void sched_submit_work(str +@@ -3593,6 +3524,20 @@ static inline void sched_submit_work(struct task_struct *tsk) { if (!tsk->state || tsk_is_pi_blocked(tsk)) return; @@ -146,7 +148,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * If we are going to sleep and we have plugged IO queued, * make sure to submit it to avoid deadlocks. -@@ -3600,6 +3545,12 @@ static inline void sched_submit_work(str +@@ -3601,6 +3546,12 @@ static inline void sched_submit_work(struct task_struct *tsk) blk_schedule_flush_plug(tsk); } @@ -159,7 +161,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> asmlinkage __visible void __sched schedule(void) { struct task_struct *tsk = current; -@@ -3610,6 +3561,7 @@ asmlinkage __visible void __sched schedu +@@ -3611,6 +3562,7 @@ asmlinkage __visible void __sched schedule(void) __schedule(false); sched_preempt_enable_no_resched(); } while (need_resched()); @@ -167,9 +169,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL(schedule); +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index f6551d189ca4..bf7be926ce5f 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c -@@ -843,43 +843,32 @@ static void wake_up_worker(struct worker +@@ -843,43 +843,32 @@ static void wake_up_worker(struct worker_pool *pool) } /** @@ -224,7 +228,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct worker_pool *pool; /* -@@ -888,13 +877,15 @@ struct task_struct *wq_worker_sleeping(s +@@ -888,13 +877,15 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task) * checking NOT_RUNNING. */ if (worker->flags & WORKER_NOT_RUNNING) @@ -244,7 +248,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * The counterpart of the following dec_and_test, implied mb, -@@ -908,9 +899,12 @@ struct task_struct *wq_worker_sleeping(s +@@ -908,9 +899,12 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task) * lock is safe. */ if (atomic_dec_and_test(&pool->nr_running) && @@ -260,6 +264,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /** +diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h +index 66fbb5a9e633..30cfed226b39 100644 --- a/kernel/workqueue_internal.h +++ b/kernel/workqueue_internal.h @@ -44,6 +44,7 @@ struct worker { @@ -270,7 +276,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Opaque string set with work_set_desc(). Printed out with task -@@ -69,7 +70,7 @@ static inline struct worker *current_wq_ +@@ -69,7 +70,7 @@ static inline struct worker *current_wq_worker(void) * Scheduler hooks for concurrency managed workqueue. Only to be used from * sched/core.c and workqueue.c. */ @@ -280,3 +286,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +void wq_worker_sleeping(struct task_struct *task); #endif /* _KERNEL_WORKQUEUE_INTERNAL_H */ +-- +2.20.1 + diff --git a/debian/patches-rt/debugobjects-rt.patch b/debian/patches-rt/0197-debugobjects-Make-RT-aware.patch index 45e303b77..8ef1bd59a 100644 --- a/debian/patches-rt/debugobjects-rt.patch +++ b/debian/patches-rt/0197-debugobjects-Make-RT-aware.patch @@ -1,18 +1,21 @@ -Subject: debugobjects: Make RT aware +From 053327774ffe140931050f994bb9547d8c55576b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 17 Jul 2011 21:41:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 197/266] debugobjects: Make RT aware +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Avoid filling the pool / allocating memory with irqs off(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - lib/debugobjects.c | 5 ++++- + lib/debugobjects.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) +diff --git a/lib/debugobjects.c b/lib/debugobjects.c +index 14afeeb7d6ef..e28481c402ae 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c -@@ -376,7 +376,10 @@ static void +@@ -376,7 +376,10 @@ __debug_object_init(void *addr, struct debug_obj_descr *descr, int onstack) struct debug_obj *obj; unsigned long flags; @@ -24,3 +27,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> db = get_bucket((unsigned long) addr); +-- +2.20.1 + diff --git a/debian/patches-rt/seqlock-prevent-rt-starvation.patch b/debian/patches-rt/0198-seqlock-Prevent-rt-starvation.patch index 64f00a505..c83e7224e 100644 --- a/debian/patches-rt/seqlock-prevent-rt-starvation.patch +++ b/debian/patches-rt/0198-seqlock-Prevent-rt-starvation.patch @@ -1,7 +1,8 @@ -Subject: seqlock: Prevent rt starvation +From c4f81bc52cd0d6586753b9554c3c00304e90d47d Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 22 Feb 2012 12:03:30 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 198/266] seqlock: Prevent rt starvation +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz If a low prio writer gets preempted while holding the seqlock write locked, a high prio reader spins forever on RT. @@ -19,16 +20,16 @@ Nicholas Mc Guire: - __write_seqcount_begin => __raw_write_seqcount_begin Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - - --- - include/linux/seqlock.h | 57 +++++++++++++++++++++++++++++++++++++----------- - include/net/neighbour.h | 6 ++--- + include/linux/seqlock.h | 57 ++++++++++++++++++++++++++++++++--------- + include/net/neighbour.h | 6 ++--- 2 files changed, 48 insertions(+), 15 deletions(-) +diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h +index bcf4cf26b8c8..689ed53016c7 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h -@@ -221,20 +221,30 @@ static inline int read_seqcount_retry(co +@@ -221,20 +221,30 @@ static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) return __read_seqcount_retry(s, start); } @@ -97,7 +98,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static inline unsigned read_seqretry(const seqlock_t *sl, unsigned start) { -@@ -446,36 +479,36 @@ static inline unsigned read_seqretry(con +@@ -446,36 +479,36 @@ static inline unsigned read_seqretry(const seqlock_t *sl, unsigned start) static inline void write_seqlock(seqlock_t *sl) { spin_lock(&sl->lock); @@ -140,7 +141,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> spin_unlock_irq(&sl->lock); } -@@ -484,7 +517,7 @@ static inline unsigned long __write_seql +@@ -484,7 +517,7 @@ static inline unsigned long __write_seqlock_irqsave(seqlock_t *sl) unsigned long flags; spin_lock_irqsave(&sl->lock, flags); @@ -149,7 +150,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return flags; } -@@ -494,7 +527,7 @@ static inline unsigned long __write_seql +@@ -494,7 +527,7 @@ static inline unsigned long __write_seqlock_irqsave(seqlock_t *sl) static inline void write_sequnlock_irqrestore(seqlock_t *sl, unsigned long flags) { @@ -158,9 +159,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> spin_unlock_irqrestore(&sl->lock, flags); } +diff --git a/include/net/neighbour.h b/include/net/neighbour.h +index beeeed126872..6dd1765e22ec 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h -@@ -451,7 +451,7 @@ static inline int neigh_hh_bridge(struct +@@ -451,7 +451,7 @@ static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb) } #endif @@ -169,7 +172,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> { unsigned int hh_alen = 0; unsigned int seq; -@@ -493,7 +493,7 @@ static inline int neigh_hh_output(const +@@ -493,7 +493,7 @@ static inline int neigh_hh_output(const struct hh_cache *hh, struct sk_buff *skb static inline int neigh_output(struct neighbour *n, struct sk_buff *skb) { @@ -187,3 +190,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> const struct net_device *dev) { unsigned int seq; +-- +2.20.1 + diff --git a/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/debian/patches-rt/0199-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch index f37d35c08..7f430fb0c 100644 --- a/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ b/debian/patches-rt/0199-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch @@ -1,7 +1,9 @@ +From 82793adbaabce238fbcb3f23affef2391caccfe3 Mon Sep 17 00:00:00 2001 From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Wed, 18 Feb 2015 16:05:28 +0100 -Subject: sunrpc: Make svc_xprt_do_enqueue() use get_cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 199/266] sunrpc: Make svc_xprt_do_enqueue() use + get_cpu_light() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 3194, name: rpc.nfsd @@ -29,12 +31,14 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4 Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - net/sunrpc/svc_xprt.c | 4 ++-- + net/sunrpc/svc_xprt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c +index 6cf0fd37cbf0..48c0a0b90946 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c -@@ -393,7 +393,7 @@ void svc_xprt_do_enqueue(struct svc_xprt +@@ -393,7 +393,7 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt) if (test_and_set_bit(XPT_BUSY, &xprt->xpt_flags)) return; @@ -43,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> pool = svc_pool_for_cpu(xprt->xpt_server, cpu); atomic_long_inc(&pool->sp_stats.packets); -@@ -417,7 +417,7 @@ void svc_xprt_do_enqueue(struct svc_xprt +@@ -417,7 +417,7 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt) rqstp = NULL; out_unlock: rcu_read_unlock(); @@ -52,3 +56,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> trace_svc_xprt_do_enqueue(xprt, rqstp); } EXPORT_SYMBOL_GPL(svc_xprt_do_enqueue); +-- +2.20.1 + diff --git a/debian/patches-rt/skbufhead-raw-lock.patch b/debian/patches-rt/0200-net-Use-skbufhead-with-raw-lock.patch index 0b11c4d51..9f1804adc 100644 --- a/debian/patches-rt/skbufhead-raw-lock.patch +++ b/debian/patches-rt/0200-net-Use-skbufhead-with-raw-lock.patch @@ -1,7 +1,8 @@ +From bf74fc8271a0cd33a6bea1ebfe9a398bb8208798 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 12 Jul 2011 15:38:34 +0200 -Subject: net: Use skbufhead with raw lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 200/266] net: Use skbufhead with raw lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Use the rps lock as rawlock so we can keep irq-off regions. It looks low latency. However we can't kfree() from this context therefore we defer this @@ -9,11 +10,13 @@ to the softirq and use the tofree_queue list for it (similar to process_queue). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/netdevice.h | 1 + - include/linux/skbuff.h | 7 +++++++ - net/core/dev.c | 33 +++++++++++++++++++++++++-------- + include/linux/netdevice.h | 1 + + include/linux/skbuff.h | 7 +++++++ + net/core/dev.c | 33 +++++++++++++++++++++++++-------- 3 files changed, 33 insertions(+), 8 deletions(-) +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index 21fef8c5eca7..4eec6a61c4f1 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2970,6 +2970,7 @@ struct softnet_data { @@ -24,6 +27,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> }; +diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h +index 820903ceac4f..f7f3abb41acb 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -287,6 +287,7 @@ struct sk_buff_head { @@ -34,7 +39,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> }; struct sk_buff; -@@ -1702,6 +1703,12 @@ static inline void skb_queue_head_init(s +@@ -1702,6 +1703,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) __skb_queue_head_init(list); } @@ -47,9 +52,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static inline void skb_queue_head_init_class(struct sk_buff_head *list, struct lock_class_key *class) { +diff --git a/net/core/dev.c b/net/core/dev.c +index b7fbababf836..a66be126c8ac 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -217,14 +217,14 @@ static inline struct hlist_head *dev_ind +@@ -217,14 +217,14 @@ static inline struct hlist_head *dev_index_hash(struct net *net, int ifindex) static inline void rps_lock(struct softnet_data *sd) { #ifdef CONFIG_RPS @@ -66,7 +73,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif } -@@ -5244,7 +5244,7 @@ static void flush_backlog(struct work_st +@@ -5244,7 +5244,7 @@ static void flush_backlog(struct work_struct *work) skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->input_pkt_queue); @@ -75,7 +82,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> input_queue_head_incr(sd); } } -@@ -5254,11 +5254,14 @@ static void flush_backlog(struct work_st +@@ -5254,11 +5254,14 @@ static void flush_backlog(struct work_struct *work) skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->process_queue); @@ -91,7 +98,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static void flush_all_backlogs(void) -@@ -5837,7 +5840,9 @@ static int process_backlog(struct napi_s +@@ -5837,7 +5840,9 @@ static int process_backlog(struct napi_struct *napi, int quota) while (again) { struct sk_buff *skb; @@ -101,7 +108,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> rcu_read_lock(); __netif_receive_skb(skb); rcu_read_unlock(); -@@ -5845,9 +5850,9 @@ static int process_backlog(struct napi_s +@@ -5845,9 +5850,9 @@ static int process_backlog(struct napi_struct *napi, int quota) if (++work >= quota) return work; @@ -112,7 +119,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> rps_lock(sd); if (skb_queue_empty(&sd->input_pkt_queue)) { /* -@@ -6312,13 +6317,21 @@ static __latent_entropy void net_rx_acti +@@ -6312,13 +6317,21 @@ 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; @@ -134,7 +141,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> for (;;) { struct napi_struct *n; -@@ -9307,10 +9320,13 @@ static int dev_cpu_dead(unsigned int old +@@ -9307,10 +9320,13 @@ static int dev_cpu_dead(unsigned int oldcpu) netif_rx_ni(skb); input_queue_head_incr(oldsd); } @@ -161,3 +168,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_XFRM_OFFLOAD skb_queue_head_init(&sd->xfrm_backlog); #endif +-- +2.20.1 + diff --git a/debian/patches-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch b/debian/patches-rt/0201-net-move-xmit_recursion-to-per-task-variable-on-RT.patch index 45307d010..c18ff4fe7 100644 --- a/debian/patches-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch +++ b/debian/patches-rt/0201-net-move-xmit_recursion-to-per-task-variable-on-RT.patch @@ -1,7 +1,8 @@ +From bf6541489a495c50b32e41bc87ab1589a1f9641a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 13 Jan 2016 15:55:02 +0100 -Subject: net: move xmit_recursion to per-task variable on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 201/266] net: move xmit_recursion to per-task variable on -RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz A softirq on -RT can be preempted. That means one task is in __dev_queue_xmit(), gets preempted and another task may enter @@ -17,12 +18,14 @@ CPU number. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/netdevice.h | 95 ++++++++++++++++++++++++++++++++++++++++++---- - include/linux/sched.h | 3 + - net/core/dev.c | 15 ++++--- - net/core/filter.c | 6 +- + include/linux/netdevice.h | 95 ++++++++++++++++++++++++++++++++++++--- + include/linux/sched.h | 3 ++ + net/core/dev.c | 15 ++++--- + net/core/filter.c | 6 +-- 4 files changed, 104 insertions(+), 15 deletions(-) +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index 4eec6a61c4f1..68bdfa139782 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -587,7 +587,11 @@ struct netdev_queue { @@ -37,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Time (in jiffies) of last Tx */ -@@ -2608,14 +2612,53 @@ void netdev_freemem(struct net_device *d +@@ -2608,14 +2612,53 @@ void netdev_freemem(struct net_device *dev); void synchronize_net(void); int init_dummy_netdev(struct net_device *dev); @@ -92,7 +95,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct net_device *dev_get_by_index(struct net *net, int ifindex); struct net_device *__dev_get_by_index(struct net *net, int ifindex); struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); -@@ -3791,10 +3834,48 @@ static inline u32 netif_msg_init(int deb +@@ -3791,10 +3834,48 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) return (1 << debug_value) - 1; } @@ -142,7 +145,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static inline bool __netif_tx_acquire(struct netdev_queue *txq) -@@ -3811,32 +3892,32 @@ static inline void __netif_tx_release(st +@@ -3811,32 +3892,32 @@ 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); @@ -180,21 +183,25 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> txq->trans_start = jiffies; } +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 7cbef398ac48..80f6dedc3391 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1209,6 +1209,9 @@ struct task_struct { +@@ -1208,6 +1208,9 @@ struct task_struct { + #endif #ifdef CONFIG_DEBUG_ATOMIC_SLEEP unsigned long task_state_change; - #endif ++#endif +#ifdef CONFIG_PREEMPT_RT_FULL + int xmit_recursion; -+#endif + #endif int pagefault_disabled; #ifdef CONFIG_MMU - struct task_struct *oom_reaper_list; +diff --git a/net/core/dev.c b/net/core/dev.c +index a66be126c8ac..163275e0beff 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3523,8 +3523,10 @@ static void skb_update_prio(struct sk_bu +@@ -3523,8 +3523,10 @@ static void skb_update_prio(struct sk_buff *skb) #define skb_update_prio(skb) #endif @@ -205,7 +212,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * dev_loopback_xmit - loop back @skb -@@ -3815,9 +3817,12 @@ static int __dev_queue_xmit(struct sk_bu +@@ -3815,9 +3817,12 @@ 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 */ @@ -220,7 +227,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto recursion_alert; skb = validate_xmit_skb(skb, dev, &again); -@@ -3827,9 +3832,9 @@ static int __dev_queue_xmit(struct sk_bu +@@ -3827,9 +3832,9 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) HARD_TX_LOCK(dev, txq, cpu); if (!netif_xmit_stopped(txq)) { @@ -232,7 +239,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (dev_xmit_complete(rc)) { HARD_TX_UNLOCK(dev, txq); goto out; -@@ -8372,7 +8377,7 @@ static void netdev_init_one_queue(struct +@@ -8372,7 +8377,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); @@ -241,9 +248,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> netdev_queue_numa_node_write(queue, NUMA_NO_NODE); queue->dev = dev; #ifdef CONFIG_BQL +diff --git a/net/core/filter.c b/net/core/filter.c +index eb81e9db4093..2dd1f2eef4fa 100644 --- a/net/core/filter.c +++ b/net/core/filter.c -@@ -2000,7 +2000,7 @@ static inline int __bpf_tx_skb(struct ne +@@ -2000,7 +2000,7 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb) { int ret; @@ -252,7 +261,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> net_crit_ratelimited("bpf: recursion limit reached on datapath, buggy bpf program?\n"); kfree_skb(skb); return -ENETDOWN; -@@ -2008,9 +2008,9 @@ static inline int __bpf_tx_skb(struct ne +@@ -2008,9 +2008,9 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb) skb->dev = dev; @@ -264,3 +273,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } +-- +2.20.1 + diff --git a/debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch b/debian/patches-rt/0202-net-provide-a-way-to-delegate-processing-a-softirq-t.patch index 7078e282f..d3532a31d 100644 --- a/debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch +++ b/debian/patches-rt/0202-net-provide-a-way-to-delegate-processing-a-softirq-t.patch @@ -1,8 +1,9 @@ +From fa53f62fc4de7d893ecc40f7552d4c09fad54d0e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 20 Jan 2016 15:39:05 +0100 -Subject: net: provide a way to delegate processing a softirq to - ksoftirqd -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 202/266] net: provide a way to delegate processing a softirq + to ksoftirqd +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz If the NET_RX uses up all of his budget it moves the following NAPI invocations into the `ksoftirqd`. On -RT it does not do so. Instead it @@ -14,11 +15,13 @@ __raise_softirq_irqoff_ksoft() which raises the softirq in the ksoftird. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/interrupt.h | 8 ++++++++ - kernel/softirq.c | 21 +++++++++++++++++++++ - net/core/dev.c | 2 +- + include/linux/interrupt.h | 8 ++++++++ + kernel/softirq.c | 21 +++++++++++++++++++++ + net/core/dev.c | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 99f8b7ace7c9..72333899f043 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -524,6 +524,14 @@ extern void thread_do_softirq(void); @@ -36,12 +39,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> extern void raise_softirq_irqoff(unsigned int nr); extern void raise_softirq(unsigned int nr); +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 27a4bb2303d0..25bcf2f2714b 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c -@@ -722,6 +722,27 @@ void __raise_softirq_irqoff(unsigned int +@@ -721,6 +721,27 @@ void __raise_softirq_irqoff(unsigned int nr) + wakeup_proper_softirq(nr); } - /* ++/* + * Same as __raise_softirq_irqoff() but will process them in ksoftirqd + */ +void __raise_softirq_irqoff_ksoft(unsigned int nr) @@ -62,13 +68,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + wakeup_proper_softirq(nr); +} + -+/* + /* * This function must run with irqs disabled! */ - void raise_softirq_irqoff(unsigned int nr) +diff --git a/net/core/dev.c b/net/core/dev.c +index 163275e0beff..bbe322600b0c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6366,7 +6366,7 @@ static __latent_entropy void net_rx_acti +@@ -6366,7 +6366,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)) @@ -77,3 +84,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> net_rps_action_and_irq_enable(sd); out: +-- +2.20.1 + diff --git a/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/debian/patches-rt/0203-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch index c74718eae..9658d54e4 100644 --- a/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ b/debian/patches-rt/0203-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch @@ -1,7 +1,9 @@ +From 8e7bc853cc2cd990c98ef62f4940161775027b31 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 30 Mar 2016 13:36:29 +0200 -Subject: [PATCH] net: dev: always take qdisc's busylock in __dev_xmit_skb() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 203/266] net: dev: always take qdisc's busylock in + __dev_xmit_skb() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The root-lock is dropped before dev_hard_start_xmit() is invoked and after setting the __QDISC___STATE_RUNNING bit. If this task is now pushed away @@ -16,12 +18,14 @@ low-prio task and submit the packet. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - net/core/dev.c | 4 ++++ + net/core/dev.c | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/net/core/dev.c b/net/core/dev.c +index bbe322600b0c..dc4e043940fb 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3451,7 +3451,11 @@ static inline int __dev_xmit_skb(struct +@@ -3451,7 +3451,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. */ @@ -33,3 +37,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (unlikely(contended)) spin_lock(&q->busylock); +-- +2.20.1 + diff --git a/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch b/debian/patches-rt/0204-net-Qdisc-use-a-seqlock-instead-seqcount.patch index 4c54ce148..1ac2400ca 100644 --- a/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ b/debian/patches-rt/0204-net-Qdisc-use-a-seqlock-instead-seqcount.patch @@ -1,7 +1,8 @@ +From c31ad87248d2f39ed7240c6648cad99d2fe48a4b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 14 Sep 2016 17:36:35 +0200 -Subject: [PATCH] net/Qdisc: use a seqlock instead seqcount -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 204/266] net/Qdisc: use a seqlock instead seqcount +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The seqcount disables preemption on -RT while it is held which can't remove. Also we don't want the reader to spin for ages if the writer is @@ -10,20 +11,22 @@ the lock while writer is active. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/seqlock.h | 9 +++++++++ - include/net/gen_stats.h | 9 +++++---- - include/net/net_seq_lock.h | 15 +++++++++++++++ - include/net/sch_generic.h | 19 +++++++++++++++++-- - net/core/gen_estimator.c | 6 +++--- - net/core/gen_stats.c | 8 ++++---- - net/sched/sch_api.c | 2 +- - net/sched/sch_generic.c | 12 ++++++++++++ + include/linux/seqlock.h | 9 +++++++++ + include/net/gen_stats.h | 9 +++++---- + include/net/net_seq_lock.h | 15 +++++++++++++++ + include/net/sch_generic.h | 19 +++++++++++++++++-- + net/core/gen_estimator.c | 6 +++--- + net/core/gen_stats.c | 8 ++++---- + net/sched/sch_api.c | 2 +- + net/sched/sch_generic.c | 12 ++++++++++++ 8 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 include/net/net_seq_lock.h +diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h +index 689ed53016c7..58f9909d6659 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h -@@ -482,6 +482,15 @@ static inline void write_seqlock(seqlock +@@ -482,6 +482,15 @@ static inline void write_seqlock(seqlock_t *sl) __raw_write_seqcount_begin(&sl->seqcount); } @@ -39,6 +42,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline void write_sequnlock(seqlock_t *sl) { __raw_write_seqcount_end(&sl->seqcount); +diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h +index 883bb9085f15..3b593cdeb9af 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h @@ -6,6 +6,7 @@ @@ -49,7 +54,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct gnet_stats_basic_cpu { struct gnet_stats_basic_packed bstats; -@@ -36,11 +37,11 @@ int gnet_stats_start_copy_compat(struct +@@ -36,11 +37,11 @@ int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, spinlock_t *lock, struct gnet_dump *d, int padattr); @@ -63,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct gnet_stats_basic_packed *bstats, struct gnet_stats_basic_cpu __percpu *cpu, struct gnet_stats_basic_packed *b); -@@ -60,13 +61,13 @@ int gen_new_estimator(struct gnet_stats_ +@@ -60,13 +61,13 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, struct gnet_stats_basic_cpu __percpu *cpu_bstats, struct net_rate_estimator __rcu **rate_est, spinlock_t *lock, @@ -79,6 +84,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> bool gen_estimator_active(struct net_rate_estimator __rcu **ptr); bool gen_estimator_read(struct net_rate_estimator __rcu **ptr, struct gnet_stats_rate_est64 *sample); +diff --git a/include/net/net_seq_lock.h b/include/net/net_seq_lock.h +new file mode 100644 +index 000000000000..a7034298a82a --- /dev/null +++ b/include/net/net_seq_lock.h @@ -0,0 +1,15 @@ @@ -97,6 +105,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +#endif + +#endif +diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h +index c44da48de7df..c85ac38f7fa9 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -10,6 +10,7 @@ @@ -107,7 +117,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <linux/refcount.h> #include <linux/workqueue.h> #include <net/gen_stats.h> -@@ -97,7 +98,7 @@ struct Qdisc { +@@ -100,7 +101,7 @@ struct Qdisc { struct sk_buff_head gso_skb ____cacheline_aligned_in_smp; struct qdisc_skb_head q; struct gnet_stats_basic_packed bstats; @@ -116,7 +126,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct gnet_stats_queue qstats; unsigned long state; struct Qdisc *next_sched; -@@ -118,7 +119,11 @@ static inline bool qdisc_is_running(stru +@@ -121,7 +122,11 @@ static inline bool qdisc_is_running(struct Qdisc *qdisc) { if (qdisc->flags & TCQ_F_NOLOCK) return spin_is_locked(&qdisc->seqlock); @@ -128,7 +138,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static inline bool qdisc_run_begin(struct Qdisc *qdisc) -@@ -129,17 +134,27 @@ static inline bool qdisc_run_begin(struc +@@ -132,17 +137,27 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc) } else if (qdisc_is_running(qdisc)) { return false; } @@ -156,7 +166,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (qdisc->flags & TCQ_F_NOLOCK) spin_unlock(&qdisc->seqlock); } -@@ -458,7 +473,7 @@ static inline spinlock_t *qdisc_root_sle +@@ -453,7 +468,7 @@ static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc) return qdisc_lock(root); } @@ -165,6 +175,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { struct Qdisc *root = qdisc_root_sleeping(qdisc); +diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c +index e4e442d70c2d..c8fa906733fb 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c @@ -46,7 +46,7 @@ @@ -176,7 +188,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct gnet_stats_basic_cpu __percpu *cpu_bstats; u8 ewma_log; u8 intvl_log; /* period : (250ms << intvl_log) */ -@@ -129,7 +129,7 @@ int gen_new_estimator(struct gnet_stats_ +@@ -129,7 +129,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, struct gnet_stats_basic_cpu __percpu *cpu_bstats, struct net_rate_estimator __rcu **rate_est, spinlock_t *lock, @@ -185,7 +197,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct nlattr *opt) { struct gnet_estimator *parm = nla_data(opt); -@@ -227,7 +227,7 @@ int gen_replace_estimator(struct gnet_st +@@ -227,7 +227,7 @@ int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, struct gnet_stats_basic_cpu __percpu *cpu_bstats, struct net_rate_estimator __rcu **rate_est, spinlock_t *lock, @@ -194,9 +206,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> { return gen_new_estimator(bstats, cpu_bstats, rate_est, lock, running, opt); +diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c +index e2fd8baec65f..8bab88738691 100644 --- a/net/core/gen_stats.c +++ b/net/core/gen_stats.c -@@ -142,7 +142,7 @@ static void +@@ -142,7 +142,7 @@ __gnet_stats_copy_basic_cpu(struct gnet_stats_basic_packed *bstats, } void @@ -205,7 +219,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct gnet_stats_basic_packed *bstats, struct gnet_stats_basic_cpu __percpu *cpu, struct gnet_stats_basic_packed *b) -@@ -155,10 +155,10 @@ void +@@ -155,10 +155,10 @@ __gnet_stats_copy_basic(const seqcount_t *running, } do { if (running) @@ -227,9 +241,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct gnet_dump *d, struct gnet_stats_basic_cpu __percpu *cpu, struct gnet_stats_basic_packed *b) +diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c +index be7cd140b2a3..5b8f90de0615 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -1166,7 +1166,7 @@ static struct Qdisc *qdisc_create(struct +@@ -1166,7 +1166,7 @@ static struct Qdisc *qdisc_create(struct net_device *dev, rcu_assign_pointer(sch->stab, stab); } if (tca[TCA_RATE]) { @@ -238,6 +254,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> err = -EOPNOTSUPP; if (sch->flags & TCQ_F_MQROOT) { +diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c +index 31b9c2b415b4..b0cc57ff96e3 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -570,7 +570,11 @@ struct Qdisc noop_qdisc = { @@ -252,7 +270,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> .busylock = __SPIN_LOCK_UNLOCKED(noop_qdisc.busylock), }; EXPORT_SYMBOL(noop_qdisc); -@@ -860,9 +864,17 @@ struct Qdisc *qdisc_alloc(struct netdev_ +@@ -859,9 +863,17 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, lockdep_set_class(&sch->busylock, dev->qdisc_tx_busylock ?: &qdisc_tx_busylock); @@ -270,3 +288,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> sch->ops = ops; sch->flags = ops->static_flags; +-- +2.20.1 + diff --git a/debian/patches-rt/net-add-back-the-missing-serialization-in-ip_send_un.patch b/debian/patches-rt/0205-net-add-back-the-missing-serialization-in-ip_send_un.patch index cbe6595ea..3ae647164 100644 --- a/debian/patches-rt/net-add-back-the-missing-serialization-in-ip_send_un.patch +++ b/debian/patches-rt/0205-net-add-back-the-missing-serialization-in-ip_send_un.patch @@ -1,11 +1,12 @@ +From 0907a92dc79cb3b6e1eb4f13bd5accbf8611b073 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 31 Aug 2016 17:21:56 +0200 -Subject: [PATCH] net: add back the missing serialization in +Subject: [PATCH 205/266] net: add back the missing serialization in ip_send_unicast_reply() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Some time ago Sami Pietikäinen reported a crash on -RT in ip_send_unicast_reply() which was later fixed by Nicholas Mc Guire @@ -38,9 +39,11 @@ This is brings back the old locks. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - net/ipv4/tcp_ipv4.c | 6 ++++++ + net/ipv4/tcp_ipv4.c | 6 ++++++ 1 file changed, 6 insertions(+) +diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c +index 30fdf891940b..94195c68207e 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -62,6 +62,7 @@ @@ -51,7 +54,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <net/net_namespace.h> #include <net/icmp.h> -@@ -634,6 +635,7 @@ void tcp_v4_send_check(struct sock *sk, +@@ -634,6 +635,7 @@ void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb) } EXPORT_SYMBOL(tcp_v4_send_check); @@ -59,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * This routine will send an RST to the other tcp. * -@@ -768,6 +770,7 @@ static void tcp_v4_send_reset(const stru +@@ -768,6 +770,7 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb) arg.tos = ip_hdr(skb)->tos; arg.uid = sock_net_uid(net, sk && sk_fullsock(sk) ? sk : NULL); local_bh_disable(); @@ -67,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ctl_sk = *this_cpu_ptr(net->ipv4.tcp_sk); if (sk) ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ? -@@ -780,6 +783,7 @@ static void tcp_v4_send_reset(const stru +@@ -780,6 +783,7 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb) ctl_sk->sk_mark = 0; __TCP_INC_STATS(net, TCP_MIB_OUTSEGS); __TCP_INC_STATS(net, TCP_MIB_OUTRSTS); @@ -75,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> local_bh_enable(); #ifdef CONFIG_TCP_MD5SIG -@@ -860,6 +864,7 @@ static void tcp_v4_send_ack(const struct +@@ -860,6 +864,7 @@ static void tcp_v4_send_ack(const struct sock *sk, arg.tos = tos; arg.uid = sock_net_uid(net, sk_fullsock(sk) ? sk : NULL); local_bh_disable(); @@ -83,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ctl_sk = *this_cpu_ptr(net->ipv4.tcp_sk); if (sk) ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ? -@@ -871,6 +876,7 @@ static void tcp_v4_send_ack(const struct +@@ -871,6 +876,7 @@ static void tcp_v4_send_ack(const struct sock *sk, ctl_sk->sk_mark = 0; __TCP_INC_STATS(net, TCP_MIB_OUTSEGS); @@ -91,3 +94,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> local_bh_enable(); } +-- +2.20.1 + diff --git a/debian/patches-rt/net-add-a-lock-around-icmp_sk.patch b/debian/patches-rt/0206-net-add-a-lock-around-icmp_sk.patch index 041801a35..b441821e0 100644 --- a/debian/patches-rt/net-add-a-lock-around-icmp_sk.patch +++ b/debian/patches-rt/0206-net-add-a-lock-around-icmp_sk.patch @@ -1,7 +1,8 @@ +From 67ee4a58aa056573b88dc5d2783ced8e864f21d0 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 31 Aug 2016 17:54:09 +0200 -Subject: [PATCH] net: add a lock around icmp_sk() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 206/266] net: add a lock around icmp_sk() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz It looks like the this_cpu_ptr() access in icmp_sk() is protected with local_bh_disable(). To avoid missing serialization in -RT I am adding @@ -10,9 +11,11 @@ here a local lock. No crash has been observed, this is just precaution. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - net/ipv4/icmp.c | 8 ++++++++ + net/ipv4/icmp.c | 8 ++++++++ 1 file changed, 8 insertions(+) +diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c +index ad75c468ecfb..1770ff1638bc 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -77,6 +77,7 @@ @@ -23,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <net/snmp.h> #include <net/ip.h> #include <net/route.h> -@@ -204,6 +205,8 @@ static const struct icmp_control icmp_po +@@ -204,6 +205,8 @@ static const struct icmp_control icmp_pointers[NR_ICMP_TYPES+1]; * * On SMP we have one ICMP socket per-cpu. */ @@ -32,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static struct sock *icmp_sk(struct net *net) { return *this_cpu_ptr(net->ipv4.icmp_sk); -@@ -214,12 +217,16 @@ static inline struct sock *icmp_xmit_loc +@@ -214,12 +217,16 @@ static inline struct sock *icmp_xmit_lock(struct net *net) { struct sock *sk; @@ -49,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return NULL; } return sk; -@@ -228,6 +235,7 @@ static inline struct sock *icmp_xmit_loc +@@ -228,6 +235,7 @@ static inline struct sock *icmp_xmit_lock(struct net *net) static inline void icmp_xmit_unlock(struct sock *sk) { spin_unlock(&sk->sk_lock.slock); @@ -57,3 +60,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } int sysctl_icmp_msgs_per_sec __read_mostly = 1000; +-- +2.20.1 + diff --git a/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch b/debian/patches-rt/0207-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch index cd7b04878..ffb2c8c0f 100644 --- a/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch +++ b/debian/patches-rt/0207-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch @@ -1,8 +1,9 @@ +From 5b46d2bfd7f52c24f2712e1740e4757d29d6dc6c Mon Sep 17 00:00:00 2001 From: Steven Rostedt <rostedt@goodmis.org> Date: Tue, 6 Dec 2016 17:50:30 -0500 -Subject: [PATCH] net: Have __napi_schedule_irqoff() disable interrupts on - RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 207/266] net: Have __napi_schedule_irqoff() disable interrupts + on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz A customer hit a crash where the napi sd->poll_list became corrupted. The customer had the bnx2x driver, which does a @@ -23,13 +24,15 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Steven Rostedt (Red Hat) <rostedt@goodmis.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/netdevice.h | 12 ++++++++++++ - net/core/dev.c | 2 ++ + include/linux/netdevice.h | 12 ++++++++++++ + net/core/dev.c | 2 ++ 2 files changed, 14 insertions(+) +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index 68bdfa139782..3a722e31e4da 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -422,7 +422,19 @@ typedef enum rx_handler_result rx_handle +@@ -422,7 +422,19 @@ typedef enum rx_handler_result rx_handler_result_t; typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb); void __napi_schedule(struct napi_struct *n); @@ -49,9 +52,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline bool napi_disable_pending(struct napi_struct *n) { +diff --git a/net/core/dev.c b/net/core/dev.c +index dc4e043940fb..b4028addf291 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5936,6 +5936,7 @@ bool napi_schedule_prep(struct napi_stru +@@ -5936,6 +5936,7 @@ bool napi_schedule_prep(struct napi_struct *n) } EXPORT_SYMBOL(napi_schedule_prep); @@ -59,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /** * __napi_schedule_irqoff - schedule for receive * @n: entry to schedule -@@ -5947,6 +5948,7 @@ void __napi_schedule_irqoff(struct napi_ +@@ -5947,6 +5948,7 @@ void __napi_schedule_irqoff(struct napi_struct *n) ____napi_schedule(this_cpu_ptr(&softnet_data), n); } EXPORT_SYMBOL(__napi_schedule_irqoff); @@ -67,3 +72,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> bool napi_complete_done(struct napi_struct *n, int work_done) { +-- +2.20.1 + diff --git a/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch b/debian/patches-rt/0208-irqwork-push-most-work-into-softirq-context.patch index 726255b18..3a3cec0da 100644 --- a/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch +++ b/debian/patches-rt/0208-irqwork-push-most-work-into-softirq-context.patch @@ -1,7 +1,8 @@ -Subject: irqwork: push most work into softirq context +From d5bc7d50b9d151688a06740c7f7bb53d31eb93b4 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 23 Jun 2015 15:32:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 208/266] irqwork: push most work into softirq context +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Initially we defered all irqwork into softirq because we didn't want the latency spikes if perf or another user was busy and delayed the RT task. @@ -22,14 +23,16 @@ Mike Galbraith, hard and soft variant] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/irq_work.h | 8 ++++++ - kernel/irq_work.c | 60 ++++++++++++++++++++++++++++++++++++----------- - kernel/rcu/tree.c | 1 - kernel/sched/topology.c | 1 - kernel/time/tick-sched.c | 1 - kernel/time/timer.c | 2 + + include/linux/irq_work.h | 8 ++++++ + kernel/irq_work.c | 60 +++++++++++++++++++++++++++++++--------- + kernel/rcu/tree.c | 1 + + kernel/sched/topology.c | 1 + + kernel/time/tick-sched.c | 1 + + kernel/time/timer.c | 2 ++ 6 files changed, 60 insertions(+), 13 deletions(-) +diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h +index b11fcdfd0770..0c50559987c5 100644 --- a/include/linux/irq_work.h +++ b/include/linux/irq_work.h @@ -18,6 +18,8 @@ @@ -41,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define IRQ_WORK_CLAIMED (IRQ_WORK_PENDING | IRQ_WORK_BUSY) -@@ -52,4 +54,10 @@ static inline bool irq_work_needs_cpu(vo +@@ -52,4 +54,10 @@ static inline bool irq_work_needs_cpu(void) { return false; } static inline void irq_work_run(void) { } #endif @@ -52,6 +55,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +#endif + #endif /* _LINUX_IRQ_WORK_H */ +diff --git a/kernel/irq_work.c b/kernel/irq_work.c +index 6b7cdf17ccf8..7b41d9aa3e9b 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -17,6 +17,7 @@ @@ -71,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* All work should have been flushed before going offline */ WARN_ON_ONCE(cpu_is_offline(cpu)); -@@ -76,7 +79,12 @@ bool irq_work_queue_on(struct irq_work * +@@ -76,7 +79,12 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) if (!irq_work_claim(work)) return false; @@ -85,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> arch_send_call_function_single_ipi(cpu); #else /* #ifdef CONFIG_SMP */ -@@ -89,6 +97,9 @@ bool irq_work_queue_on(struct irq_work * +@@ -89,6 +97,9 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) /* Enqueue the irq work @work on the current CPU */ bool irq_work_queue(struct irq_work *work) { @@ -95,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Only queue if not already pending */ if (!irq_work_claim(work)) return false; -@@ -96,13 +107,15 @@ bool irq_work_queue(struct irq_work *wor +@@ -96,13 +107,15 @@ bool irq_work_queue(struct irq_work *work) /* Queue the entry and raise the IPI if needed. */ preempt_disable(); @@ -130,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* All work should have been flushed before going offline */ WARN_ON_ONCE(cpu_is_offline(smp_processor_id())); -@@ -135,8 +147,12 @@ static void irq_work_run_list(struct lli +@@ -135,8 +147,12 @@ static void irq_work_run_list(struct llist_head *list) struct llist_node *llnode; unsigned long flags; @@ -144,7 +149,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (llist_empty(list)) return; -@@ -168,7 +184,16 @@ static void irq_work_run_list(struct lli +@@ -168,7 +184,16 @@ static void irq_work_run_list(struct llist_head *list) void irq_work_run(void) { irq_work_run_list(this_cpu_ptr(&raised_list)); @@ -180,9 +185,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Synchronize against the irq_work @entry, ensures the entry is not +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c +index f162a4f54b05..278fe66bfb70 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c -@@ -1296,6 +1296,7 @@ static int rcu_implicit_dynticks_qs(stru +@@ -1296,6 +1296,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); @@ -190,9 +197,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> rdp->rcu_iw_pending = true; rdp->rcu_iw_gp_seq = rnp->gp_seq; irq_work_queue_on(&rdp->rcu_iw, rdp->cpu); +diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c +index 505a41c42b96..a32943de5dbc 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c -@@ -279,6 +279,7 @@ static int init_rootdomain(struct root_d +@@ -279,6 +279,7 @@ static int init_rootdomain(struct root_domain *rd) rd->rto_cpu = -1; raw_spin_lock_init(&rd->rto_lock); init_irq_work(&rd->rto_push_work, rto_push_irq_work_func); @@ -200,9 +209,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #endif init_dl_bw(&rd->dl_bw); +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index 6482945f8ae8..da4a3f8feb56 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -232,6 +232,7 @@ static void nohz_full_kick_func(struct i +@@ -232,6 +232,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, @@ -210,9 +221,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> }; /* +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 696e7583137c..781483c76b17 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -1733,6 +1733,8 @@ static __latent_entropy void run_timer_s +@@ -1733,6 +1733,8 @@ static __latent_entropy void run_timer_softirq(struct softirq_action *h) { struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); @@ -221,3 +234,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> __run_timers(base); if (IS_ENABLED(CONFIG_NO_HZ_COMMON)) __run_timers(this_cpu_ptr(&timer_bases[BASE_DEF])); +-- +2.20.1 + diff --git a/debian/patches-rt/printk-rt-aware.patch b/debian/patches-rt/0209-printk-Make-rt-aware.patch index 6490088e3..ab955bc57 100644 --- a/debian/patches-rt/printk-rt-aware.patch +++ b/debian/patches-rt/0209-printk-Make-rt-aware.patch @@ -1,19 +1,22 @@ -Subject: printk: Make rt aware +From 8faf80f4a440f15668ace2c02bed1d35ae4adff3 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 19 Sep 2012 14:50:37 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 209/266] printk: Make rt aware +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Drop the lock before calling the console driver and do not disable interrupts while printing to a serial console. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/printk/printk.c | 33 ++++++++++++++++++++++++++++++--- + kernel/printk/printk.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 6553508ff388..d983c509f74a 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1617,6 +1617,7 @@ SYSCALL_DEFINE3(syslog, int, type, char +@@ -1617,6 +1617,7 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) return do_syslog(type, buf, len, SYSLOG_FROM_READER); } @@ -21,7 +24,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * 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. -@@ -1757,6 +1758,15 @@ static int console_trylock_spinning(void +@@ -1757,6 +1758,15 @@ static int console_trylock_spinning(void) return 1; } @@ -37,7 +40,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Call the console drivers, asking them to write out * log_buf[start] to log_buf[end - 1]. -@@ -1772,6 +1782,7 @@ static void call_console_drivers(const c +@@ -1772,6 +1782,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, if (!console_drivers) return; @@ -45,7 +48,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> for_each_console(con) { if (exclusive_console && con != exclusive_console) continue; -@@ -1787,6 +1798,7 @@ static void call_console_drivers(const c +@@ -1787,6 +1798,7 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, else con->write(con, text, len); } @@ -53,7 +56,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } int printk_delay_msec __read_mostly; -@@ -1978,20 +1990,30 @@ asmlinkage int vprintk_emit(int facility +@@ -1978,20 +1990,30 @@ asmlinkage int vprintk_emit(int facility, int level, /* If called from the scheduler, we can not call up(). */ if (!in_sched) { @@ -106,3 +109,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (do_cond_resched) cond_resched(); +-- +2.20.1 + diff --git a/debian/patches-rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch b/debian/patches-rt/0210-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch index a5ea39ce7..16e6122ea 100644 --- a/debian/patches-rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch +++ b/debian/patches-rt/0210-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch @@ -1,7 +1,8 @@ +From af59a684620beb5f2edbea7e302390e7d980b73e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 19 May 2016 17:45:27 +0200 -Subject: [PATCH] kernel/printk: Don't try to print from IRQ/NMI region -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 210/266] kernel/printk: Don't try to print from IRQ/NMI region +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On -RT we try to acquire sleeping locks which might lead to warnings from lockdep or a warn_on() from spin_try_lock() (which is a rtmutex on @@ -11,12 +12,14 @@ this via console_unblank() / bust_spinlocks() as well. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/printk/printk.c | 10 ++++++++++ + kernel/printk/printk.c | 10 ++++++++++ 1 file changed, 10 insertions(+) +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index d983c509f74a..f15988a33860 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1782,6 +1782,11 @@ static void call_console_drivers(const c +@@ -1782,6 +1782,11 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, if (!console_drivers) return; @@ -40,3 +43,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * console_unblank can no longer be called in interrupt context unless * oops_in_progress is set to 1.. +-- +2.20.1 + diff --git a/debian/patches-rt/HACK-printk-drop-the-logbuf_lock-more-often.patch b/debian/patches-rt/0211-printk-Drop-the-logbuf_lock-more-often.patch index 13bb994ce..33f1c6625 100644 --- a/debian/patches-rt/HACK-printk-drop-the-logbuf_lock-more-often.patch +++ b/debian/patches-rt/0211-printk-Drop-the-logbuf_lock-more-often.patch @@ -1,19 +1,22 @@ +From 06810537e40e728eb91fab5dbc8b836db1989912 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 21 Mar 2013 19:01:05 +0100 -Subject: printk: Drop the logbuf_lock more often -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 211/266] printk: Drop the logbuf_lock more often +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The lock is hold with irgs off. The latency drops 500us+ on my arm bugs with a "full" buffer after executing "dmesg" on the shell. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/printk/printk.c | 28 ++++++++++++++++++++++++++++ + kernel/printk/printk.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index f15988a33860..a43d07d4e043 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1420,12 +1420,23 @@ static int syslog_print_all(char __user +@@ -1420,12 +1420,23 @@ static int syslog_print_all(char __user *buf, int size, bool clear) u64 next_seq; u64 seq; u32 idx; @@ -37,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Find first record that fits, including all following records, * into the user-provided buffer for this dump. -@@ -1438,6 +1449,14 @@ static int syslog_print_all(char __user +@@ -1438,6 +1449,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) len += msg_print_text(msg, true, NULL, 0); idx = log_next(idx); seq++; @@ -52,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* move first record forward until length fits into the buffer */ -@@ -1449,6 +1468,14 @@ static int syslog_print_all(char __user +@@ -1449,6 +1468,14 @@ static int syslog_print_all(char __user *buf, int size, bool clear) len -= msg_print_text(msg, true, NULL, 0); idx = log_next(idx); seq++; @@ -67,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* last message fitting into this dump */ -@@ -1486,6 +1513,7 @@ static int syslog_print_all(char __user +@@ -1486,6 +1513,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) clear_seq = log_next_seq; clear_idx = log_next_idx; } @@ -75,3 +78,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> logbuf_unlock_irq(); kfree(text); +-- +2.20.1 + diff --git a/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch b/debian/patches-rt/0212-ARM-enable-irq-in-translation-section-permission-fau.patch index 6305da359..356efbf45 100644 --- a/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch +++ b/debian/patches-rt/0212-ARM-enable-irq-in-translation-section-permission-fau.patch @@ -1,7 +1,12 @@ +From 418f742ee48703d6d790578aea5580eaf782722e Mon Sep 17 00:00:00 2001 From: "Yadi.hu" <yadi.hu@windriver.com> Date: Wed, 10 Dec 2014 10:32:09 +0800 -Subject: ARM: enable irq in translation/section permission fault handlers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 212/266] ARM: enable irq in translation/section permission + fault handlers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Probably happens on all ARM, with CONFIG_PREEMPT_RT_FULL @@ -59,12 +64,14 @@ permission exception. Signed-off-by: Yadi.hu <yadi.hu@windriver.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm/mm/fault.c | 6 ++++++ + arch/arm/mm/fault.c | 6 ++++++ 1 file changed, 6 insertions(+) +diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c +index 3232afb6fdc0..3bec1f73a9aa 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c -@@ -439,6 +439,9 @@ do_translation_fault(unsigned long addr, +@@ -439,6 +439,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, if (addr < TASK_SIZE) return do_page_fault(addr, fsr, regs); @@ -74,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (user_mode(regs)) goto bad_area; -@@ -506,6 +509,9 @@ do_translation_fault(unsigned long addr, +@@ -506,6 +509,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, static int do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) { @@ -84,3 +91,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> do_bad_area(addr, fsr, regs); return 0; } +-- +2.20.1 + diff --git a/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch b/debian/patches-rt/0213-genirq-update-irq_set_irqchip_state-documentation.patch index 1f734c30d..810bef0cf 100644 --- a/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch +++ b/debian/patches-rt/0213-genirq-update-irq_set_irqchip_state-documentation.patch @@ -1,7 +1,8 @@ +From 8a492dd953741486ef8dec9c107d4e1ba0190fa9 Mon Sep 17 00:00:00 2001 From: Josh Cartwright <joshc@ni.com> Date: Thu, 11 Feb 2016 11:54:00 -0600 -Subject: genirq: update irq_set_irqchip_state documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 213/266] genirq: update irq_set_irqchip_state documentation +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On -rt kernels, the use of migrate_disable()/migrate_enable() is sufficient to guarantee a task isn't moved to another CPU. Update the @@ -10,12 +11,14 @@ irq_set_irqchip_state() documentation to reflect this. Signed-off-by: Josh Cartwright <joshc@ni.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/irq/manage.c | 2 +- + kernel/irq/manage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index ba5bba5f1ffd..48c2690070f3 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -2274,7 +2274,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state) +@@ -2277,7 +2277,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); * This call sets the internal irqchip state of an interrupt, * depending on the value of @which. * @@ -24,3 +27,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * interrupt controller has per-cpu registers. */ int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, +-- +2.20.1 + diff --git a/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/debian/patches-rt/0214-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch index 848176de1..9d3d46ad8 100644 --- a/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ b/debian/patches-rt/0214-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -1,7 +1,9 @@ +From 3bc92c364ea4a31b42fbaeebab098e6caf3d2feb Mon Sep 17 00:00:00 2001 From: Josh Cartwright <joshc@ni.com> Date: Thu, 11 Feb 2016 11:54:01 -0600 -Subject: KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 214/266] KVM: arm/arm64: downgrade preempt_disable()d region + to migrate_disable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz kvm_arch_vcpu_ioctl_run() disables the use of preemption when updating the vgic and timer states to prevent the calling task from migrating to @@ -18,12 +20,14 @@ Reported-by: Manish Jaggi <Manish.Jaggi@caviumnetworks.com> Signed-off-by: Josh Cartwright <joshc@ni.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - virt/kvm/arm/arm.c | 6 +++--- + virt/kvm/arm/arm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) +diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c +index 1415e36fed3d..8d8caad49eb6 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c -@@ -699,7 +699,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -709,7 +709,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) * involves poking the GIC, which must be done in a * non-preemptible context. */ @@ -32,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> kvm_pmu_flush_hwstate(vcpu); -@@ -748,7 +748,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -758,7 +758,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) kvm_timer_sync_hwstate(vcpu); kvm_vgic_sync_hwstate(vcpu); local_irq_enable(); @@ -41,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> continue; } -@@ -826,7 +826,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -836,7 +836,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) /* Exit types that need handling before we can be preempted */ handle_exit_early(vcpu, run, ret); @@ -50,3 +54,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ret = handle_exit(vcpu, run, ret); } +-- +2.20.1 + diff --git a/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch b/debian/patches-rt/0215-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch index d978a8ae0..23d3d3a73 100644 --- a/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch +++ b/debian/patches-rt/0215-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch @@ -1,8 +1,9 @@ +From 972a07118b3e07e7e585182621cbc2b69acf78c0 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 25 Jul 2018 14:02:38 +0200 -Subject: [PATCH] arm64: fpsimd: use preemp_disable in addition to +Subject: [PATCH 215/266] arm64: fpsimd: use preemp_disable in addition to local_bh_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In v4.16-RT I noticed a number of warnings from task_fpsimd_load(). The code disables BH and expects that it is not preemptible. On -RT the @@ -14,12 +15,14 @@ Add preempt_disable()/enable() to enfore the required semantic on -RT. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm64/kernel/fpsimd.c | 31 +++++++++++++++++++++++++++++-- + arch/arm64/kernel/fpsimd.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) +diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c +index 58c53bc96928..71252cd8b594 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c -@@ -159,6 +159,16 @@ static void sve_free(struct task_struct +@@ -159,6 +159,16 @@ static void sve_free(struct task_struct *task) __sve_free(task); } @@ -36,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * TIF_SVE controls whether a task can use SVE without trapping while * in userspace, and also the way a task's FPSIMD/SVE state is stored -@@ -547,6 +557,7 @@ int sve_set_vector_length(struct task_st +@@ -547,6 +557,7 @@ int sve_set_vector_length(struct task_struct *task, * non-SVE thread. */ if (task == current) { @@ -44,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> local_bh_disable(); fpsimd_save(); -@@ -557,8 +568,10 @@ int sve_set_vector_length(struct task_st +@@ -557,8 +568,10 @@ int sve_set_vector_length(struct task_struct *task, if (test_and_clear_tsk_thread_flag(task, TIF_SVE)) sve_to_fpsimd(task); @@ -56,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Force reallocation of task SVE state to the correct size -@@ -813,6 +826,7 @@ asmlinkage void do_sve_acc(unsigned int +@@ -813,6 +826,7 @@ asmlinkage void do_sve_acc(unsigned int esr, struct pt_regs *regs) sve_alloc(current); @@ -64,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> local_bh_disable(); fpsimd_save(); -@@ -826,6 +840,7 @@ asmlinkage void do_sve_acc(unsigned int +@@ -826,6 +840,7 @@ asmlinkage void do_sve_acc(unsigned int esr, struct pt_regs *regs) WARN_ON(1); /* SVE access shouldn't have trapped */ local_bh_enable(); @@ -72,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -892,10 +907,12 @@ void fpsimd_thread_switch(struct task_st +@@ -892,10 +907,12 @@ void fpsimd_thread_switch(struct task_struct *next) void fpsimd_flush_thread(void) { int vl, supported_vl; @@ -131,7 +134,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -1031,6 +1054,7 @@ void fpsimd_update_current_state(struct +@@ -1031,6 +1054,7 @@ void fpsimd_update_current_state(struct user_fpsimd_state const *state) if (!system_supports_fpsimd()) return; @@ -139,7 +142,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> local_bh_disable(); current->thread.uw.fpsimd_state = *state; -@@ -1043,6 +1067,7 @@ void fpsimd_update_current_state(struct +@@ -1043,6 +1067,7 @@ void fpsimd_update_current_state(struct user_fpsimd_state const *state) clear_thread_flag(TIF_FOREIGN_FPSTATE); local_bh_enable(); @@ -163,3 +166,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL(kernel_neon_begin); +-- +2.20.1 + diff --git a/debian/patches-rt/kgb-serial-hackaround.patch b/debian/patches-rt/0216-kgdb-serial-Short-term-workaround.patch index f05640b42..b17113202 100644 --- a/debian/patches-rt/kgb-serial-hackaround.patch +++ b/debian/patches-rt/0216-kgdb-serial-Short-term-workaround.patch @@ -1,7 +1,8 @@ +From f2715a381adb65a81e31558b869e2a010bb5ae8a Mon Sep 17 00:00:00 2001 From: Jason Wessel <jason.wessel@windriver.com> Date: Thu, 28 Jul 2011 12:42:23 -0500 -Subject: kgdb/serial: Short term workaround -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 216/266] kgdb/serial: Short term workaround +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On 07/27/2011 04:37 PM, Thomas Gleixner wrote: > - KGDB (not yet disabled) is reportedly unusable on -rt right now due @@ -17,13 +18,14 @@ change separation between the console and the HW to have a polled mode Thanks, Jason. - --- - drivers/tty/serial/8250/8250_port.c | 3 +++ - include/linux/kdb.h | 2 ++ - kernel/debug/kdb/kdb_io.c | 2 ++ + drivers/tty/serial/8250/8250_port.c | 3 +++ + include/linux/kdb.h | 2 ++ + kernel/debug/kdb/kdb_io.c | 2 ++ 3 files changed, 7 insertions(+) +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c +index 851d7f6046a4..a2705b401efc 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -31,6 +31,7 @@ @@ -34,7 +36,7 @@ Jason. #include <linux/uaccess.h> #include <linux/pm_runtime.h> #include <linux/ktime.h> -@@ -3241,6 +3242,8 @@ void serial8250_console_write(struct uar +@@ -3241,6 +3242,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, if (port->sysrq || oops_in_progress) locked = 0; @@ -43,9 +45,11 @@ Jason. else spin_lock_irqsave(&port->lock, flags); +diff --git a/include/linux/kdb.h b/include/linux/kdb.h +index 68bd88223417..e033b25b0b72 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h -@@ -167,6 +167,7 @@ extern __printf(2, 0) int vkdb_printf(en +@@ -167,6 +167,7 @@ extern __printf(2, 0) int vkdb_printf(enum kdb_msgsrc src, const char *fmt, extern __printf(1, 2) int kdb_printf(const char *, ...); typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...); @@ -53,7 +57,7 @@ Jason. extern void kdb_init(int level); /* Access to kdb specific polling devices */ -@@ -201,6 +202,7 @@ extern int kdb_register_flags(char *, kd +@@ -201,6 +202,7 @@ extern int kdb_register_flags(char *, kdb_func_t, char *, char *, extern int kdb_unregister(char *); #else /* ! CONFIG_KGDB_KDB */ static inline __printf(1, 2) int kdb_printf(const char *fmt, ...) { return 0; } @@ -61,6 +65,8 @@ Jason. static inline void kdb_init(int level) {} static inline int kdb_register(char *cmd, kdb_func_t func, char *usage, char *help, short minlen) { return 0; } +diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c +index 6a4b41484afe..197cb422f6e1 100644 --- a/kernel/debug/kdb/kdb_io.c +++ b/kernel/debug/kdb/kdb_io.c @@ -857,9 +857,11 @@ int kdb_printf(const char *fmt, ...) @@ -75,3 +81,6 @@ Jason. return r; } +-- +2.20.1 + diff --git a/debian/patches-rt/sysfs-realtime-entry.patch b/debian/patches-rt/0217-sysfs-Add-sys-kernel-realtime-entry.patch index c322a0400..188447d50 100644 --- a/debian/patches-rt/sysfs-realtime-entry.patch +++ b/debian/patches-rt/0217-sysfs-Add-sys-kernel-realtime-entry.patch @@ -1,7 +1,8 @@ -Subject: sysfs: Add /sys/kernel/realtime entry +From d1cbdeac46f1ee781ca0a2258241f88581088ce6 Mon Sep 17 00:00:00 2001 From: Clark Williams <williams@redhat.com> -Date: Sat Jul 30 21:55:53 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Sat, 30 Jul 2011 21:55:53 -0500 +Subject: [PATCH 217/266] sysfs: Add /sys/kernel/realtime entry +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Add a /sys/kernel entry to indicate that the kernel is a realtime kernel. @@ -15,9 +16,11 @@ Are there better solutions? Should it exist and return 0 on !-rt? Signed-off-by: Clark Williams <williams@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> --- - kernel/ksysfs.c | 12 ++++++++++++ + kernel/ksysfs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) +diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c +index 46ba853656f6..9a23632b6294 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c @@ -140,6 +140,15 @@ KERNEL_ATTR_RO(vmcoreinfo); @@ -36,13 +39,16 @@ Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> /* whether file capabilities are enabled */ static ssize_t fscaps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) -@@ -231,6 +240,9 @@ static struct attribute * kernel_attrs[] +@@ -230,6 +239,9 @@ static struct attribute * kernel_attrs[] = { + #ifndef CONFIG_TINY_RCU &rcu_expedited_attr.attr, &rcu_normal_attr.attr, - #endif ++#endif +#ifdef CONFIG_PREEMPT_RT_FULL + &realtime_attr.attr, -+#endif + #endif NULL }; - +-- +2.20.1 + diff --git a/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch b/debian/patches-rt/0218-mm-rt-kmap_atomic-scheduling.patch index 11c1530a2..308a60eff 100644 --- a/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch +++ b/debian/patches-rt/0218-mm-rt-kmap_atomic-scheduling.patch @@ -1,7 +1,8 @@ -Subject: mm, rt: kmap_atomic scheduling +From bc54e9dc9a1914d97010a4e14c68d1a21406b346 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra <peterz@infradead.org> Date: Thu, 28 Jul 2011 10:43:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 218/266] mm, rt: kmap_atomic scheduling +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In fact, with migrate_disable() existing one could play games with kmap_atomic. You could save/restore the kmap_atomic slots on context @@ -20,15 +21,17 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins and the pte content right away in the task struct. Shortens the context switch code. ] --- - arch/x86/kernel/process_32.c | 32 ++++++++++++++++++++++++++++++++ - arch/x86/mm/highmem_32.c | 13 ++++++++++--- - arch/x86/mm/iomap_32.c | 9 ++++++++- - include/linux/highmem.h | 31 +++++++++++++++++++++++++------ - include/linux/sched.h | 7 +++++++ - include/linux/uaccess.h | 2 ++ - mm/highmem.c | 6 ++++-- + arch/x86/kernel/process_32.c | 32 ++++++++++++++++++++++++++++++++ + arch/x86/mm/highmem_32.c | 13 ++++++++++--- + arch/x86/mm/iomap_32.c | 9 ++++++++- + include/linux/highmem.h | 31 +++++++++++++++++++++++++------ + include/linux/sched.h | 7 +++++++ + include/linux/uaccess.h | 2 ++ + mm/highmem.c | 6 ++++-- 7 files changed, 88 insertions(+), 12 deletions(-) +diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c +index d3e593eb189f..84afe55625f8 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -38,6 +38,7 @@ @@ -39,7 +42,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins #include <asm/pgtable.h> #include <asm/ldt.h> -@@ -198,6 +199,35 @@ start_thread(struct pt_regs *regs, unsig +@@ -198,6 +199,35 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) } EXPORT_SYMBOL_GPL(start_thread); @@ -75,7 +78,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins /* * switch_to(x,y) should switch tasks from x to y. -@@ -267,6 +297,8 @@ EXPORT_SYMBOL_GPL(start_thread); +@@ -267,6 +297,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) switch_to_extra(prev_p, next_p); @@ -84,6 +87,8 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins /* * Leave lazy mode, flushing any hypercalls made here. * This must be done before restoring TLS segments so +diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c +index 6d18b70ed5a9..f752724c22e8 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c @@ -32,10 +32,11 @@ EXPORT_SYMBOL(kunmap); @@ -99,7 +104,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins pagefault_disable(); if (!PageHighMem(page)) -@@ -45,7 +46,10 @@ void *kmap_atomic_prot(struct page *page +@@ -45,7 +46,10 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot) idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); BUG_ON(!pte_none(*(kmap_pte-idx))); @@ -130,6 +135,8 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins } EXPORT_SYMBOL(__kunmap_atomic); +diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c +index b3294d36769d..d5a48210d0f6 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c @@ -59,6 +59,7 @@ EXPORT_SYMBOL_GPL(iomap_free); @@ -140,7 +147,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins unsigned long vaddr; int idx, type; -@@ -68,7 +69,10 @@ void *kmap_atomic_prot_pfn(unsigned long +@@ -68,7 +69,10 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot) type = kmap_atomic_idx_push(); idx = type + KM_TYPE_NR * smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); @@ -162,9 +169,11 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins kpte_clear_flush(kmap_pte-idx, vaddr); kmap_atomic_idx_pop(); } +diff --git a/include/linux/highmem.h b/include/linux/highmem.h +index 0690679832d4..1ac89e4718bf 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h -@@ -66,7 +66,7 @@ static inline void kunmap(struct page *p +@@ -66,7 +66,7 @@ static inline void kunmap(struct page *page) static inline void *kmap_atomic(struct page *page) { @@ -173,7 +182,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins pagefault_disable(); return page_address(page); } -@@ -75,7 +75,7 @@ static inline void *kmap_atomic(struct p +@@ -75,7 +75,7 @@ static inline void *kmap_atomic(struct page *page) static inline void __kunmap_atomic(void *addr) { pagefault_enable(); @@ -182,7 +191,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins } #define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn)) -@@ -87,32 +87,51 @@ static inline void __kunmap_atomic(void +@@ -87,32 +87,51 @@ static inline void __kunmap_atomic(void *addr) #if defined(CONFIG_HIGHMEM) || defined(CONFIG_X86_32) @@ -238,6 +247,8 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins #endif } +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 80f6dedc3391..320be04498a9 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -28,6 +28,7 @@ @@ -261,9 +272,11 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins #ifdef CONFIG_DEBUG_ATOMIC_SLEEP unsigned long task_state_change; #endif +diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h +index efe79c1cdd47..128a8489047d 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h -@@ -185,6 +185,7 @@ static __always_inline void pagefault_di +@@ -185,6 +185,7 @@ static __always_inline void pagefault_disabled_dec(void) */ static inline void pagefault_disable(void) { @@ -271,7 +284,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins pagefault_disabled_inc(); /* * make sure to have issued the store before a pagefault -@@ -201,6 +202,7 @@ static inline void pagefault_enable(void +@@ -201,6 +202,7 @@ static inline void pagefault_enable(void) */ barrier(); pagefault_disabled_dec(); @@ -279,6 +292,8 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins } /* +diff --git a/mm/highmem.c b/mm/highmem.c +index 59db3223a5d6..22aa3ddbd87b 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -30,10 +30,11 @@ @@ -294,7 +309,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins /* * Virtual_count is not a pure "count". -@@ -108,8 +109,9 @@ static inline wait_queue_head_t *get_pkm +@@ -108,8 +109,9 @@ static inline wait_queue_head_t *get_pkmap_wait_queue_head(unsigned int color) unsigned long totalhigh_pages __read_mostly; EXPORT_SYMBOL(totalhigh_pages); @@ -305,3 +320,6 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins unsigned int nr_free_highpages (void) { +-- +2.20.1 + diff --git a/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch b/debian/patches-rt/0219-x86-highmem-Add-a-already-used-pte-check.patch index 49540de2f..e4b1eea46 100644 --- a/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch +++ b/debian/patches-rt/0219-x86-highmem-Add-a-already-used-pte-check.patch @@ -1,18 +1,21 @@ +From cd3614855e4c65eaa6be98bb350080ec58373cde Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 11 Mar 2013 17:09:55 +0100 -Subject: x86/highmem: Add a "already used pte" check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 219/266] x86/highmem: Add a "already used pte" check +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz This is a copy from kmap_atomic_prot(). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/mm/iomap_32.c | 2 ++ + arch/x86/mm/iomap_32.c | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c +index d5a48210d0f6..c0ec8d430c02 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c -@@ -69,6 +69,8 @@ void *kmap_atomic_prot_pfn(unsigned long +@@ -69,6 +69,8 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot) type = kmap_atomic_idx_push(); idx = type + KM_TYPE_NR * smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); @@ -21,3 +24,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_PREEMPT_RT_FULL current->kmap_pte[type] = pte; #endif +-- +2.20.1 + diff --git a/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch b/debian/patches-rt/0220-arm-highmem-Flush-tlb-on-unmap.patch index 297272c98..5fe7f6076 100644 --- a/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch +++ b/debian/patches-rt/0220-arm-highmem-Flush-tlb-on-unmap.patch @@ -1,7 +1,8 @@ +From 7587838e3ab05a258457bce16fb13a5c625ee6b9 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 11 Mar 2013 21:37:27 +0100 -Subject: arm/highmem: Flush tlb on unmap -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 220/266] arm/highmem: Flush tlb on unmap +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The tlb should be flushed on unmap and thus make the mapping entry invalid. This is only done in the non-debug case which does not look @@ -9,9 +10,11 @@ right. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/arm/mm/highmem.c | 2 +- + arch/arm/mm/highmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c +index d02f8187b1cc..eb4b225d28c9 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c @@ -112,10 +112,10 @@ void __kunmap_atomic(void *kvaddr) @@ -26,3 +29,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> kmap_atomic_idx_pop(); } else if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) { /* this address was obtained through kmap_high_get() */ +-- +2.20.1 + diff --git a/debian/patches-rt/arm-enable-highmem-for-rt.patch b/debian/patches-rt/0221-arm-Enable-highmem-for-rt.patch index 796487215..d144f48d4 100644 --- a/debian/patches-rt/arm-enable-highmem-for-rt.patch +++ b/debian/patches-rt/0221-arm-Enable-highmem-for-rt.patch @@ -1,17 +1,20 @@ -Subject: arm: Enable highmem for rt +From 24d080b32cfb2d1e6644ae723bbdfbab742aa274 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 13 Feb 2013 11:03:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 221/266] arm: Enable highmem for rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz fixup highmem for ARM. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/arm/include/asm/switch_to.h | 8 +++++ - arch/arm/mm/highmem.c | 56 +++++++++++++++++++++++++++++++++------ - include/linux/highmem.h | 1 + arch/arm/include/asm/switch_to.h | 8 +++++ + arch/arm/mm/highmem.c | 56 +++++++++++++++++++++++++++----- + include/linux/highmem.h | 1 + 3 files changed, 57 insertions(+), 8 deletions(-) +diff --git a/arch/arm/include/asm/switch_to.h b/arch/arm/include/asm/switch_to.h +index d3e937dcee4d..6ab96a2ce1f8 100644 --- a/arch/arm/include/asm/switch_to.h +++ b/arch/arm/include/asm/switch_to.h @@ -4,6 +4,13 @@ @@ -28,7 +31,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * For v7 SMP cores running a preemptible kernel we may be pre-empted * during a TLB maintenance operation, so execute an inner-shareable dsb -@@ -26,6 +33,7 @@ extern struct task_struct *__switch_to(s +@@ -26,6 +33,7 @@ extern struct task_struct *__switch_to(struct task_struct *, struct thread_info #define switch_to(prev,next,last) \ do { \ __complete_pending_tlbi(); \ @@ -36,9 +39,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \ } while (0) +diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c +index eb4b225d28c9..542692dbd40a 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c -@@ -34,6 +34,11 @@ static inline pte_t get_fixmap_pte(unsig +@@ -34,6 +34,11 @@ static inline pte_t get_fixmap_pte(unsigned long vaddr) return *ptep; } @@ -162,6 +167,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> + } +} +#endif +diff --git a/include/linux/highmem.h b/include/linux/highmem.h +index 1ac89e4718bf..eaa2ef9bc10e 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -8,6 +8,7 @@ @@ -172,3 +179,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include <asm/cacheflush.h> +-- +2.20.1 + diff --git a/debian/patches-rt/scsi-fcoe-rt-aware.patch b/debian/patches-rt/0222-scsi-fcoe-Make-RT-aware.patch index c1f6dceaa..5d832953c 100644 --- a/debian/patches-rt/scsi-fcoe-rt-aware.patch +++ b/debian/patches-rt/0222-scsi-fcoe-Make-RT-aware.patch @@ -1,21 +1,24 @@ -Subject: scsi/fcoe: Make RT aware. +From fa1bdacac643ee0a36ed8a7d9e42aac2c2075655 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sat, 12 Nov 2011 14:00:48 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 222/266] scsi/fcoe: Make RT aware. +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - drivers/scsi/fcoe/fcoe.c | 16 ++++++++-------- - drivers/scsi/fcoe/fcoe_ctlr.c | 4 ++-- - drivers/scsi/libfc/fc_exch.c | 4 ++-- + drivers/scsi/fcoe/fcoe.c | 16 ++++++++-------- + drivers/scsi/fcoe/fcoe_ctlr.c | 4 ++-- + drivers/scsi/libfc/fc_exch.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) +diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c +index f46b312d04bc..adbdb38eced2 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c -@@ -1459,11 +1459,11 @@ static int fcoe_rcv(struct sk_buff *skb, +@@ -1459,11 +1459,11 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev, static int fcoe_alloc_paged_crc_eof(struct sk_buff *skb, int tlen) { struct fcoe_percpu_s *fps; @@ -30,7 +33,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return rc; } -@@ -1650,11 +1650,11 @@ static inline int fcoe_filter_frames(str +@@ -1650,11 +1650,11 @@ static inline int fcoe_filter_frames(struct fc_lport *lport, return 0; } @@ -44,7 +47,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return -EINVAL; } -@@ -1697,7 +1697,7 @@ static void fcoe_recv_frame(struct sk_bu +@@ -1697,7 +1697,7 @@ static void fcoe_recv_frame(struct sk_buff *skb) */ hp = (struct fcoe_hdr *) skb_network_header(skb); @@ -53,7 +56,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (unlikely(FC_FCOE_DECAPS_VER(hp) != FC_FCOE_VER)) { if (stats->ErrorFrames < 5) printk(KERN_WARNING "fcoe: FCoE version " -@@ -1729,13 +1729,13 @@ static void fcoe_recv_frame(struct sk_bu +@@ -1729,13 +1729,13 @@ static void fcoe_recv_frame(struct sk_buff *skb) goto drop; if (!fcoe_filter_frames(lport, fp)) { @@ -69,9 +72,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> kfree_skb(skb); } +diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c +index 54da3166da8d..ac4e443c3ba8 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c -@@ -835,7 +835,7 @@ static unsigned long fcoe_ctlr_age_fcfs( +@@ -835,7 +835,7 @@ static unsigned long fcoe_ctlr_age_fcfs(struct fcoe_ctlr *fip) INIT_LIST_HEAD(&del_list); @@ -80,7 +85,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> list_for_each_entry_safe(fcf, next, &fip->fcfs, list) { deadline = fcf->time + fcf->fka_period + fcf->fka_period / 2; -@@ -871,7 +871,7 @@ static unsigned long fcoe_ctlr_age_fcfs( +@@ -871,7 +871,7 @@ static unsigned long fcoe_ctlr_age_fcfs(struct fcoe_ctlr *fip) sel_time = fcf->time; } } @@ -89,9 +94,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> list_for_each_entry_safe(fcf, next, &del_list, list) { /* Removes fcf from current list */ +diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c +index 42bcf7f3a0f9..2ce045d6860c 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c -@@ -833,10 +833,10 @@ static struct fc_exch *fc_exch_em_alloc( +@@ -833,10 +833,10 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, } memset(ep, 0, sizeof(*ep)); @@ -104,3 +111,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* peek cache of free slot */ if (pool->left != FC_XID_UNKNOWN) { +-- +2.20.1 + diff --git a/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch b/debian/patches-rt/0223-x86-crypto-Reduce-preempt-disabled-regions.patch index 482b45f7f..69ea79896 100644 --- a/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch +++ b/debian/patches-rt/0223-x86-crypto-Reduce-preempt-disabled-regions.patch @@ -1,7 +1,8 @@ -Subject: x86: crypto: Reduce preempt disabled regions +From afdbe47317480e4e195faebb0cbaeaba166d27ec Mon Sep 17 00:00:00 2001 From: Peter Zijlstra <peterz@infradead.org> Date: Mon, 14 Nov 2011 18:19:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 223/266] x86: crypto: Reduce preempt disabled regions +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Restrict the preempt disabled regions to the actual floating point operations and enable preemption for the administrative actions. @@ -14,12 +15,14 @@ Signed-off-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/x86/crypto/aesni-intel_glue.c | 22 ++++++++++++---------- + arch/x86/crypto/aesni-intel_glue.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) +diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c +index 917f25e4d0a8..58d8c03fc32d 100644 --- a/arch/x86/crypto/aesni-intel_glue.c +++ b/arch/x86/crypto/aesni-intel_glue.c -@@ -434,14 +434,14 @@ static int ecb_encrypt(struct skcipher_r +@@ -434,14 +434,14 @@ static int ecb_encrypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, true); @@ -36,7 +39,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return err; } -@@ -456,14 +456,14 @@ static int ecb_decrypt(struct skcipher_r +@@ -456,14 +456,14 @@ static int ecb_decrypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, true); @@ -53,7 +56,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return err; } -@@ -478,14 +478,14 @@ static int cbc_encrypt(struct skcipher_r +@@ -478,14 +478,14 @@ static int cbc_encrypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, true); @@ -70,7 +73,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return err; } -@@ -500,14 +500,14 @@ static int cbc_decrypt(struct skcipher_r +@@ -500,14 +500,14 @@ static int cbc_decrypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, true); @@ -87,7 +90,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return err; } -@@ -557,18 +557,20 @@ static int ctr_crypt(struct skcipher_req +@@ -557,18 +557,20 @@ static int ctr_crypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, true); @@ -110,3 +113,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return err; } +-- +2.20.1 + diff --git a/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch b/debian/patches-rt/0224-crypto-Reduce-preempt-disabled-regions-more-algos.patch index 476f7d666..cc6a3b719 100644 --- a/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch +++ b/debian/patches-rt/0224-crypto-Reduce-preempt-disabled-regions-more-algos.patch @@ -1,7 +1,8 @@ +From b1087b7d43c527984b5892d4b50c921c78432950 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 21 Feb 2014 17:24:04 +0100 -Subject: crypto: Reduce preempt disabled regions, more algos -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 224/266] crypto: Reduce preempt disabled regions, more algos +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Don Estabrook reported | kernel: WARNING: CPU: 2 PID: 858 at kernel/sched/core.c:2428 migrate_disable+0xed/0x100() @@ -38,13 +39,15 @@ the bug is gone. Reported-by: Don Estabrook <don.estabrook@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/crypto/cast5_avx_glue.c | 21 +++++++++------------ - arch/x86/crypto/glue_helper.c | 31 ++++++++++++++++--------------- + arch/x86/crypto/cast5_avx_glue.c | 21 +++++++++------------ + arch/x86/crypto/glue_helper.c | 31 ++++++++++++++++--------------- 2 files changed, 25 insertions(+), 27 deletions(-) +diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86/crypto/cast5_avx_glue.c +index 41034745d6a2..d4bf7fc02ee7 100644 --- a/arch/x86/crypto/cast5_avx_glue.c +++ b/arch/x86/crypto/cast5_avx_glue.c -@@ -61,7 +61,7 @@ static inline void cast5_fpu_end(bool fp +@@ -61,7 +61,7 @@ static inline void cast5_fpu_end(bool fpu_enabled) static int ecb_crypt(struct skcipher_request *req, bool enc) { @@ -53,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct cast5_ctx *ctx = crypto_skcipher_ctx(tfm); struct skcipher_walk walk; -@@ -76,7 +76,7 @@ static int ecb_crypt(struct skcipher_req +@@ -76,7 +76,7 @@ static int ecb_crypt(struct skcipher_request *req, bool enc) u8 *wsrc = walk.src.virt.addr; u8 *wdst = walk.dst.virt.addr; @@ -62,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Process multi-block batch */ if (nbytes >= bsize * CAST5_PARALLEL_BLOCKS) { -@@ -105,10 +105,9 @@ static int ecb_crypt(struct skcipher_req +@@ -105,10 +105,9 @@ static int ecb_crypt(struct skcipher_request *req, bool enc) } while (nbytes >= bsize); done: @@ -74,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return err; } -@@ -212,7 +211,7 @@ static int cbc_decrypt(struct skcipher_r +@@ -212,7 +211,7 @@ static int cbc_decrypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct cast5_ctx *ctx = crypto_skcipher_ctx(tfm); @@ -83,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct skcipher_walk walk; unsigned int nbytes; int err; -@@ -220,12 +219,11 @@ static int cbc_decrypt(struct skcipher_r +@@ -220,12 +219,11 @@ static int cbc_decrypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, false); while ((nbytes = walk.nbytes)) { @@ -98,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return err; } -@@ -292,7 +290,7 @@ static int ctr_crypt(struct skcipher_req +@@ -292,7 +290,7 @@ static int ctr_crypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct cast5_ctx *ctx = crypto_skcipher_ctx(tfm); @@ -107,7 +110,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct skcipher_walk walk; unsigned int nbytes; int err; -@@ -300,13 +298,12 @@ static int ctr_crypt(struct skcipher_req +@@ -300,13 +298,12 @@ static int ctr_crypt(struct skcipher_request *req) err = skcipher_walk_virt(&walk, req, false); while ((nbytes = walk.nbytes) >= CAST5_BLOCK_SIZE) { @@ -123,9 +126,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (walk.nbytes) { ctr_crypt_final(&walk, ctx); err = skcipher_walk_done(&walk, 0); +diff --git a/arch/x86/crypto/glue_helper.c b/arch/x86/crypto/glue_helper.c +index a78ef99a9981..dac489a1c4da 100644 --- a/arch/x86/crypto/glue_helper.c +++ b/arch/x86/crypto/glue_helper.c -@@ -38,7 +38,7 @@ int glue_ecb_req_128bit(const struct com +@@ -38,7 +38,7 @@ int glue_ecb_req_128bit(const struct common_glue_ctx *gctx, void *ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); const unsigned int bsize = 128 / 8; struct skcipher_walk walk; @@ -134,7 +139,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> unsigned int nbytes; int err; -@@ -51,7 +51,7 @@ int glue_ecb_req_128bit(const struct com +@@ -51,7 +51,7 @@ int glue_ecb_req_128bit(const struct common_glue_ctx *gctx, unsigned int i; fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, @@ -143,7 +148,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> for (i = 0; i < gctx->num_funcs; i++) { func_bytes = bsize * gctx->funcs[i].num_blocks; -@@ -69,10 +69,9 @@ int glue_ecb_req_128bit(const struct com +@@ -69,10 +69,9 @@ int glue_ecb_req_128bit(const struct common_glue_ctx *gctx, if (nbytes < bsize) break; } @@ -155,7 +160,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return err; } EXPORT_SYMBOL_GPL(glue_ecb_req_128bit); -@@ -115,7 +114,7 @@ int glue_cbc_decrypt_req_128bit(const st +@@ -115,7 +114,7 @@ int glue_cbc_decrypt_req_128bit(const struct common_glue_ctx *gctx, void *ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); const unsigned int bsize = 128 / 8; struct skcipher_walk walk; @@ -164,7 +169,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> unsigned int nbytes; int err; -@@ -129,7 +128,7 @@ int glue_cbc_decrypt_req_128bit(const st +@@ -129,7 +128,7 @@ int glue_cbc_decrypt_req_128bit(const struct common_glue_ctx *gctx, u128 last_iv; fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, @@ -173,7 +178,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Start of the last block. */ src += nbytes / bsize - 1; dst += nbytes / bsize - 1; -@@ -161,10 +160,10 @@ int glue_cbc_decrypt_req_128bit(const st +@@ -161,10 +160,10 @@ int glue_cbc_decrypt_req_128bit(const struct common_glue_ctx *gctx, done: u128_xor(dst, dst, (u128 *)walk.iv); *(u128 *)walk.iv = last_iv; @@ -185,7 +190,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return err; } EXPORT_SYMBOL_GPL(glue_cbc_decrypt_req_128bit); -@@ -175,7 +174,7 @@ int glue_ctr_req_128bit(const struct com +@@ -175,7 +174,7 @@ int glue_ctr_req_128bit(const struct common_glue_ctx *gctx, void *ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); const unsigned int bsize = 128 / 8; struct skcipher_walk walk; @@ -194,7 +199,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> unsigned int nbytes; int err; -@@ -189,7 +188,7 @@ int glue_ctr_req_128bit(const struct com +@@ -189,7 +188,7 @@ int glue_ctr_req_128bit(const struct common_glue_ctx *gctx, le128 ctrblk; fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, @@ -203,7 +208,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> be128_to_le128(&ctrblk, (be128 *)walk.iv); -@@ -213,11 +212,10 @@ int glue_ctr_req_128bit(const struct com +@@ -213,11 +212,10 @@ int glue_ctr_req_128bit(const struct common_glue_ctx *gctx, } le128_to_be128((be128 *)walk.iv, &ctrblk); @@ -216,7 +221,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (nbytes) { le128 ctrblk; u128 tmp; -@@ -278,7 +276,7 @@ int glue_xts_req_128bit(const struct com +@@ -278,7 +276,7 @@ int glue_xts_req_128bit(const struct common_glue_ctx *gctx, { const unsigned int bsize = 128 / 8; struct skcipher_walk walk; @@ -225,7 +230,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> unsigned int nbytes; int err; -@@ -289,21 +287,24 @@ int glue_xts_req_128bit(const struct com +@@ -289,21 +287,24 @@ int glue_xts_req_128bit(const struct common_glue_ctx *gctx, /* set minimum length to bsize, for tweak_fn */ fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, @@ -253,3 +258,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return err; } EXPORT_SYMBOL_GPL(glue_xts_req_128bit); +-- +2.20.1 + diff --git a/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch b/debian/patches-rt/0225-crypto-limit-more-FPU-enabled-sections.patch index 4dac722d3..270f86305 100644 --- a/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch +++ b/debian/patches-rt/0225-crypto-limit-more-FPU-enabled-sections.patch @@ -1,10 +1,11 @@ +From 607e8697d0dc5e97c9b707c96e81841f9b587467 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 30 Nov 2017 13:40:10 +0100 -Subject: [PATCH] crypto: limit more FPU-enabled sections +Subject: [PATCH 225/266] crypto: limit more FPU-enabled sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Those crypto drivers use SSE/AVX/… for their crypto work and in order to do so in kernel they need to enable the "FPU" in kernel mode which @@ -29,14 +30,16 @@ performance. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/crypto/chacha20_glue.c | 9 +++++---- - arch/x86/include/asm/fpu/api.h | 1 + - arch/x86/kernel/fpu/core.c | 12 ++++++++++++ + arch/x86/crypto/chacha20_glue.c | 9 +++++---- + arch/x86/include/asm/fpu/api.h | 1 + + arch/x86/kernel/fpu/core.c | 12 ++++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) +diff --git a/arch/x86/crypto/chacha20_glue.c b/arch/x86/crypto/chacha20_glue.c +index dce7c5d39c2f..6194160b7fbc 100644 --- a/arch/x86/crypto/chacha20_glue.c +++ b/arch/x86/crypto/chacha20_glue.c -@@ -81,23 +81,24 @@ static int chacha20_simd(struct skcipher +@@ -81,23 +81,24 @@ static int chacha20_simd(struct skcipher_request *req) crypto_chacha20_init(state, ctx, walk.iv); @@ -65,6 +68,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return err; } +diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h +index a9caac9d4a72..18b31f22ca5d 100644 --- a/arch/x86/include/asm/fpu/api.h +++ b/arch/x86/include/asm/fpu/api.h @@ -25,6 +25,7 @@ extern void __kernel_fpu_begin(void); @@ -75,6 +80,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> extern bool irq_fpu_usable(void); /* +diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c +index 2ea85b32421a..6914dc569d1e 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -138,6 +138,18 @@ void kernel_fpu_end(void) @@ -96,3 +103,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Save the FPU state (mark it for reload if necessary): * +-- +2.20.1 + diff --git a/debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch b/debian/patches-rt/0226-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch index b3d221d11..6aa8c922c 100644 --- a/debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch +++ b/debian/patches-rt/0226-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch @@ -1,8 +1,9 @@ +From 2d8273e45e5c4831f867f1f3e3311f1f9cb203ec Mon Sep 17 00:00:00 2001 From: Mike Galbraith <efault@gmx.de> Date: Wed, 11 Jul 2018 17:14:47 +0200 -Subject: [PATCH] crypto: scompress - serialize RT percpu scratch buffer - access with a local lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 226/266] crypto: scompress - serialize RT percpu scratch + buffer access with a local lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:974 | in_atomic(): 1, irqs_disabled(): 0, pid: 1401, name: cryptomgr_test @@ -36,9 +37,11 @@ causing the splat above. Serialize with a local lock for RT instead. Signed-off-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - crypto/scompress.c | 6 ++++-- + crypto/scompress.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) +diff --git a/crypto/scompress.c b/crypto/scompress.c +index 968bbcf65c94..c2f0077e0801 100644 --- a/crypto/scompress.c +++ b/crypto/scompress.c @@ -24,6 +24,7 @@ @@ -49,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <crypto/scatterwalk.h> #include <crypto/internal/acompress.h> #include <crypto/internal/scompress.h> -@@ -34,6 +35,7 @@ static void * __percpu *scomp_src_scratc +@@ -34,6 +35,7 @@ static void * __percpu *scomp_src_scratches; static void * __percpu *scomp_dst_scratches; static int scomp_scratch_users; static DEFINE_MUTEX(scomp_lock); @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_NET static int crypto_scomp_report(struct sk_buff *skb, struct crypto_alg *alg) -@@ -146,7 +148,7 @@ static int scomp_acomp_comp_decomp(struc +@@ -146,7 +148,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir) void **tfm_ctx = acomp_tfm_ctx(tfm); struct crypto_scomp *scomp = *tfm_ctx; void **ctx = acomp_request_ctx(req); @@ -66,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> u8 *scratch_src = *per_cpu_ptr(scomp_src_scratches, cpu); u8 *scratch_dst = *per_cpu_ptr(scomp_dst_scratches, cpu); int ret; -@@ -181,7 +183,7 @@ static int scomp_acomp_comp_decomp(struc +@@ -181,7 +183,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir) 1); } out: @@ -75,3 +78,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } +-- +2.20.1 + diff --git a/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch b/debian/patches-rt/0227-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch index 733e5c485..1c134b79b 100644 --- a/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch +++ b/debian/patches-rt/0227-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch @@ -1,8 +1,9 @@ +From 3e017e1cdb6fa08d6cc7c6f3cc57ba9b269c6fca Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 26 Jul 2018 18:52:00 +0200 -Subject: [PATCH] crypto: cryptd - add a lock instead +Subject: [PATCH 227/266] crypto: cryptd - add a lock instead preempt_disable/local_bh_disable -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz cryptd has a per-CPU lock which protected with local_bh_disable() and preempt_disable(). @@ -15,12 +16,14 @@ actual ressource is protected by the spinlock. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - crypto/cryptd.c | 19 +++++++++---------- + crypto/cryptd.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) +diff --git a/crypto/cryptd.c b/crypto/cryptd.c +index addca7bae33f..8ad657cddc0a 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c -@@ -39,6 +39,7 @@ MODULE_PARM_DESC(cryptd_max_cpu_qlen, "S +@@ -39,6 +39,7 @@ MODULE_PARM_DESC(cryptd_max_cpu_qlen, "Set cryptd Max queue depth"); struct cryptd_cpu_queue { struct crypto_queue queue; struct work_struct work; @@ -28,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> }; struct cryptd_queue { -@@ -117,6 +118,7 @@ static int cryptd_init_queue(struct cryp +@@ -117,6 +118,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); @@ -36,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } 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 +@@ -141,8 +143,10 @@ static int cryptd_enqueue_request(struct cryptd_queue *queue, struct cryptd_cpu_queue *cpu_queue; atomic_t *refcnt; @@ -49,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> err = crypto_enqueue_request(&cpu_queue->queue, request); refcnt = crypto_tfm_ctx(request->tfm); -@@ -158,7 +162,7 @@ static int cryptd_enqueue_request(struct +@@ -158,7 +162,7 @@ static int cryptd_enqueue_request(struct cryptd_queue *queue, atomic_inc(refcnt); out_put_cpu: @@ -58,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return err; } -@@ -174,16 +178,11 @@ static void cryptd_queue_worker(struct w +@@ -174,16 +178,11 @@ static void cryptd_queue_worker(struct work_struct *work) cpu_queue = container_of(work, struct cryptd_cpu_queue, work); /* * Only handle one request at a time to avoid hogging crypto workqueue. @@ -77,3 +80,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!req) return; +-- +2.20.1 + diff --git a/debian/patches-rt/panic-disable-random-on-rt.patch b/debian/patches-rt/0228-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch index 012711a80..a13bd8428 100644 --- a/debian/patches-rt/panic-disable-random-on-rt.patch +++ b/debian/patches-rt/0228-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch @@ -1,16 +1,20 @@ +From a5584c410beb3104139873c7f81a0225da6bc302 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: panic: skip get_random_bytes for RT_FULL in init_oops_id -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 228/266] panic: skip get_random_bytes for RT_FULL in + init_oops_id +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Disable on -RT. If this is invoked from irq-context we will have problems to acquire the sleeping lock. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/panic.c | 2 ++ + kernel/panic.c | 2 ++ 1 file changed, 2 insertions(+) +diff --git a/kernel/panic.c b/kernel/panic.c +index 6a6df23acd1a..8f0a896e8428 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -479,9 +479,11 @@ static u64 oops_id; @@ -25,3 +29,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> oops_id++; return 0; +-- +2.20.1 + diff --git a/debian/patches-rt/x86-stackprot-no-random-on-rt.patch b/debian/patches-rt/0229-x86-stackprotector-Avoid-random-pool-on-rt.patch index 2fc8772cc..ba1ff6b63 100644 --- a/debian/patches-rt/x86-stackprot-no-random-on-rt.patch +++ b/debian/patches-rt/0229-x86-stackprotector-Avoid-random-pool-on-rt.patch @@ -1,7 +1,8 @@ +From 36751fceed79c085219ead85013948d19ed1f000 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 16 Dec 2010 14:25:18 +0100 -Subject: x86: stackprotector: Avoid random pool on rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 229/266] x86: stackprotector: Avoid random pool on rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz CPU bringup calls into the random pool to initialize the stack canary. During boot that works nicely even on RT as the might sleep @@ -13,11 +14,12 @@ entropy and we rely on the TSC randomnness. Reported-by: Carsten Emde <carsten.emde@osadl.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - arch/x86/include/asm/stackprotector.h | 8 +++++++- + arch/x86/include/asm/stackprotector.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) +diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h +index 8ec97a62c245..7bc85841fc56 100644 --- a/arch/x86/include/asm/stackprotector.h +++ b/arch/x86/include/asm/stackprotector.h @@ -60,7 +60,7 @@ @@ -29,7 +31,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> u64 tsc; #ifdef CONFIG_X86_64 -@@ -71,8 +71,14 @@ static __always_inline void boot_init_st +@@ -71,8 +71,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. @@ -44,3 +46,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> tsc = rdtsc(); canary += tsc + (tsc << 32UL); canary &= CANARY_MASK; +-- +2.20.1 + diff --git a/debian/patches-rt/random-make-it-work-on-rt.patch b/debian/patches-rt/0230-random-Make-it-work-on-rt.patch index 054510d62..0e06525ab 100644 --- a/debian/patches-rt/random-make-it-work-on-rt.patch +++ b/debian/patches-rt/0230-random-Make-it-work-on-rt.patch @@ -1,7 +1,8 @@ -Subject: random: Make it work on rt +From c9ed52a80deb0f924bfe5c5062f0395f234017dc Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Tue, 21 Aug 2012 20:38:50 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 230/266] random: Make it work on rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq @@ -9,20 +10,21 @@ descriptor and feed it into the random generator as a source of entropy. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - drivers/char/random.c | 11 +++++------ - drivers/hv/hv.c | 4 +++- - drivers/hv/vmbus_drv.c | 4 +++- - include/linux/irqdesc.h | 1 + - include/linux/random.h | 2 +- - kernel/irq/handle.c | 8 +++++++- - kernel/irq/manage.c | 6 ++++++ + drivers/char/random.c | 11 +++++------ + drivers/hv/hv.c | 4 +++- + drivers/hv/vmbus_drv.c | 4 +++- + include/linux/irqdesc.h | 1 + + include/linux/random.h | 2 +- + kernel/irq/handle.c | 8 +++++++- + kernel/irq/manage.c | 6 ++++++ 7 files changed, 26 insertions(+), 10 deletions(-) +diff --git a/drivers/char/random.c b/drivers/char/random.c +index c75b6cdf0053..4c20da67edd5 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c -@@ -1229,28 +1229,27 @@ static __u32 get_reg(struct fast_pool *f +@@ -1229,28 +1229,27 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs) return *ptr; } @@ -56,9 +58,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> fast_mix(fast_pool); add_interrupt_bench(cycles); +diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c +index 748a1c4172a6..4258244fa314 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c -@@ -112,10 +112,12 @@ int hv_post_message(union hv_connection_ +@@ -112,10 +112,12 @@ int hv_post_message(union hv_connection_id connection_id, static void hv_stimer0_isr(void) { struct hv_per_cpu_context *hv_cpu; @@ -72,6 +76,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static int hv_ce_set_next_event(unsigned long delta, +diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c +index 9aa18f387a34..39aaa14993cc 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1042,6 +1042,8 @@ static void vmbus_isr(void) @@ -92,6 +98,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* +diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h +index dd1e40ddac7d..f8796e6e9e8a 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h @@ -70,6 +70,7 @@ struct irq_desc { @@ -102,9 +110,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> raw_spinlock_t lock; struct cpumask *percpu_enabled; const struct cpumask *percpu_affinity; +diff --git a/include/linux/random.h b/include/linux/random.h +index 445a0ea4ff49..a7b7d9f97580 100644 --- a/include/linux/random.h +++ b/include/linux/random.h -@@ -32,7 +32,7 @@ static inline void add_latent_entropy(vo +@@ -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; @@ -113,9 +123,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern void get_random_bytes(void *buf, int nbytes); extern int wait_for_random_bytes(void); +diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c +index 38554bc35375..06a80bbf78af 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c -@@ -185,10 +185,16 @@ irqreturn_t handle_irq_event_percpu(stru +@@ -185,10 +185,16 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc) { irqreturn_t retval; unsigned int flags = 0; @@ -133,9 +145,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (!noirqdebug) note_interrupt(desc, retval); +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index 48c2690070f3..9d7be2c33d19 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -1076,6 +1076,12 @@ static int irq_thread(void *data) +@@ -1079,6 +1079,12 @@ static int irq_thread(void *data) if (action_ret == IRQ_WAKE_THREAD) irq_wake_secondary(desc, action); @@ -148,3 +162,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> wake_threads_waitq(desc); } +-- +2.20.1 + diff --git a/debian/patches-rt/random-avoid-preempt_disable-ed-section.patch b/debian/patches-rt/0231-random-avoid-preempt_disable-ed-section.patch index 097adcd63..fe0a43ad4 100644 --- a/debian/patches-rt/random-avoid-preempt_disable-ed-section.patch +++ b/debian/patches-rt/0231-random-avoid-preempt_disable-ed-section.patch @@ -1,7 +1,8 @@ +From d607e6cd468a930b893f032564747b95466a9704 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 12 May 2017 15:46:17 +0200 -Subject: [PATCH] random: avoid preempt_disable()ed section -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 231/266] random: avoid preempt_disable()ed section +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz extract_crng() will use sleeping locks while in a preempt_disable() section due to get_cpu_var(). @@ -10,9 +11,11 @@ Work around it with local_locks. Cc: stable-rt@vger.kernel.org # where it applies to Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/char/random.c | 11 +++++++---- + drivers/char/random.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) +diff --git a/drivers/char/random.c b/drivers/char/random.c +index 4c20da67edd5..91c1972b6a17 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -265,6 +265,7 @@ @@ -23,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <crypto/chacha20.h> #include <asm/processor.h> -@@ -2223,6 +2224,7 @@ static rwlock_t batched_entropy_reset_lo +@@ -2223,6 +2224,7 @@ static rwlock_t batched_entropy_reset_lock = __RW_LOCK_UNLOCKED(batched_entropy_ * at any point prior. */ static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_u64); @@ -73,3 +76,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } EXPORT_SYMBOL(get_random_u32); +-- +2.20.1 + diff --git a/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch b/debian/patches-rt/0232-cpu-hotplug-Implement-CPU-pinning.patch index 92b35810c..9a78f2e21 100644 --- a/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch +++ b/debian/patches-rt/0232-cpu-hotplug-Implement-CPU-pinning.patch @@ -1,14 +1,17 @@ -Subject: cpu/hotplug: Implement CPU pinning +From 648b8e5d6b23936164d2ccf52df6f5169bfc7e90 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 19 Jul 2017 17:31:20 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 232/266] cpu/hotplug: Implement CPU pinning +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/sched.h | 1 + - kernel/cpu.c | 38 ++++++++++++++++++++++++++++++++++++++ + include/linux/sched.h | 1 + + kernel/cpu.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 320be04498a9..f4bd8754744b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -671,6 +671,7 @@ struct task_struct { @@ -19,9 +22,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> # ifdef CONFIG_SCHED_DEBUG int migrate_disable_atomic; # endif +diff --git a/kernel/cpu.c b/kernel/cpu.c +index e244bc4d2157..9fb2fcd1a5c8 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c -@@ -75,6 +75,11 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_s +@@ -75,6 +75,11 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = { .fail = CPUHP_INVALID, }; @@ -84,7 +89,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); int err; -@@ -840,11 +874,14 @@ static int takedown_cpu(unsigned int cpu +@@ -840,11 +874,14 @@ static int takedown_cpu(unsigned int cpu) */ irq_lock_sparse(); @@ -99,7 +104,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* CPU refused to die */ irq_unlock_sparse(); /* Unpark the hotplug thread so we can rollback there */ -@@ -863,6 +900,7 @@ static int takedown_cpu(unsigned int cpu +@@ -863,6 +900,7 @@ static int takedown_cpu(unsigned int cpu) wait_for_ap_thread(st, false); BUG_ON(st->state != CPUHP_AP_IDLE_DEAD); @@ -107,3 +112,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* Interrupts are moved away from the dying cpu, reenable alloc/free */ irq_unlock_sparse(); +-- +2.20.1 + diff --git a/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch b/debian/patches-rt/0233-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch index 419e7ba02..2a25a4f13 100644 --- a/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch +++ b/debian/patches-rt/0233-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch @@ -1,8 +1,9 @@ +From 8e2b950fa322a31581bd93b5e9c91640d3f6cfd3 Mon Sep 17 00:00:00 2001 From: Mike Galbraith <efault@gmx.de> Date: Sun, 19 Aug 2018 08:28:35 +0200 -Subject: [PATCH] sched: Allow pinned user tasks to be awakened to the CPU they - pinned -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 233/266] sched: Allow pinned user tasks to be awakened to the + CPU they pinned +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Since commit 7af443ee16976 ("sched/core: Require cpu_active() in select_task_rq(), for user tasks") select_fallback_rq() will BUG() if @@ -17,12 +18,14 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/sched/core.c | 2 +- + kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index afae5090e573..3ae90dfa36da 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -902,7 +902,7 @@ static inline bool is_cpu_allowed(struct +@@ -903,7 +903,7 @@ static inline bool is_cpu_allowed(struct task_struct *p, int cpu) if (!cpumask_test_cpu(cpu, p->cpus_ptr)) return false; @@ -31,3 +34,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return cpu_online(cpu); return cpu_active(cpu); +-- +2.20.1 + diff --git a/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch b/debian/patches-rt/0234-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch index 476dbdbd8..24ba0fc6d 100644 --- a/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +++ b/debian/patches-rt/0234-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch @@ -1,7 +1,8 @@ +From 74306a17fd2310c2c18ac38a6c9c8c8a72dd5fbc Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 4 Aug 2017 18:31:00 +0200 -Subject: [PATCH] hotplug: duct-tape RT-rwlock usage for non-RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 234/266] hotplug: duct-tape RT-rwlock usage for non-RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz This type is only available on -RT. We need to craft something for non-RT. Since the only migrate_disable() user is -RT only, there is no @@ -9,12 +10,14 @@ damage. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/cpu.c | 14 +++++++++++++- + kernel/cpu.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) +diff --git a/kernel/cpu.c b/kernel/cpu.c +index 9fb2fcd1a5c8..580bf6fc4f5d 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c -@@ -75,7 +75,7 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_s +@@ -75,7 +75,7 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = { .fail = CPUHP_INVALID, }; @@ -65,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); int err; -@@ -874,14 +880,18 @@ static int takedown_cpu(unsigned int cpu +@@ -874,14 +880,18 @@ static int takedown_cpu(unsigned int cpu) */ irq_lock_sparse(); @@ -84,7 +87,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* CPU refused to die */ irq_unlock_sparse(); /* Unpark the hotplug thread so we can rollback there */ -@@ -900,7 +910,9 @@ static int takedown_cpu(unsigned int cpu +@@ -900,7 +910,9 @@ static int takedown_cpu(unsigned int cpu) wait_for_ap_thread(st, false); BUG_ON(st->state != CPUHP_AP_IDLE_DEAD); @@ -94,3 +97,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Interrupts are moved away from the dying cpu, reenable alloc/free */ irq_unlock_sparse(); +-- +2.20.1 + diff --git a/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch b/debian/patches-rt/0235-net-Remove-preemption-disabling-in-netif_rx.patch index 0d994719f..0349f7cbb 100644 --- a/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch +++ b/debian/patches-rt/0235-net-Remove-preemption-disabling-in-netif_rx.patch @@ -1,7 +1,8 @@ -Subject: net: Remove preemption disabling in netif_rx() +From 0e5d84d9d8c76899bc02a8275b2f0e65da5dadfc Mon Sep 17 00:00:00 2001 From: Priyanka Jain <Priyanka.Jain@freescale.com> Date: Thu, 17 May 2012 09:35:11 +0530 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 235/266] net: Remove preemption disabling in netif_rx() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz 1)enqueue_to_backlog() (called from netif_rx) should be bind to a particluar CPU. This can be achieved by @@ -31,14 +32,14 @@ Link: http://lkml.kernel.org/r/1337227511-2271-1-git-send-email-Priyanka.Jain@fr Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - Testing: Tested successfully on p4080ds(8-core SMP system) - - net/core/dev.c | 8 ++++---- + net/core/dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) +diff --git a/net/core/dev.c b/net/core/dev.c +index b4028addf291..7d3f923a0436 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4470,7 +4470,7 @@ static int netif_rx_internal(struct sk_b +@@ -4470,7 +4470,7 @@ static int netif_rx_internal(struct sk_buff *skb) struct rps_dev_flow voidflow, *rflow = &voidflow; int cpu; @@ -47,7 +48,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> rcu_read_lock(); cpu = get_rps_cpu(skb->dev, skb, &rflow); -@@ -4480,14 +4480,14 @@ static int netif_rx_internal(struct sk_b +@@ -4480,14 +4480,14 @@ static int netif_rx_internal(struct sk_buff *skb) ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); @@ -65,3 +66,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } return ret; } +-- +2.20.1 + diff --git a/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch b/debian/patches-rt/0236-net-Another-local_irq_disable-kmalloc-headache.patch index 3491a8350..0a27eb9f8 100644 --- a/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch +++ b/debian/patches-rt/0236-net-Another-local_irq_disable-kmalloc-headache.patch @@ -1,15 +1,18 @@ +From 987dcd48a15be9b3628b0494136908e55b9e5f00 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 26 Sep 2012 16:21:08 +0200 -Subject: net: Another local_irq_disable/kmalloc headache -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 236/266] net: Another local_irq_disable/kmalloc headache +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Replace it by a local lock. Though that's pretty inefficient :( Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - net/core/skbuff.c | 10 ++++++---- + net/core/skbuff.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) +diff --git a/net/core/skbuff.c b/net/core/skbuff.c +index 8656b1e20d35..3f3b9e06c9e8 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -63,6 +63,7 @@ @@ -28,7 +31,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask) { -@@ -337,10 +339,10 @@ static void *__netdev_alloc_frag(unsigne +@@ -337,10 +339,10 @@ static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask) unsigned long flags; void *data; @@ -41,7 +44,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return data; } -@@ -412,13 +414,13 @@ struct sk_buff *__netdev_alloc_skb(struc +@@ -412,13 +414,13 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len, if (sk_memalloc_socks()) gfp_mask |= __GFP_MEMALLOC; @@ -57,3 +60,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (unlikely(!data)) return NULL; +-- +2.20.1 + diff --git a/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch b/debian/patches-rt/0237-net-core-protect-users-of-napi_alloc_cache-against-r.patch index 58e78523b..9a1fd8fd6 100644 --- a/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch +++ b/debian/patches-rt/0237-net-core-protect-users-of-napi_alloc_cache-against-r.patch @@ -1,8 +1,9 @@ +From 29f6e57de6c190abc11019bce2efbffdcc50bc18 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 15 Jan 2016 16:33:34 +0100 -Subject: net/core: protect users of napi_alloc_cache against +Subject: [PATCH 237/266] net/core: protect users of napi_alloc_cache against reentrance -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On -RT the code running in BH can not be moved to another CPU so CPU local variable remain local. However the code can be preempted @@ -13,9 +14,11 @@ This patch ensures that each user of napi_alloc_cache uses a local lock. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - net/core/skbuff.c | 25 +++++++++++++++++++------ + net/core/skbuff.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) +diff --git a/net/core/skbuff.c b/net/core/skbuff.c +index 3f3b9e06c9e8..bc27edb6a316 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -332,6 +332,7 @@ struct napi_alloc_cache { @@ -54,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> len += NET_SKB_PAD + NET_IP_ALIGN; -@@ -481,7 +487,10 @@ struct sk_buff *__napi_alloc_skb(struct +@@ -481,7 +487,10 @@ struct sk_buff *__napi_alloc_skb(struct napi_struct *napi, unsigned int len, if (sk_memalloc_socks()) gfp_mask |= __GFP_MEMALLOC; @@ -65,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (unlikely(!data)) return NULL; -@@ -492,7 +501,7 @@ struct sk_buff *__napi_alloc_skb(struct +@@ -492,7 +501,7 @@ struct sk_buff *__napi_alloc_skb(struct napi_struct *napi, unsigned int len, } /* use OR instead of assignment to avoid clearing of bits in mask */ @@ -74,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> skb->pfmemalloc = 1; skb->head_frag = 1; -@@ -724,23 +733,26 @@ void __consume_stateless_skb(struct sk_b +@@ -724,23 +733,26 @@ void __consume_stateless_skb(struct sk_buff *skb) void __kfree_skb_flush(void) { @@ -103,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* record skb to CPU local list */ nc->skb_cache[nc->skb_count++] = skb; -@@ -755,6 +767,7 @@ static inline void _kfree_skb_defer(stru +@@ -755,6 +767,7 @@ static inline void _kfree_skb_defer(struct sk_buff *skb) nc->skb_cache); nc->skb_count = 0; } @@ -111,3 +114,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } void __kfree_skb_defer(struct sk_buff *skb) { +-- +2.20.1 + diff --git a/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch b/debian/patches-rt/0238-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch index 04874c48a..b6956f651 100644 --- a/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch +++ b/debian/patches-rt/0238-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch @@ -1,7 +1,9 @@ -Subject: net: netfilter: Serialize xt_write_recseq sections on RT +From 02efcce7d36253d7b375cf6424b874833ee9f32c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Sun, 28 Oct 2012 11:18:08 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 238/266] net: netfilter: Serialize xt_write_recseq sections on + RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The netfilter code relies only on the implicit semantics of local_bh_disable() for serializing wt_write_recseq sections. RT breaks @@ -9,12 +11,13 @@ that and needs explicit serialization here. Reported-by: Peter LaDow <petela@gocougs.wsu.edu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - include/linux/netfilter/x_tables.h | 7 +++++++ - net/netfilter/core.c | 6 ++++++ + include/linux/netfilter/x_tables.h | 7 +++++++ + net/netfilter/core.c | 6 ++++++ 2 files changed, 13 insertions(+) +diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h +index 9077b3ebea08..1710f2aff350 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -6,6 +6,7 @@ @@ -25,7 +28,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include <uapi/linux/netfilter/x_tables.h> /* Test a struct->invflags and a boolean for inequality */ -@@ -345,6 +346,8 @@ void xt_free_table_info(struct xt_table_ +@@ -345,6 +346,8 @@ void xt_free_table_info(struct xt_table_info *info); */ DECLARE_PER_CPU(seqcount_t, xt_recseq); @@ -34,7 +37,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* xt_tee_enabled - true if x_tables needs to handle reentrancy * * Enabled if current ip(6)tables ruleset has at least one -j TEE rule. -@@ -365,6 +368,9 @@ static inline unsigned int xt_write_recs +@@ -365,6 +368,9 @@ static inline unsigned int xt_write_recseq_begin(void) { unsigned int addend; @@ -44,7 +47,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Low order bit of sequence is set if we already * called xt_write_recseq_begin(). -@@ -395,6 +401,7 @@ static inline void xt_write_recseq_end(u +@@ -395,6 +401,7 @@ static inline void xt_write_recseq_end(unsigned int addend) /* this is kind of a write_seqcount_end(), but addend is 0 or 1 */ smp_wmb(); __this_cpu_add(xt_recseq.sequence, addend); @@ -52,6 +55,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* +diff --git a/net/netfilter/core.c b/net/netfilter/core.c +index dc240cb47ddf..9bd8f062ebc1 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c @@ -20,6 +20,7 @@ @@ -74,3 +79,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> const struct nf_ipv6_ops __rcu *nf_ipv6_ops __read_mostly; EXPORT_SYMBOL_GPL(nf_ipv6_ops); +-- +2.20.1 + diff --git a/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch b/debian/patches-rt/0239-net-Add-a-mutex-around-devnet_rename_seq.patch index a2d3c609f..1a7927334 100644 --- a/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch +++ b/debian/patches-rt/0239-net-Add-a-mutex-around-devnet_rename_seq.patch @@ -1,7 +1,8 @@ +From 3f9f4bd60152113147989ef17257a50d8b5e419d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 20 Mar 2013 18:06:20 +0100 -Subject: net: Add a mutex around devnet_rename_seq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 239/266] net: Add a mutex around devnet_rename_seq +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On RT write_seqcount_begin() disables preemption and device_rename() allocates memory with GFP_KERNEL and grabs later the sysfs_mutex @@ -17,12 +18,14 @@ it when it detects a writer in progress. This keeps the normal case Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - net/core/dev.c | 34 ++++++++++++++++++++-------------- + net/core/dev.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) +diff --git a/net/core/dev.c b/net/core/dev.c +index 7d3f923a0436..5e42a8640e98 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -195,6 +195,7 @@ static unsigned int napi_gen_id = NR_CPU +@@ -195,6 +195,7 @@ static unsigned int napi_gen_id = NR_CPUS; static DEFINE_READ_MOSTLY_HASHTABLE(napi_hash, 8); static seqcount_t devnet_rename_seq; @@ -30,7 +33,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static inline void dev_base_seq_inc(struct net *net) { -@@ -920,7 +921,8 @@ int netdev_get_name(struct net *net, cha +@@ -920,7 +921,8 @@ int netdev_get_name(struct net *net, char *name, int ifindex) strcpy(name, dev->name); rcu_read_unlock(); if (read_seqcount_retry(&devnet_rename_seq, seq)) { @@ -40,7 +43,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> goto retry; } -@@ -1183,20 +1185,17 @@ int dev_change_name(struct net_device *d +@@ -1183,20 +1185,17 @@ int dev_change_name(struct net_device *dev, const char *newname) if (dev->flags & IFF_UP) return -EBUSY; @@ -67,7 +70,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (oldname[0] && !strchr(oldname, '%')) netdev_info(dev, "renamed from %s\n", oldname); -@@ -1209,11 +1208,12 @@ int dev_change_name(struct net_device *d +@@ -1209,11 +1208,12 @@ int dev_change_name(struct net_device *dev, const char *newname) if (ret) { memcpy(dev->name, oldname, IFNAMSIZ); dev->name_assign_type = old_assign_type; @@ -83,7 +86,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> netdev_adjacent_rename_links(dev, oldname); -@@ -1234,7 +1234,8 @@ int dev_change_name(struct net_device *d +@@ -1234,7 +1234,8 @@ int dev_change_name(struct net_device *dev, const char *newname) /* err >= 0 after dev_alloc_name() or stores the first errno */ if (err >= 0) { err = ret; @@ -93,7 +96,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> memcpy(dev->name, oldname, IFNAMSIZ); memcpy(oldname, newname, IFNAMSIZ); dev->name_assign_type = old_assign_type; -@@ -1247,6 +1248,11 @@ int dev_change_name(struct net_device *d +@@ -1247,6 +1248,11 @@ int dev_change_name(struct net_device *dev, const char *newname) } return err; @@ -105,3 +108,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /** +-- +2.20.1 + diff --git a/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch b/debian/patches-rt/0240-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch index ff01f8acb..2f4bac41c 100644 --- a/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch +++ b/debian/patches-rt/0240-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch @@ -1,9 +1,9 @@ -Subject: lockdep: selftest: Only do hardirq context test for raw spinlock -From: Yong Zhang <yong.zhang0@gmail.com> -Date: Mon, 16 Apr 2012 15:01:56 +0800 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz - +From 77fce3edd290f7c5c4fcf858ed242aa60c62b984 Mon Sep 17 00:00:00 2001 From: Yong Zhang <yong.zhang@windriver.com> +Date: Mon, 16 Apr 2012 15:01:56 +0800 +Subject: [PATCH 240/266] lockdep: selftest: Only do hardirq context test for + raw spinlock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz On -rt there is no softirq context any more and rwlock is sleepable, disable softirq context test and rwlock+irq test. @@ -13,9 +13,11 @@ Cc: Yong Zhang <yong.zhang@windriver.com> Link: http://lkml.kernel.org/r/1334559716-18447-3-git-send-email-yong.zhang0@gmail.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - lib/locking-selftest.c | 23 +++++++++++++++++++++++ + lib/locking-selftest.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) +diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c +index 1e1bbf171eca..5cdf3809905e 100644 --- a/lib/locking-selftest.c +++ b/lib/locking-selftest.c @@ -2057,6 +2057,7 @@ void locking_selftest(void) @@ -55,3 +57,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ww_tests(); +-- +2.20.1 + diff --git a/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/debian/patches-rt/0241-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch index 74f0b6367..65ee4012f 100644 --- a/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ b/debian/patches-rt/0241-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch @@ -1,7 +1,9 @@ +From 0446455888db835ab4752900736f86b7ca18f5f3 Mon Sep 17 00:00:00 2001 From: Josh Cartwright <josh.cartwright@ni.com> Date: Wed, 28 Jan 2015 13:08:45 -0600 -Subject: lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 241/266] lockdep: selftest: fix warnings due to missing + PREEMPT_RT conditionals +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz "lockdep: Selftest: Only do hardirq context test for raw spinlock" disabled the execution of certain tests with PREEMPT_RT_FULL, but did @@ -24,9 +26,11 @@ Signed-off-by: Xander Huff <xander.huff@ni.com> Acked-by: Gratian Crisan <gratian.crisan@ni.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - lib/locking-selftest.c | 27 +++++++++++++++++++++++++++ + lib/locking-selftest.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) +diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c +index 5cdf3809905e..32db9532ddd4 100644 --- a/lib/locking-selftest.c +++ b/lib/locking-selftest.c @@ -742,6 +742,8 @@ GENERATE_TESTCASE(init_held_rtmutex); @@ -38,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "locking-selftest-rlock-hardirq.h" GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_rlock) -@@ -757,9 +759,12 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_ +@@ -757,9 +759,12 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_rlock) #include "locking-selftest-wlock-softirq.h" GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_wlock) @@ -51,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Enabling hardirqs with a softirq-safe lock held: */ -@@ -792,6 +797,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A +@@ -792,6 +797,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock) #undef E1 #undef E2 @@ -60,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Enabling irqs with an irq-safe lock held: */ -@@ -815,6 +822,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A +@@ -815,6 +822,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock) #include "locking-selftest-spin-hardirq.h" GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_spin) @@ -69,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "locking-selftest-rlock-hardirq.h" GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_rlock) -@@ -830,6 +839,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B +@@ -830,6 +839,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_rlock) #include "locking-selftest-wlock-softirq.h" GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock) @@ -78,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #undef E1 #undef E2 -@@ -861,6 +872,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B +@@ -861,6 +872,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock) #include "locking-selftest-spin-hardirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_spin) @@ -87,7 +91,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "locking-selftest-rlock-hardirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_rlock) -@@ -876,6 +889,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_ +@@ -876,6 +889,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_rlock) #include "locking-selftest-wlock-softirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock) @@ -96,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #undef E1 #undef E2 #undef E3 -@@ -909,6 +924,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_ +@@ -909,6 +924,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock) #include "locking-selftest-spin-hardirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_spin) @@ -105,7 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include "locking-selftest-rlock-hardirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_rlock) -@@ -924,10 +941,14 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_ +@@ -924,10 +941,14 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_rlock) #include "locking-selftest-wlock-softirq.h" GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_wlock) @@ -120,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * read-lock / write-lock irq inversion. * -@@ -990,6 +1011,10 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_inver +@@ -990,6 +1011,10 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_soft_wlock) #undef E2 #undef E3 @@ -131,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * read-lock / write-lock recursion that is actually safe. */ -@@ -1028,6 +1053,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_ +@@ -1028,6 +1053,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_soft) #undef E2 #undef E3 @@ -140,3 +144,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * read-lock / write-lock recursion that is unsafe. */ +-- +2.20.1 + diff --git a/debian/patches-rt/preempt-lazy-support.patch b/debian/patches-rt/0242-sched-Add-support-for-lazy-preemption.patch index a7544cec4..d9bf072ed 100644 --- a/debian/patches-rt/preempt-lazy-support.patch +++ b/debian/patches-rt/0242-sched-Add-support-for-lazy-preemption.patch @@ -1,7 +1,8 @@ -Subject: sched: Add support for lazy preemption +From e191c8b2ec2810646a31e0ab366d8a94f8332e65 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 26 Oct 2012 18:50:54 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 242/266] sched: Add support for lazy preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz It has become an obsession to mitigate the determinism vs. throughput loss of RT. Looking at the mainline semantics of preemption points @@ -53,21 +54,23 @@ performance. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - include/linux/preempt.h | 35 +++++++++++++++++- - include/linux/sched.h | 38 +++++++++++++++++++ - include/linux/thread_info.h | 12 +++++- - include/linux/trace_events.h | 1 - kernel/Kconfig.preempt | 6 +++ - kernel/cpu.c | 2 + - kernel/sched/core.c | 83 +++++++++++++++++++++++++++++++++++++++++-- - kernel/sched/fair.c | 16 ++++---- - kernel/sched/features.h | 3 + - kernel/sched/sched.h | 9 ++++ - kernel/trace/trace.c | 36 ++++++++++-------- - kernel/trace/trace.h | 2 + - kernel/trace/trace_output.c | 14 ++++++- + include/linux/preempt.h | 35 ++++++++++++++- + include/linux/sched.h | 38 +++++++++++++++++ + include/linux/thread_info.h | 12 +++++- + include/linux/trace_events.h | 1 + + kernel/Kconfig.preempt | 6 +++ + kernel/cpu.c | 2 + + kernel/sched/core.c | 83 +++++++++++++++++++++++++++++++++++- + kernel/sched/fair.c | 16 +++---- + kernel/sched/features.h | 3 ++ + kernel/sched/sched.h | 9 ++++ + kernel/trace/trace.c | 36 +++++++++------- + kernel/trace/trace.h | 2 + + kernel/trace/trace_output.c | 14 +++++- 13 files changed, 228 insertions(+), 29 deletions(-) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index ed8413e7140f..9c74a019bf57 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -180,6 +180,20 @@ extern void preempt_count_sub(int val); @@ -140,9 +143,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> set_preempt_need_resched(); \ } while (0) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index f4bd8754744b..5e87f7429c26 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1725,6 +1725,44 @@ static inline int test_tsk_need_resched( +@@ -1725,6 +1725,44 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); } @@ -187,9 +192,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static inline bool __task_is_stopped_or_traced(struct task_struct *task) { if (task->state & (__TASK_STOPPED | __TASK_TRACED)) +diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h +index 8d8821b3689a..d3fcab20d2a3 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h -@@ -97,7 +97,17 @@ static inline int test_ti_thread_flag(st +@@ -97,7 +97,17 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) #define test_thread_flag(flag) \ test_ti_thread_flag(current_thread_info(), flag) @@ -208,6 +215,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES static inline int arch_within_stack_frames(const void * const stack, +diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h +index 0403d9696944..c20237c5ab66 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -64,6 +64,7 @@ struct trace_entry { @@ -218,6 +227,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> }; #define TRACE_EVENT_TYPE_MAX \ +diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt +index 907d72b3ba95..306567f72a3e 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -6,6 +6,12 @@ config PREEMPT_RT_BASE @@ -233,6 +244,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> choice prompt "Preemption Model" default PREEMPT_NONE +diff --git a/kernel/cpu.c b/kernel/cpu.c +index 580bf6fc4f5d..8f295d3a6270 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -304,11 +304,13 @@ void pin_current_cpu(void) @@ -249,9 +262,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (cpu != smp_processor_id()) { __read_rt_unlock(cpuhp_pin); goto again; +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 3ae90dfa36da..9811d79d19ba 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -491,6 +491,48 @@ void resched_curr(struct rq *rq) +@@ -492,6 +492,48 @@ void resched_curr(struct rq *rq) trace_sched_wake_idle_without_ipi(cpu); } @@ -300,7 +315,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void resched_cpu(int cpu) { struct rq *rq = cpu_rq(cpu); -@@ -2403,6 +2445,9 @@ int sched_fork(unsigned long clone_flags +@@ -2404,6 +2446,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) p->on_cpu = 0; #endif init_task_preempt_count(p); @@ -310,7 +325,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_SMP plist_node_init(&p->pushable_tasks, MAX_PRIO); RB_CLEAR_NODE(&p->pushable_dl_tasks); -@@ -3470,6 +3515,7 @@ static void __sched notrace __schedule(b +@@ -3471,6 +3516,7 @@ static void __sched notrace __schedule(bool preempt) next = pick_next_task(rq, prev, &rf); clear_tsk_need_resched(prev); @@ -318,7 +333,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> clear_preempt_need_resched(); if (likely(prev != next)) { -@@ -3650,6 +3696,30 @@ static void __sched notrace preempt_sche +@@ -3651,6 +3697,30 @@ static void __sched notrace preempt_schedule_common(void) } while (need_resched()); } @@ -349,7 +364,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_PREEMPT /* * this is the entry point to schedule() from in-kernel preemption -@@ -3664,7 +3734,8 @@ asmlinkage __visible void __sched notrac +@@ -3665,7 +3735,8 @@ asmlinkage __visible void __sched notrace preempt_schedule(void) */ if (likely(!preemptible())) return; @@ -359,7 +374,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> preempt_schedule_common(); } NOKPROBE_SYMBOL(preempt_schedule); -@@ -3691,6 +3762,9 @@ asmlinkage __visible void __sched notrac +@@ -3692,6 +3763,9 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) if (likely(!preemptible())) return; @@ -369,7 +384,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> do { /* * Because the function tracer can trace preempt_count_sub() -@@ -5459,7 +5533,9 @@ void init_idle(struct task_struct *idle, +@@ -5460,7 +5534,9 @@ void init_idle(struct task_struct *idle, int cpu) /* Set the preempt count _outside_ the spinlocks! */ init_idle_preempt_count(idle, cpu); @@ -380,7 +395,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * The idle tasks have their own, simple scheduling class: */ -@@ -7181,6 +7257,7 @@ void migrate_disable(void) +@@ -7182,6 +7258,7 @@ void migrate_disable(void) } preempt_disable(); @@ -388,7 +403,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> pin_current_cpu(); migrate_disable_update_cpus_allowed(p); -@@ -7248,6 +7325,7 @@ void migrate_enable(void) +@@ -7249,6 +7326,7 @@ void migrate_enable(void) arg.dest_cpu = dest_cpu; unpin_current_cpu(); @@ -396,7 +411,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> preempt_enable(); stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg); tlb_migrate_finish(p->mm); -@@ -7256,6 +7334,7 @@ void migrate_enable(void) +@@ -7257,6 +7335,7 @@ void migrate_enable(void) } } unpin_current_cpu(); @@ -404,9 +419,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> preempt_enable(); } EXPORT_SYMBOL(migrate_enable); +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index 09a1e32c366f..e2ee22587fb3 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4017,7 +4017,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq +@@ -4017,7 +4017,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) { @@ -415,7 +432,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * The current task ran long enough, ensure it doesn't get * re-elected due to buddy favours. -@@ -4041,7 +4041,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq +@@ -4041,7 +4041,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) return; if (delta > ideal_runtime) @@ -424,7 +441,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static void -@@ -4183,7 +4183,7 @@ entity_tick(struct cfs_rq *cfs_rq, struc +@@ -4183,7 +4183,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) * validating it and just reschedule. */ if (queued) { @@ -433,7 +450,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return; } /* -@@ -4367,7 +4367,7 @@ static void __account_cfs_rq_runtime(str +@@ -4367,7 +4367,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)) @@ -442,7 +459,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static __always_inline -@@ -5038,7 +5038,7 @@ static void hrtick_start_fair(struct rq +@@ -5038,7 +5038,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) if (delta < 0) { if (rq->curr == p) @@ -451,7 +468,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return; } hrtick_start(rq, delta); -@@ -6614,7 +6614,7 @@ static void check_preempt_wakeup(struct +@@ -6614,7 +6614,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ return; preempt: @@ -460,7 +477,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* * Only set the backward buddy when the current task is still * on the rq. This can happen when a wakeup gets interleaved -@@ -9701,7 +9701,7 @@ static void task_fork_fair(struct task_s +@@ -9701,7 +9701,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); @@ -469,7 +486,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } se->vruntime -= cfs_rq->min_vruntime; -@@ -9725,7 +9725,7 @@ prio_changed_fair(struct rq *rq, struct +@@ -9725,7 +9725,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) */ if (rq->curr == p) { if (p->prio > oldprio) @@ -478,6 +495,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } else check_preempt_curr(rq, p, 0); } +diff --git a/kernel/sched/features.h b/kernel/sched/features.h +index 68de18405857..12a12be6770b 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -48,6 +48,9 @@ SCHED_FEAT(NONTASK_CAPACITY, true) @@ -490,9 +509,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #else /* +diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h +index 74750997b061..780be08170d7 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h -@@ -1638,6 +1638,15 @@ extern void reweight_task(struct task_st +@@ -1638,6 +1638,15 @@ extern void reweight_task(struct task_struct *p, int prio); extern void resched_curr(struct rq *rq); extern void resched_cpu(int cpu); @@ -508,9 +529,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> extern struct rt_bandwidth def_rt_bandwidth; extern void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime); +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index ff041c26dbb4..1a07fe69dd37 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -2134,6 +2134,7 @@ tracing_generic_entry_update(struct trac +@@ -2134,6 +2134,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags, struct task_struct *tsk = current; entry->preempt_count = pc & 0xff; @@ -518,7 +541,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> entry->pid = (tsk) ? tsk->pid : 0; entry->flags = #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT -@@ -2144,7 +2145,8 @@ tracing_generic_entry_update(struct trac +@@ -2144,7 +2145,8 @@ 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) | @@ -528,7 +551,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> (test_preempt_need_resched() ? TRACE_FLAG_PREEMPT_RESCHED : 0); entry->migrate_disable = (tsk) ? __migrate_disabled(tsk) & 0xFF : 0; -@@ -3346,15 +3348,17 @@ get_total_entries(struct trace_buffer *b +@@ -3346,15 +3348,17 @@ get_total_entries(struct trace_buffer *buf, static void print_lat_help_header(struct seq_file *m) { @@ -555,7 +578,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } static void print_event_info(struct trace_buffer *buf, struct seq_file *m) -@@ -3390,15 +3394,17 @@ static void print_func_help_header_irq(s +@@ -3392,15 +3396,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); @@ -578,6 +601,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> tgid ? " | " : space); } +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index 447bd96ee658..65afd0c04622 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -127,6 +127,7 @@ struct kretprobe_trace_entry_head { @@ -596,9 +621,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> }; #define TRACE_BUF_SIZE 1024 +diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c +index 46c96744f09d..3f78b0afb729 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c -@@ -448,6 +448,7 @@ int trace_print_lat_fmt(struct trace_seq +@@ -448,6 +448,7 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) { char hardsoft_irq; char need_resched; @@ -606,7 +633,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> char irqs_off; int hardirq; int softirq; -@@ -478,6 +479,9 @@ int trace_print_lat_fmt(struct trace_seq +@@ -478,6 +479,9 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) break; } @@ -616,7 +643,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> hardsoft_irq = (nmi && hardirq) ? 'Z' : nmi ? 'z' : -@@ -486,14 +490,20 @@ int trace_print_lat_fmt(struct trace_seq +@@ -486,14 +490,20 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) softirq ? 's' : '.' ; @@ -639,3 +666,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (entry->migrate_disable) trace_seq_printf(s, "%x", entry->migrate_disable); else +-- +2.20.1 + diff --git a/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch b/debian/patches-rt/0243-ftrace-Fix-trace-header-alignment.patch index bd763f8f1..d36769f1e 100644 --- a/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch +++ b/debian/patches-rt/0243-ftrace-Fix-trace-header-alignment.patch @@ -1,7 +1,8 @@ +From 8e8c6e698ff89c0ce02e1ec2087b11d65b257442 Mon Sep 17 00:00:00 2001 From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Sun, 16 Oct 2016 05:08:30 +0200 -Subject: [PATCH] ftrace: Fix trace header alignment -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 243/266] ftrace: Fix trace header alignment +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Line up helper arrows to the right column. @@ -10,12 +11,14 @@ Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> [bigeasy: fixup function tracer header] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/trace/trace.c | 22 +++++++++++----------- + kernel/trace/trace.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 1a07fe69dd37..1b5a223fd69a 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -3348,17 +3348,17 @@ get_total_entries(struct trace_buffer *b +@@ -3348,17 +3348,17 @@ get_total_entries(struct trace_buffer *buf, static void print_lat_help_header(struct seq_file *m) { @@ -44,3 +47,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static void print_event_info(struct trace_buffer *buf, struct seq_file *m) +-- +2.20.1 + diff --git a/debian/patches-rt/x86-preempt-lazy.patch b/debian/patches-rt/0244-x86-Support-for-lazy-preemption.patch index 4963a186a..ffda26a91 100644 --- a/debian/patches-rt/x86-preempt-lazy.patch +++ b/debian/patches-rt/0244-x86-Support-for-lazy-preemption.patch @@ -1,21 +1,24 @@ -Subject: x86: Support for lazy preemption +From 0bf47192a779dfefe044cdd60717b9d5bd4b53b4 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 01 Nov 2012 11:03:47 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Thu, 1 Nov 2012 11:03:47 +0100 +Subject: [PATCH 244/266] x86: Support for lazy preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Implement the x86 pieces for lazy preempt. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/x86/Kconfig | 1 + - arch/x86/entry/common.c | 4 ++-- - arch/x86/entry/entry_32.S | 17 +++++++++++++++++ - arch/x86/entry/entry_64.S | 16 ++++++++++++++++ - arch/x86/include/asm/preempt.h | 31 ++++++++++++++++++++++++++++++- - arch/x86/include/asm/thread_info.h | 11 +++++++++++ - arch/x86/kernel/asm-offsets.c | 2 ++ + arch/x86/Kconfig | 1 + + arch/x86/entry/common.c | 4 ++-- + arch/x86/entry/entry_32.S | 17 ++++++++++++++++ + arch/x86/entry/entry_64.S | 16 +++++++++++++++ + arch/x86/include/asm/preempt.h | 31 +++++++++++++++++++++++++++++- + arch/x86/include/asm/thread_info.h | 11 +++++++++++ + arch/x86/kernel/asm-offsets.c | 2 ++ 7 files changed, 79 insertions(+), 3 deletions(-) +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index 8c56260bdf84..28f8cd79aa74 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -180,6 +180,7 @@ config X86 @@ -26,9 +29,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> select HAVE_RCU_TABLE_FREE if PARAVIRT select HAVE_RCU_TABLE_INVALIDATE if HAVE_RCU_TABLE_FREE select HAVE_REGS_AND_STACK_ACCESS_API +diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c +index ec46ee700791..fbb14008bd43 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c -@@ -133,7 +133,7 @@ static long syscall_trace_enter(struct p +@@ -133,7 +133,7 @@ static long syscall_trace_enter(struct pt_regs *regs) #define EXIT_TO_USERMODE_LOOP_FLAGS \ (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ @@ -37,7 +42,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) { -@@ -148,7 +148,7 @@ static void exit_to_usermode_loop(struct +@@ -148,7 +148,7 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) /* We have work to do. */ local_irq_enable(); @@ -46,6 +51,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> schedule(); #ifdef ARCH_RT_DELAYS_SIGNAL_SEND +diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S +index fbbf1ba57ec6..0169c257cfff 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -764,8 +764,25 @@ END(ret_from_exception) @@ -74,9 +81,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> testl $X86_EFLAGS_IF, PT_EFLAGS(%esp) # interrupts off (exception path) ? 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 fbbf9ce28af1..826262a5868e 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -705,7 +705,23 @@ GLOBAL(swapgs_restore_regs_and_return_to +@@ -705,7 +705,23 @@ retint_kernel: btl $9, EFLAGS(%rsp) /* were interrupts off? */ jnc 1f 0: cmpl $0, PER_CPU_VAR(__preempt_count) @@ -100,9 +109,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> call preempt_schedule_irq jmp 0b 1: +diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h +index 7f2dbd91fc74..22992c837795 100644 --- a/arch/x86/include/asm/preempt.h +++ b/arch/x86/include/asm/preempt.h -@@ -86,17 +86,46 @@ static __always_inline void __preempt_co +@@ -86,17 +86,46 @@ static __always_inline void __preempt_count_sub(int val) * a decrement which hits zero means we have no preempt_count and should * reschedule. */ @@ -150,6 +161,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } #ifdef CONFIG_PREEMPT +diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h +index 82b73b75d67c..dc267291f131 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -56,17 +56,24 @@ struct task_struct; @@ -202,6 +215,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define STACK_WARN (THREAD_SIZE/8) /* +diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c +index 01de31db300d..ce1c5b9fbd8c 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c @@ -38,6 +38,7 @@ void common(void) { @@ -220,3 +235,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* TLB state for the entry code */ OFFSET(TLB_STATE_user_pcid_flush_mask, tlb_state, user_pcid_flush_mask); +-- +2.20.1 + diff --git a/debian/patches-rt/x86-lazy-preempt-properly-check-against-preempt-mask.patch b/debian/patches-rt/0245-x86-lazy-preempt-properly-check-against-preempt-mask.patch index 15ddaeb2d..7eb2260e2 100644 --- a/debian/patches-rt/x86-lazy-preempt-properly-check-against-preempt-mask.patch +++ b/debian/patches-rt/0245-x86-lazy-preempt-properly-check-against-preempt-mask.patch @@ -1,7 +1,9 @@ +From 3aca0b7f02e232494aeac9cd55afc698bf8f3e29 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 18 Feb 2019 16:57:09 +0100 -Subject: [PATCH] x86: lazy-preempt: properly check against preempt-mask -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 245/266] x86: lazy-preempt: properly check against + preempt-mask +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz should_resched() should check against preempt_offset after unmasking the need-resched-bit. Otherwise should_resched() won't work for @@ -10,12 +12,14 @@ preempt_offset != 0 and lazy-preempt set. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/include/asm/preempt.h | 2 +- + arch/x86/include/asm/preempt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h +index 22992c837795..f66708779274 100644 --- a/arch/x86/include/asm/preempt.h +++ b/arch/x86/include/asm/preempt.h -@@ -118,7 +118,7 @@ static __always_inline bool should_resch +@@ -118,7 +118,7 @@ static __always_inline bool should_resched(int preempt_offset) /* preempt count == 0 ? */ tmp &= ~PREEMPT_NEED_RESCHED; @@ -24,3 +28,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return false; if (current_thread_info()->preempt_lazy_count) return false; +-- +2.20.1 + diff --git a/debian/patches-rt/x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch b/debian/patches-rt/0246-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch index 927d7efb1..7512d3451 100644 --- a/debian/patches-rt/x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch +++ b/debian/patches-rt/0246-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch @@ -1,7 +1,9 @@ +From 094d90481f6be0ffabaecf80017a607fb51167a1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Tue, 26 Feb 2019 14:53:49 +0100 -Subject: [PATCH] x86: lazy-preempt: use proper return label on 32bit-x86 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 246/266] x86: lazy-preempt: use proper return label on + 32bit-x86 +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The lazy-preempt uses the wrong return label in case preemption isn't possible. This results crash while returning to the kernel. @@ -11,9 +13,11 @@ Use the correct return label if preemption isn' possible. Reported-by: Andri Yngvason <andri@yngvason.is> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - arch/x86/entry/entry_32.S | 8 ++++---- + arch/x86/entry/entry_32.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) +diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S +index 0169c257cfff..e6f61c813baf 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -773,15 +773,15 @@ ENTRY(resume_kernel) @@ -36,3 +40,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #endif testl $X86_EFLAGS_IF, PT_EFLAGS(%esp) # interrupts off (exception path) ? jz restore_all_kernel +-- +2.20.1 + diff --git a/debian/patches-rt/arm-preempt-lazy-support.patch b/debian/patches-rt/0247-arm-Add-support-for-lazy-preemption.patch index 12915da3b..04784fbf1 100644 --- a/debian/patches-rt/arm-preempt-lazy-support.patch +++ b/debian/patches-rt/0247-arm-Add-support-for-lazy-preemption.patch @@ -1,20 +1,23 @@ -Subject: arm: Add support for lazy preemption +From 27abc6e47b12fa13152b6642facc203874ca16c7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Wed, 31 Oct 2012 12:04:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 247/266] arm: Add support for lazy preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Implement the arm pieces for lazy preempt. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/arm/Kconfig | 1 + - 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/Kconfig | 1 + + 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 ++- 6 files changed, 33 insertions(+), 8 deletions(-) +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index 91f4f80a6f24..cba596677f6e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -90,6 +90,7 @@ config ARM @@ -25,6 +28,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> select HAVE_RCU_TABLE_FREE if (SMP && ARM_LPAE) select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RSEQ +diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h +index 8f55dc520a3e..4f834bfca470 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h @@ -49,6 +49,7 @@ struct cpu_context_save { @@ -35,7 +40,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> mm_segment_t addr_limit; /* address limit */ struct task_struct *task; /* main task structure */ __u32 cpu; /* cpu */ -@@ -139,7 +140,8 @@ extern int vfp_restore_user_hwstate(stru +@@ -139,7 +140,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, #define TIF_SYSCALL_TRACE 4 /* syscall trace active */ #define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ #define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */ @@ -45,7 +50,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define TIF_NOHZ 12 /* in adaptive nohz mode */ #define TIF_USING_IWMMXT 17 -@@ -149,6 +151,7 @@ extern int vfp_restore_user_hwstate(stru +@@ -149,6 +151,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) @@ -53,7 +58,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define _TIF_UPROBE (1 << TIF_UPROBE) #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) -@@ -164,7 +167,8 @@ extern int vfp_restore_user_hwstate(stru +@@ -164,7 +167,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, * Change these and you break ASM code in entry-common.S */ #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ @@ -63,6 +68,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif /* __KERNEL__ */ #endif /* __ASM_ARM_THREAD_INFO_H */ +diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c +index 3968d6c22455..b35d373fc982 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c @@ -56,6 +56,7 @@ int main(void) @@ -73,9 +80,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); 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 e85a3af9ddeb..cc67c0a3ae7b 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S -@@ -216,11 +216,18 @@ ENDPROC(__dabt_svc) +@@ -216,11 +216,18 @@ __irq_svc: #ifdef CONFIG_PREEMPT ldr r8, [tsk, #TI_PREEMPT] @ get preempt count @@ -96,7 +105,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif svc_exit r5, irq = 1 @ return from exception -@@ -235,8 +242,14 @@ ENDPROC(__irq_svc) +@@ -235,8 +242,14 @@ svc_preempt: 1: bl preempt_schedule_irq @ irq en/disable is done inside ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS tst r0, #_TIF_NEED_RESCHED @@ -112,9 +121,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif __und_fault: +diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S +index 746565a876dc..156e3ba4b319 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S -@@ -56,7 +56,9 @@ saved_pc .req lr +@@ -56,7 +56,9 @@ __ret_fast_syscall: cmp r2, #TASK_SIZE blne addr_limit_check_failed ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing @@ -125,7 +136,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> bne fast_work_pending -@@ -93,8 +95,11 @@ ENDPROC(ret_fast_syscall) +@@ -93,8 +95,11 @@ __ret_fast_syscall: cmp r2, #TASK_SIZE blne addr_limit_check_failed ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing @@ -138,9 +149,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> UNWIND(.fnend ) ENDPROC(ret_fast_syscall) +diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c +index b908382b69ff..339fbc281cf1 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c -@@ -652,7 +652,8 @@ do_work_pending(struct pt_regs *regs, un +@@ -652,7 +652,8 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) */ trace_hardirqs_off(); do { @@ -150,3 +163,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> schedule(); } else { if (unlikely(!user_mode(regs))) +-- +2.20.1 + diff --git a/debian/patches-rt/powerpc-preempt-lazy-support.patch b/debian/patches-rt/0248-powerpc-Add-support-for-lazy-preemption.patch index 7dfd98492..ba0fc4c1b 100644 --- a/debian/patches-rt/powerpc-preempt-lazy-support.patch +++ b/debian/patches-rt/0248-powerpc-Add-support-for-lazy-preemption.patch @@ -1,19 +1,22 @@ +From 6e5f05d1ca90b51f8bce63ea76b4af56c7d5cb6c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 1 Nov 2012 10:14:11 +0100 -Subject: powerpc: Add support for lazy preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 248/266] powerpc: Add support for lazy preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Implement the powerpc pieces for lazy preempt. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - arch/powerpc/Kconfig | 1 + - arch/powerpc/include/asm/thread_info.h | 9 +++++++-- - arch/powerpc/kernel/asm-offsets.c | 1 + - arch/powerpc/kernel/entry_32.S | 17 ++++++++++++----- - arch/powerpc/kernel/entry_64.S | 16 ++++++++++++---- + arch/powerpc/Kconfig | 1 + + arch/powerpc/include/asm/thread_info.h | 9 +++++++-- + arch/powerpc/kernel/asm-offsets.c | 1 + + arch/powerpc/kernel/entry_32.S | 17 ++++++++++++----- + arch/powerpc/kernel/entry_64.S | 16 ++++++++++++---- 5 files changed, 33 insertions(+), 11 deletions(-) +diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig +index 1563820a37e8..d4835f8cfcf2 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -216,6 +216,7 @@ config PPC @@ -24,6 +27,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> select HAVE_RCU_TABLE_FREE if SMP select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RELIABLE_STACKTRACE if PPC64 && CPU_LITTLE_ENDIAN +diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h +index 3c0002044bc9..ce316076bc52 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h @@ -37,6 +37,8 @@ struct thread_info { @@ -35,7 +40,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> unsigned long local_flags; /* private flags for thread */ #ifdef CONFIG_LIVEPATCH unsigned long *livepatch_sp; -@@ -81,7 +83,7 @@ extern int arch_dup_task_struct(struct t +@@ -81,7 +83,7 @@ extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src #define TIF_SIGPENDING 1 /* signal pending */ #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ #define TIF_FSCHECK 3 /* Check FS is USER_DS on return */ @@ -44,7 +49,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define TIF_RESTORE_TM 5 /* need to restore TM FP/VEC/VSX */ #define TIF_PATCH_PENDING 6 /* pending live patching update */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ -@@ -100,6 +102,7 @@ extern int arch_dup_task_struct(struct t +@@ -100,6 +102,7 @@ extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src #define TIF_ELF2ABI 18 /* function descriptors must die! */ #endif #define TIF_POLLING_NRFLAG 19 /* true if poll_idle() is polling TIF_NEED_RESCHED */ @@ -52,7 +57,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* as above, but as bit values */ #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) -@@ -119,6 +122,7 @@ extern int arch_dup_task_struct(struct t +@@ -119,6 +122,7 @@ extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src #define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) #define _TIF_EMULATE_STACK_STORE (1<<TIF_EMULATE_STACK_STORE) #define _TIF_NOHZ (1<<TIF_NOHZ) @@ -60,7 +65,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #define _TIF_FSCHECK (1<<TIF_FSCHECK) #define _TIF_SYSCALL_DOTRACE (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT | \ -@@ -127,8 +131,9 @@ extern int arch_dup_task_struct(struct t +@@ -127,8 +131,9 @@ extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ _TIF_RESTORE_TM | _TIF_PATCH_PENDING | \ @@ -71,6 +76,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* Bits in local_flags */ /* Don't move TLF_NAPPING without adjusting the code in entry_32.S */ +diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c +index 89cf15566c4e..1870c87fb22a 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c @@ -156,6 +156,7 @@ int main(void) @@ -81,9 +88,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> OFFSET(TI_TASK, thread_info, task); OFFSET(TI_CPU, thread_info, cpu); +diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S +index 26b3f853cbf6..3783f3ef17a4 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S -@@ -885,7 +885,14 @@ user_exc_return: /* r10 contains MSR_KE +@@ -888,7 +888,14 @@ resume_kernel: cmpwi 0,r0,0 /* if non-zero, just restore regs and return */ bne restore andi. r8,r8,_TIF_NEED_RESCHED @@ -98,7 +107,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> lwz r3,_MSR(r1) andi. r0,r3,MSR_EE /* interrupts off? */ beq restore /* don't schedule if so */ -@@ -896,11 +903,11 @@ user_exc_return: /* r10 contains MSR_KE +@@ -899,11 +906,11 @@ resume_kernel: */ bl trace_hardirqs_off #endif @@ -113,7 +122,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_TRACE_IRQFLAGS /* And now, to properly rebalance the above, we tell lockdep they * are being turned back on, which will happen when we return -@@ -1223,7 +1230,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRE +@@ -1232,7 +1239,7 @@ global_dbcr0: #endif /* !(CONFIG_4xx || CONFIG_BOOKE) */ do_work: /* r10 contains MSR_KERNEL here */ @@ -122,7 +131,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> beq do_user_signal do_resched: /* r10 contains MSR_KERNEL here */ -@@ -1244,7 +1251,7 @@ do_resched: /* r10 contains MSR_KERNEL +@@ -1253,7 +1260,7 @@ recheck: MTMSRD(r10) /* disable interrupts */ CURRENT_THREAD_INFO(r9, r1) lwz r9,TI_FLAGS(r9) @@ -131,9 +140,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> bne- do_resched andi. r0,r9,_TIF_USER_WORK_MASK beq restore_user +diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S +index 2206912ea4f0..970c3643789a 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S -@@ -171,7 +171,7 @@ system_call: /* label this so stack tr +@@ -171,7 +171,7 @@ system_call: /* label this so stack traces look sane */ * based on caller's run-mode / personality. */ ld r11,SYS_CALL_TABLE@toc(2) @@ -142,7 +153,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> beq 15f addi r11,r11,8 /* use 32-bit syscall entries */ clrldi r3,r3,32 -@@ -763,7 +763,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG +@@ -763,7 +763,7 @@ _GLOBAL(ret_from_except_lite) bl restore_math b restore #endif @@ -151,7 +162,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> beq 2f bl restore_interrupts SCHEDULE_USER -@@ -825,10 +825,18 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG +@@ -825,10 +825,18 @@ resume_kernel: #ifdef CONFIG_PREEMPT /* Check if we need to preempt */ @@ -171,7 +182,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> cmpwi cr0,r8,0 bne restore ld r0,SOFTE(r1) -@@ -845,7 +853,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG +@@ -845,7 +853,7 @@ resume_kernel: /* Re-test flags and eventually loop */ CURRENT_THREAD_INFO(r9, r1) ld r4,TI_FLAGS(r9) @@ -180,3 +191,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> bne 1b /* +-- +2.20.1 + diff --git a/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch b/debian/patches-rt/0249-arch-arm64-Add-lazy-preempt-support.patch index 37282db20..2675a4de3 100644 --- a/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch +++ b/debian/patches-rt/0249-arch-arm64-Add-lazy-preempt-support.patch @@ -1,7 +1,8 @@ +From ac569db45631d8be8ac90304342ef8370d4e3826 Mon Sep 17 00:00:00 2001 From: Anders Roxell <anders.roxell@linaro.org> Date: Thu, 14 May 2015 17:52:17 +0200 -Subject: arch/arm64: Add lazy preempt support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 249/266] arch/arm64: Add lazy preempt support +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz arm64 is missing support for PREEMPT_RT. The main feature which is lacking is support for lazy preemption. The arch-specific entry code, @@ -12,13 +13,15 @@ indicate that support for full RT preemption is now available. Signed-off-by: Anders Roxell <anders.roxell@linaro.org> --- - arch/arm64/Kconfig | 1 + - arch/arm64/include/asm/thread_info.h | 6 +++++- - arch/arm64/kernel/asm-offsets.c | 1 + - arch/arm64/kernel/entry.S | 12 +++++++++--- - arch/arm64/kernel/signal.c | 2 +- + arch/arm64/Kconfig | 1 + + arch/arm64/include/asm/thread_info.h | 6 +++++- + arch/arm64/kernel/asm-offsets.c | 1 + + arch/arm64/kernel/entry.S | 12 +++++++++--- + arch/arm64/kernel/signal.c | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) +diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig +index 1b1a0e95c751..418a75d30f5c 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -140,6 +140,7 @@ config ARM64 @@ -29,6 +32,8 @@ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RCU_TABLE_FREE select HAVE_RSEQ +diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h +index cb2c10a8f0a8..f1820f7318b6 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -43,6 +43,7 @@ struct thread_info { @@ -39,7 +44,7 @@ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> }; #define thread_saved_pc(tsk) \ -@@ -76,6 +77,7 @@ void arch_release_task_struct(struct tas +@@ -76,6 +77,7 @@ void arch_release_task_struct(struct task_struct *tsk); #define TIF_FOREIGN_FPSTATE 3 /* CPU's FP state is not current's */ #define TIF_UPROBE 4 /* uprobe breakpoint or singlestep */ #define TIF_FSCHECK 5 /* Check FS is USER_DS on return */ @@ -47,7 +52,7 @@ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> #define TIF_NOHZ 7 #define TIF_SYSCALL_TRACE 8 #define TIF_SYSCALL_AUDIT 9 -@@ -94,6 +96,7 @@ void arch_release_task_struct(struct tas +@@ -94,6 +96,7 @@ void arch_release_task_struct(struct task_struct *tsk); #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) #define _TIF_FOREIGN_FPSTATE (1 << TIF_FOREIGN_FPSTATE) @@ -55,7 +60,7 @@ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> #define _TIF_NOHZ (1 << TIF_NOHZ) #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) -@@ -106,8 +109,9 @@ void arch_release_task_struct(struct tas +@@ -106,8 +109,9 @@ void arch_release_task_struct(struct task_struct *tsk); #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \ @@ -66,6 +71,8 @@ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \ _TIF_NOHZ) +diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c +index 323aeb5f2fe6..7edd5a2668ea 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c @@ -41,6 +41,7 @@ int main(void) @@ -76,9 +83,11 @@ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> DEFINE(TSK_TI_ADDR_LIMIT, offsetof(struct task_struct, thread_info.addr_limit)); #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 8556876c9109..d30ca1b304cd 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S -@@ -623,11 +623,16 @@ ENDPROC(el1_sync) +@@ -623,11 +623,16 @@ el1_irq: #ifdef CONFIG_PREEMPT ldr w24, [tsk, #TSK_TI_PREEMPT] // get preempt count @@ -98,7 +107,7 @@ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> #endif #ifdef CONFIG_TRACE_IRQFLAGS bl trace_hardirqs_on -@@ -641,6 +646,7 @@ ENDPROC(el1_irq) +@@ -641,6 +646,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? @@ -106,9 +115,11 @@ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> ret x24 #endif +diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c +index 5dcc942906db..4fec251fe147 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c -@@ -926,7 +926,7 @@ asmlinkage void do_notify_resume(struct +@@ -926,7 +926,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, /* Check valid user FS if needed */ addr_limit_user_check(); @@ -117,3 +128,6 @@ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> /* Unmask Debug and SError for the next task */ local_daif_restore(DAIF_PROCCTX_NOIRQ); +-- +2.20.1 + diff --git a/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch b/debian/patches-rt/0250-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch index 027a15368..dfaf880cb 100644 --- a/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +++ b/debian/patches-rt/0250-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch @@ -1,8 +1,9 @@ +From 8a3ebce56251a19129b169e40504a4d841775496 Mon Sep 17 00:00:00 2001 From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Sun, 16 Oct 2016 05:11:54 +0200 -Subject: [PATCH] connector/cn_proc: Protect send_msg() with a local lock - on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 250/266] connector/cn_proc: Protect send_msg() with a local + lock on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931 |in_atomic(): 1, irqs_disabled(): 0, pid: 31807, name: sleep @@ -31,9 +32,11 @@ delivery") which is v4.7-rc6. Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/connector/cn_proc.c | 6 ++++-- + drivers/connector/cn_proc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) +diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c +index ad48fd52cb53..c5264b3ee0b0 100644 --- a/drivers/connector/cn_proc.c +++ b/drivers/connector/cn_proc.c @@ -32,6 +32,7 @@ @@ -44,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Size of a cn_msg followed by a proc_event structure. Since the -@@ -54,10 +55,11 @@ static struct cb_id cn_proc_event_id = { +@@ -54,10 +55,11 @@ static struct cb_id cn_proc_event_id = { CN_IDX_PROC, CN_VAL_PROC }; /* proc_event_counts is used as the sequence number of the netlink message */ static DEFINE_PER_CPU(__u32, proc_event_counts) = { 0 }; @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> msg->seq = __this_cpu_inc_return(proc_event_counts) - 1; ((struct proc_event *)msg->data)->cpu = smp_processor_id(); -@@ -70,7 +72,7 @@ static inline void send_msg(struct cn_ms +@@ -70,7 +72,7 @@ static inline void send_msg(struct cn_msg *msg) */ cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_NOWAIT); @@ -66,3 +69,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } void proc_fork_connector(struct task_struct *task) +-- +2.20.1 + diff --git a/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/debian/patches-rt/0251-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch index d98d1d7ef..370b8d7ad 100644 --- a/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ b/debian/patches-rt/0251-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch @@ -1,8 +1,9 @@ +From 596390e9ca896b8f80a6c5736f3e0fb63c26ca57 Mon Sep 17 00:00:00 2001 From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Thu, 31 Mar 2016 04:08:28 +0200 -Subject: [PATCH] drivers/block/zram: Replace bit spinlocks with rtmutex - for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 251/266] drivers/block/zram: Replace bit spinlocks with + rtmutex for -rt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz They're nondeterministic, and lead to ___might_sleep() splats in -rt. OTOH, they're a lot less wasteful than an rtmutex per page. @@ -10,10 +11,12 @@ OTOH, they're a lot less wasteful than an rtmutex per page. Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/block/zram/zram_drv.c | 38 ++++++++++++++++++++++++++++++++++++++ - drivers/block/zram/zram_drv.h | 3 +++ + drivers/block/zram/zram_drv.c | 38 +++++++++++++++++++++++++++++++++++ + drivers/block/zram/zram_drv.h | 3 +++ 2 files changed, 41 insertions(+) +diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c +index a65505db09e5..f35eccc43558 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -53,6 +53,40 @@ static size_t huge_class_size; @@ -57,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static int zram_slot_trylock(struct zram *zram, u32 index) { return bit_spin_trylock(ZRAM_LOCK, &zram->table[index].value); -@@ -67,6 +101,7 @@ static void zram_slot_unlock(struct zram +@@ -67,6 +101,7 @@ static void zram_slot_unlock(struct zram *zram, u32 index) { bit_spin_unlock(ZRAM_LOCK, &zram->table[index].value); } @@ -74,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void zram_meta_free(struct zram *zram, u64 disksize) { size_t num_pages = disksize >> PAGE_SHIFT; -@@ -930,6 +967,7 @@ static bool zram_meta_alloc(struct zram +@@ -930,6 +967,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) if (!huge_class_size) huge_class_size = zs_huge_class_size(zram->mem_pool); @@ -82,6 +85,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return true; } +diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h +index d1095dfdffa8..144e91061df8 100644 --- a/drivers/block/zram/zram_drv.h +++ b/drivers/block/zram/zram_drv.h @@ -61,6 +61,9 @@ struct zram_table_entry { @@ -94,3 +99,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_ZRAM_MEMORY_TRACKING ktime_t ac_time; #endif +-- +2.20.1 + diff --git a/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch b/debian/patches-rt/0252-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch index 4d96fca94..416b5c1ab 100644 --- a/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +++ b/debian/patches-rt/0252-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch @@ -1,8 +1,9 @@ +From 804440336b04875f7b737fd5cdcfb118c416340c Mon Sep 17 00:00:00 2001 From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Thu, 20 Oct 2016 11:15:22 +0200 -Subject: [PATCH] drivers/zram: Don't disable preemption in +Subject: [PATCH 252/266] drivers/zram: Don't disable preemption in zcomp_stream_get/put() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz In v4.7, the driver switched to percpu compression streams, disabling preemption via get/put_cpu_ptr(). Use a per-zcomp_strm lock here. We @@ -14,14 +15,16 @@ Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> [bigeasy: get_locked_var() -> per zcomp_strm lock] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/block/zram/zcomp.c | 12 ++++++++++-- - drivers/block/zram/zcomp.h | 1 + - drivers/block/zram/zram_drv.c | 5 +++-- + drivers/block/zram/zcomp.c | 12 ++++++++++-- + drivers/block/zram/zcomp.h | 1 + + drivers/block/zram/zram_drv.c | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) +diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c +index 4ed0a78fdc09..dd65a27ae2cc 100644 --- a/drivers/block/zram/zcomp.c +++ b/drivers/block/zram/zcomp.c -@@ -116,12 +116,19 @@ ssize_t zcomp_available_show(const char +@@ -116,12 +116,19 @@ ssize_t zcomp_available_show(const char *comp, char *buf) struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) { @@ -43,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } int zcomp_compress(struct zcomp_strm *zstrm, -@@ -171,6 +178,7 @@ int zcomp_cpu_up_prepare(unsigned int cp +@@ -171,6 +178,7 @@ int zcomp_cpu_up_prepare(unsigned int cpu, struct hlist_node *node) pr_err("Can't allocate a compression stream\n"); return -ENOMEM; } @@ -51,6 +54,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> *per_cpu_ptr(comp->stream, cpu) = zstrm; return 0; } +diff --git a/drivers/block/zram/zcomp.h b/drivers/block/zram/zcomp.h +index 41c1002a7d7d..d424eafcbf8e 100644 --- a/drivers/block/zram/zcomp.h +++ b/drivers/block/zram/zcomp.h @@ -14,6 +14,7 @@ struct zcomp_strm { @@ -61,9 +66,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> }; /* dynamic per-device compression frontend */ +diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c +index f35eccc43558..b2a347b8b517 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c -@@ -1026,6 +1026,7 @@ static int __zram_bvec_read(struct zram +@@ -1026,6 +1026,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, unsigned long handle; unsigned int size; void *src, *dst; @@ -71,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (zram_wb_enabled(zram)) { zram_slot_lock(zram, index); -@@ -1060,6 +1061,7 @@ static int __zram_bvec_read(struct zram +@@ -1060,6 +1061,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, size = zram_get_obj_size(zram, index); @@ -79,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> src = zs_map_object(zram->mem_pool, handle, ZS_MM_RO); if (size == PAGE_SIZE) { dst = kmap_atomic(page); -@@ -1067,14 +1069,13 @@ static int __zram_bvec_read(struct zram +@@ -1067,14 +1069,13 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, kunmap_atomic(dst); ret = 0; } else { @@ -95,3 +102,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> zram_slot_unlock(zram, index); /* Should NEVER happen. Return bio error if it does. */ +-- +2.20.1 + diff --git a/debian/patches-rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch b/debian/patches-rt/0253-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch index 8a527f27f..851f381af 100644 --- a/debian/patches-rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch +++ b/debian/patches-rt/0253-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch @@ -1,8 +1,9 @@ +From 8f12c2d0304bfa4554e0216fa621b0cdb8bd99b6 Mon Sep 17 00:00:00 2001 From: Mike Galbraith <efault@gmx.de> Date: Wed, 23 Aug 2017 11:57:29 +0200 -Subject: [PATCH] drivers/zram: fix zcomp_stream_get() smp_processor_id() use - in preemptible code -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 253/266] drivers/zram: fix zcomp_stream_get() + smp_processor_id() use in preemptible code +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Use get_local_ptr() instead this_cpu_ptr() to avoid a warning regarding smp_processor_id() in preemptible code. @@ -14,12 +15,14 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/block/zram/zcomp.c | 3 ++- + drivers/block/zram/zcomp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) +diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c +index dd65a27ae2cc..eece02262000 100644 --- a/drivers/block/zram/zcomp.c +++ b/drivers/block/zram/zcomp.c -@@ -118,7 +118,7 @@ struct zcomp_strm *zcomp_stream_get(stru +@@ -118,7 +118,7 @@ struct zcomp_strm *zcomp_stream_get(struct zcomp *comp) { struct zcomp_strm *zstrm; @@ -28,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> spin_lock(&zstrm->zcomp_lock); return zstrm; } -@@ -129,6 +129,7 @@ void zcomp_stream_put(struct zcomp *comp +@@ -129,6 +129,7 @@ void zcomp_stream_put(struct zcomp *comp) zstrm = *this_cpu_ptr(comp->stream); spin_unlock(&zstrm->zcomp_lock); @@ -36,3 +39,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } int zcomp_compress(struct zcomp_strm *zstrm, +-- +2.20.1 + diff --git a/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch b/debian/patches-rt/0254-tpm_tis-fix-stall-after-iowrite-s.patch index 1f7b046a3..2ad05dd9b 100644 --- a/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch +++ b/debian/patches-rt/0254-tpm_tis-fix-stall-after-iowrite-s.patch @@ -1,7 +1,8 @@ +From 8afa13346657d6fbf5a52a5dc31e14f37a611866 Mon Sep 17 00:00:00 2001 From: Haris Okanovic <haris.okanovic@ni.com> Date: Tue, 15 Aug 2017 15:13:08 -0500 -Subject: [PATCH] tpm_tis: fix stall after iowrite*()s -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 254/266] tpm_tis: fix stall after iowrite*()s +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz ioread8() operations to TPM MMIO addresses can stall the cpu when immediately following a sequence of iowrite*()'s to the same region. @@ -21,12 +22,14 @@ amortize the cost of flushing data to chip across multiple instructions. Signed-off-by: Haris Okanovic <haris.okanovic@ni.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/char/tpm/tpm_tis.c | 29 +++++++++++++++++++++++++++-- + drivers/char/tpm/tpm_tis.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) +diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c +index f08949a5f678..9fefcfcae593 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c -@@ -53,6 +53,31 @@ static inline struct tpm_tis_tcg_phy *to +@@ -53,6 +53,31 @@ static inline struct tpm_tis_tcg_phy *to_tpm_tis_tcg_phy(struct tpm_tis_data *da return container_of(data, struct tpm_tis_tcg_phy, priv); } @@ -58,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static bool interrupts = true; module_param(interrupts, bool, 0444); MODULE_PARM_DESC(interrupts, "Enable interrupts"); -@@ -150,7 +175,7 @@ static int tpm_tcg_write_bytes(struct tp +@@ -150,7 +175,7 @@ static int tpm_tcg_write_bytes(struct tpm_tis_data *data, u32 addr, u16 len, struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); while (len--) @@ -67,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } -@@ -177,7 +202,7 @@ static int tpm_tcg_write32(struct tpm_ti +@@ -177,7 +202,7 @@ static int tpm_tcg_write32(struct tpm_tis_data *data, u32 addr, u32 value) { struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); @@ -76,3 +79,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } +-- +2.20.1 + diff --git a/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch b/debian/patches-rt/0255-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch index 92ea6ad85..ee49ce0ef 100644 --- a/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch +++ b/debian/patches-rt/0255-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch @@ -1,7 +1,8 @@ +From e2846d88f2af5d8052bf0234060f7381a7ba9d56 Mon Sep 17 00:00:00 2001 From: Julia Cartwright <julia@ni.com> Date: Fri, 28 Sep 2018 21:03:51 +0000 -Subject: [PATCH] watchdog: prevent deferral of watchdogd wakeup on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 255/266] watchdog: prevent deferral of watchdogd wakeup on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz When PREEMPT_RT_FULL is enabled, all hrtimer expiry functions are deferred for execution into the context of ktimersoftd unless otherwise @@ -32,12 +33,14 @@ Acked-by: Guenter Roeck <linux@roeck-us.net> [bigeasy: use only HRTIMER_MODE_REL_HARD] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/watchdog/watchdog_dev.c | 8 ++++---- + drivers/watchdog/watchdog_dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) +diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c +index ffbdc4642ea5..84f75b5045f6 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c -@@ -147,7 +147,7 @@ static inline void watchdog_update_worke +@@ -147,7 +147,7 @@ static inline void watchdog_update_worker(struct watchdog_device *wdd) ktime_t t = watchdog_next_keepalive(wdd); if (t > 0) @@ -46,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } else { hrtimer_cancel(&wd_data->timer); } -@@ -166,7 +166,7 @@ static int __watchdog_ping(struct watchd +@@ -166,7 +166,7 @@ static int __watchdog_ping(struct watchdog_device *wdd) if (ktime_after(earliest_keepalive, now)) { hrtimer_start(&wd_data->timer, ktime_sub(earliest_keepalive, now), @@ -55,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } -@@ -945,7 +945,7 @@ static int watchdog_cdev_register(struct +@@ -945,7 +945,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd, dev_t devno) return -ENODEV; kthread_init_work(&wd_data->work, watchdog_ping_work); @@ -64,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> wd_data->timer.function = watchdog_timer_expired; if (wdd->id == 0) { -@@ -992,7 +992,7 @@ static int watchdog_cdev_register(struct +@@ -992,7 +992,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd, dev_t devno) __module_get(wdd->ops->owner); kref_get(&wd_data->kref); if (handle_boot_enabled) @@ -73,3 +76,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> else pr_info("watchdog%d running and kernel based pre-userspace handler disabled\n", wdd->id); +-- +2.20.1 + diff --git a/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch b/debian/patches-rt/0256-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch index 8187ade05..5eacc7187 100644 --- a/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch +++ b/debian/patches-rt/0256-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch @@ -1,7 +1,9 @@ -Subject: drm,radeon,i915: Use preempt_disable/enable_rt() where recommended +From fd7ad451657bc1d2745adae012accec69a290a7f Mon Sep 17 00:00:00 2001 From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Sat, 27 Feb 2016 08:09:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 256/266] drm,radeon,i915: Use preempt_disable/enable_rt() + where recommended +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz DRM folks identified the spots, so use them. @@ -10,13 +12,15 @@ Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: linux-rt-users <linux-rt-users@vger.kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - drivers/gpu/drm/i915/i915_irq.c | 2 ++ - drivers/gpu/drm/radeon/radeon_display.c | 2 ++ + drivers/gpu/drm/i915/i915_irq.c | 2 ++ + drivers/gpu/drm/radeon/radeon_display.c | 2 ++ 2 files changed, 4 insertions(+) +diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c +index 29877969310d..f65817c51c2a 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c -@@ -1025,6 +1025,7 @@ static bool i915_get_crtc_scanoutpos(str +@@ -1025,6 +1025,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ @@ -24,7 +28,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* Get optional system timestamp before query. */ if (stime) -@@ -1076,6 +1077,7 @@ static bool i915_get_crtc_scanoutpos(str +@@ -1076,6 +1077,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, *etime = ktime_get(); /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ @@ -32,9 +36,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); +diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c +index 9d3ac8b981da..bde228c7739a 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c -@@ -1813,6 +1813,7 @@ int radeon_get_crtc_scanoutpos(struct dr +@@ -1813,6 +1813,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, struct radeon_device *rdev = dev->dev_private; /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ @@ -42,7 +48,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* Get optional system timestamp before query. */ if (stime) -@@ -1905,6 +1906,7 @@ int radeon_get_crtc_scanoutpos(struct dr +@@ -1905,6 +1906,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, *etime = ktime_get(); /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ @@ -50,3 +56,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* Decode into vertical and horizontal scanout position. */ *vpos = position & 0x1fff; +-- +2.20.1 + diff --git a/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch b/debian/patches-rt/0257-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch index d6b4a8e0f..311583c27 100644 --- a/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch +++ b/debian/patches-rt/0257-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch @@ -1,8 +1,9 @@ -Subject: drm,i915: Use local_lock/unlock_irq() in intel_pipe_update_start/end() +From 014ca6a4c50510ca158c89df3e03ddf459b2cca8 Mon Sep 17 00:00:00 2001 From: Mike Galbraith <umgwanakikbuti@gmail.com> Date: Sat, 27 Feb 2016 09:01:42 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz - +Subject: [PATCH 257/266] drm,i915: Use local_lock/unlock_irq() in + intel_pipe_update_start/end() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz [ 8.014039] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:918 [ 8.014041] in_atomic(): 0, irqs_disabled(): 1, pid: 78, name: kworker/u4:4 @@ -57,9 +58,11 @@ Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: linux-rt-users <linux-rt-users@vger.kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - drivers/gpu/drm/i915/intel_sprite.c | 13 ++++++++----- + drivers/gpu/drm/i915/intel_sprite.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) +diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c +index f7026e887fa9..07e4ddebdd80 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c @@ -36,6 +36,7 @@ @@ -70,7 +73,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include "intel_drv.h" #include "intel_frontbuffer.h" #include <drm/i915_drm.h> -@@ -60,6 +61,8 @@ int intel_usecs_to_scanlines(const struc +@@ -60,6 +61,8 @@ int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode, #define VBLANK_EVASION_TIME_US 100 #endif @@ -79,7 +82,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /** * intel_pipe_update_start() - start update of a set of display registers * @new_crtc_state: the new crtc state -@@ -107,7 +110,7 @@ void intel_pipe_update_start(const struc +@@ -107,7 +110,7 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state) if (intel_psr_wait_for_idle(new_crtc_state)) DRM_ERROR("PSR idle timed out, atomic update may fail\n"); @@ -88,7 +91,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> crtc->debug.min_vbl = min; crtc->debug.max_vbl = max; -@@ -131,11 +134,11 @@ void intel_pipe_update_start(const struc +@@ -131,11 +134,11 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state) break; } @@ -102,7 +105,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } finish_wait(wq, &wait); -@@ -168,7 +171,7 @@ void intel_pipe_update_start(const struc +@@ -168,7 +171,7 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state) return; irq_disable: @@ -111,7 +114,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /** -@@ -204,7 +207,7 @@ void intel_pipe_update_end(struct intel_ +@@ -204,7 +207,7 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state) new_crtc_state->base.event = NULL; } @@ -120,3 +123,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (intel_vgpu_active(dev_priv)) return; +-- +2.20.1 + diff --git a/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch b/debian/patches-rt/0258-drm-i915-disable-tracing-on-RT.patch index 57a6a50c0..2e9fb5e01 100644 --- a/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch +++ b/debian/patches-rt/0258-drm-i915-disable-tracing-on-RT.patch @@ -1,7 +1,8 @@ +From 2c9b4d76e3ee784c2b29c08e1e6ee0a51972602e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 6 Dec 2018 09:52:20 +0100 -Subject: [PATCH] drm/i915: disable tracing on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 258/266] drm/i915: disable tracing on -RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Luca Abeni reported this: | BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 @@ -23,9 +24,11 @@ Cc: stable-rt@vger.kernel.org Reported-by: Luca Abeni <lucabe72@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/gpu/drm/i915/i915_trace.h | 4 ++++ + drivers/gpu/drm/i915/i915_trace.h | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h +index b50c6b829715..cc54ec0ef75c 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h @@ -2,6 +2,10 @@ @@ -39,3 +42,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <linux/stringify.h> #include <linux/types.h> #include <linux/tracepoint.h> +-- +2.20.1 + diff --git a/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch b/debian/patches-rt/0259-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch index f4a9b62b6..e80c97899 100644 --- a/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch +++ b/debian/patches-rt/0259-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch @@ -1,7 +1,9 @@ +From 33e6f852f6d813a1dfe1e579957fca84cfb80a6e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 19 Dec 2018 10:47:02 +0100 -Subject: [PATCH] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with NOTRACE -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 259/266] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with + NOTRACE +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The order of the header files is important. If this header file is included after tracepoint.h was included then the NOTRACE here becomes a @@ -10,12 +12,14 @@ behind DRM_I915_LOW_LEVEL_TRACEPOINTS. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - drivers/gpu/drm/i915/i915_trace.h | 2 +- + drivers/gpu/drm/i915/i915_trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h +index cc54ec0ef75c..33028d8f470e 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h -@@ -683,7 +683,7 @@ DEFINE_EVENT(i915_request, i915_request_ +@@ -683,7 +683,7 @@ DEFINE_EVENT(i915_request, i915_request_add, TP_ARGS(rq) ); @@ -24,3 +28,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> DEFINE_EVENT(i915_request, i915_request_submit, TP_PROTO(struct i915_request *rq), TP_ARGS(rq) +-- +2.20.1 + diff --git a/debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch b/debian/patches-rt/0260-cgroups-use-simple-wait-in-css_release.patch index ad23a5163..1dcf734df 100644 --- a/debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch +++ b/debian/patches-rt/0260-cgroups-use-simple-wait-in-css_release.patch @@ -1,7 +1,8 @@ +From d12fcd626ee85e19b217131c681953e534772eb1 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Fri, 13 Feb 2015 15:52:24 +0100 -Subject: cgroups: use simple wait in css_release() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 260/266] cgroups: use simple wait in css_release() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz To avoid: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 @@ -29,10 +30,12 @@ To avoid: Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - include/linux/cgroup-defs.h | 2 ++ - kernel/cgroup/cgroup.c | 9 +++++---- + include/linux/cgroup-defs.h | 2 ++ + kernel/cgroup/cgroup.c | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) +diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h +index 22254c1fe1c5..1762eee54f74 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -20,6 +20,7 @@ @@ -51,9 +54,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct rcu_work destroy_rwork; /* +diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c +index e710ac7fbbbf..0e7e4500c549 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -4625,10 +4625,10 @@ static void css_free_rwork_fn(struct wor +@@ -4628,10 +4628,10 @@ static void css_free_rwork_fn(struct work_struct *work) } } @@ -66,7 +71,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct cgroup_subsys *ss = css->ss; struct cgroup *cgrp = css->cgroup; -@@ -4688,8 +4688,8 @@ static void css_release(struct percpu_re +@@ -4691,8 +4691,8 @@ static void css_release(struct percpu_ref *ref) struct cgroup_subsys_state *css = container_of(ref, struct cgroup_subsys_state, refcnt); @@ -77,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } static void init_and_link_css(struct cgroup_subsys_state *css, -@@ -5411,6 +5411,7 @@ static int __init cgroup_wq_init(void) +@@ -5414,6 +5414,7 @@ static int __init cgroup_wq_init(void) */ cgroup_destroy_wq = alloc_workqueue("cgroup_destroy", 0, 1); BUG_ON(!cgroup_destroy_wq); @@ -85,3 +90,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } core_initcall(cgroup_wq_init); +-- +2.20.1 + diff --git a/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/debian/patches-rt/0261-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch index 2d36cf3b6..7a7fbf8a1 100644 --- a/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/0261-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch @@ -1,7 +1,8 @@ +From da07ea849302ed3d11e26c0b4543e5982d1234da Mon Sep 17 00:00:00 2001 From: Mike Galbraith <efault@gmx.de> Date: Sun, 8 Jan 2017 09:32:25 +0100 -Subject: [PATCH] cpuset: Convert callback_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 261/266] cpuset: Convert callback_lock to raw_spinlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz The two commits below add up to a cpuset might_sleep() splat for RT: @@ -46,9 +47,11 @@ Cc: stable-rt@vger.kernel.org Signed-off-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/cgroup/cpuset.c | 66 ++++++++++++++++++++++++------------------------- + kernel/cgroup/cpuset.c | 66 +++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) +diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c +index ef085d84a940..3e5d90076368 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -288,7 +288,7 @@ static struct cpuset top_cpuset = { @@ -60,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static struct workqueue_struct *cpuset_migrate_mm_wq; -@@ -922,9 +922,9 @@ static void update_cpumasks_hier(struct +@@ -922,9 +922,9 @@ static void update_cpumasks_hier(struct cpuset *cs, struct cpumask *new_cpus) continue; rcu_read_unlock(); @@ -72,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> WARN_ON(!is_in_v2_mode() && !cpumask_equal(cp->cpus_allowed, cp->effective_cpus)); -@@ -989,9 +989,9 @@ static int update_cpumask(struct cpuset +@@ -989,9 +989,9 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, if (retval < 0) return retval; @@ -84,7 +87,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* use trialcs->cpus_allowed as a temp variable */ update_cpumasks_hier(cs, trialcs->cpus_allowed); -@@ -1175,9 +1175,9 @@ static void update_nodemasks_hier(struct +@@ -1175,9 +1175,9 @@ static void update_nodemasks_hier(struct cpuset *cs, nodemask_t *new_mems) continue; rcu_read_unlock(); @@ -96,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> WARN_ON(!is_in_v2_mode() && !nodes_equal(cp->mems_allowed, cp->effective_mems)); -@@ -1245,9 +1245,9 @@ static int update_nodemask(struct cpuset +@@ -1245,9 +1245,9 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, if (retval < 0) goto done; @@ -108,7 +111,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* use trialcs->mems_allowed as a temp variable */ update_nodemasks_hier(cs, &trialcs->mems_allowed); -@@ -1338,9 +1338,9 @@ static int update_flag(cpuset_flagbits_t +@@ -1338,9 +1338,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))); @@ -120,7 +123,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!cpumask_empty(trialcs->cpus_allowed) && balance_flag_changed) rebuild_sched_domains_locked(); -@@ -1755,7 +1755,7 @@ static int cpuset_common_seq_show(struct +@@ -1755,7 +1755,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v) cpuset_filetype_t type = seq_cft(sf)->private; int ret = 0; @@ -129,7 +132,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> switch (type) { case FILE_CPULIST: -@@ -1774,7 +1774,7 @@ static int cpuset_common_seq_show(struct +@@ -1774,7 +1774,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v) ret = -EINVAL; } @@ -138,7 +141,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } -@@ -1989,12 +1989,12 @@ static int cpuset_css_online(struct cgro +@@ -1989,12 +1989,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) cpuset_inc(); @@ -153,7 +156,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags)) goto out_unlock; -@@ -2021,12 +2021,12 @@ static int cpuset_css_online(struct cgro +@@ -2021,12 +2021,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) } rcu_read_unlock(); @@ -168,7 +171,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> out_unlock: mutex_unlock(&cpuset_mutex); return 0; -@@ -2065,7 +2065,7 @@ static void cpuset_css_free(struct cgrou +@@ -2065,7 +2065,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); @@ -177,7 +180,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (is_in_v2_mode()) { cpumask_copy(top_cpuset.cpus_allowed, cpu_possible_mask); -@@ -2076,7 +2076,7 @@ static void cpuset_bind(struct cgroup_su +@@ -2076,7 +2076,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) top_cpuset.mems_allowed = top_cpuset.effective_mems; } @@ -186,7 +189,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> mutex_unlock(&cpuset_mutex); } -@@ -2174,12 +2174,12 @@ hotplug_update_tasks_legacy(struct cpuse +@@ -2174,12 +2174,12 @@ hotplug_update_tasks_legacy(struct cpuset *cs, { bool is_empty; @@ -214,7 +217,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (cpus_updated) update_tasks_cpumask(cs); -@@ -2312,21 +2312,21 @@ static void cpuset_hotplug_workfn(struct +@@ -2312,21 +2312,21 @@ static void cpuset_hotplug_workfn(struct work_struct *work) /* synchronize cpus_allowed to cpu_active_mask */ if (cpus_updated) { @@ -240,7 +243,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> update_tasks_nodemask(&top_cpuset); } -@@ -2425,11 +2425,11 @@ void cpuset_cpus_allowed(struct task_str +@@ -2425,11 +2425,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) { unsigned long flags; @@ -254,7 +257,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } void cpuset_cpus_allowed_fallback(struct task_struct *tsk) -@@ -2477,11 +2477,11 @@ nodemask_t cpuset_mems_allowed(struct ta +@@ -2477,11 +2477,11 @@ nodemask_t cpuset_mems_allowed(struct task_struct *tsk) nodemask_t mask; unsigned long flags; @@ -268,7 +271,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return mask; } -@@ -2573,14 +2573,14 @@ bool __cpuset_node_allowed(int node, gfp +@@ -2573,14 +2573,14 @@ bool __cpuset_node_allowed(int node, gfp_t gfp_mask) return true; /* Not hardwall and node outside mems_allowed: scan up cpusets */ @@ -285,3 +288,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return allowed; } +-- +2.20.1 + diff --git a/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch b/debian/patches-rt/0262-apparmor-use-a-locallock-instead-preempt_disable.patch index b6619c168..406aadf47 100644 --- a/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch +++ b/debian/patches-rt/0262-apparmor-use-a-locallock-instead-preempt_disable.patch @@ -1,7 +1,8 @@ +From b029b075f29695c1a7095a1eea4d3949fa7a334a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 11 Oct 2017 17:43:49 +0200 -Subject: apparmor: use a locallock instead preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 262/266] apparmor: use a locallock instead preempt_disable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz get_buffers() disables preemption which acts as a lock for the per-CPU variable. Since we can't disable preemption here on RT, a local_lock is @@ -10,10 +11,12 @@ than one user within the critical section. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - security/apparmor/include/path.h | 19 ++++++++++++++++--- - security/apparmor/lsm.c | 2 +- + security/apparmor/include/path.h | 19 ++++++++++++++++--- + security/apparmor/lsm.c | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) +diff --git a/security/apparmor/include/path.h b/security/apparmor/include/path.h +index b6380c5f0097..12abfddb19c9 100644 --- a/security/apparmor/include/path.h +++ b/security/apparmor/include/path.h @@ -40,8 +40,10 @@ struct aa_buffers { @@ -27,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define ASSIGN(FN, A, X, N) ((X) = FN(A, N)) #define EVAL1(FN, A, X) ASSIGN(FN, A, X, 0) /*X = FN(0)*/ -@@ -51,7 +53,17 @@ DECLARE_PER_CPU(struct aa_buffers, aa_bu +@@ -51,7 +53,17 @@ DECLARE_PER_CPU(struct aa_buffers, aa_buffers); #define for_each_cpu_buffer(I) for ((I) = 0; (I) < MAX_PATH_BUFFERS; (I)++) @@ -46,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #define AA_BUG_PREEMPT_ENABLED(X) AA_BUG(preempt_count() <= 0, X) #else #define AA_BUG_PREEMPT_ENABLED(X) /* nop */ -@@ -67,14 +79,15 @@ DECLARE_PER_CPU(struct aa_buffers, aa_bu +@@ -67,14 +79,15 @@ DECLARE_PER_CPU(struct aa_buffers, aa_buffers); #define get_buffers(X...) \ do { \ @@ -64,6 +67,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } while (0) #endif /* __AA_PATH_H */ +diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c +index 8b8b70620bbe..8330ef57a784 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -45,7 +45,7 @@ @@ -75,3 +80,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * LSM hook functions +-- +2.20.1 + diff --git a/debian/patches-rt/workqueue-prevent-deadlock-stall.patch b/debian/patches-rt/0263-workqueue-Prevent-deadlock-stall-on-RT.patch index f376d5f42..d99fbbd7b 100644 --- a/debian/patches-rt/workqueue-prevent-deadlock-stall.patch +++ b/debian/patches-rt/0263-workqueue-Prevent-deadlock-stall-on-RT.patch @@ -1,7 +1,8 @@ -Subject: workqueue: Prevent deadlock/stall on RT +From 9ff4c4812c4c2db18d01f0218a5cec21f962a0ce Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> -Date: Fri, 27 Jun 2014 16:24:52 +0200 (CEST) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Date: Fri, 27 Jun 2014 16:24:52 +0200 +Subject: [PATCH 263/266] workqueue: Prevent deadlock/stall on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz Austin reported a XFS deadlock/stall on RT where scheduled work gets never exececuted and tasks are waiting for each other for ever. @@ -36,15 +37,16 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: http://vger.kernel.org/r/alpine.DEB.2.10.1406271249510.5170@nanos Cc: Richard Weinberger <richard.weinberger@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> - --- - kernel/sched/core.c | 6 +++-- - kernel/workqueue.c | 60 ++++++++++++++++++++++++++++++++++++++++------------ + kernel/sched/core.c | 6 +++-- + kernel/workqueue.c | 60 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 51 insertions(+), 15 deletions(-) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 9811d79d19ba..0689c0c4e39f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -3567,9 +3567,8 @@ void __noreturn do_task_dead(void) +@@ -3568,9 +3568,8 @@ void __noreturn do_task_dead(void) static inline void sched_submit_work(struct task_struct *tsk) { @@ -55,7 +57,7 @@ Cc: Steven Rostedt <rostedt@goodmis.org> /* * If a worker went to sleep, notify and ask workqueue whether * it wants to wake up a task to maintain concurrency. -@@ -3583,6 +3582,9 @@ static inline void sched_submit_work(str +@@ -3584,6 +3583,9 @@ static inline void sched_submit_work(struct task_struct *tsk) preempt_enable_no_resched(); } @@ -65,6 +67,8 @@ Cc: Steven Rostedt <rostedt@goodmis.org> /* * If we are going to sleep and we have plugged IO queued, * make sure to submit it to avoid deadlocks. +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index bf7be926ce5f..84397c2a4465 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -125,6 +125,11 @@ enum { @@ -79,7 +83,7 @@ Cc: Steven Rostedt <rostedt@goodmis.org> * A: wq_pool_attach_mutex protected. * * PL: wq_pool_mutex protected. -@@ -430,6 +435,31 @@ static void workqueue_sysfs_unregister(s +@@ -430,6 +435,31 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); if (({ assert_rcu_or_wq_mutex(wq); false; })) { } \ else @@ -111,7 +115,7 @@ Cc: Steven Rostedt <rostedt@goodmis.org> #ifdef CONFIG_DEBUG_OBJECTS_WORK static struct debug_obj_descr work_debug_descr; -@@ -836,10 +866,16 @@ static struct worker *first_idle_worker( +@@ -836,10 +866,16 @@ static struct worker *first_idle_worker(struct worker_pool *pool) */ static void wake_up_worker(struct worker_pool *pool) { @@ -129,7 +133,7 @@ Cc: Steven Rostedt <rostedt@goodmis.org> } /** -@@ -868,7 +904,7 @@ void wq_worker_running(struct task_struc +@@ -868,7 +904,7 @@ void wq_worker_running(struct task_struct *task) */ void wq_worker_sleeping(struct task_struct *task) { @@ -138,7 +142,7 @@ Cc: Steven Rostedt <rostedt@goodmis.org> struct worker_pool *pool; /* -@@ -885,26 +921,18 @@ void wq_worker_sleeping(struct task_stru +@@ -885,26 +921,18 @@ void wq_worker_sleeping(struct task_struct *task) return; worker->sleeping = 1; @@ -168,7 +172,7 @@ Cc: Steven Rostedt <rostedt@goodmis.org> } /** -@@ -1675,7 +1703,9 @@ static void worker_enter_idle(struct wor +@@ -1675,7 +1703,9 @@ static void worker_enter_idle(struct worker *worker) worker->last_active = jiffies; /* idle_list is LIFO */ @@ -178,7 +182,7 @@ Cc: Steven Rostedt <rostedt@goodmis.org> if (too_many_workers(pool) && !timer_pending(&pool->idle_timer)) mod_timer(&pool->idle_timer, jiffies + IDLE_WORKER_TIMEOUT); -@@ -1708,7 +1738,9 @@ static void worker_leave_idle(struct wor +@@ -1708,7 +1738,9 @@ static void worker_leave_idle(struct worker *worker) return; worker_clr_flags(worker, WORKER_IDLE); pool->nr_idle--; @@ -188,7 +192,7 @@ Cc: Steven Rostedt <rostedt@goodmis.org> } static struct worker *alloc_worker(int node) -@@ -1876,7 +1908,9 @@ static void destroy_worker(struct worker +@@ -1876,7 +1908,9 @@ static void destroy_worker(struct worker *worker) pool->nr_workers--; pool->nr_idle--; @@ -198,3 +202,6 @@ Cc: Steven Rostedt <rostedt@goodmis.org> worker->flags |= WORKER_DIE; wake_up_process(worker->task); } +-- +2.20.1 + diff --git a/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/debian/patches-rt/0264-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch index 5b7834030..39cedcf03 100644 --- a/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/debian/patches-rt/0264-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch @@ -1,21 +1,23 @@ +From a75a6d0bbac2c7cbe1e654021c59cb43299881b2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner <tglx@linutronix.de> Date: Fri, 3 Jul 2009 08:44:56 -0500 -Subject: signals: Allow rt tasks to cache one sigqueue struct -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz +Subject: [PATCH 264/266] signals: Allow rt tasks to cache one sigqueue struct +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> - --- - include/linux/sched.h | 2 + - include/linux/signal.h | 1 - kernel/exit.c | 2 - - kernel/fork.c | 1 - kernel/signal.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++--- + include/linux/sched.h | 2 ++ + include/linux/signal.h | 1 + + kernel/exit.c | 2 +- + kernel/fork.c | 1 + + kernel/signal.c | 69 +++++++++++++++++++++++++++++++++++++++--- 5 files changed, 70 insertions(+), 5 deletions(-) +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 5e87f7429c26..f61e536c5eb9 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -895,6 +895,8 @@ struct task_struct { @@ -27,9 +29,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> sigset_t blocked; sigset_t real_blocked; /* Restored if set_restore_sigmask() was used: */ +diff --git a/include/linux/signal.h b/include/linux/signal.h +index e4d01469ed60..746dd5d28c54 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h -@@ -245,6 +245,7 @@ static inline void init_sigpending(struc +@@ -245,6 +245,7 @@ static inline void init_sigpending(struct sigpending *sig) } extern void flush_sigqueue(struct sigpending *queue); @@ -37,9 +41,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */ static inline int valid_signal(unsigned long sig) +diff --git a/kernel/exit.c b/kernel/exit.c +index d607e23fd0c3..9874b088a11f 100644 --- a/kernel/exit.c +++ b/kernel/exit.c -@@ -160,7 +160,7 @@ static void __exit_signal(struct task_st +@@ -160,7 +160,7 @@ static void __exit_signal(struct task_struct *tsk) * Do this under ->siglock, we can race with another thread * doing sigqueue_free() if we have SIGQUEUE_PREALLOC signals. */ @@ -48,9 +54,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> tsk->sighand = NULL; spin_unlock(&sighand->siglock); +diff --git a/kernel/fork.c b/kernel/fork.c +index f62ae61064c7..1cd87e9c9f17 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1802,6 +1802,7 @@ static __latent_entropy struct task_stru +@@ -1802,6 +1802,7 @@ static __latent_entropy struct task_struct *copy_process( spin_lock_init(&p->alloc_lock); init_sigpending(&p->pending); @@ -58,6 +66,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> p->utime = p->stime = p->gtime = 0; #ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME +diff --git a/kernel/signal.c b/kernel/signal.c +index 57c48b3d1491..367e10c919d1 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -19,6 +19,7 @@ @@ -68,7 +78,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #include <linux/fs.h> #include <linux/tty.h> #include <linux/binfmts.h> -@@ -388,13 +389,30 @@ void task_join_group_stop(struct task_st +@@ -388,13 +389,30 @@ void task_join_group_stop(struct task_struct *task) } } @@ -100,7 +110,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> { struct sigqueue *q = NULL; struct user_struct *user; -@@ -411,7 +429,10 @@ static struct sigqueue * +@@ -411,7 +429,10 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi if (override_rlimit || atomic_read(&user->sigpending) <= task_rlimit(t, RLIMIT_SIGPENDING)) { @@ -112,7 +122,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } else { print_dropped_signal(sig); } -@@ -428,6 +449,13 @@ static struct sigqueue * +@@ -428,6 +449,13 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi return q; } @@ -126,7 +136,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static void __sigqueue_free(struct sigqueue *q) { if (q->flags & SIGQUEUE_PREALLOC) -@@ -437,6 +465,21 @@ static void __sigqueue_free(struct sigqu +@@ -437,6 +465,21 @@ static void __sigqueue_free(struct sigqueue *q) kmem_cache_free(sigqueue_cachep, q); } @@ -148,10 +158,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> void flush_sigqueue(struct sigpending *queue) { struct sigqueue *q; -@@ -450,6 +493,21 @@ void flush_sigqueue(struct sigpending *q +@@ -449,6 +492,21 @@ void flush_sigqueue(struct sigpending *queue) + } } - /* ++/* + * Called from __exit_signal. Flush tsk->pending and + * tsk->sigqueue_cache + */ @@ -166,11 +177,10 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> + kmem_cache_free(sigqueue_cachep, q); +} + -+/* + /* * Flush all pending signals for this kthread. */ - void flush_signals(struct task_struct *t) -@@ -572,7 +630,7 @@ static void collect_signal(int sig, stru +@@ -572,7 +630,7 @@ static void collect_signal(int sig, struct sigpending *list, siginfo_t *info, (info->si_code == SI_TIMER) && (info->si_sys_private); @@ -179,7 +189,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } else { /* * Ok, it wasn't in the queue. This must be -@@ -609,6 +667,8 @@ int dequeue_signal(struct task_struct *t +@@ -609,6 +667,8 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) bool resched_timer = false; int signr; @@ -198,3 +208,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (q) q->flags |= SIGQUEUE_PREALLOC; +-- +2.20.1 + diff --git a/debian/patches-rt/0265-Add-localversion-for-RT-release.patch b/debian/patches-rt/0265-Add-localversion-for-RT-release.patch new file mode 100644 index 000000000..1e127fa51 --- /dev/null +++ b/debian/patches-rt/0265-Add-localversion-for-RT-release.patch @@ -0,0 +1,22 @@ +From 4bf4dea23aa2921131627e921c3dd6bfd9e8f0dd Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner <tglx@linutronix.de> +Date: Fri, 8 Jul 2011 20:25:16 +0200 +Subject: [PATCH 265/266] Add localversion for -RT release +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz + +Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +--- + localversion-rt | 1 + + 1 file changed, 1 insertion(+) + create mode 100644 localversion-rt + +diff --git a/localversion-rt b/localversion-rt +new file mode 100644 +index 000000000000..1199ebade17b +--- /dev/null ++++ b/localversion-rt +@@ -0,0 +1 @@ ++-rt16 +-- +2.20.1 + diff --git a/debian/patches-rt/0266-Linux-4.19.31-rt18-REBASE.patch b/debian/patches-rt/0266-Linux-4.19.31-rt18-REBASE.patch new file mode 100644 index 000000000..84580993d --- /dev/null +++ b/debian/patches-rt/0266-Linux-4.19.31-rt18-REBASE.patch @@ -0,0 +1,20 @@ +From 6b52b8ce2b7051a19d8dba22b0bffec2d44cb0fd Mon Sep 17 00:00:00 2001 +From: Steven Rostedt <rostedt@goodmis.org> +Date: Wed, 27 Mar 2019 10:00:33 -0400 +Subject: [PATCH 266/266] Linux 4.19.31-rt18 REBASE +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.31-rt18.tar.xz + +--- + localversion-rt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/localversion-rt b/localversion-rt +index 1199ebade17b..9e7cd66d9f44 100644 +--- a/localversion-rt ++++ b/localversion-rt +@@ -1 +1 @@ +--rt16 ++-rt18 +-- +2.20.1 + diff --git a/debian/patches-rt/arm-unwind-use_raw_lock.patch b/debian/patches-rt/arm-unwind-use_raw_lock.patch deleted file mode 100644 index 12b6d6153..000000000 --- a/debian/patches-rt/arm-unwind-use_raw_lock.patch +++ /dev/null @@ -1,84 +0,0 @@ -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 20 Sep 2013 14:31:54 +0200 -Subject: arm/unwind: use a raw_spin_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz - -Mostly unwind is done with irqs enabled however SLUB may call it with -irqs disabled while creating a new SLUB cache. - -I had system freeze while loading a module which called -kmem_cache_create() on init. That means SLUB's __slab_alloc() disabled -interrupts and then - -->new_slab_objects() - ->new_slab() - ->setup_object() - ->setup_object_debug() - ->init_tracking() - ->set_track() - ->save_stack_trace() - ->save_stack_trace_tsk() - ->walk_stackframe() - ->unwind_frame() - ->unwind_find_idx() - =>spin_lock_irqsave(&unwind_lock); - - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/arm/kernel/unwind.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - ---- a/arch/arm/kernel/unwind.c -+++ b/arch/arm/kernel/unwind.c -@@ -93,7 +93,7 @@ extern const struct unwind_idx __start_u - static const struct unwind_idx *__origin_unwind_idx; - extern const struct unwind_idx __stop_unwind_idx[]; - --static DEFINE_SPINLOCK(unwind_lock); -+static DEFINE_RAW_SPINLOCK(unwind_lock); - static LIST_HEAD(unwind_tables); - - /* Convert a prel31 symbol to an absolute address */ -@@ -201,7 +201,7 @@ static const struct unwind_idx *unwind_f - /* module unwind tables */ - struct unwind_table *table; - -- spin_lock_irqsave(&unwind_lock, flags); -+ raw_spin_lock_irqsave(&unwind_lock, flags); - list_for_each_entry(table, &unwind_tables, list) { - if (addr >= table->begin_addr && - addr < table->end_addr) { -@@ -213,7 +213,7 @@ static const struct unwind_idx *unwind_f - break; - } - } -- spin_unlock_irqrestore(&unwind_lock, flags); -+ raw_spin_unlock_irqrestore(&unwind_lock, flags); - } - - pr_debug("%s: idx = %p\n", __func__, idx); -@@ -529,9 +529,9 @@ struct unwind_table *unwind_table_add(un - tab->begin_addr = text_addr; - tab->end_addr = text_addr + text_size; - -- spin_lock_irqsave(&unwind_lock, flags); -+ raw_spin_lock_irqsave(&unwind_lock, flags); - list_add_tail(&tab->list, &unwind_tables); -- spin_unlock_irqrestore(&unwind_lock, flags); -+ raw_spin_unlock_irqrestore(&unwind_lock, flags); - - return tab; - } -@@ -543,9 +543,9 @@ void unwind_table_del(struct unwind_tabl - if (!tab) - return; - -- spin_lock_irqsave(&unwind_lock, flags); -+ raw_spin_lock_irqsave(&unwind_lock, flags); - list_del(&tab->list); -- spin_unlock_irqrestore(&unwind_lock, flags); -+ raw_spin_unlock_irqrestore(&unwind_lock, flags); - - kfree(tab); - } diff --git a/debian/patches-rt/localversion.patch b/debian/patches-rt/localversion.patch deleted file mode 100644 index 5cb93385d..000000000 --- a/debian/patches-rt/localversion.patch +++ /dev/null @@ -1,14 +0,0 @@ -Subject: Add localversion for -RT release -From: Thomas Gleixner <tglx@linutronix.de> -Date: Fri, 08 Jul 2011 20:25:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - localversion-rt | 1 + - 1 file changed, 1 insertion(+) - ---- /dev/null -+++ b/localversion-rt -@@ -0,0 +1 @@ -+-rt16 diff --git a/debian/patches-rt/series b/debian/patches-rt/series index 40166035d..a3ec3e37d 100644 --- a/debian/patches-rt/series +++ b/debian/patches-rt/series @@ -1,17 +1,3 @@ -########################################################### -# DELTA against a known Linus release -########################################################### - -############################################################ -# UPSTREAM merged -############################################################ - -############################################################ -# POSTED by others -############################################################ -# AT91 -# Alexandre Belloni | [PATCH v7 0/7] clocksource: rework Atmel TCB timer driver -# Date: Thu, 13 Sep 2018 13:30:18 +0200 0001-ARM-at91-add-TCB-registers-definitions.patch 0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch 0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch @@ -19,418 +5,261 @@ 0005-ARM-at91-Implement-clocksource-selection.patch 0006-ARM-configs-at91-use-new-TCB-timer-driver.patch 0007-ARM-configs-at91-unselect-PIT.patch - -irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch -kthread-convert-worker-lock-to-raw-spinlock.patch -crypto-caam-qi-simplify-CGR-allocation-freeing.patch -sched-fair-Robustify-CFS-bandwidth-timer-locking.patch - -############################################################ -# POSTED -############################################################ -arm-convert-boot-lock-to-raw.patch -x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch -arm-kprobe-replace-patch_lock-to-raw-lock.patch -arm-unwind-use_raw_lock.patch -cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch -fscache-initialize-cookie-hash-table-raw-spinlocks.patch -Drivers-hv-vmbus-include-header-for-get_irq_regs.patch -percpu-include-irqflags.h-for-raw_local_irq_save.patch - -############################################################ -# Ready for posting -############################################################ -efi-Allow-efi-runtime.patch - -############################################################ -# Needs to address review feedback -############################################################ - -############################################################ -# Almost ready, needs final polishing -############################################################ -x86-efi-drop-task_lock-from-efi_switch_mm.patch -arm64-KVM-compute_layout-before-altenates-are-applie.patch -of-allocate-free-phandle-cache-outside-of-the-devtre.patch -mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch -EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch -kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch - -############################################################### -# Stuff broken upstream and upstream wants something different -############################################################### -NFSv4-replace-seqcount_t-with-a-seqlock_t.patch -kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch -add_migrate_disable.patch -sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch - -# Those two should vanish soon (not use PIT during bootup) -at91_dont_enable_disable_clock.patch -clocksource-tclib-allow-higher-clockrates.patch - -# Timekeeping split jiffies lock. Needs a good argument :) -timekeeping-split-jiffies-lock.patch - -# PTRACE/SIGNAL crap -signal-revert-ptrace-preempt-magic.patch - -# NETWORKING -net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch - -# The removal of NONRT helpers -dm-rq-remove-BUG_ON-irqs_disabled-check.patch -usb-do-not-disable-interrupts-in-giveback.patch - -################################################## -# REAL RT STUFF starts here -################################################## - -# Kconfig on/off -rt-preempt-base-config.patch -cpumask-disable-offstack-on-rt.patch -jump-label-rt.patch -kconfig-disable-a-few-options-rt.patch -lockdep-disable-self-test.patch -mm-disable-sloub-rt.patch -mutex-no-spin-on-rt.patch -rcu-disable-rcu-fast-no-hz-on-rt.patch -rcu-make-RCU_BOOST-default-on-RT.patch -sched-disable-rt-group-sched-on-rt.patch -net_disable_NET_RX_BUSY_POLL.patch -arm-disable-NEON-in-kernel-mode.patch -power-use-generic-rwsem-on-rt.patch -powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch -power-disable-highmem-on-rt.patch -mips-disable-highmem-on-rt.patch -x86-use-gen-rwsem-spinlocks-rt.patch -leds-trigger-disable-CPU-trigger-on-RT.patch -cpufreq-drop-K8-s-driver-from-beeing-selected.patch -md-disable-bcache.patch -efi-Disable-runtime-services-on-RT.patch - -# PRINTK -printk-kill.patch -printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch - -# PREEMPT NORT -preempt-nort-rt-variants.patch - -# local locks & migrate disable -futex-workaround-migrate_disable-enable-in-different.patch -rt-local-irq-lock.patch -locallock-provide-get-put-_locked_ptr-variants.patch - -# ANNOTATE local_irq_disable sites -mm-scatterlist-dont-disable-irqs-on-RT.patch - -# Sigh -oleg-signal-rt-fix.patch -x86-signal-delay-calling-signals-on-32bit.patch - -# BIT SPINLOCKS - SIGH -fs-replace-bh_uptodate_lock-for-rt.patch -fs-jbd-replace-bh_state-lock.patch - -# GENIRQ -list_bl.h-make-list-head-locking-RT-safe.patch -list_bl-fixup-bogus-lockdep-warning.patch -genirq-disable-irqpoll-on-rt.patch -genirq-force-threading.patch - -# MM page alloc -0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch -0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch -0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch -0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch -mm-page_alloc-rt-friendly-per-cpu-pages.patch - -# MM SWAP -mm-convert-swap-to-percpu-locked.patch -mm-perform-lru_add_drain_all-remotely.patch - -# MM vmstat -mm-make-vmstat-rt-aware.patch - -# MM memory -re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch - -# MM SLxB -mm-enable-slub.patch -slub-enable-irqs-for-no-wait.patch -slub-disable-SLUB_CPU_PARTIAL.patch - -# MM -mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch -mm-memcontrol-do_not_disable_irq.patch -mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch -# check in next release if it is still required. -x86-mm-pat-disable-preemption-__split_large_page-aft.patch - -# RADIX TREE -radix-tree-use-local-locks.patch - -# TIMERS -timers-prepare-for-full-preemption.patch - -# KVM require constant freq TSC (smp function call -> cpufreq) -x86-kvm-require-const-tsc-for-rt.patch -# -# SIMPLE WAITQUEUE -pci-switchtec-Don-t-use-completion-s-wait-queue.patch -wait.h-include-atomic.h.patch -work-simple-Simple-work-queue-implemenation.patch -work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch -completion-use-simple-wait-queues.patch -fs-aio-simple-simple-work.patch -genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch - -# HRTIMERS -time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch -hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch -hrtimers-prepare-full-preemption.patch -hrtimer-by-timers-by-default-into-the-softirq-context.patch -sched-fair-Make-the-hrtimers-non-hard-again.patch -hrtimer-Move-schedule_work-call-to-helper-thread.patch -hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch - -# POSIX-CPU-TIMERS -posix-timers-thread-posix-cpu-timers-on-rt.patch - -# SCHEDULER -sched-delay-put-task.patch -sched-limit-nr-migrate.patch -sched-mmdrop-delayed.patch -kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch -sched-rt-mutex-wakeup.patch -sched-might-sleep-do-not-account-rcu-depth.patch -cond-resched-lock-rt-tweak.patch -sched-disable-ttwu-queue.patch -sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch -rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch - -# MIGRATE DISABLE AND PER CPU -hotplug-light-get-online-cpus.patch -ftrace-migrate-disable-tracing.patch - -# LOCKDEP -lockdep-no-softirq-accounting-on-rt.patch - -# SOFTIRQ -tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch -softirq-preempt-fix-3-re.patch -softirq-disable-softirq-stacks-for-rt.patch -softirq-split-locks.patch -net-core-use-local_bh_disable-in-netif_rx_ni.patch -irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch -softirq-split-timer-softirqs-out-of-ksoftirqd.patch -softirq-Avoid-local_softirq_pending-messages-if-ksof.patch -softirq-Avoid-local_softirq_pending-messages-if-task.patch -rtmutex-trylock-is-okay-on-RT.patch - -# compile fix due to rtmutex locks -fs-nfs-turn-rmdir_sem-into-a-semaphore.patch - -# FUTEX/RTMUTEX -rtmutex-futex-prepare-rt.patch -futex-requeue-pi-fix.patch -futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch - -# RTMUTEX -pid.h-include-atomic.h.patch -arm-include-definition-for-cpumask_t.patch -locking-locktorture-Do-NOT-include-rwlock.h-directly.patch -rtmutex-lock-killable.patch -rtmutex-Make-lock_killable-work.patch -spinlock-types-separate-raw.patch -rtmutex-avoid-include-hell.patch -rtmutex_dont_include_rcu.patch -rtmutex-Provide-rt_mutex_slowlock_locked.patch -rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch -rtmutex-add-sleeping-lock-implementation.patch -rtmutex-add-mutex-implementation-based-on-rtmutex.patch -rtmutex-add-rwsem-implementation-based-on-rtmutex.patch -rtmutex-add-rwlock-implementation-based-on-rtmutex.patch -rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch -rtmutex-wire-up-RT-s-locking.patch -rtmutex-add-ww_mutex-addon-for-mutex-rt.patch -# Allow to enable RT-FULL after sleeping spinlocks are wired up -kconfig-preempt-rt-full.patch -locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch -locking-rt-mutex-Flush-block-plug-on-__down_read.patch -locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch -ptrace-fix-ptrace-vs-tasklist_lock-race.patch -rtmutex-annotate-sleeping-lock-context.patch -sched-migrate_disable-fallback-to-preempt_disable-in.patch -locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch - -# RCU -peter_zijlstra-frob-rcu.patch -rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch -patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch -rcu-Eliminate-softirq-processing-from-rcutree.patch -srcu-use-cpu_online-instead-custom-check.patch -srcu-replace-local_irqsave-with-a-locallock.patch -rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch - -# DRIVERS SERIAL -drivers-tty-fix-omap-lock-crap.patch -drivers-tty-pl011-irq-disable-madness.patch -tty-serial-pl011-warning-about-uninitialized.patch -rt-serial-warn-fix.patch -tty-serial-8250-don-t-take-the-trylock-during-oops.patch - -# FS -peterz-percpu-rwsem-rt.patch -mm-protect-activate-switch-mm.patch -fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch -fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch -squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch - -# X86 -thermal-Defer-thermal-wakups-to-threads.patch -x86-fpu-Disable-preemption-around-local_bh_disable.patch - -# CPU get light -epoll-use-get-cpu-light.patch -mm-vmalloc-use-get-cpu-light.patch -block-mq-use-cpu_light.patch -block-mq-drop-preempt-disable.patch -block-mq-don-t-complete-requests-via-IPI.patch -md-raid5-percpu-handling-rt-aware.patch - -# CPU CHILL -rt-introduce-cpu-chill.patch -hrtimer-Don-t-lose-state-in-cpu_chill.patch -hrtimer-cpu_chill-save-task-state-in-saved_state.patch - -# block -block-blk-mq-move-blk_queue_usage_counter_release-in.patch - -# BLOCK LIVELOCK PREVENTION -block-use-cpu-chill.patch - -# FS LIVELOCK PREVENTION -fs-dcache-use-cpu-chill-in-trylock-loops.patch -net-use-cpu-chill.patch -fs-dcache-use-swait_queue-instead-of-waitqueue.patch - -# WORKQUEUE more fixes -workqueue-use-rcu.patch -workqueue-use-locallock.patch -work-queue-work-around-irqsafe-timer-optimization.patch -workqueue-distangle-from-rq-lock.patch - -# DEBUGOBJECTS -debugobjects-rt.patch - -# SEQLOCKS -seqlock-prevent-rt-starvation.patch - -# NETWORKING -sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch -skbufhead-raw-lock.patch -net-move-xmit_recursion-to-per-task-variable-on-RT.patch -net-provide-a-way-to-delegate-processing-a-softirq-t.patch -net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch -net-Qdisc-use-a-seqlock-instead-seqcount.patch -net-add-back-the-missing-serialization-in-ip_send_un.patch -net-add-a-lock-around-icmp_sk.patch -net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch - -# irqwork -irqwork-push_most_work_into_softirq_context.patch - -# CONSOLE. NEEDS more thought !!! -printk-rt-aware.patch -kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch -HACK-printk-drop-the-logbuf_lock-more-often.patch - -# ARM -ARM-enable-irq-in-translation-section-permission-fau.patch -genirq-update-irq_set_irqchip_state-documentation.patch -KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch -arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch - -# KGDB -kgb-serial-hackaround.patch - -# SYSFS - RT indicator -sysfs-realtime-entry.patch - -# KMAP/HIGHMEM -mm-rt-kmap-atomic-scheduling.patch -x86-highmem-add-a-already-used-pte-check.patch -arm-highmem-flush-tlb-on-unmap.patch -arm-enable-highmem-for-rt.patch - -# SCSI/FCOE -scsi-fcoe-rt-aware.patch - -# crypto drivers -x86-crypto-reduce-preempt-disabled-regions.patch -crypto-Reduce-preempt-disabled-regions-more-algos.patch -crypto-limit-more-FPU-enabled-sections.patch -crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch -crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch - -# RANDOM -panic-disable-random-on-rt.patch -x86-stackprot-no-random-on-rt.patch -random-make-it-work-on-rt.patch -random-avoid-preempt_disable-ed-section.patch - -# HOTPLUG -cpu-hotplug--Implement-CPU-pinning.patch -sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch -hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch - -# NET -upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch -net-another-local-irq-disable-alloc-atomic-headache.patch -net-core-protect-users-of-napi_alloc_cache-against-r.patch -net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch -net-make-devnet_rename_seq-a-mutex.patch - -# LOCKDEP -lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch -lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch - -# PREEMPT LAZY -preempt-lazy-support.patch -ftrace-Fix-trace-header-alignment.patch -x86-preempt-lazy.patch -x86-lazy-preempt-properly-check-against-preempt-mask.patch -x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch -arm-preempt-lazy-support.patch -powerpc-preempt-lazy-support.patch -arch-arm64-Add-lazy-preempt-support.patch - -# DRIVERS -connector-cn_proc-Protect-send_msg-with-a-local-lock.patch -drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch -drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch -drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch -tpm_tis-fix-stall-after-iowrite-s.patch -watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch - -# I915 -drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch -drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch -drm-i915-disable-tracing-on-RT.patch -drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch - -# CGROUPS -cgroups-use-simple-wait-in-css_release.patch -cpuset-Convert-callback_lock-to-raw_spinlock_t.patch - -# Security -apparmor-use-a-locallock-instead-preempt_disable.patch - -# WORKQUEUE SIGH -workqueue-prevent-deadlock-stall.patch - -# Nice to have -signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch - -# Add RT to version -localversion.patch +0008-irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch +0009-kthread-convert-worker-lock-to-raw-spinlock.patch +0010-crypto-caam-qi-simplify-CGR-allocation-freeing.patch +0011-sched-fair-Robustify-CFS-bandwidth-timer-locking.patch +0012-arm-Convert-arm-boot_lock-to-raw.patch +0013-x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch +0014-arm-kprobe-replace-patch_lock-to-raw-lock.patch +0016-cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch +0017-fscache-initialize-cookie-hash-table-raw-spinlocks.patch +0018-Drivers-hv-vmbus-include-header-for-get_irq_regs.patch +0019-percpu-include-irqflags.h-for-raw_local_irq_save.patch +0020-efi-Allow-efi-runtime.patch +0021-x86-efi-drop-task_lock-from-efi_switch_mm.patch +0022-arm64-KVM-compute_layout-before-altenates-are-applie.patch +0023-of-allocate-free-phandle-cache-outside-of-the-devtre.patch +0024-mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch +0025-EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch +0026-kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch +0027-NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +0028-kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +0029-kernel-sched-core-add-migrate_disable.patch +0030-sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch +0031-arm-at91-do-not-disable-enable-clocks-in-a-row.patch +0032-clocksource-TCLIB-Allow-higher-clock-rates-for-clock.patch +0033-timekeeping-Split-jiffies-seqlock.patch +0034-signal-Revert-ptrace-preempt-magic.patch +0035-net-sched-Use-msleep-instead-of-yield.patch +0036-dm-rq-remove-BUG_ON-irqs_disabled-check.patch +0037-usb-do-no-disable-interrupts-in-giveback.patch +0038-rt-Provide-PREEMPT_RT_BASE-config-switch.patch +0039-cpumask-Disable-CONFIG_CPUMASK_OFFSTACK-for-RT.patch +0040-jump-label-disable-if-stop_machine-is-used.patch +0041-kconfig-Disable-config-options-which-are-not-RT-comp.patch +0042-lockdep-disable-self-test.patch +0043-mm-Allow-only-slub-on-RT.patch +0044-locking-Disable-spin-on-owner-for-RT.patch +0045-rcu-Disable-RCU_FAST_NO_HZ-on-RT.patch +0046-rcu-make-RCU_BOOST-default-on-RT.patch +0047-sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch +0048-net-core-disable-NET_RX_BUSY_POLL.patch +0049-arm-disable-NEON-in-kernel-mode.patch +0050-powerpc-Use-generic-rwsem-on-RT.patch +0051-powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +0052-powerpc-Disable-highmem-on-RT.patch +0053-mips-Disable-highmem-on-RT.patch +0054-x86-Use-generic-rwsem_spinlocks-on-rt.patch +0055-leds-trigger-disable-CPU-trigger-on-RT.patch +0056-cpufreq-drop-K8-s-driver-from-beeing-selected.patch +0057-md-disable-bcache.patch +0058-efi-Disable-runtime-services-on-RT.patch +0059-printk-Add-a-printk-kill-switch.patch +0060-printk-Add-force_early_printk-boot-param-to-help-wit.patch +0061-preempt-Provide-preempt_-_-no-rt-variants.patch +0062-futex-workaround-migrate_disable-enable-in-different.patch +0063-rt-Add-local-irq-locks.patch +0064-locallock-provide-get-put-_locked_ptr-variants.patch +0065-mm-scatterlist-Do-not-disable-irqs-on-RT.patch +0066-signal-x86-Delay-calling-signals-in-atomic.patch +0067-x86-signal-delay-calling-signals-on-32bit.patch +0068-buffer_head-Replace-bh_uptodate_lock-for-rt.patch +0069-fs-jbd-jbd2-Make-state-lock-and-journal-head-lock-rt.patch +0070-list_bl-Make-list-head-locking-RT-safe.patch +0071-list_bl-fixup-bogus-lockdep-warning.patch +0072-genirq-Disable-irqpoll-on-rt.patch +0073-genirq-Force-interrupt-thread-on-RT.patch +0074-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +0075-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +0076-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch +0077-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch +0078-mm-page_alloc-rt-friendly-per-cpu-pages.patch +0079-mm-swap-Convert-to-percpu-locked.patch +0080-mm-perform-lru_add_drain_all-remotely.patch +0081-mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch +0082-ARM-Initialize-split-page-table-locks-for-vector-pag.patch +0083-mm-Enable-SLUB-for-RT.patch +0084-slub-Enable-irqs-for-__GFP_WAIT.patch +0085-slub-Disable-SLUB_CPU_PARTIAL.patch +0086-mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +0087-mm-memcontrol-Replace-local_irq_disable-with-local-l.patch +0088-mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch +0089-x86-mm-pat-disable-preemption-__split_large_page-aft.patch +0090-radix-tree-use-local-locks.patch +0091-timers-Prepare-for-full-preemption.patch +0092-x86-kvm-Require-const-tsc-for-RT.patch +0093-pci-switchtec-Don-t-use-completion-s-wait-queue.patch +0094-wait.h-include-atomic.h.patch +0095-work-simple-Simple-work-queue-implemenation.patch +0096-work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch +0097-completion-Use-simple-wait-queues.patch +0098-fs-aio-simple-simple-work.patch +0099-genirq-Do-not-invoke-the-affinity-callback-via-a-wor.patch +0100-time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch +0101-hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch +0102-hrtimers-Prepare-full-preemption.patch +0103-hrtimer-by-timers-by-default-into-the-softirq-contex.patch +0104-sched-fair-Make-the-hrtimers-non-hard-again.patch +0105-hrtimer-Move-schedule_work-call-to-helper-thread.patch +0106-hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch +0107-posix-timers-Thread-posix-cpu-timers-on-rt.patch +0108-sched-Move-task_struct-cleanup-to-RCU.patch +0109-sched-Limit-the-number-of-task-migrations-per-batch.patch +0110-sched-Move-mmdrop-to-RCU-on-RT.patch +0111-kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +0112-sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch +0113-sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch +0114-sched-Use-the-proper-LOCK_OFFSET-for-cond_resched.patch +0115-sched-Disable-TTWU_QUEUE-on-RT.patch +0116-sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch +0117-rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch +0118-hotplug-Lightweight-get-online-cpus.patch +0119-trace-Add-migrate-disabled-counter-to-tracing-output.patch +0120-lockdep-Make-it-RT-aware.patch +0121-tasklet-Prevent-tasklets-from-going-into-infinite-sp.patch +0122-softirq-Check-preemption-after-reenabling-interrupts.patch +0123-softirq-Disable-softirq-stacks-for-RT.patch +0124-softirq-Split-softirq-locks.patch +0125-net-core-use-local_bh_disable-in-netif_rx_ni.patch +0126-genirq-Allow-disabling-of-softirq-processing-in-irq-.patch +0127-softirq-split-timer-softirqs-out-of-ksoftirqd.patch +0128-softirq-Avoid-local_softirq_pending-messages-if-ksof.patch +0129-softirq-Avoid-local_softirq_pending-messages-if-task.patch +0130-rtmutex-trylock-is-okay-on-RT.patch +0131-fs-nfs-turn-rmdir_sem-into-a-semaphore.patch +0132-rtmutex-Handle-the-various-new-futex-race-conditions.patch +0133-futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch +0134-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch +0135-pid.h-include-atomic.h.patch +0136-arm-include-definition-for-cpumask_t.patch +0137-locking-locktorture-Do-NOT-include-rwlock.h-directly.patch +0138-rtmutex-Add-rtmutex_lock_killable.patch +0139-rtmutex-Make-lock_killable-work.patch +0140-spinlock-Split-the-lock-types-header.patch +0141-rtmutex-Avoid-include-hell.patch +0142-rbtree-don-t-include-the-rcu-header.patch +0143-rtmutex-Provide-rt_mutex_slowlock_locked.patch +0144-rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch +0145-rtmutex-add-sleeping-lock-implementation.patch +0146-rtmutex-add-mutex-implementation-based-on-rtmutex.patch +0147-rtmutex-add-rwsem-implementation-based-on-rtmutex.patch +0148-rtmutex-add-rwlock-implementation-based-on-rtmutex.patch +0149-rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch +0150-rtmutex-wire-up-RT-s-locking.patch +0151-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +0152-kconfig-Add-PREEMPT_RT_FULL.patch +0153-locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch +0154-locking-rt-mutex-Flush-block-plug-on-__down_read.patch +0155-locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch +0156-ptrace-fix-ptrace-vs-tasklist_lock-race.patch +0157-rtmutex-annotate-sleeping-lock-context.patch +0158-sched-migrate_disable-fallback-to-preempt_disable-in.patch +0159-locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +0160-rcu-Frob-softirq-test.patch +0161-rcu-Merge-RCU-bh-into-RCU-preempt.patch +0162-rcu-Make-ksoftirqd-do-RCU-quiescent-states.patch +0163-rcu-Eliminate-softirq-processing-from-rcutree.patch +0164-srcu-use-cpu_online-instead-custom-check.patch +0165-srcu-replace-local_irqsave-with-a-locallock.patch +0166-rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch +0167-tty-serial-omap-Make-the-locking-RT-aware.patch +0168-tty-serial-pl011-Make-the-locking-work-on-RT.patch +0169-tty-serial-pl011-explicitly-initialize-the-flags-var.patch +0170-rt-Improve-the-serial-console-PASS_LIMIT.patch +0171-tty-serial-8250-don-t-take-the-trylock-during-oops.patch +0172-locking-percpu-rwsem-Remove-preempt_disable-variants.patch +0173-mm-Protect-activate_mm-by-preempt_-disable-enable-_r.patch +0174-fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-ini.patch +0175-fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +0176-squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch +0177-thermal-Defer-thermal-wakups-to-threads.patch +0178-x86-fpu-Disable-preemption-around-local_bh_disable.patch +0179-fs-epoll-Do-not-disable-preemption-on-RT.patch +0180-mm-vmalloc-Another-preempt-disable-region-which-suck.patch +0181-block-mq-use-cpu_light.patch +0182-block-mq-do-not-invoke-preempt_disable.patch +0183-block-mq-don-t-complete-requests-via-IPI.patch +0184-md-raid5-Make-raid5_percpu-handling-RT-aware.patch +0185-rt-Introduce-cpu_chill.patch +0186-hrtimer-Don-t-lose-state-in-cpu_chill.patch +0187-hrtimer-cpu_chill-save-task-state-in-saved_state.patch +0188-block-blk-mq-move-blk_queue_usage_counter_release-in.patch +0189-block-Use-cpu_chill-for-retry-loops.patch +0190-fs-dcache-Use-cpu_chill-in-trylock-loops.patch +0191-net-Use-cpu_chill-instead-of-cpu_relax.patch +0192-fs-dcache-use-swait_queue-instead-of-waitqueue.patch +0193-workqueue-Use-normal-rcu.patch +0194-workqueue-Use-local-irq-lock-instead-of-irq-disable-.patch +0195-workqueue-Prevent-workqueue-versus-ata-piix-livelock.patch +0196-sched-Distangle-worker-accounting-from-rqlock.patch +0197-debugobjects-Make-RT-aware.patch +0198-seqlock-Prevent-rt-starvation.patch +0199-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch +0200-net-Use-skbufhead-with-raw-lock.patch +0201-net-move-xmit_recursion-to-per-task-variable-on-RT.patch +0202-net-provide-a-way-to-delegate-processing-a-softirq-t.patch +0203-net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +0204-net-Qdisc-use-a-seqlock-instead-seqcount.patch +0205-net-add-back-the-missing-serialization-in-ip_send_un.patch +0206-net-add-a-lock-around-icmp_sk.patch +0207-net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch +0208-irqwork-push-most-work-into-softirq-context.patch +0209-printk-Make-rt-aware.patch +0210-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch +0211-printk-Drop-the-logbuf_lock-more-often.patch +0212-ARM-enable-irq-in-translation-section-permission-fau.patch +0213-genirq-update-irq_set_irqchip_state-documentation.patch +0214-KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +0215-arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch +0216-kgdb-serial-Short-term-workaround.patch +0217-sysfs-Add-sys-kernel-realtime-entry.patch +0218-mm-rt-kmap_atomic-scheduling.patch +0219-x86-highmem-Add-a-already-used-pte-check.patch +0220-arm-highmem-Flush-tlb-on-unmap.patch +0221-arm-Enable-highmem-for-rt.patch +0222-scsi-fcoe-Make-RT-aware.patch +0223-x86-crypto-Reduce-preempt-disabled-regions.patch +0224-crypto-Reduce-preempt-disabled-regions-more-algos.patch +0225-crypto-limit-more-FPU-enabled-sections.patch +0226-crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch +0227-crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch +0228-panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch +0229-x86-stackprotector-Avoid-random-pool-on-rt.patch +0230-random-Make-it-work-on-rt.patch +0231-random-avoid-preempt_disable-ed-section.patch +0232-cpu-hotplug-Implement-CPU-pinning.patch +0233-sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch +0234-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +0235-net-Remove-preemption-disabling-in-netif_rx.patch +0236-net-Another-local_irq_disable-kmalloc-headache.patch +0237-net-core-protect-users-of-napi_alloc_cache-against-r.patch +0238-net-netfilter-Serialize-xt_write_recseq-sections-on-.patch +0239-net-Add-a-mutex-around-devnet_rename_seq.patch +0240-lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch +0241-lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +0242-sched-Add-support-for-lazy-preemption.patch +0243-ftrace-Fix-trace-header-alignment.patch +0244-x86-Support-for-lazy-preemption.patch +0245-x86-lazy-preempt-properly-check-against-preempt-mask.patch +0246-x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch +0247-arm-Add-support-for-lazy-preemption.patch +0248-powerpc-Add-support-for-lazy-preemption.patch +0249-arch-arm64-Add-lazy-preempt-support.patch +0250-connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +0251-drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +0252-drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +0253-drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch +0254-tpm_tis-fix-stall-after-iowrite-s.patch +0255-watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch +0256-drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch +0257-drm-i915-Use-local_lock-unlock_irq-in-intel_pipe_upd.patch +0258-drm-i915-disable-tracing-on-RT.patch +0259-drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch +0260-cgroups-use-simple-wait-in-css_release.patch +0261-cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +0262-apparmor-use-a-locallock-instead-preempt_disable.patch +0263-workqueue-Prevent-deadlock-stall-on-RT.patch +0264-signals-Allow-rt-tasks-to-cache-one-sigqueue-struct.patch +0265-Add-localversion-for-RT-release.patch +0266-Linux-4.19.31-rt18-REBASE.patch |