[linux] 01/01: [rt] Update to 4.9-rt1 and reenable
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Fri Dec 23 20:25:42 UTC 2016
This is an automated email from the git hooks/post-receive script.
ukleinek pushed a commit to branch master
in repository linux.
commit 61b71464b392f5c0c2759cff6b7fab693fc14be4
Author: Uwe Kleine-König <ukleinek at debian.org>
Date: Fri Dec 23 21:25:24 2016 +0100
[rt] Update to 4.9-rt1 and reenable
---
debian/changelog | 3 +-
debian/config/defines | 2 +-
...e-lock-unlock-symetry-versus-pi_lock-and-.patch | 43 -
...irq-in-translation-section-permission-fau.patch | 2 +-
.../all/rt/ARM-imx-always-use-TWD-on-IMX6Q.patch | 31 -
...CK-printk-drop-the-logbuf_lock-more-often.patch | 12 +-
...64-downgrade-preempt_disable-d-region-to-.patch | 8 +-
...lapic-mark-LAPIC-timer-handler-as-irqsafe.patch | 4 +-
...NFSv4-replace-seqcount_t-with-a-seqlock_t.patch | 12 +-
...vert-acpi_gbl_hardware-lock-back-to-a-raw.patch | 6 +-
.../rt/arch-arm64-Add-lazy-preempt-support.patch | 43 +-
...azy-preempt-add-TIF_NEED_RESCHED_LAZY-to-.patch | 77 --
...t-remove-irq-handler-when-clock-is-unused.patch | 4 +-
...-at91-tclib-default-to-tclib-timer-for-rt.patch | 2 +-
.../all/rt/arm-convert-boot-lock-to-raw.patch | 2 +-
.../all/rt/arm-enable-highmem-for-rt.patch | 2 +-
.../all/rt/arm-highmem-flush-tlb-on-unmap.patch | 2 +-
.../rt/arm-include-definition-for-cpumask_t.patch | 25 +
...arm-kprobe-replace-patch_lock-to-raw-lock.patch | 2 +-
...rm-lazy-preempt-correct-resched-condition.patch | 32 -
.../features/all/rt/arm-preempt-lazy-support.patch | 2 +-
.../features/all/rt/arm-unwind-use_raw_lock.patch | 2 +-
.../rt/arm64-xen--Make-XEN-depend-on-non-rt.patch | 4 +-
.../all/rt/at91_dont_enable_disable_clock.patch | 2 +-
.../all/rt/ata-disable-interrupts-if-non-rt.patch | 2 +-
...st-pone-notifier-to-POST_D.patchto-POST_D.patch | 84 --
.../features/all/rt/block-blk-mq-use-swait.patch | 8 +-
.../block-mq-don-t-complete-requests-via-IPI.patch | 23 +-
.../all/rt/block-mq-drop-preempt-disable.patch | 12 +-
.../features/all/rt/block-mq-use-cpu_light.patch | 4 +-
.../block-shorten-interrupt-disabled-regions.patch | 12 +-
.../features/all/rt/block-use-cpu-chill.patch | 2 +-
...trace_btrfs_all_work_done-from-normal_wor.patch | 39 +
...-free-and-trace-point-in-run_ordered_work.patch | 34 +
.../all/rt/bug-rt-dependend-variants.patch | 2 +-
...ps-scheduling-while-atomic-in-cgroup-code.patch | 14 +-
.../cgroups-use-simple-wait-in-css_release.patch | 8 +-
...-drivers-timer-atmel-pit-fix-double-free_.patch | 2 +-
...clocksource-tclib-allow-higher-clockrates.patch | 2 +-
.../all/rt/completion-use-simple-wait-queues.patch | 20 +-
.../all/rt/cond-resched-lock-rt-tweak.patch | 2 +-
.../features/all/rt/cond-resched-softirq-rt.patch | 8 +-
...n_proc-Protect-send_msg-with-a-local-lock.patch | 2 +-
...g-Document-why-PREEMPT_RT-uses-a-spinlock.patch | 4 +-
...ke-hotplug-lock-a-sleeping-spinlock-on-rt.patch | 16 +-
.../features/all/rt/cpu-rt-rework-cpu-down.patch | 40 +-
...l-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch | 2 +-
.../all/rt/cpu_down_move_migrate_enable_back.patch | 6 +-
...req-drop-K8-s-driver-from-beeing-selected.patch | 2 +-
.../all/rt/cpumask-disable-offstack-on-rt.patch | 4 +-
...educe-preempt-disabled-regions-more-algos.patch | 2 +-
.../all/rt/crypto-ccp-remove-rwlocks_types.h.patch | 23 -
.../patches/features/all/rt/debugobjects-rt.patch | 2 +-
.../patches/features/all/rt/dm-make-rt-aware.patch | 6 +-
...ck-zram-Replace-bit-spinlocks-with-rtmute.patch | 2 +-
.../rt/drivers-net-8139-disable-irq-nosync.patch | 2 +-
.../all/rt/drivers-net-fix-livelock-issues.patch | 127 --
.../rt/drivers-net-vortex-fix-locking-issues.patch | 2 +-
...ers-random-reduce-preempt-disabled-region.patch | 2 +-
.../all/rt/drivers-tty-fix-omap-lock-crap.patch | 2 +-
.../rt/drivers-tty-pl011-irq-disable-madness.patch | 6 +-
...m-Don-t-disable-preemption-in-zcomp_strea.patch | 2 +-
...15-drop-trace_i915_gem_ring_dispatch-onrt.patch | 4 +-
...ock_irq()_in_intel_pipe_update_startend().patch | 22 +-
...empt_disableenable_rt()_where_recommended.patch | 6 +-
...ack-don-t-disable-preemption-during-trace.patch | 78 --
.../features/all/rt/epoll-use-get-cpu-light.patch | 2 +-
.../all/rt/fs-aio-simple-simple-work.patch | 10 +-
.../features/all/rt/fs-block-rt-support.patch | 2 +-
.../features/all/rt/fs-dcache-include-wait.h.patch | 2 +-
.../rt/fs-dcache-init-in_lookup_hashtable.patch | 2 +-
.../fs-dcache-use-cpu-chill-in-trylock-loops.patch | 6 +-
...ache-use-swait_queue-instead-of-waitqueue.patch | 12 +-
.../all/rt/fs-jbd-replace-bh_state-lock.patch | 2 +-
...bd2-pull-your-plug-when-waiting-for-space.patch | 2 +-
.../all/rt/fs-namespace-preemption-fix.patch | 4 +-
.../fs-nfs-turn-rmdir_sem-into-a-semaphore.patch | 6 +-
.../all/rt/fs-ntfs-disable-interrupt-non-rt.patch | 2 +-
.../rt/fs-replace-bh_uptodate_lock-for-rt.patch | 4 +-
.../all/rt/ftrace-Fix-trace-header-alignment.patch | 2 +-
.../all/rt/ftrace-migrate-disable-tracing.patch | 2 +-
...e-lock-unlock-symetry-versus-pi_lock-and-.patch | 4 +-
.../features/all/rt/futex-requeue-pi-fix.patch | 4 +-
.../all/rt/genirq-disable-irqpoll-on-rt.patch | 2 +-
...ot-invoke-the-affinity-callback-via-a-wor.patch | 2 +-
.../features/all/rt/genirq-force-threading.patch | 4 +-
...pdate-irq_set_irqchip_state-documentation.patch | 2 +-
.../rt/gpu_don_t_check_for_the_lock_owner.patch | 2 +-
...-set_cpus_allowed_ptr-in-sync_unplug_thre.patch | 4 +-
.../all/rt/hotplug-light-get-online-cpus.patch | 16 +-
...lug-sync_unplug-no-27-5cn-27-in-task-name.patch | 4 +-
.../all/rt/hotplug-use-migrate-disable.patch | 6 +-
...-Move-schedule_work-call-to-helper-thread.patch | 2 +-
.../all/rt/hrtimer-enfore-64byte-alignment.patch | 2 +-
...up-hrtimer-callback-changes-for-preempt-r.patch | 4 +-
.../all/rt/hrtimers-prepare-full-preemption.patch | 2 +-
...tor-Don-t-ignore-threshold-module-paramet.patch | 26 -
...tor-Update-hwlat_detector-to-add-outer-lo.patch | 126 --
...tector-Use-thread-instead-of-stop-machine.patch | 184 ---
...tector-Use-trace_clock_local-if-available.patch | 93 --
debian/patches/features/all/rt/hwlatdetect.patch | 1348 --------------------
.../i2c-omap-drop-the-lock-hard-irq-context.patch | 34 -
...warning-from-i915-when-running-on-PREEMPT.patch | 4 +-
.../patches/features/all/rt/i915_compile_fix.patch | 24 -
.../all/rt/ide-use-nort-local-irq-variants.patch | 2 +-
.../all/rt/idr-use-local-lock-for-protection.patch | 2 +-
.../rt/infiniband-mellanox-ib-use-nort-irq.patch | 2 +-
.../infiniband-ulp-ipoib-remove-pkey_mutex.patch | 26 -
.../all/rt/inpt-gameport-use-local-irq-nort.patch | 2 +-
.../rt/introduce_migrate_disable_cpu_light.patch | 26 +-
.../all/rt/iommu-amd--Use-WARN_ON_NORT.patch | 6 +-
...don-t-disable-preempt-around-this_cpu_ptr.patch | 2 +-
...don-t-disable-preemption-while-accessing-.patch | 6 +-
...-msg-Implement-lockless-pipelined-wakeups.patch | 228 ----
.../all/rt/ipc-sem-rework-semaphore-wakeups.patch | 2 +-
...-softirq-processing-in-irq-thread-context.patch | 4 +-
...irqwork-Move-irq-safe-work-to-irq-context.patch | 4 +-
...qwork-push_most_work_into_softirq_context.patch | 6 +-
debian/patches/features/all/rt/jump-label-rt.patch | 2 +-
.../all/rt/kconfig-disable-a-few-options-rt.patch | 2 +-
.../features/all/rt/kconfig-preempt-rt-full.patch | 4 +-
.../kernel-SRCU-provide-a-static-initializer.patch | 2 +-
...fix-cpu-down-problem-if-kthread-s-cpu-is-.patch | 14 +-
.../rt/kernel-futex-don-t-deboost-too-early.patch | 4 +-
...plug-restore-original-cpu-mask-oncpu-down.patch | 10 +-
...ate_disable-do-fastpath-in-atomic-irqs-of.patch | 6 +-
...-mark-perf_cpu_context-s-timer-as-irqsafe.patch | 4 +-
...tk-Don-t-try-to-print-from-IRQ-NMI-region.patch | 6 +-
...tex-only-warn-once-on-a-try-lock-from-bad.patch | 27 -
...d-move-stack-kprobe-clean-up-to-__put_tas.patch | 61 +
.../rt/kernel-softirq-unlock-with-irqs-on.patch | 4 +-
.../features/all/rt/kgb-serial-hackaround.patch | 4 +-
debian/patches/features/all/rt/latency-hist.patch | 18 +-
.../latency_hist-update-sched_wakeup-probe.patch | 2 +-
.../all/rt/latencyhist-disable-jump-labels.patch | 2 +-
.../leds-trigger-disable-CPU-trigger-on-RT.patch | 2 +-
debian/patches/features/all/rt/lglocks-rt.patch | 200 ---
.../rt/list_bl-fixup-bogus-lockdep-warning.patch | 2 +-
.../list_bl.h-make-list-head-locking-RT-safe.patch | 2 +-
.../all/rt/local-irq-rt-depending-variants.patch | 2 +-
.../all/rt/locallock-add-local_lock_on.patch | 2 +-
debian/patches/features/all/rt/localversion.patch | 4 +-
...et-gcc-about-dangerous-__builtin_return_a.patch | 111 --
.../rt/lockdep-no-softirq-accounting-on-rt.patch | 6 +-
...ftest-fix-warnings-due-to-missing-PREEMPT.patch | 2 +-
...-do-hardirq-context-test-for-raw-spinlock.patch | 2 +-
...ktorture-Do-NOT-include-rwlock.h-directly.patch | 2 +-
...cpu-rwsem-use-swait-for-the-wating-writer.patch | 73 ++
..._nort()_in_lg_double_locklg_double_unlock.patch | 35 -
...inglglocks_Use_preempt_enabledisable_nort.patch | 35 -
.../features/all/rt/md-disable-bcache.patch | 2 +-
.../all/rt/md-raid5-percpu-handling-rt-aware.patch | 26 +-
.../all/rt/mips-disable-highmem-on-rt.patch | 4 +-
.../all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT | 41 -
.../mm--rt--Fix-generic-kmap_atomic-for-RT.patch | 2 +-
...dev-don-t-disable-IRQs-in-wb_congested_pu.patch | 2 +-
.../all/rt/mm-bounce-local-irq-save-nort.patch | 2 +-
.../all/rt/mm-convert-swap-to-percpu-locked.patch | 8 +-
.../features/all/rt/mm-disable-sloub-rt.patch | 6 +-
.../patches/features/all/rt/mm-enable-slub.patch | 82 +-
.../features/all/rt/mm-make-vmstat-rt-aware.patch | 2 +-
...ol-Don-t-call-schedule_work_on-in-preempt.patch | 6 +-
.../all/rt/mm-memcontrol-do_not_disable_irq.patch | 12 +-
...ol-mem_cgroup_migrate-replace-another-loc.patch | 4 +-
...m-page-alloc-use-local-lock-on-target-cpu.patch | 4 +-
...m-page_alloc-reduce-lock-sections-further.patch | 20 +-
.../mm-page_alloc-rt-friendly-per-cpu-pages.patch | 30 +-
.../rt/mm-perform-lru_add_drain_all-remotely.patch | 2 +-
.../all/rt/mm-protect-activate-switch-mm.patch | 4 +-
.../all/rt/mm-rt-kmap-atomic-scheduling.patch | 8 +-
.../mm-scatterlist-dont-disable-irqs-on-RT.patch | 2 +-
.../all/rt/mm-vmalloc-use-get-cpu-light.patch | 2 +-
...et-do-not-protect-workingset_shadow_nodes.patch | 4 +-
...-Use-get-put_cpu_light-in-zs_map_object-z.patch | 165 ---
...smalloc_copy_with_get_cpu_var_and_locking.patch | 2 +-
.../all/rt/mmci-remove-bogus-irq-save.patch | 2 +-
.../all/rt/move_sched_delayed_work_to_helper.patch | 2 +-
.../features/all/rt/mutex-no-spin-on-rt.patch | 2 +-
...napi_schedule_irqoff-disable-interrupts-o.patch | 8 +-
.../net-Qdisc-use-a-seqlock-instead-seqcount.patch | 20 +-
.../all/rt/net-add-a-lock-around-icmp_sk.patch | 2 +-
...k-the-missing-serialization-in-ip_send_un.patch | 12 +-
...r-local-irq-disable-alloc-atomic-headache.patch | 2 +-
...cpuhotplug-drain-input_pkt_queue-lockless.patch | 4 +-
...otect-users-of-napi_alloc_cache-against-r.patch | 2 +-
...ays-take-qdisc-s-busylock-in-__dev_xmit_s.patch | 4 +-
...-iptable-xt-write-recseq-begin-rt-fallout.patch | 5 +-
.../rt/net-make-devnet_rename_seq-a-mutex.patch | 2 +-
...xmit_recursion-to-per-task-variable-on-RT.patch | 16 +-
.../all/rt/net-prevent-abba-deadlock.patch | 4 +-
...-a-way-to-delegate-processing-a-softirq-t.patch | 8 +-
...ev_deactivate_many-use-msleep-1-instead-o.patch | 4 +-
.../rt/net-tx-action-avoid-livelock-on-rt.patch | 93 --
.../features/all/rt/net-use-cpu-chill.patch | 2 +-
.../features/all/rt/net-wireless-warn-nort.patch | 4 +-
...synchronize-rcu_expedited_conditional-on-non-rt | 36 -
.../features/all/rt/oleg-signal-rt-fix.patch | 12 +-
.../all/rt/panic-disable-random-on-rt.patch | 4 +-
...troduce-rcu-bh-qs-where-safe-from-softirq.patch | 6 +-
.../rt/pci-access-use-__wake_up_all_locked.patch | 2 +-
.../features/all/rt/percpu_ida-use-locklocks.patch | 2 +-
.../all/rt/perf-make-swevent-hrtimer-irqsafe.patch | 4 +-
.../features/all/rt/peter_zijlstra-frob-rcu.patch | 2 +-
.../features/all/rt/peterz-percpu-rwsem-rt.patch | 219 ++++
.../features/all/rt/peterz-srcu-crypto-chain.patch | 2 +-
.../features/all/rt/pid.h-include-atomic.h.patch | 2 +-
debian/patches/features/all/rt/ping-sysrq.patch | 4 +-
.../all/rt/posix-timers-no-broadcast.patch | 2 +-
...osix-timers-thread-posix-cpu-timers-on-rt.patch | 10 +-
.../all/rt/power-disable-highmem-on-rt.patch | 4 +-
.../all/rt/power-use-generic-rwsem-on-rt.patch | 4 +-
...-Disable-in-kernel-MPIC-emulation-for-PRE.patch | 4 +-
.../all/rt/powerpc-preempt-lazy-support.patch | 10 +-
...-device-init.c-adapt-to-completions-using.patch | 2 +-
.../rt/preempt-lazy-check-preempt_schedule.patch | 74 --
.../features/all/rt/preempt-lazy-support.patch | 44 +-
.../features/all/rt/preempt-nort-rt-variants.patch | 2 +-
...intk-27-boot-param-to-help-with-debugging.patch | 2 +-
debian/patches/features/all/rt/printk-kill.patch | 8 +-
.../patches/features/all/rt/printk-rt-aware.patch | 12 +-
.../ptrace-fix-ptrace-vs-tasklist_lock-race.patch | 12 +-
.../features/all/rt/radix-tree-rt-aware.patch | 2 +-
.../all/rt/random-make-it-work-on-rt.patch | 14 +-
.../rbtree-include-rcu.h-because-we-use-it.patch | 2 +-
...Eliminate-softirq-processing-from-rcutree.patch | 14 +-
.../all/rt/rcu-disable-more-spots-of-rcu_bh.patch | 64 -
.../all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch | 4 +-
...e-rcu_normal_after_boot-by-default-for-RT.patch | 4 +-
.../all/rt/rcu-make-RCU_BOOST-default-on-RT.patch | 6 +-
.../rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch | 34 +-
...rcu-update-make-RCU_EXPEDITE_BOOT-default.patch | 8 +-
...comment-out-rcu_bh-ops-on-PREEMPT_RT_FULL.patch | 37 -
..._bh_qs-disable-irq-while-calling-rcu_pree.patch | 4 +-
...-migrate_disable-race-with-cpu-hotplug-3f.patch | 4 +-
...t_full-arm-coredump-fails-for-cpu-3e-3d-4.patch | 4 +-
.../features/all/rt/relay-fix-timer-madness.patch | 53 -
...ping-function-called-from-invalid-context.patch | 2 +-
.../patches/features/all/rt/rt-add-rt-locks.patch | 18 +-
.../features/all/rt/rt-introduce-cpu-chill.patch | 2 +-
.../features/all/rt/rt-local-irq-lock.patch | 2 +-
...cking-Reenable-migration-accross-schedule.patch | 2 +-
.../features/all/rt/rt-preempt-base-config.patch | 2 +-
.../features/all/rt/rt-serial-warn-fix.patch | 2 +-
...rtmutex--Handle-non-enqueued-waiters-gracefully | 33 -
...x--Handle-non-enqueued-waiters-gracefully.patch | 4 +-
.../rt/rtmutex-Use-chainwalking-control-enum.patch | 28 -
.../rt/rtmutex-add-a-first-shot-of-ww_mutex.patch | 2 +-
.../all/rt/rtmutex-avoid-include-hell.patch | 2 +-
.../features/all/rt/rtmutex-futex-prepare-rt.patch | 14 +-
.../features/all/rt/rtmutex-lock-killable.patch | 2 +-
...sh-down-migrate_disable-into-rt_spin_lock.patch | 272 ----
.../all/rt/rtmutex-trylock-is-okay-on-RT.patch | 2 +-
.../features/all/rt/rtmutex_dont_include_rcu.patch | 4 +-
.../rt/rxrpc-remove-unused-static-variables.patch | 2 +-
...i-dont-t-disable-interrupts-in-qc_issue-h.patch | 2 +-
.../sc16is7xx_Drop_bogus_use_of_IRQF_ONESHOT.patch | 4 +-
...-deadline-dl_task_timer-has-to-be-irqsafe.patch | 4 +-
.../features/all/rt/sched-delay-put-task.patch | 12 +-
.../rt/sched-disable-rt-group-sched-on-rt.patch | 4 +-
.../features/all/rt/sched-disable-ttwu-queue.patch | 2 +-
.../features/all/rt/sched-limit-nr-migrate.patch | 2 +-
...ched-might-sleep-do-not-account-rcu-depth.patch | 4 +-
.../features/all/rt/sched-mmdrop-delayed.patch | 18 +-
...d-preempt-Fix-preempt_count-manipulations.patch | 52 -
...ched-provide-a-tsk_nr_cpus_allowed-helper.patch | 262 ----
.../features/all/rt/sched-rt-mutex-wakeup.patch | 18 +-
...hed-ttwu-ensure-success-return-is-correct.patch | 4 +-
...sk_cpus_allowed-instead-of-accessing-cpus.patch | 58 -
...ueue-Only-wake-up-idle-workers-if-not-blo.patch | 4 +-
.../features/all/rt/scsi-fcoe-rt-aware.patch | 2 +-
...ping-function-called-from-invalid-context.patch | 2 +-
.../all/rt/seqlock-prevent-rt-starvation.patch | 2 +-
.../all/rt/signal-fix-up-rcu-wreckage.patch | 2 +-
.../rt/signal-revert-ptrace-preempt-magic.patch | 2 +-
...low-rt-tasks-to-cache-one-sigqueue-struct.patch | 6 +-
.../all/rt/skbufhead-raw-lock-free-skbs.patch | 38 -
.../features/all/rt/skbufhead-raw-lock.patch | 74 +-
.../all/rt/slub-disable-SLUB_CPU_PARTIAL.patch | 4 +-
.../all/rt/slub-enable-irqs-for-no-wait.patch | 6 +-
...-snd_pcm_stream_lock-irqs_disabled-splats.patch | 2 +-
.../rt/softirq-disable-softirq-stacks-for-rt.patch | 20 +-
.../features/all/rt/softirq-preempt-fix-3-re.patch | 50 +-
.../features/all/rt/softirq-split-locks.patch | 59 +-
...irq-split-timer-softirqs-out-of-ksoftirqd.patch | 30 +-
.../sparc64-use-generic-rwsem-spinlocks-rt.patch | 4 +-
.../all/rt/spinlock-types-separate-raw.patch | 2 +-
...ne-create-lg_global_trylock_relax-primiti.patch | 87 --
...ne-use-lg_global_trylock_relax-to-dead-wi.patch | 74 --
.../features/all/rt/stop-machine-raw-lock.patch | 45 +-
...ne-convert-stop_machine_run-to-PREEMPT_RT.patch | 4 +-
...ake-svc_xprt_do_enqueue-use-get_cpu_light.patch | 2 +-
.../rt/suspend-prevernt-might-sleep-splats.patch | 18 +-
.../features/all/rt/sysfs-realtime-entry.patch | 2 +-
...klets-from-going-into-infinite-spin-in-rt.patch | 22 +-
.../thermal-Defer-thermal-wakups-to-threads.patch | 14 +-
.../rt/tick-broadcast--Make-hrtimer-irqsafe.patch | 2 +-
.../all/rt/timekeeping-split-jiffies-lock.patch | 4 +-
...delay-waking-softirqs-from-the-jiffy-tick.patch | 2 +-
.../features/all/rt/timer-fd-avoid-live-lock.patch | 2 +-
.../all/rt/timer-make-the-base-lock-raw.patch | 2 +-
...s-avoid-the-base-null-otptimization-on-rt.patch | 74 --
.../all/rt/timers-preempt-rt-support.patch | 55 -
.../rt/timers-prepare-for-full-preemption.patch | 2 +-
...ct-off-by-one-while-recording-the-trace-e.patch | 50 -
...cy-hist-Consider-new-argument-when-probin.patch | 2 +-
...e_version_for_preemptoff_hist_trace_point.patch | 2 +-
...count-for-preempt-off-in-preempt_schedule.patch | 4 +-
...l-8250-don-t-take-the-trylock-during-oops.patch | 4 +-
...t-remove-preemption-disabling-in-netif_rx.patch | 6 +-
.../all/rt/usb-use-_nort-in-giveback.patch | 4 +-
.../features/all/rt/user-use-local-irq-nort.patch | 2 +-
.../features/all/rt/wait.h-include-atomic.h.patch | 2 +-
...ue-work-around-irqsafe-timer-optimization.patch | 2 +-
...rk-simple-Simple-work-queue-implemenation.patch | 2 +-
.../all/rt/workqueue-distangle-from-rq-lock.patch | 18 +-
.../all/rt/workqueue-prevent-deadlock-stall.patch | 6 +-
.../features/all/rt/workqueue-use-locallock.patch | 34 +-
.../features/all/rt/workqueue-use-rcu.patch | 26 +-
...ueue-use-rcu_readlock-in-put_pwq_unlocked.patch | 50 -
.../all/rt/x86-UV-raw_spinlock-conversion.patch | 26 +-
...t-rid-of-warning-acpi_ioapic_lock-defined.patch | 2 +-
...86-crypto-reduce-preempt-disabled-regions.patch | 2 +-
.../x86-highmem-add-a-already-used-pte-check.patch | 2 +-
.../all/rt/x86-io-apic-migra-no-unmask.patch | 2 +-
.../all/rt/x86-kvm-require-const-tsc-for-rt.patch | 4 +-
.../features/all/rt/x86-mce-timer-hrtimer.patch | 26 +-
.../x86-mce-use-swait-queue-for-mce-wakeups.patch | 10 +-
.../patches/features/all/rt/x86-preempt-lazy.patch | 62 +-
...x86-signal-delay-calling-signals-on-32bit.patch | 4 +-
.../all/rt/x86-stackprot-no-random-on-rt.patch | 2 +-
.../all/rt/x86-use-gen-rwsem-spinlocks-rt.patch | 4 +-
debian/patches/series-rt | 32 +-
332 files changed, 1533 insertions(+), 5694 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 2ac464f..1c75baf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,8 +9,9 @@ linux (4.9-1~exp1) UNRELEASED; urgency=medium
[ Uwe Kleine-König ]
* enable `perf data' support; patch by Sebastian Andrzej Siewior
(Closes: #846597)
+ * [rt] Update to 4.9-rt1 and reenable
- -- Uwe Kleine-Koenig <ukleinek at debian.org> Sun, 18 Dec 2016 17:53:39 +0100
+ -- Uwe Kleine-König <ukleinek at debian.org> Sun, 18 Dec 2016 17:53:39 +0100
linux (4.9~rc8-1~exp1) experimental; urgency=medium
diff --git a/debian/config/defines b/debian/config/defines
index 774c0ea..da2967d 100644
--- a/debian/config/defines
+++ b/debian/config/defines
@@ -47,7 +47,7 @@ debug-info: true
signed-modules: true
[featureset-rt_base]
-enabled: false
+enabled: true
[description]
part-long-up: This kernel is not suitable for SMP (multi-processor,
diff --git a/debian/patches/features/all/rt/0005-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/debian/patches/features/all/rt/0005-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch
deleted file mode 100644
index f01b906..0000000
--- a/debian/patches/features/all/rt/0005-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From: Thomas Gleixner <tglx at 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.6/older/patches-4.6.2-rt5.tar.xz
-
-In exit_pi_state_list() we have the following locking construct:
-
- spin_lock(&hb->lock);
- raw_spin_lock_irq(&curr->pi_lock);
-
- ...
- spin_unlock(&hb->lock);
-
-In !RT this works, but on RT the migrate_enable() function which is
-called from spin_unlock() sees atomic context due to the held pi_lock
-and just decrements the migrate_disable_atomic counter of the
-task. Now the next call to migrate_disable() sees the counter being
-negative and issues a warning. That check should be in
-migrate_enable() already.
-
-Fix this by dropping pi_lock before unlocking hb->lock and reaquire
-pi_lock after that again. This is safe as the loop code reevaluates
-head again under the pi_lock.
-
-Reported-by: Yong Zhang <yong.zhang at windriver.com>
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- kernel/futex.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/kernel/futex.c
-+++ b/kernel/futex.c
-@@ -866,7 +866,9 @@ void exit_pi_state_list(struct task_stru
- * task still owns the PI-state:
- */
- if (head->next != next) {
-+ raw_spin_unlock_irq(&curr->pi_lock);
- spin_unlock(&hb->lock);
-+ raw_spin_lock_irq(&curr->pi_lock);
- continue;
- }
-
diff --git a/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch b/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch
index 9910f79..7c0bf97 100644
--- a/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch
+++ b/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch
@@ -1,7 +1,7 @@
From: "Yadi.hu" <yadi.hu at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Probably happens on all ARM, with
CONFIG_PREEMPT_RT_FULL
diff --git a/debian/patches/features/all/rt/ARM-imx-always-use-TWD-on-IMX6Q.patch b/debian/patches/features/all/rt/ARM-imx-always-use-TWD-on-IMX6Q.patch
deleted file mode 100644
index 4ae196a..0000000
--- a/debian/patches/features/all/rt/ARM-imx-always-use-TWD-on-IMX6Q.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Wed, 6 Apr 2016 17:30:28 +0200
-Subject: [PATCH] ARM: imx: always use TWD on IMX6Q
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-There is no reason to limit the TWD to be used on SMP kernels only if the
-hardware has it available.
-On Wandboard i.MX6SOLO, running PREEMPT-RT and cyclictest I see as max
-immediately after start in idle:
-UP : ~90us
-SMP: ~50us
-UP + TWD: ~20us.
-Based on this numbers I prefer the TWD over the slightly slower MXC
-timer.
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- arch/arm/mach-imx/Kconfig | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/arch/arm/mach-imx/Kconfig
-+++ b/arch/arm/mach-imx/Kconfig
-@@ -526,7 +526,7 @@ config SOC_IMX6Q
- bool "i.MX6 Quad/DualLite support"
- select ARM_ERRATA_764369 if SMP
- select HAVE_ARM_SCU if SMP
-- select HAVE_ARM_TWD if SMP
-+ select HAVE_ARM_TWD
- select PCI_DOMAINS if PCI
- select PINCTRL_IMX6Q
- select SOC_IMX6
diff --git a/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch b/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch
index cafd710..88ba0b7 100644
--- a/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch
+++ b/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
@@ -13,7 +13,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -1399,6 +1399,7 @@ static int syslog_print_all(char __user
+@@ -1396,6 +1396,7 @@ static int syslog_print_all(char __user
{
char *text;
int len = 0;
@@ -21,7 +21,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL);
if (!text)
-@@ -1410,6 +1411,14 @@ static int syslog_print_all(char __user
+@@ -1407,6 +1408,14 @@ static int syslog_print_all(char __user
u64 seq;
u32 idx;
enum log_flags prev;
@@ -36,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/*
* Find first record that fits, including all following records,
-@@ -1425,6 +1434,14 @@ static int syslog_print_all(char __user
+@@ -1422,6 +1431,14 @@ static int syslog_print_all(char __user
prev = msg->flags;
idx = log_next(idx);
seq++;
@@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
/* move first record forward until length fits into the buffer */
-@@ -1438,6 +1455,14 @@ static int syslog_print_all(char __user
+@@ -1435,6 +1452,14 @@ static int syslog_print_all(char __user
prev = msg->flags;
idx = log_next(idx);
seq++;
@@ -66,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
/* last message fitting into this dump */
-@@ -1478,6 +1503,7 @@ static int syslog_print_all(char __user
+@@ -1475,6 +1500,7 @@ static int syslog_print_all(char __user
clear_seq = log_next_seq;
clear_idx = log_next_idx;
}
diff --git a/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch
index 172f794..d91772f 100644
--- a/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch
+++ b/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch
@@ -1,7 +1,7 @@
From: Josh Cartwright <joshc at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -23,7 +23,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
-@@ -584,7 +584,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v
+@@ -619,7 +619,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v
* involves poking the GIC, which must be done in a
* non-preemptible context.
*/
@@ -32,7 +32,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
kvm_pmu_flush_hwstate(vcpu);
kvm_timer_flush_hwstate(vcpu);
kvm_vgic_flush_hwstate(vcpu);
-@@ -605,7 +605,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v
+@@ -640,7 +640,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v
kvm_pmu_sync_hwstate(vcpu);
kvm_timer_sync_hwstate(vcpu);
kvm_vgic_sync_hwstate(vcpu);
@@ -41,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
continue;
}
-@@ -661,7 +661,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v
+@@ -696,7 +696,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v
kvm_vgic_sync_hwstate(vcpu);
diff --git a/debian/patches/features/all/rt/KVM-lapic-mark-LAPIC-timer-handler-as-irqsafe.patch b/debian/patches/features/all/rt/KVM-lapic-mark-LAPIC-timer-handler-as-irqsafe.patch
index 29aaaf3..13212a4 100644
--- a/debian/patches/features/all/rt/KVM-lapic-mark-LAPIC-timer-handler-as-irqsafe.patch
+++ b/debian/patches/features/all/rt/KVM-lapic-mark-LAPIC-timer-handler-as-irqsafe.patch
@@ -1,7 +1,7 @@
From: Marcelo Tosatti <mtosatti at redhat.com>
Date: Wed, 8 Apr 2015 20:33:25 -0300
Subject: KVM: lapic: mark LAPIC timer handler as irqsafe
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Since lapic timer handler only wakes up a simple waitqueue,
it can be executed from hardirq context.
@@ -16,7 +16,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
-@@ -1938,6 +1938,7 @@ int kvm_create_lapic(struct kvm_vcpu *vc
+@@ -1939,6 +1939,7 @@ int kvm_create_lapic(struct kvm_vcpu *vc
hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC,
HRTIMER_MODE_ABS_PINNED);
apic->lapic_timer.timer.function = apic_timer_fn;
diff --git a/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch
index b011591..abe028a 100644
--- a/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch
+++ b/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch
@@ -5,7 +5,7 @@ Cc: Anna Schumaker <anna.schumaker at netapp.com>,
linux-nfs at vger.kernel.org, linux-kernel at vger.kernel.org,
tglx at linutronix.de
Subject: NFSv4: replace seqcount_t with a seqlock_t
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -47,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
put_nfs_open_context(ctx);
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
-@@ -107,7 +107,7 @@ struct nfs4_state_owner {
+@@ -111,7 +111,7 @@ struct nfs4_state_owner {
unsigned long so_flags;
struct list_head so_states;
struct nfs_seqid_counter so_seqid;
@@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
-@@ -2525,7 +2525,7 @@ static int _nfs4_open_and_get_state(stru
+@@ -2697,7 +2697,7 @@ static int _nfs4_open_and_get_state(stru
unsigned int seq;
int ret;
@@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
ret = _nfs4_proc_open(opendata);
if (ret != 0)
-@@ -2561,7 +2561,7 @@ static int _nfs4_open_and_get_state(stru
+@@ -2735,7 +2735,7 @@ static int _nfs4_open_and_get_state(stru
ctx->state = state;
if (d_inode(dentry) == state->inode) {
nfs_inode_attach_open_context(ctx);
@@ -87,7 +87,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
mutex_init(&sp->so_delegreturn_mutex);
return sp;
}
-@@ -1459,8 +1459,12 @@ static int nfs4_reclaim_open_state(struc
+@@ -1497,8 +1497,12 @@ static int nfs4_reclaim_open_state(struc
* recovering after a network partition or a reboot from a
* server that doesn't support a grace period.
*/
@@ -101,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
restart:
list_for_each_entry(state, &sp->so_states, open_states) {
if (!test_and_clear_bit(ops->state_flag_bit, &state->flags))
-@@ -1528,14 +1532,20 @@ static int nfs4_reclaim_open_state(struc
+@@ -1567,14 +1571,20 @@ static int nfs4_reclaim_open_state(struc
spin_lock(&sp->so_lock);
goto restart;
}
diff --git a/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch b/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch
index 4a88234..4184747 100644
--- a/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch
+++ b/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch
@@ -1,7 +1,7 @@
From: Steven Rostedt <rostedt at goodmis.org>
Date: Wed, 13 Feb 2013 09:26:05 -0500
Subject: acpi/rt: Convert acpi_gbl_hardware lock back to a raw_spinlock_t
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
We hit the following bug with 3.6-rt:
@@ -143,7 +143,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/* Delete the reader/writer lock */
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
-@@ -131,6 +131,7 @@
+@@ -133,6 +133,7 @@
#define acpi_cache_t struct kmem_cache
#define acpi_spinlock spinlock_t *
@@ -151,7 +151,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#define acpi_cpu_flags unsigned long
/* Use native linux version of acpi_os_allocate_zeroed */
-@@ -149,6 +150,20 @@
+@@ -151,6 +152,20 @@
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_lock
diff --git a/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch b/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch
index 559ebde..d2256b6 100644
--- a/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch
+++ b/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch
@@ -1,7 +1,7 @@
From: Anders Roxell <anders.roxell at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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,
@@ -13,14 +13,15 @@ indicate that support for full RT preemption is now available.
Signed-off-by: Anders Roxell <anders.roxell at linaro.org>
---
arch/arm64/Kconfig | 1 +
- arch/arm64/include/asm/thread_info.h | 6 +++++-
+ arch/arm64/include/asm/thread_info.h | 7 ++++++-
arch/arm64/kernel/asm-offsets.c | 1 +
- arch/arm64/kernel/entry.S | 13 ++++++++++---
- 4 files changed, 17 insertions(+), 4 deletions(-)
+ arch/arm64/kernel/entry.S | 12 +++++++++---
+ arch/arm64/kernel/signal.c | 2 +-
+ 5 files changed, 18 insertions(+), 5 deletions(-)
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
-@@ -90,6 +90,7 @@ config ARM64
+@@ -91,6 +91,7 @@ config ARM64
select HAVE_PERF_EVENTS
select HAVE_PERF_REGS
select HAVE_PERF_USER_STACK_DUMP
@@ -38,7 +39,7 @@ Signed-off-by: Anders Roxell <anders.roxell at linaro.org>
int cpu; /* cpu */
};
-@@ -109,6 +110,7 @@ static inline struct thread_info *curren
+@@ -112,6 +113,7 @@ static inline struct thread_info *curren
#define TIF_NEED_RESCHED 1
#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
#define TIF_FOREIGN_FPSTATE 3 /* CPU's FP state is not current's */
@@ -46,7 +47,7 @@ Signed-off-by: Anders Roxell <anders.roxell at linaro.org>
#define TIF_NOHZ 7
#define TIF_SYSCALL_TRACE 8
#define TIF_SYSCALL_AUDIT 9
-@@ -124,6 +126,7 @@ static inline struct thread_info *curren
+@@ -127,6 +129,7 @@ static inline struct thread_info *curren
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
#define _TIF_FOREIGN_FPSTATE (1 << TIF_FOREIGN_FPSTATE)
@@ -54,19 +55,20 @@ Signed-off-by: Anders Roxell <anders.roxell at linaro.org>
#define _TIF_NOHZ (1 << TIF_NOHZ)
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
-@@ -132,7 +135,8 @@ static inline struct thread_info *curren
+@@ -135,7 +138,9 @@ static inline struct thread_info *curren
#define _TIF_32BIT (1 << TIF_32BIT)
#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
- _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE)
+ _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \
+ _TIF_NEED_RESCHED_LAZY)
++#define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)
#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
_TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \
--- a/arch/arm64/kernel/asm-offsets.c
+++ b/arch/arm64/kernel/asm-offsets.c
-@@ -37,6 +37,7 @@ int main(void)
+@@ -38,6 +38,7 @@ int main(void)
BLANK();
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
@@ -76,7 +78,7 @@ Signed-off-by: Anders Roxell <anders.roxell at linaro.org>
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
-@@ -434,11 +434,16 @@ ENDPROC(el1_sync)
+@@ -428,11 +428,16 @@ ENDPROC(el1_sync)
#ifdef CONFIG_PREEMPT
ldr w24, [tsk, #TI_PREEMPT] // get preempt count
@@ -96,7 +98,7 @@ Signed-off-by: Anders Roxell <anders.roxell at linaro.org>
#endif
#ifdef CONFIG_TRACE_IRQFLAGS
bl trace_hardirqs_on
-@@ -452,6 +457,7 @@ ENDPROC(el1_irq)
+@@ -446,6 +451,7 @@ ENDPROC(el1_irq)
1: bl preempt_schedule_irq // irq en/disable is done inside
ldr x0, [tsk, #TI_FLAGS] // get new tasks TI_FLAGS
tbnz x0, #TIF_NEED_RESCHED, 1b // needs rescheduling?
@@ -104,11 +106,14 @@ Signed-off-by: Anders Roxell <anders.roxell at linaro.org>
ret x24
#endif
-@@ -708,6 +714,7 @@ ENDPROC(cpu_switch_to)
- */
- work_pending:
- tbnz x1, #TIF_NEED_RESCHED, work_resched
-+ tbnz x1, #TIF_NEED_RESCHED_LAZY, work_resched
- /* TIF_SIGPENDING, TIF_NOTIFY_RESUME or TIF_FOREIGN_FPSTATE case */
- mov x0, sp // 'regs'
- enable_irq // enable interrupts for do_notify_resume()
+--- a/arch/arm64/kernel/signal.c
++++ b/arch/arm64/kernel/signal.c
+@@ -409,7 +409,7 @@ asmlinkage void do_notify_resume(struct
+ */
+ trace_hardirqs_off();
+ do {
+- if (thread_flags & _TIF_NEED_RESCHED) {
++ if (thread_flags & _TIF_NEED_RESCHED_MASK) {
+ schedule();
+ } else {
+ local_irq_enable();
diff --git a/debian/patches/features/all/rt/arm-arm64-lazy-preempt-add-TIF_NEED_RESCHED_LAZY-to-.patch b/debian/patches/features/all/rt/arm-arm64-lazy-preempt-add-TIF_NEED_RESCHED_LAZY-to-.patch
deleted file mode 100644
index 355d502..0000000
--- a/debian/patches/features/all/rt/arm-arm64-lazy-preempt-add-TIF_NEED_RESCHED_LAZY-to-.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Fri, 22 Jan 2016 21:33:39 +0100
-Subject: arm+arm64: lazy-preempt: add TIF_NEED_RESCHED_LAZY to _TIF_WORK_MASK
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-_TIF_WORK_MASK is used to check for TIF_NEED_RESCHED so we need to check
-for TIF_NEED_RESCHED_LAZY here, too.
-
-Reported-by: Grygorii Strashko <grygorii.strashko at ti.com>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- arch/arm/include/asm/thread_info.h | 7 ++++---
- arch/arm/kernel/entry-common.S | 9 +++++++--
- arch/arm64/include/asm/thread_info.h | 3 ++-
- 3 files changed, 13 insertions(+), 6 deletions(-)
-
---- a/arch/arm/include/asm/thread_info.h
-+++ b/arch/arm/include/asm/thread_info.h
-@@ -143,8 +143,8 @@ extern int vfp_restore_user_hwstate(stru
- #define TIF_SYSCALL_TRACE 4 /* syscall trace active */
- #define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */
- #define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */
--#define TIF_SECCOMP 7 /* seccomp syscall filtering active */
--#define TIF_NEED_RESCHED_LAZY 8
-+#define TIF_SECCOMP 8 /* seccomp syscall filtering active */
-+#define TIF_NEED_RESCHED_LAZY 7
-
- #define TIF_NOHZ 12 /* in adaptive nohz mode */
- #define TIF_USING_IWMMXT 17
-@@ -170,7 +170,8 @@ extern int vfp_restore_user_hwstate(stru
- * Change these and you break ASM code in entry-common.S
- */
- #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
-- _TIF_NOTIFY_RESUME | _TIF_UPROBE)
-+ _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
-+ _TIF_NEED_RESCHED_LAZY)
-
- #endif /* __KERNEL__ */
- #endif /* __ASM_ARM_THREAD_INFO_H */
---- a/arch/arm/kernel/entry-common.S
-+++ b/arch/arm/kernel/entry-common.S
-@@ -36,7 +36,9 @@
- UNWIND(.cantunwind )
- disable_irq_notrace @ disable interrupts
- ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing
-- tst r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
-+ tst r1, #((_TIF_SYSCALL_WORK | _TIF_WORK_MASK) & ~_TIF_SECCOMP)
-+ bne fast_work_pending
-+ tst r1, #_TIF_SECCOMP
- bne fast_work_pending
-
- /* perform architecture specific actions before user return */
-@@ -62,8 +64,11 @@ ENDPROC(ret_fast_syscall)
- str r0, [sp, #S_R0 + S_OFF]! @ save returned r0
- disable_irq_notrace @ disable interrupts
- ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing
-- tst r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
-+ tst r1, #((_TIF_SYSCALL_WORK | _TIF_WORK_MASK) & ~_TIF_SECCOMP)
-+ bne do_slower_path
-+ tst r1, #_TIF_SECCOMP
- beq no_work_pending
-+do_slower_path:
- UNWIND(.fnend )
- ENDPROC(ret_fast_syscall)
-
---- a/arch/arm64/include/asm/thread_info.h
-+++ b/arch/arm64/include/asm/thread_info.h
-@@ -135,7 +135,8 @@ static inline struct thread_info *curren
- #define _TIF_32BIT (1 << TIF_32BIT)
-
- #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
-- _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE)
-+ _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \
-+ _TIF_NEED_RESCHED_LAZY)
-
- #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
- _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \
diff --git a/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch b/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch
index 13520cd..70754dd 100644
--- a/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch
+++ b/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch
@@ -1,7 +1,7 @@
From: Benedikt Spranger <b.spranger at linutronix.de>
Date: Sat, 6 Mar 2010 17:47:10 +0100
Subject: ARM: AT91: PIT: Remove irq handler when clock event is unused
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Setup and remove the interrupt handler in clock event mode selection.
This avoids calling the (shared) interrupt handler when the device is
@@ -45,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/* update clocksource counter */
data->cnt += data->cycle * PIT_PICNT(pit_read(data->base, AT91_PIT_PIVR));
-@@ -211,15 +220,6 @@ static int __init at91sam926x_pit_common
+@@ -230,15 +239,6 @@ static int __init at91sam926x_pit_dt_ini
return ret;
}
diff --git a/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch b/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch
index d200b61..d4a6cff 100644
--- a/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch
+++ b/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sat, 1 May 2010 18:29:35 +0200
Subject: ARM: at91: tclib: Default to tclib timer for RT
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
RT is not too happy about the shared timer interrupt in AT91
devices. Default to tclib timer for RT.
diff --git a/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch b/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch
index 5481efe..67b2b2e 100644
--- a/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch
+++ b/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch
@@ -1,7 +1,7 @@
From: Frank Rowand <frank.rowand at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
diff --git a/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch b/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch
index 4e5ed3c..9a12751 100644
--- a/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch
+++ b/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch
@@ -1,7 +1,7 @@
Subject: arm: Enable highmem for rt
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 13 Feb 2013 11:03:11 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
fixup highmem for ARM.
diff --git a/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch b/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch
index b89e8ee..69c01c5 100644
--- a/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch
+++ b/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch b/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch
new file mode 100644
index 0000000..87905aa
--- /dev/null
+++ b/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch
@@ -0,0 +1,25 @@
+From: Sebastian Andrzej Siewior <bigeasy at 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.9/older/patches-4.9-rt1.tar.xz
+
+This definition gets pulled in by other files. With the (later) split of
+RCU and spinlock.h it won't compile anymore.
+The split is done in ("rbtree: don't include the rcu header").
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+---
+ arch/arm/include/asm/irq.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/arm/include/asm/irq.h
++++ b/arch/arm/include/asm/irq.h
+@@ -22,6 +22,8 @@
+ #endif
+
+ #ifndef __ASSEMBLY__
++#include <linux/cpumask.h>
++
+ struct irqaction;
+ struct pt_regs;
+ extern void migrate_irqs(void);
diff --git a/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch b/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch
index 0c04f1b..d3126f0 100644
--- a/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch
+++ b/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch
@@ -2,7 +2,7 @@ From 6e2639b6d72e1ef9e264aa658db3b6171d9ba12f Mon Sep 17 00:00:00 2001
From: Yang Shi <yang.shi at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
When running kprobe on -rt kernel, the below bug is caught:
diff --git a/debian/patches/features/all/rt/arm-lazy-preempt-correct-resched-condition.patch b/debian/patches/features/all/rt/arm-lazy-preempt-correct-resched-condition.patch
deleted file mode 100644
index 9dbdd84..0000000
--- a/debian/patches/features/all/rt/arm-lazy-preempt-correct-resched-condition.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Tue, 24 May 2016 12:56:38 +0200
-Subject: [PATCH] arm: lazy preempt: correct resched condition
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-If we get out of preempt_schedule_irq() then we check for NEED_RESCHED
-and call the former function again if set because the preemption counter
-has be zero at this point.
-However the counter for lazy-preempt might not be zero therefore we have
-to check the counter before looking at the need_resched_lazy flag.
-
-Cc: stable-rt at vger.kernel.org
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- arch/arm/kernel/entry-armv.S | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
---- a/arch/arm/kernel/entry-armv.S
-+++ b/arch/arm/kernel/entry-armv.S
-@@ -244,7 +244,11 @@ ENDPROC(__irq_svc)
- bne 1b
- tst r0, #_TIF_NEED_RESCHED_LAZY
- reteq r8 @ go again
-- b 1b
-+ ldr r0, [tsk, #TI_PREEMPT_LAZY] @ get preempt lazy count
-+ teq r0, #0 @ if preempt lazy count != 0
-+ beq 1b
-+ ret r8 @ go again
-+
- #endif
-
- __und_fault:
diff --git a/debian/patches/features/all/rt/arm-preempt-lazy-support.patch b/debian/patches/features/all/rt/arm-preempt-lazy-support.patch
index aa717dd..f3364a2 100644
--- a/debian/patches/features/all/rt/arm-preempt-lazy-support.patch
+++ b/debian/patches/features/all/rt/arm-preempt-lazy-support.patch
@@ -1,7 +1,7 @@
Subject: arm: Add support for lazy preemption
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 31 Oct 2012 12:04:11 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Implement the arm pieces for lazy preempt.
diff --git a/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch b/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch
index 3e11246..622dcc7 100644
--- a/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch
+++ b/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Mostly unwind is done with irqs enabled however SLUB may call it with
irqs disabled while creating a new SLUB cache.
diff --git a/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch b/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch
index 982fe5c..38d7eff 100644
--- a/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch
+++ b/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch
@@ -1,7 +1,7 @@
Subject: arm64/xen: Make XEN depend on !RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 12 Oct 2015 11:18:40 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
It's not ready and probably never will be, unless xen folks have a
look at it.
@@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
-@@ -689,7 +689,7 @@ config XEN_DOM0
+@@ -694,7 +694,7 @@ config XEN_DOM0
config XEN
bool "Xen guest support on ARM64"
diff --git a/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch b/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch
index 227647f..1c84694 100644
--- a/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch
+++ b/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
diff --git a/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch b/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch
index 3e503b1..0befaf7 100644
--- a/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch
+++ b/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch
@@ -1,7 +1,7 @@
From: Steven Rostedt <srostedt at redhat.com>
Date: Fri, 3 Jul 2009 08:44:29 -0500
Subject: ata: Do not disable interrupts in ide code for preempt-rt
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Use the local_irq_*_nort variants.
diff --git a/debian/patches/features/all/rt/blk-mq-revert-raw-locks-post-pone-notifier-to-POST_D.patchto-POST_D.patch b/debian/patches/features/all/rt/blk-mq-revert-raw-locks-post-pone-notifier-to-POST_D.patchto-POST_D.patch
deleted file mode 100644
index c9ff213..0000000
--- a/debian/patches/features/all/rt/blk-mq-revert-raw-locks-post-pone-notifier-to-POST_D.patchto-POST_D.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Sat, 3 May 2014 11:00:29 +0200
-Subject: blk-mq: revert raw locks, post pone notifier to POST_DEAD
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-The blk_mq_cpu_notify_lock should be raw because some CPU down levels
-are called with interrupts off. The notifier itself calls currently one
-function that is blk_mq_hctx_notify().
-That function acquires the ctx->lock lock which is sleeping and I would
-prefer to keep it that way. That function only moves IO-requests from
-the CPU that is going offline to another CPU and it is currently the
-only one. Therefore I revert the list lock back to sleeping spinlocks
-and let the notifier run at POST_DEAD time.
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- block/blk-mq-cpu.c | 17 ++++++++++-------
- block/blk-mq.c | 2 +-
- 2 files changed, 11 insertions(+), 8 deletions(-)
-
---- a/block/blk-mq-cpu.c
-+++ b/block/blk-mq-cpu.c
-@@ -16,7 +16,7 @@
- #include "blk-mq.h"
-
- static LIST_HEAD(blk_mq_cpu_notify_list);
--static DEFINE_RAW_SPINLOCK(blk_mq_cpu_notify_lock);
-+static DEFINE_SPINLOCK(blk_mq_cpu_notify_lock);
-
- static int blk_mq_main_cpu_notify(struct notifier_block *self,
- unsigned long action, void *hcpu)
-@@ -25,7 +25,10 @@ static int blk_mq_main_cpu_notify(struct
- struct blk_mq_cpu_notifier *notify;
- int ret = NOTIFY_OK;
-
-- raw_spin_lock(&blk_mq_cpu_notify_lock);
-+ if (action != CPU_POST_DEAD)
-+ return NOTIFY_OK;
-+
-+ spin_lock(&blk_mq_cpu_notify_lock);
-
- list_for_each_entry(notify, &blk_mq_cpu_notify_list, list) {
- ret = notify->notify(notify->data, action, cpu);
-@@ -33,7 +36,7 @@ static int blk_mq_main_cpu_notify(struct
- break;
- }
-
-- raw_spin_unlock(&blk_mq_cpu_notify_lock);
-+ spin_unlock(&blk_mq_cpu_notify_lock);
- return ret;
- }
-
-@@ -41,16 +44,16 @@ void blk_mq_register_cpu_notifier(struct
- {
- BUG_ON(!notifier->notify);
-
-- raw_spin_lock(&blk_mq_cpu_notify_lock);
-+ spin_lock(&blk_mq_cpu_notify_lock);
- list_add_tail(¬ifier->list, &blk_mq_cpu_notify_list);
-- raw_spin_unlock(&blk_mq_cpu_notify_lock);
-+ spin_unlock(&blk_mq_cpu_notify_lock);
- }
-
- void blk_mq_unregister_cpu_notifier(struct blk_mq_cpu_notifier *notifier)
- {
-- raw_spin_lock(&blk_mq_cpu_notify_lock);
-+ spin_lock(&blk_mq_cpu_notify_lock);
- list_del(¬ifier->list);
-- raw_spin_unlock(&blk_mq_cpu_notify_lock);
-+ spin_unlock(&blk_mq_cpu_notify_lock);
- }
-
- void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier,
---- a/block/blk-mq.c
-+++ b/block/blk-mq.c
-@@ -1687,7 +1687,7 @@ static int blk_mq_hctx_notify(void *data
- {
- struct blk_mq_hw_ctx *hctx = data;
-
-- if (action == CPU_DEAD || action == CPU_DEAD_FROZEN)
-+ if (action == CPU_POST_DEAD)
- return blk_mq_hctx_cpu_offline(hctx, cpu);
-
- /*
diff --git a/debian/patches/features/all/rt/block-blk-mq-use-swait.patch b/debian/patches/features/all/rt/block-blk-mq-use-swait.patch
index dc348c8..50de26c 100644
--- a/debian/patches/features/all/rt/block-blk-mq-use-swait.patch
+++ b/debian/patches/features/all/rt/block-blk-mq-use-swait.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Fri, 13 Feb 2015 11:01:26 +0100
Subject: block: blk-mq: Use swait
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
* Init percpu_ref in atomic mode so that it's faster to shutdown.
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
-@@ -92,7 +92,7 @@ EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_st
+@@ -72,7 +72,7 @@ EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_st
static void blk_mq_freeze_queue_wait(struct request_queue *q)
{
@@ -84,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
/*
-@@ -130,7 +130,7 @@ void blk_mq_unfreeze_queue(struct reques
+@@ -110,7 +110,7 @@ void blk_mq_unfreeze_queue(struct reques
WARN_ON_ONCE(freeze_depth < 0);
if (!freeze_depth) {
percpu_ref_reinit(&q->q_usage_counter);
@@ -93,7 +93,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
}
EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue);
-@@ -149,7 +149,7 @@ void blk_mq_wake_waiters(struct request_
+@@ -129,7 +129,7 @@ void blk_mq_wake_waiters(struct request_
* dying, we need to ensure that processes currently waiting on
* the queue are notified as well.
*/
diff --git a/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch b/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch
index 87c267e..3546d33 100644
--- a/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch
+++ b/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The IPI runs in hardirq context and there are sleeping locks. This patch
moves the completion into a workqueue.
@@ -10,9 +10,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
block/blk-core.c | 3 +++
block/blk-mq.c | 20 ++++++++++++++++++++
- include/linux/blk-mq.h | 1 +
+ include/linux/blk-mq.h | 2 +-
include/linux/blkdev.h | 1 +
- 4 files changed, 25 insertions(+)
+ 4 files changed, 25 insertions(+), 1 deletion(-)
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -28,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
rq->__sector = (sector_t) -1;
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
-@@ -197,6 +197,9 @@ static void blk_mq_rq_ctx_init(struct re
+@@ -177,6 +177,9 @@ static void blk_mq_rq_ctx_init(struct re
rq->resid_len = 0;
rq->sense = NULL;
@@ -38,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
INIT_LIST_HEAD(&rq->timeout_list);
rq->timeout = 0;
-@@ -379,6 +382,17 @@ void blk_mq_end_request(struct request *
+@@ -345,6 +348,17 @@ void blk_mq_end_request(struct request *
}
EXPORT_SYMBOL(blk_mq_end_request);
@@ -56,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
static void __blk_mq_complete_request_remote(void *data)
{
struct request *rq = data;
-@@ -386,6 +400,8 @@ static void __blk_mq_complete_request_re
+@@ -352,6 +366,8 @@ static void __blk_mq_complete_request_re
rq->q->softirq_done_fn(rq);
}
@@ -65,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
static void blk_mq_ipi_complete_request(struct request *rq)
{
struct blk_mq_ctx *ctx = rq->mq_ctx;
-@@ -402,10 +418,14 @@ static void blk_mq_ipi_complete_request(
+@@ -368,10 +384,14 @@ static void blk_mq_ipi_complete_request(
shared = cpus_share_cache(cpu, ctx->cpu);
if (cpu != ctx->cpu && !shared && cpu_online(ctx->cpu)) {
@@ -82,14 +82,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
-@@ -222,6 +222,7 @@ static inline u16 blk_mq_unique_tag_to_t
+@@ -209,7 +209,7 @@ static inline u16 blk_mq_unique_tag_to_t
+ return unique_tag & BLK_MQ_UNIQUE_TAG_MASK;
+ }
- struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_index);
- struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_tag_set *, unsigned int, int);
+-
+void __blk_mq_complete_request_remote_work(struct work_struct *work);
-
int blk_mq_request_started(struct request *rq);
void blk_mq_start_request(struct request *rq);
+ void blk_mq_end_request(struct request *rq, int error);
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -89,6 +89,7 @@ struct request {
diff --git a/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch b/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch
index a3509af..4b1d5a0 100644
--- a/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch
+++ b/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
preempt_disable() and get_cpu() don't play well together with the sleeping
locks it tries to allocate later.
@@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
-@@ -397,7 +397,7 @@ static void blk_mq_ipi_complete_request(
+@@ -363,7 +363,7 @@ static void blk_mq_ipi_complete_request(
return;
}
@@ -23,7 +23,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
if (!test_bit(QUEUE_FLAG_SAME_FORCE, &rq->q->queue_flags))
shared = cpus_share_cache(cpu, ctx->cpu);
-@@ -409,7 +409,7 @@ static void blk_mq_ipi_complete_request(
+@@ -375,7 +375,7 @@ static void blk_mq_ipi_complete_request(
} else {
rq->q->softirq_done_fn(rq);
}
@@ -32,10 +32,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
static void __blk_mq_complete_request(struct request *rq)
-@@ -938,14 +938,14 @@ void blk_mq_run_hw_queue(struct blk_mq_h
+@@ -917,14 +917,14 @@ void blk_mq_run_hw_queue(struct blk_mq_h
return;
- if (!async) {
+ if (!async && !(hctx->flags & BLK_MQ_F_BLOCKING)) {
- int cpu = get_cpu();
+ int cpu = get_cpu_light();
if (cpumask_test_cpu(cpu, hctx->cpumask)) {
@@ -49,4 +49,4 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+ put_cpu_light();
}
- kblockd_schedule_delayed_work_on(blk_mq_hctx_next_cpu(hctx),
+ kblockd_schedule_work_on(blk_mq_hctx_next_cpu(hctx), &hctx->run_work);
diff --git a/debian/patches/features/all/rt/block-mq-use-cpu_light.patch b/debian/patches/features/all/rt/block-mq-use-cpu_light.patch
index add7665..3f8c635 100644
--- a/debian/patches/features/all/rt/block-mq-use-cpu_light.patch
+++ b/debian/patches/features/all/rt/block-mq-use-cpu_light.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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().
@@ -13,7 +13,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
-@@ -86,12 +86,12 @@ static inline struct blk_mq_ctx *__blk_m
+@@ -72,12 +72,12 @@ static inline struct blk_mq_ctx *__blk_m
*/
static inline struct blk_mq_ctx *blk_mq_get_ctx(struct request_queue *q)
{
diff --git a/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch b/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch
index 225b505..9ddd078 100644
--- a/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch
+++ b/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch
@@ -1,7 +1,7 @@
Subject: block: Shorten interrupt disabled regions
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 22 Jun 2011 19:47:02 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Moving the blk_sched_flush_plug() call out of the interrupt/preempt
disabled region in the scheduler allows us to replace
@@ -48,7 +48,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de
--- a/block/blk-core.c
+++ b/block/blk-core.c
-@@ -3171,7 +3171,7 @@ static void queue_unplugged(struct reque
+@@ -3177,7 +3177,7 @@ static void queue_unplugged(struct reque
blk_run_queue_async(q);
else
__blk_run_queue(q);
@@ -57,7 +57,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de
}
static void flush_plug_callbacks(struct blk_plug *plug, bool from_schedule)
-@@ -3219,7 +3219,6 @@ EXPORT_SYMBOL(blk_check_plugged);
+@@ -3225,7 +3225,6 @@ EXPORT_SYMBOL(blk_check_plugged);
void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule)
{
struct request_queue *q;
@@ -65,7 +65,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de
struct request *rq;
LIST_HEAD(list);
unsigned int depth;
-@@ -3239,11 +3238,6 @@ void blk_flush_plug_list(struct blk_plug
+@@ -3245,11 +3244,6 @@ void blk_flush_plug_list(struct blk_plug
q = NULL;
depth = 0;
@@ -77,7 +77,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de
while (!list_empty(&list)) {
rq = list_entry_rq(list.next);
list_del_init(&rq->queuelist);
-@@ -3256,7 +3250,7 @@ void blk_flush_plug_list(struct blk_plug
+@@ -3262,7 +3256,7 @@ void blk_flush_plug_list(struct blk_plug
queue_unplugged(q, depth, from_schedule);
q = rq->q;
depth = 0;
@@ -86,7 +86,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de
}
/*
-@@ -3283,8 +3277,6 @@ void blk_flush_plug_list(struct blk_plug
+@@ -3289,8 +3283,6 @@ void blk_flush_plug_list(struct blk_plug
*/
if (q)
queue_unplugged(q, depth, from_schedule);
diff --git a/debian/patches/features/all/rt/block-use-cpu-chill.patch b/debian/patches/features/all/rt/block-use-cpu-chill.patch
index c4ec262..b4760dd 100644
--- a/debian/patches/features/all/rt/block-use-cpu-chill.patch
+++ b/debian/patches/features/all/rt/block-use-cpu-chill.patch
@@ -1,7 +1,7 @@
Subject: block: Use cpu_chill() for retry loops
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 20 Dec 2012 18:28:26 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/btrfs-drop-trace_btrfs_all_work_done-from-normal_wor.patch b/debian/patches/features/all/rt/btrfs-drop-trace_btrfs_all_work_done-from-normal_wor.patch
new file mode 100644
index 0000000..8c666a7
--- /dev/null
+++ b/debian/patches/features/all/rt/btrfs-drop-trace_btrfs_all_work_done-from-normal_wor.patch
@@ -0,0 +1,39 @@
+From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+Date: Wed, 14 Dec 2016 14:44:18 +0100
+Subject: [PATCH] btrfs: drop trace_btrfs_all_work_done() from
+ normal_work_helper()
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
+
+For btrfs_scrubparity_helper() the ->func() is set to
+scrub_parity_bio_endio_worker(). This functions invokes invokes
+scrub_free_parity() which kfrees() the worked object. All is good as
+long as trace events are not enabled because we boom with a backtrace
+like this:
+| Workqueue: btrfs-endio btrfs_endio_helper
+| RIP: 0010:[<ffffffff812f81ae>] [<ffffffff812f81ae>] trace_event_raw_event_btrfs__work__done+0x4e/0xa0
+| Call Trace:
+| [<ffffffff8136497d>] btrfs_scrubparity_helper+0x59d/0x780
+| [<ffffffff81364c49>] btrfs_endio_helper+0x9/0x10
+| [<ffffffff8108af8e>] process_one_work+0x26e/0x7b0
+| [<ffffffff8108b516>] worker_thread+0x46/0x560
+| [<ffffffff81091c4e>] kthread+0xee/0x110
+| [<ffffffff818e166a>] ret_from_fork+0x2a/0x40
+
+So in order to avoid this, I remove the trace point.
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+---
+ fs/btrfs/async-thread.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/fs/btrfs/async-thread.c
++++ b/fs/btrfs/async-thread.c
+@@ -318,8 +318,6 @@ static void normal_work_helper(struct bt
+ set_bit(WORK_DONE_BIT, &work->flags);
+ run_ordered_work(wq);
+ }
+- if (!need_order)
+- trace_btrfs_all_work_done(work);
+ }
+
+ void btrfs_init_work(struct btrfs_work *work, btrfs_work_func_t uniq_func,
diff --git a/debian/patches/features/all/rt/btrfs-swap-free-and-trace-point-in-run_ordered_work.patch b/debian/patches/features/all/rt/btrfs-swap-free-and-trace-point-in-run_ordered_work.patch
new file mode 100644
index 0000000..32e7510
--- /dev/null
+++ b/debian/patches/features/all/rt/btrfs-swap-free-and-trace-point-in-run_ordered_work.patch
@@ -0,0 +1,34 @@
+From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+Date: Wed, 14 Dec 2016 12:28:52 +0100
+Subject: [PATCH] btrfs: swap free() and trace point in run_ordered_work()
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
+
+The previous patch removed a trace point due to a use after free problem
+with tracing enabled. While looking at the backtrace it took me a while
+to find the right spot. While doing so I noticed that this trace point
+could be used with two clean-up functions in run_ordered_work():
+- run_one_async_free()
+- async_cow_free()
+
+Both of them free the `work' item so a later use in the tracepoint is
+not possible.
+This patches swaps the order so we first have the trace point and then
+free the struct.
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+---
+ fs/btrfs/async-thread.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/btrfs/async-thread.c
++++ b/fs/btrfs/async-thread.c
+@@ -288,8 +288,8 @@ static void run_ordered_work(struct __bt
+ * we don't want to call the ordered free functions
+ * with the lock held though
+ */
+- work->ordered_free(work);
+ trace_btrfs_all_work_done(work);
++ work->ordered_free(work);
+ }
+ spin_unlock_irqrestore(lock, flags);
+ }
diff --git a/debian/patches/features/all/rt/bug-rt-dependend-variants.patch b/debian/patches/features/all/rt/bug-rt-dependend-variants.patch
index 6945fa4..e338270 100644
--- a/debian/patches/features/all/rt/bug-rt-dependend-variants.patch
+++ b/debian/patches/features/all/rt/bug-rt-dependend-variants.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at elte.hu>
Date: Fri, 3 Jul 2009 08:29:58 -0500
Subject: bug: BUG_ON/WARN_ON variants dependend on RT/!RT
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Introduce RT/NON-RT WARN/BUG statements to avoid ifdefs in the code.
diff --git a/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch b/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch
index 561eb05..006095b 100644
--- a/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch
+++ b/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch
@@ -1,7 +1,7 @@
From: Mike Galbraith <umgwanakikbuti at gmail.com>
Date: Sat, 21 Jun 2014 10:09:48 +0200
Subject: memcontrol: Prevent scheduling while atomic in cgroup code
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
mm, memcg: make refill_stock() use get_cpu_light()
@@ -43,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
-@@ -1727,6 +1727,7 @@ struct memcg_stock_pcp {
+@@ -1697,6 +1697,7 @@ struct memcg_stock_pcp {
#define FLUSHING_CACHED_CHARGE 0
};
static DEFINE_PER_CPU(struct memcg_stock_pcp, memcg_stock);
@@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
static DEFINE_MUTEX(percpu_charge_mutex);
/**
-@@ -1749,7 +1750,7 @@ static bool consume_stock(struct mem_cgr
+@@ -1719,7 +1720,7 @@ static bool consume_stock(struct mem_cgr
if (nr_pages > CHARGE_BATCH)
return ret;
@@ -60,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
stock = this_cpu_ptr(&memcg_stock);
if (memcg == stock->cached && stock->nr_pages >= nr_pages) {
-@@ -1757,7 +1758,7 @@ static bool consume_stock(struct mem_cgr
+@@ -1727,7 +1728,7 @@ static bool consume_stock(struct mem_cgr
ret = true;
}
@@ -69,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
return ret;
}
-@@ -1784,13 +1785,13 @@ static void drain_local_stock(struct wor
+@@ -1754,13 +1755,13 @@ static void drain_local_stock(struct wor
struct memcg_stock_pcp *stock;
unsigned long flags;
@@ -85,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
/*
-@@ -1802,7 +1803,7 @@ static void refill_stock(struct mem_cgro
+@@ -1772,7 +1773,7 @@ static void refill_stock(struct mem_cgro
struct memcg_stock_pcp *stock;
unsigned long flags;
@@ -94,7 +94,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
stock = this_cpu_ptr(&memcg_stock);
if (stock->cached != memcg) { /* reset if necessary */
-@@ -1811,7 +1812,7 @@ static void refill_stock(struct mem_cgro
+@@ -1781,7 +1782,7 @@ static void refill_stock(struct mem_cgro
}
stock->nr_pages += nr_pages;
diff --git a/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch b/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch
index 0ae2b8d..a5f7a6e 100644
--- a/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch
+++ b/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
To avoid:
|BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914
@@ -53,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/*
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
-@@ -5027,10 +5027,10 @@ static void css_free_rcu_fn(struct rcu_h
+@@ -5040,10 +5040,10 @@ static void css_free_rcu_fn(struct rcu_h
queue_work(cgroup_destroy_wq, &css->destroy_work);
}
@@ -66,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
struct cgroup_subsys *ss = css->ss;
struct cgroup *cgrp = css->cgroup;
-@@ -5071,8 +5071,8 @@ static void css_release(struct percpu_re
+@@ -5086,8 +5086,8 @@ static void css_release(struct percpu_re
struct cgroup_subsys_state *css =
container_of(ref, struct cgroup_subsys_state, refcnt);
@@ -77,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
static void init_and_link_css(struct cgroup_subsys_state *css,
-@@ -5716,6 +5716,7 @@ static int __init cgroup_wq_init(void)
+@@ -5742,6 +5742,7 @@ static int __init cgroup_wq_init(void)
*/
cgroup_destroy_wq = alloc_workqueue("cgroup_destroy", 0, 1);
BUG_ON(!cgroup_destroy_wq);
diff --git a/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch b/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch
index 441636c..c4e8a60 100644
--- a/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch
+++ b/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch
@@ -1,7 +1,7 @@
From: Alexandre Belloni <alexandre.belloni at free-electrons.com>
Date: Thu, 17 Mar 2016 21:09:43 +0100
Subject: [PATCH] clockevents/drivers/timer-atmel-pit: fix double free_irq
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
clockevents_exchange_device() changes the state from detached to shutdown
and so at that point the IRQ has not yet been requested.
diff --git a/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch b/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch
index f4c6da7..7140750 100644
--- a/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch
+++ b/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch
@@ -1,7 +1,7 @@
From: Benedikt Spranger <b.spranger at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
diff --git a/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch b/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch
index 612a1e3..d5228b1 100644
--- a/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch
+++ b/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch
@@ -1,7 +1,7 @@
Subject: completion: Use simple wait queues
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 11 Jan 2013 11:23:51 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Completions have no long lasting callbacks and therefor do not need
the complex waitqueue variant. Use simple waitqueues which reduces the
@@ -36,7 +36,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
break;
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
-@@ -1590,7 +1590,7 @@ static void ffs_data_put(struct ffs_data
+@@ -1593,7 +1593,7 @@ static void ffs_data_put(struct ffs_data
pr_info("%s(): freeing\n", __func__);
ffs_data_clear(ffs);
BUG_ON(waitqueue_active(&ffs->ev.waitq) ||
@@ -137,7 +137,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
struct mm_struct;
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
-@@ -681,6 +681,10 @@ static int load_image_and_restore(void)
+@@ -683,6 +683,10 @@ static int load_image_and_restore(void)
return error;
}
@@ -148,7 +148,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/**
* hibernate - Carry out system hibernation, including saving the image.
*/
-@@ -694,6 +698,8 @@ int hibernate(void)
+@@ -696,6 +700,8 @@ int hibernate(void)
return -EPERM;
}
@@ -157,7 +157,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
lock_system_sleep();
/* The snapshot device should not be opened while we're running */
if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
-@@ -771,6 +777,7 @@ int hibernate(void)
+@@ -773,6 +779,7 @@ int hibernate(void)
atomic_inc(&snapshot_device_available);
Unlock:
unlock_system_sleep();
@@ -167,7 +167,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
-@@ -523,6 +523,8 @@ static int enter_state(suspend_state_t s
+@@ -531,6 +531,8 @@ static int enter_state(suspend_state_t s
return error;
}
@@ -176,7 +176,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/**
* pm_suspend - Externally visible function for suspending the system.
* @state: System sleep state to enter.
-@@ -537,6 +539,8 @@ int pm_suspend(suspend_state_t state)
+@@ -545,6 +547,8 @@ int pm_suspend(suspend_state_t state)
if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
return -EINVAL;
@@ -185,7 +185,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
error = enter_state(state);
if (error) {
suspend_stats.fail++;
-@@ -544,6 +548,7 @@ int pm_suspend(suspend_state_t state)
+@@ -552,6 +556,7 @@ int pm_suspend(suspend_state_t state)
} else {
suspend_stats.success++;
}
@@ -287,7 +287,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
EXPORT_SYMBOL(completion_done);
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -3317,7 +3317,10 @@ void migrate_disable(void)
+@@ -3323,7 +3323,10 @@ void migrate_disable(void)
}
#ifdef CONFIG_SCHED_DEBUG
@@ -299,7 +299,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#endif
if (p->migrate_disable) {
-@@ -3344,7 +3347,10 @@ void migrate_enable(void)
+@@ -3350,7 +3353,10 @@ void migrate_enable(void)
}
#ifdef CONFIG_SCHED_DEBUG
diff --git a/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch b/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch
index 10398a2..44a9fd5 100644
--- a/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch
+++ b/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch
@@ -1,7 +1,7 @@
Subject: sched: Use the proper LOCK_OFFSET for cond_resched()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 17 Jul 2011 22:51:33 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
RT does not increment preempt count when a 'sleeping' spinlock is
locked. Update PREEMPT_LOCK_OFFSET for that case.
diff --git a/debian/patches/features/all/rt/cond-resched-softirq-rt.patch b/debian/patches/features/all/rt/cond-resched-softirq-rt.patch
index 5213dd1..430bce7 100644
--- a/debian/patches/features/all/rt/cond-resched-softirq-rt.patch
+++ b/debian/patches/features/all/rt/cond-resched-softirq-rt.patch
@@ -1,7 +1,7 @@
Subject: sched: Take RT softirq semantics into account in cond_resched()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 14 Jul 2011 09:56:44 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The softirq semantics work different on -RT. There is no SOFTIRQ_MASK in
the preemption counter which leads to the BUG_ON() statement in
@@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -3258,12 +3258,16 @@ extern int __cond_resched_lock(spinlock_
+@@ -3366,12 +3366,16 @@ extern int __cond_resched_lock(spinlock_
__cond_resched_lock(lock); \
})
@@ -35,7 +35,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
{
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -5021,6 +5021,7 @@ int __cond_resched_lock(spinlock_t *lock
+@@ -5050,6 +5050,7 @@ int __cond_resched_lock(spinlock_t *lock
}
EXPORT_SYMBOL(__cond_resched_lock);
@@ -43,7 +43,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
int __sched __cond_resched_softirq(void)
{
BUG_ON(!in_softirq());
-@@ -5034,6 +5035,7 @@ int __sched __cond_resched_softirq(void)
+@@ -5063,6 +5064,7 @@ int __sched __cond_resched_softirq(void)
return 0;
}
EXPORT_SYMBOL(__cond_resched_softirq);
diff --git a/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch b/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch
index d39c467..310f6c5 100644
--- a/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch
+++ b/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch
@@ -2,7 +2,7 @@ From: Mike Galbraith <umgwanakikbuti at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/cpu-hotplug-Document-why-PREEMPT_RT-uses-a-spinlock.patch b/debian/patches/features/all/rt/cpu-hotplug-Document-why-PREEMPT_RT-uses-a-spinlock.patch
index 0498a74..8b78c1b 100644
--- a/debian/patches/features/all/rt/cpu-hotplug-Document-why-PREEMPT_RT-uses-a-spinlock.patch
+++ b/debian/patches/features/all/rt/cpu-hotplug-Document-why-PREEMPT_RT-uses-a-spinlock.patch
@@ -1,7 +1,7 @@
From: Steven Rostedt <rostedt at goodmis.org>
Date: Thu, 5 Dec 2013 09:16:52 -0500
Subject: cpu hotplug: Document why PREEMPT_RT uses a spinlock
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The patch:
@@ -39,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -187,6 +187,14 @@ struct hotplug_pcp {
+@@ -260,6 +260,14 @@ struct hotplug_pcp {
int grab_lock;
struct completion synced;
#ifdef CONFIG_PREEMPT_RT_FULL
diff --git a/debian/patches/features/all/rt/cpu-rt-make-hotplug-lock-a-sleeping-spinlock-on-rt.patch b/debian/patches/features/all/rt/cpu-rt-make-hotplug-lock-a-sleeping-spinlock-on-rt.patch
index 7ab0c0f..49086f8 100644
--- a/debian/patches/features/all/rt/cpu-rt-make-hotplug-lock-a-sleeping-spinlock-on-rt.patch
+++ b/debian/patches/features/all/rt/cpu-rt-make-hotplug-lock-a-sleeping-spinlock-on-rt.patch
@@ -1,7 +1,7 @@
Subject: cpu: Make hotplug.lock a "sleeping" spinlock on RT
From: Steven Rostedt <rostedt at goodmis.org>
Date: Fri, 02 Mar 2012 10:36:57 -0500
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Tasks can block on hotplug.lock in pin_current_cpu(), but their state
might be != RUNNING. So the mutex wakeup will set the state
@@ -25,7 +25,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -137,10 +137,16 @@ static int cpu_hotplug_disabled;
+@@ -210,10 +210,16 @@ static int cpu_hotplug_disabled;
static struct {
struct task_struct *active_writer;
@@ -42,7 +42,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Also blocks the new readers during
* an ongoing cpu hotplug operation.
-@@ -153,12 +159,24 @@ static struct {
+@@ -226,12 +232,24 @@ static struct {
} cpu_hotplug = {
.active_writer = NULL,
.wq = __WAIT_QUEUE_HEAD_INITIALIZER(cpu_hotplug.wq),
@@ -52,7 +52,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
.lock = __MUTEX_INITIALIZER(cpu_hotplug.lock),
+#endif
#ifdef CONFIG_DEBUG_LOCK_ALLOC
- .dep_map = {.name = "cpu_hotplug.lock" },
+ .dep_map = STATIC_LOCKDEP_MAP_INIT("cpu_hotplug.dep_map", &cpu_hotplug.dep_map),
#endif
};
@@ -67,7 +67,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Lockdep annotations for get/put_online_cpus() and cpu_hotplug_begin/end() */
#define cpuhp_lock_acquire_read() lock_map_acquire_read(&cpu_hotplug.dep_map)
#define cpuhp_lock_acquire_tryread() \
-@@ -195,8 +213,8 @@ void pin_current_cpu(void)
+@@ -268,8 +286,8 @@ void pin_current_cpu(void)
return;
}
preempt_enable();
@@ -78,7 +78,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
preempt_disable();
goto retry;
}
-@@ -269,9 +287,9 @@ void get_online_cpus(void)
+@@ -342,9 +360,9 @@ void get_online_cpus(void)
if (cpu_hotplug.active_writer == current)
return;
cpuhp_lock_acquire_read();
@@ -90,7 +90,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
EXPORT_SYMBOL_GPL(get_online_cpus);
-@@ -324,11 +342,11 @@ void cpu_hotplug_begin(void)
+@@ -397,11 +415,11 @@ void cpu_hotplug_begin(void)
cpuhp_lock_acquire();
for (;;) {
@@ -104,7 +104,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
schedule();
}
finish_wait(&cpu_hotplug.wq, &wait);
-@@ -337,7 +355,7 @@ void cpu_hotplug_begin(void)
+@@ -410,7 +428,7 @@ void cpu_hotplug_begin(void)
void cpu_hotplug_done(void)
{
cpu_hotplug.active_writer = NULL;
diff --git a/debian/patches/features/all/rt/cpu-rt-rework-cpu-down.patch b/debian/patches/features/all/rt/cpu-rt-rework-cpu-down.patch
index d4ecbfe..2ec7d15 100644
--- a/debian/patches/features/all/rt/cpu-rt-rework-cpu-down.patch
+++ b/debian/patches/features/all/rt/cpu-rt-rework-cpu-down.patch
@@ -1,7 +1,7 @@
From: Steven Rostedt <srostedt at redhat.com>
Date: Mon, 16 Jul 2012 08:07:43 +0000
Subject: cpu/rt: Rework cpu down for PREEMPT_RT
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Bringing a CPU down is a pain with the PREEMPT_RT kernel because
tasks can be preempted in many more places than in non-RT. In
@@ -51,13 +51,13 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
---
include/linux/sched.h | 7 +
- kernel/cpu.c | 238 +++++++++++++++++++++++++++++++++++++++++---------
+ kernel/cpu.c | 236 +++++++++++++++++++++++++++++++++++++++++---------
kernel/sched/core.c | 78 ++++++++++++++++
- 3 files changed, 281 insertions(+), 42 deletions(-)
+ 3 files changed, 280 insertions(+), 41 deletions(-)
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -2429,6 +2429,10 @@ extern void do_set_cpus_allowed(struct t
+@@ -2473,6 +2473,10 @@ extern void do_set_cpus_allowed(struct t
extern int set_cpus_allowed_ptr(struct task_struct *p,
const struct cpumask *new_mask);
@@ -68,7 +68,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#else
static inline void do_set_cpus_allowed(struct task_struct *p,
const struct cpumask *new_mask)
-@@ -2441,6 +2445,9 @@ static inline int set_cpus_allowed_ptr(s
+@@ -2485,6 +2489,9 @@ static inline int set_cpus_allowed_ptr(s
return -EINVAL;
return 0;
}
@@ -80,7 +80,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef CONFIG_NO_HZ_COMMON
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -137,16 +137,10 @@ static int cpu_hotplug_disabled;
+@@ -210,16 +210,10 @@ static int cpu_hotplug_disabled;
static struct {
struct task_struct *active_writer;
@@ -97,19 +97,17 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Also blocks the new readers during
* an ongoing cpu hotplug operation.
-@@ -158,25 +152,13 @@ static struct {
- #endif
+@@ -232,24 +226,12 @@ static struct {
} cpu_hotplug = {
.active_writer = NULL,
-- .wq = __WAIT_QUEUE_HEAD_INITIALIZER(cpu_hotplug.wq),
+ .wq = __WAIT_QUEUE_HEAD_INITIALIZER(cpu_hotplug.wq),
-#ifdef CONFIG_PREEMPT_RT_FULL
- .lock = __SPIN_LOCK_UNLOCKED(cpu_hotplug.lock),
-#else
.lock = __MUTEX_INITIALIZER(cpu_hotplug.lock),
-#endif
-+ .wq = __WAIT_QUEUE_HEAD_INITIALIZER(cpu_hotplug.wq),
#ifdef CONFIG_DEBUG_LOCK_ALLOC
- .dep_map = {.name = "cpu_hotplug.lock" },
+ .dep_map = STATIC_LOCKDEP_MAP_INIT("cpu_hotplug.dep_map", &cpu_hotplug.dep_map),
#endif
};
@@ -124,7 +122,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Lockdep annotations for get/put_online_cpus() and cpu_hotplug_begin/end() */
#define cpuhp_lock_acquire_read() lock_map_acquire_read(&cpu_hotplug.dep_map)
#define cpuhp_lock_acquire_tryread() \
-@@ -184,12 +166,42 @@ static struct {
+@@ -257,12 +239,42 @@ static struct {
#define cpuhp_lock_acquire() lock_map_acquire(&cpu_hotplug.dep_map)
#define cpuhp_lock_release() lock_map_release(&cpu_hotplug.dep_map)
@@ -167,7 +165,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
static DEFINE_PER_CPU(struct hotplug_pcp, hotplug_pcp);
/**
-@@ -203,18 +215,39 @@ static DEFINE_PER_CPU(struct hotplug_pcp
+@@ -276,18 +288,39 @@ static DEFINE_PER_CPU(struct hotplug_pcp
void pin_current_cpu(void)
{
struct hotplug_pcp *hp;
@@ -211,7 +209,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
preempt_disable();
goto retry;
}
-@@ -235,26 +268,84 @@ void unpin_current_cpu(void)
+@@ -308,26 +341,84 @@ void unpin_current_cpu(void)
wake_up_process(hp->unplug);
}
@@ -303,7 +301,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Start the sync_unplug_thread on the target cpu and wait for it to
* complete.
-@@ -262,23 +353,83 @@ static int sync_unplug_thread(void *data
+@@ -335,23 +426,83 @@ static int sync_unplug_thread(void *data
static int cpu_unplug_begin(unsigned int cpu)
{
struct hotplug_pcp *hp = &per_cpu(hotplug_pcp, cpu);
@@ -394,7 +392,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
void get_online_cpus(void)
-@@ -287,9 +438,9 @@ void get_online_cpus(void)
+@@ -360,9 +511,9 @@ void get_online_cpus(void)
if (cpu_hotplug.active_writer == current)
return;
cpuhp_lock_acquire_read();
@@ -406,7 +404,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
EXPORT_SYMBOL_GPL(get_online_cpus);
-@@ -342,11 +493,11 @@ void cpu_hotplug_begin(void)
+@@ -415,11 +566,11 @@ void cpu_hotplug_begin(void)
cpuhp_lock_acquire();
for (;;) {
@@ -420,7 +418,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
schedule();
}
finish_wait(&cpu_hotplug.wq, &wait);
-@@ -355,7 +506,7 @@ void cpu_hotplug_begin(void)
+@@ -428,7 +579,7 @@ void cpu_hotplug_begin(void)
void cpu_hotplug_done(void)
{
cpu_hotplug.active_writer = NULL;
@@ -429,7 +427,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
cpuhp_lock_release();
}
-@@ -828,6 +979,9 @@ static int takedown_cpu(unsigned int cpu
+@@ -907,6 +1058,9 @@ static int takedown_cpu(unsigned int cpu
kthread_park(per_cpu_ptr(&cpuhp_state, cpu)->thread);
smpboot_park_threads(cpu);
@@ -441,8 +439,8 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
* interrupt affinities.
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -1129,6 +1129,84 @@ void do_set_cpus_allowed(struct task_str
- enqueue_task(rq, p, ENQUEUE_RESTORE);
+@@ -1140,6 +1140,84 @@ void do_set_cpus_allowed(struct task_str
+ set_curr_task(rq, p);
}
+static DEFINE_PER_CPU(struct cpumask, sched_cpumasks);
diff --git a/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch b/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch
index a2d52bd..aadc056 100644
--- a/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch
+++ b/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch
@@ -1,7 +1,7 @@
From: Steven Rostedt <rostedt at goodmis.org>
Date: Tue, 4 Mar 2014 12:28:32 -0500
Subject: cpu_chill: Add a UNINTERRUPTIBLE hrtimer_nanosleep
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
We hit another bug that was caused by switching cpu_chill() from
msleep() to hrtimer_nanosleep().
diff --git a/debian/patches/features/all/rt/cpu_down_move_migrate_enable_back.patch b/debian/patches/features/all/rt/cpu_down_move_migrate_enable_back.patch
index 06390c3..504c896 100644
--- a/debian/patches/features/all/rt/cpu_down_move_migrate_enable_back.patch
+++ b/debian/patches/features/all/rt/cpu_down_move_migrate_enable_back.patch
@@ -1,7 +1,7 @@
From: Tiejun Chen <tiejun.chen at windriver.com>
Subject: cpu_down: move migrate_enable() back
Date: Thu, 7 Nov 2013 10:06:07 +0800
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Commit 08c1ab68, "hotplug-use-migrate-disable.patch", intends to
use migrate_enable()/migrate_disable() to replace that combination
@@ -35,7 +35,7 @@ Signed-off-by: Tiejun Chen <tiejun.chen at windriver.com>
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -1117,6 +1117,7 @@ static int __ref _cpu_down(unsigned int
+@@ -1195,6 +1195,7 @@ static int __ref _cpu_down(unsigned int
goto restore_cpus;
}
@@ -43,7 +43,7 @@ Signed-off-by: Tiejun Chen <tiejun.chen at windriver.com>
cpu_hotplug_begin();
ret = cpu_unplug_begin(cpu);
if (ret) {
-@@ -1164,7 +1165,6 @@ static int __ref _cpu_down(unsigned int
+@@ -1242,7 +1243,6 @@ static int __ref _cpu_down(unsigned int
cpu_unplug_done(cpu);
out_cancel:
cpu_hotplug_done();
diff --git a/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch b/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch
index cede33e..b97d3f5 100644
--- a/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch
+++ b/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Ralf posted a picture of a backtrace from
diff --git a/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch b/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch
index 44f41c0..fd6e15f 100644
--- a/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch
+++ b/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch
@@ -1,7 +1,7 @@
Subject: cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 14 Dec 2011 01:03:49 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
There are "valid" GFP_ATOMIC allocations such as
@@ -47,7 +47,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -888,7 +888,7 @@ config IOMMU_HELPER
+@@ -900,7 +900,7 @@ config IOMMU_HELPER
config MAXSMP
bool "Enable Maximum number of SMP Processors and NUMA Nodes"
depends on X86_64 && SMP && DEBUG_KERNEL
diff --git a/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch b/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch
index 8020d75..2a95cfe 100644
--- a/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch
+++ b/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Don Estabrook reported
| kernel: WARNING: CPU: 2 PID: 858 at kernel/sched/core.c:2428 migrate_disable+0xed/0x100()
diff --git a/debian/patches/features/all/rt/crypto-ccp-remove-rwlocks_types.h.patch b/debian/patches/features/all/rt/crypto-ccp-remove-rwlocks_types.h.patch
deleted file mode 100644
index ad9be73..0000000
--- a/debian/patches/features/all/rt/crypto-ccp-remove-rwlocks_types.h.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Wed, 11 May 2016 11:56:18 +0200
-Subject: crypto/ccp: remove rwlocks_types.h
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-Users of rwlocks should include spinlock.h instead including this
-header file. The current users of rwlocks_types.h are internal.
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- drivers/crypto/ccp/ccp-dev.c | 1 -
- 1 file changed, 1 deletion(-)
-
---- a/drivers/crypto/ccp/ccp-dev.c
-+++ b/drivers/crypto/ccp/ccp-dev.c
-@@ -16,7 +16,6 @@
- #include <linux/sched.h>
- #include <linux/interrupt.h>
- #include <linux/spinlock.h>
--#include <linux/rwlock_types.h>
- #include <linux/types.h>
- #include <linux/mutex.h>
- #include <linux/delay.h>
diff --git a/debian/patches/features/all/rt/debugobjects-rt.patch b/debian/patches/features/all/rt/debugobjects-rt.patch
index 6c12b59..6ca7597 100644
--- a/debian/patches/features/all/rt/debugobjects-rt.patch
+++ b/debian/patches/features/all/rt/debugobjects-rt.patch
@@ -1,7 +1,7 @@
Subject: debugobjects: Make RT aware
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 17 Jul 2011 21:41:35 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Avoid filling the pool / allocating memory with irqs off().
diff --git a/debian/patches/features/all/rt/dm-make-rt-aware.patch b/debian/patches/features/all/rt/dm-make-rt-aware.patch
index aeae7ef..265a99d 100644
--- a/debian/patches/features/all/rt/dm-make-rt-aware.patch
+++ b/debian/patches/features/all/rt/dm-make-rt-aware.patch
@@ -1,7 +1,7 @@
Subject: dm: Make rt aware
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 14 Nov 2011 23:06:09 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Use the BUG_ON_NORT variant for the irq_disabled() checks. RT has
interrupts legitimately enabled here as we cant deadlock against the
@@ -16,10 +16,10 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
-@@ -811,7 +811,7 @@ static void dm_old_request_fn(struct req
+@@ -832,7 +832,7 @@ static void dm_old_request_fn(struct req
/* Establish tio->ti before queuing work (map_tio_request) */
tio->ti = ti;
- queue_kthread_work(&md->kworker, &tio->work);
+ kthread_queue_work(&md->kworker, &tio->work);
- BUG_ON(!irqs_disabled());
+ BUG_ON_NONRT(!irqs_disabled());
}
diff --git a/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch
index 37a0b92..b429c90 100644
--- a/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch
+++ b/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch
@@ -2,7 +2,7 @@ From: Mike Galbraith <umgwanakikbuti at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
diff --git a/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch b/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch
index da0e733..ee0a244 100644
--- a/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch
+++ b/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at elte.hu>
Date: Fri, 3 Jul 2009 08:29:24 -0500
Subject: drivers/net: Use disable_irq_nosync() in 8139too
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Use disable_irq_nosync() instead of disable_irq() as this might be
called in atomic context with netpoll.
diff --git a/debian/patches/features/all/rt/drivers-net-fix-livelock-issues.patch b/debian/patches/features/all/rt/drivers-net-fix-livelock-issues.patch
deleted file mode 100644
index 5bc8aa9..0000000
--- a/debian/patches/features/all/rt/drivers-net-fix-livelock-issues.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From: Thomas Gleixner <tglx at linutronix.de>
-Date: Sat, 20 Jun 2009 11:36:54 +0200
-Subject: drivers/net: fix livelock issues
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-Preempt-RT runs into a live lock issue with the NETDEV_TX_LOCKED micro
-optimization. The reason is that the softirq thread is rescheduling
-itself on that return value. Depending on priorities it starts to
-monoplize the CPU and livelock on UP systems.
-
-Remove it.
-
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
-
----
- drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 6 +-----
- drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 3 +--
- drivers/net/ethernet/chelsio/cxgb/sge.c | 3 +--
- drivers/net/ethernet/neterion/s2io.c | 7 +------
- drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 6 ++----
- drivers/net/ethernet/tehuti/tehuti.c | 9 ++-------
- drivers/net/rionet.c | 6 +-----
- 7 files changed, 9 insertions(+), 31 deletions(-)
-
---- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
-+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
-@@ -2217,11 +2217,7 @@ static netdev_tx_t atl1c_xmit_frame(stru
- }
-
- tpd_req = atl1c_cal_tpd_req(skb);
-- if (!spin_trylock_irqsave(&adapter->tx_lock, flags)) {
-- if (netif_msg_pktdata(adapter))
-- dev_info(&adapter->pdev->dev, "tx locked\n");
-- return NETDEV_TX_LOCKED;
-- }
-+ spin_lock_irqsave(&adapter->tx_lock, flags);
-
- if (atl1c_tpd_avail(adapter, type) < tpd_req) {
- /* no enough descriptor, just stop queue */
---- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
-+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
-@@ -1880,8 +1880,7 @@ static netdev_tx_t atl1e_xmit_frame(stru
- return NETDEV_TX_OK;
- }
- tpd_req = atl1e_cal_tdp_req(skb);
-- if (!spin_trylock_irqsave(&adapter->tx_lock, flags))
-- return NETDEV_TX_LOCKED;
-+ spin_lock_irqsave(&adapter->tx_lock, flags);
-
- if (atl1e_tpd_avail(adapter) < tpd_req) {
- /* no enough descriptor, just stop queue */
---- a/drivers/net/ethernet/chelsio/cxgb/sge.c
-+++ b/drivers/net/ethernet/chelsio/cxgb/sge.c
-@@ -1664,8 +1664,7 @@ static int t1_sge_tx(struct sk_buff *skb
- struct cmdQ *q = &sge->cmdQ[qid];
- unsigned int credits, pidx, genbit, count, use_sched_skb = 0;
-
-- if (!spin_trylock(&q->lock))
-- return NETDEV_TX_LOCKED;
-+ spin_lock(&q->lock);
-
- reclaim_completed_tx(sge, q);
-
---- a/drivers/net/ethernet/neterion/s2io.c
-+++ b/drivers/net/ethernet/neterion/s2io.c
-@@ -4084,12 +4084,7 @@ static netdev_tx_t s2io_xmit(struct sk_b
- [skb->priority & (MAX_TX_FIFOS - 1)];
- fifo = &mac_control->fifos[queue];
-
-- if (do_spin_lock)
-- spin_lock_irqsave(&fifo->tx_lock, flags);
-- else {
-- if (unlikely(!spin_trylock_irqsave(&fifo->tx_lock, flags)))
-- return NETDEV_TX_LOCKED;
-- }
-+ spin_lock_irqsave(&fifo->tx_lock, flags);
-
- if (sp->config.multiq) {
- if (__netif_subqueue_stopped(dev, fifo->fifo_no)) {
---- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
-+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
-@@ -2137,10 +2137,8 @@ static int pch_gbe_xmit_frame(struct sk_
- struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring;
- unsigned long flags;
-
-- if (!spin_trylock_irqsave(&tx_ring->tx_lock, flags)) {
-- /* Collision - tell upper layer to requeue */
-- return NETDEV_TX_LOCKED;
-- }
-+ spin_lock_irqsave(&tx_ring->tx_lock, flags);
-+
- if (unlikely(!PCH_GBE_DESC_UNUSED(tx_ring))) {
- netif_stop_queue(netdev);
- spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
---- a/drivers/net/ethernet/tehuti/tehuti.c
-+++ b/drivers/net/ethernet/tehuti/tehuti.c
-@@ -1629,13 +1629,8 @@ static netdev_tx_t bdx_tx_transmit(struc
- unsigned long flags;
-
- ENTER;
-- local_irq_save(flags);
-- if (!spin_trylock(&priv->tx_lock)) {
-- local_irq_restore(flags);
-- DBG("%s[%s]: TX locked, returning NETDEV_TX_LOCKED\n",
-- BDX_DRV_NAME, ndev->name);
-- return NETDEV_TX_LOCKED;
-- }
-+
-+ spin_lock_irqsave(&priv->tx_lock, flags);
-
- /* build tx descriptor */
- BDX_ASSERT(f->m.wptr >= f->m.memsz); /* started with valid wptr */
---- a/drivers/net/rionet.c
-+++ b/drivers/net/rionet.c
-@@ -179,11 +179,7 @@ static int rionet_start_xmit(struct sk_b
- unsigned long flags;
- int add_num = 1;
-
-- local_irq_save(flags);
-- if (!spin_trylock(&rnet->tx_lock)) {
-- local_irq_restore(flags);
-- return NETDEV_TX_LOCKED;
-- }
-+ spin_lock_irqsave(&rnet->tx_lock, flags);
-
- if (is_multicast_ether_addr(eth->h_dest))
- add_num = nets[rnet->mport->id].nact;
diff --git a/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch b/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch
index f5ad732..4b6d2da 100644
--- a/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch
+++ b/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch
@@ -1,7 +1,7 @@
From: Steven Rostedt <rostedt at goodmis.org>
Date: Fri, 3 Jul 2009 08:30:00 -0500
Subject: drivers/net: vortex fix locking issues
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Argh, cut and paste wasn't enough...
diff --git a/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch b/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch
index aeab9ca..61649db 100644
--- a/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch
+++ b/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at elte.hu>
Date: Fri, 3 Jul 2009 08:29:30 -0500
Subject: drivers: random: Reduce preempt disabled region
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
No need to keep preemption disabled across the whole function.
diff --git a/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch b/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch
index ca9378a..bfe4685 100644
--- a/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch
+++ b/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch
@@ -1,7 +1,7 @@
Subject: tty/serial/omap: Make the locking RT aware
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 28 Jul 2011 13:32:57 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch b/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch
index cc7cca1..e368bdb 100644
--- a/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch
+++ b/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch
@@ -1,7 +1,7 @@
Subject: tty/serial/pl011: Make the locking work on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 08 Jan 2013 21:36:51 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
@@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
-@@ -2167,13 +2167,19 @@ pl011_console_write(struct console *co,
+@@ -2194,13 +2194,19 @@ pl011_console_write(struct console *co,
clk_enable(uap->clk);
@@ -36,7 +36,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* First save the CR then disable the interrupts
-@@ -2197,8 +2203,7 @@ pl011_console_write(struct console *co,
+@@ -2224,8 +2230,7 @@ pl011_console_write(struct console *co,
pl011_write(old_cr, uap, REG_CR);
if (locked)
diff --git a/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch b/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch
index 0a271fc..f54003a 100644
--- a/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch
+++ b/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch
@@ -2,7 +2,7 @@ From: Mike Galbraith <umgwanakikbuti at gmail.com>
Date: Thu, 20 Oct 2016 11:15:22 +0200
Subject: [PATCH] drivers/zram: Don't disable preemption in
zcomp_stream_get/put()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/drm-i915-drop-trace_i915_gem_ring_dispatch-onrt.patch b/debian/patches/features/all/rt/drm-i915-drop-trace_i915_gem_ring_dispatch-onrt.patch
index a6b68ca..0a22a29 100644
--- a/debian/patches/features/all/rt/drm-i915-drop-trace_i915_gem_ring_dispatch-onrt.patch
+++ b/debian/patches/features/all/rt/drm-i915-drop-trace_i915_gem_ring_dispatch-onrt.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Thu, 25 Apr 2013 18:12:52 +0200
Subject: drm/i915: drop trace_i915_gem_ring_dispatch on rt
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
This tracepoint is responsible for:
@@ -47,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
-@@ -1302,7 +1302,9 @@ i915_gem_ringbuffer_submission(struct i9
+@@ -1537,7 +1537,9 @@ execbuf_submit(struct i915_execbuffer_pa
if (ret)
return ret;
diff --git a/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch b/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch
index 0dbfc2d..74faa6e 100644
--- a/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch
+++ b/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch
@@ -1,7 +1,7 @@
Subject: drm,i915: Use local_lock/unlock_irq() in intel_pipe_update_start/end()
From: Mike Galbraith <umgwanakikbuti at gmail.com>
Date: Sat, 27 Feb 2016 09:01:42 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
[ 8.014039] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:918
@@ -62,15 +62,15 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
-@@ -38,6 +38,7 @@
+@@ -35,6 +35,7 @@
+ #include <drm/drm_rect.h>
+ #include <drm/drm_atomic.h>
+ #include <drm/drm_plane_helper.h>
++#include <linux/locallock.h>
#include "intel_drv.h"
+ #include "intel_frontbuffer.h"
#include <drm/i915_drm.h>
- #include "i915_drv.h"
-+#include <linux/locallock.h>
-
- static bool
- format_is_yuv(uint32_t format)
-@@ -64,6 +65,8 @@ int intel_usecs_to_scanlines(const struc
+@@ -65,6 +66,8 @@ int intel_usecs_to_scanlines(const struc
1000 * adjusted_mode->crtc_htotal);
}
@@ -79,7 +79,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/**
* intel_pipe_update_start() - start update of a set of display registers
* @crtc: the crtc of which the registers are going to be updated
-@@ -94,7 +97,7 @@ void intel_pipe_update_start(struct inte
+@@ -95,7 +98,7 @@ void intel_pipe_update_start(struct inte
min = vblank_start - intel_usecs_to_scanlines(adjusted_mode, 100);
max = vblank_start - 1;
@@ -88,7 +88,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (min <= 0 || max <= 0)
return;
-@@ -124,11 +127,11 @@ void intel_pipe_update_start(struct inte
+@@ -125,11 +128,11 @@ void intel_pipe_update_start(struct inte
break;
}
@@ -102,7 +102,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
finish_wait(wq, &wait);
-@@ -180,7 +183,7 @@ void intel_pipe_update_end(struct intel_
+@@ -181,7 +184,7 @@ void intel_pipe_update_end(struct intel_
crtc->base.state->event = NULL;
}
diff --git a/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch b/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch
index 042f0d9..1f5ef82 100644
--- a/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch
+++ b/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch
@@ -1,7 +1,7 @@
Subject: drm,radeon,i915: Use preempt_disable/enable_rt() where recommended
From: Mike Galbraith <umgwanakikbuti at gmail.com>
Date: Sat, 27 Feb 2016 08:09:11 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
DRM folks identified the spots, so use them.
@@ -34,7 +34,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
-@@ -1869,6 +1869,7 @@ int radeon_get_crtc_scanoutpos(struct dr
+@@ -1845,6 +1845,7 @@ int radeon_get_crtc_scanoutpos(struct dr
struct radeon_device *rdev = dev->dev_private;
/* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */
@@ -42,7 +42,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Get optional system timestamp before query. */
if (stime)
-@@ -1961,6 +1962,7 @@ int radeon_get_crtc_scanoutpos(struct dr
+@@ -1937,6 +1938,7 @@ int radeon_get_crtc_scanoutpos(struct dr
*etime = ktime_get();
/* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */
diff --git a/debian/patches/features/all/rt/dump-stack-don-t-disable-preemption-during-trace.patch b/debian/patches/features/all/rt/dump-stack-don-t-disable-preemption-during-trace.patch
deleted file mode 100644
index c382a4d..0000000
--- a/debian/patches/features/all/rt/dump-stack-don-t-disable-preemption-during-trace.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Sun, 16 Aug 2015 14:27:50 +0200
-Subject: dump stack: don't disable preemption during trace
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-I see here large latencies during a stack dump on x86. The
-preempt_disable() and get_cpu() should forbid moving the task to another
-CPU during a stack dump and avoiding two stack traces in parallel on the
-same CPU. However a stack trace from a second CPU may still happen in
-parallel. Also nesting is allowed so a stack trace happens in
-process-context and we may have another one from IRQ context. With migrate
-disable we keep this code preemptible and allow a second backtrace on
-the same CPU by another task.
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- arch/x86/kernel/dumpstack_32.c | 4 ++--
- arch/x86/kernel/dumpstack_64.c | 8 ++++----
- 2 files changed, 6 insertions(+), 6 deletions(-)
-
---- a/arch/x86/kernel/dumpstack_32.c
-+++ b/arch/x86/kernel/dumpstack_32.c
-@@ -42,7 +42,7 @@ void dump_trace(struct task_struct *task
- unsigned long *stack, unsigned long bp,
- const struct stacktrace_ops *ops, void *data)
- {
-- const unsigned cpu = get_cpu();
-+ const unsigned cpu = get_cpu_light();
- int graph = 0;
- u32 *prev_esp;
-
-@@ -84,7 +84,7 @@ void dump_trace(struct task_struct *task
- break;
- touch_nmi_watchdog();
- }
-- put_cpu();
-+ put_cpu_light();
- }
- EXPORT_SYMBOL(dump_trace);
-
---- a/arch/x86/kernel/dumpstack_64.c
-+++ b/arch/x86/kernel/dumpstack_64.c
-@@ -152,7 +152,7 @@ void dump_trace(struct task_struct *task
- unsigned long *stack, unsigned long bp,
- const struct stacktrace_ops *ops, void *data)
- {
-- const unsigned cpu = get_cpu();
-+ const unsigned cpu = get_cpu_light();
- unsigned long *irq_stack = (unsigned long *)per_cpu(irq_stack_ptr, cpu);
- unsigned long dummy;
- unsigned used = 0;
-@@ -239,7 +239,7 @@ void dump_trace(struct task_struct *task
- * This handles the process stack:
- */
- bp = ops->walk_stack(task, stack, bp, ops, data, NULL, &graph);
-- put_cpu();
-+ put_cpu_light();
- }
- EXPORT_SYMBOL(dump_trace);
-
-@@ -253,7 +253,7 @@ show_stack_log_lvl(struct task_struct *t
- int cpu;
- int i;
-
-- preempt_disable();
-+ migrate_disable();
- cpu = smp_processor_id();
-
- irq_stack_end = (unsigned long *)(per_cpu(irq_stack_ptr, cpu));
-@@ -299,7 +299,7 @@ show_stack_log_lvl(struct task_struct *t
- stack++;
- touch_nmi_watchdog();
- }
-- preempt_enable();
-+ migrate_enable();
-
- pr_cont("\n");
- show_trace_log_lvl(task, regs, sp, bp, log_lvl);
diff --git a/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch b/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch
index fa84d63..f05b19c 100644
--- a/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch
+++ b/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch
@@ -1,7 +1,7 @@
Subject: fs/epoll: Do not disable preemption on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 08 Jul 2011 16:35:35 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch b/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch
index 8e7bf3f..996a77c 100644
--- a/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch
+++ b/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -55,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
aio_mnt = kern_mount(&aio_fs);
if (IS_ERR(aio_mnt))
panic("Failed to create aio fs mount.");
-@@ -578,9 +580,9 @@ static int kiocb_cancel(struct aio_kiocb
+@@ -581,9 +583,9 @@ static int kiocb_cancel(struct aio_kiocb
return cancel(&kiocb->common);
}
@@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
pr_debug("freeing %p\n", ctx);
-@@ -599,8 +601,8 @@ static void free_ioctx_reqs(struct percp
+@@ -602,8 +604,8 @@ static void free_ioctx_reqs(struct percp
if (ctx->rq_wait && atomic_dec_and_test(&ctx->rq_wait->count))
complete(&ctx->rq_wait->comp);
@@ -78,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
/*
-@@ -608,9 +610,9 @@ static void free_ioctx_reqs(struct percp
+@@ -611,9 +613,9 @@ static void free_ioctx_reqs(struct percp
* 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.
*/
@@ -90,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
struct aio_kiocb *req;
spin_lock_irq(&ctx->ctx_lock);
-@@ -629,6 +631,14 @@ static void free_ioctx_users(struct perc
+@@ -632,6 +634,14 @@ static void free_ioctx_users(struct perc
percpu_ref_put(&ctx->reqs);
}
diff --git a/debian/patches/features/all/rt/fs-block-rt-support.patch b/debian/patches/features/all/rt/fs-block-rt-support.patch
index de5a7f6..69e101a 100644
--- a/debian/patches/features/all/rt/fs-block-rt-support.patch
+++ b/debian/patches/features/all/rt/fs-block-rt-support.patch
@@ -1,7 +1,7 @@
Subject: block: Turn off warning which is bogus on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 14 Jun 2011 17:05:09 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
On -RT the context is always with IRQs enabled. Ignore this warning on -RT.
diff --git a/debian/patches/features/all/rt/fs-dcache-include-wait.h.patch b/debian/patches/features/all/rt/fs-dcache-include-wait.h.patch
index 40003f9..119d327 100644
--- a/debian/patches/features/all/rt/fs-dcache-include-wait.h.patch
+++ b/debian/patches/features/all/rt/fs-dcache-include-wait.h.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Wed, 14 Sep 2016 11:55:23 +0200
Subject: fs/dcache: include wait.h
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Since commit d9171b934526 ("parallel lookups machinery, part 4 (and
last)") dcache.h is using but does not include wait.h. It works as long
diff --git a/debian/patches/features/all/rt/fs-dcache-init-in_lookup_hashtable.patch b/debian/patches/features/all/rt/fs-dcache-init-in_lookup_hashtable.patch
index 0465430..e46f036 100644
--- a/debian/patches/features/all/rt/fs-dcache-init-in_lookup_hashtable.patch
+++ b/debian/patches/features/all/rt/fs-dcache-init-in_lookup_hashtable.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Wed, 14 Sep 2016 17:57:03 +0200
Subject: [PATCH] fs/dcache: init in_lookup_hashtable
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
in_lookup_hashtable was introduced in commit 94bdd655caba ("parallel
lookups machinery, part 3") and never initialized but since it is in
diff --git a/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch b/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch
index 1e42144..717fac9 100644
--- a/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch
+++ b/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch
@@ -1,7 +1,7 @@
Subject: fs: dcache: Use cpu_chill() in trylock loops
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 07 Mar 2012 21:00:34 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -18,7 +18,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
-@@ -30,6 +30,7 @@
+@@ -31,6 +31,7 @@
#include <linux/sched.h>
#include <linux/mount.h>
#include <linux/namei.h>
@@ -97,7 +97,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#include <linux/security.h>
#include <linux/idr.h>
#include <linux/init.h> /* init_rootfs */
-@@ -355,7 +356,7 @@ int __mnt_want_write(struct vfsmount *m)
+@@ -358,7 +359,7 @@ int __mnt_want_write(struct vfsmount *m)
smp_mb();
while (ACCESS_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) {
preempt_enable();
diff --git a/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch
index 8290fac..c8ceaf6 100644
--- a/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch
+++ b/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
@@ -81,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
INIT_HLIST_NODE(&dentry->d_u.d_alias);
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
-@@ -1174,7 +1174,7 @@ static int fuse_direntplus_link(struct f
+@@ -1191,7 +1191,7 @@ static int fuse_direntplus_link(struct f
struct inode *dir = d_inode(parent);
struct fuse_conn *fc;
struct inode *inode;
@@ -121,7 +121,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
struct dentry *dentry;
struct dentry *alias;
struct inode *dir = d_inode(parent);
-@@ -1490,7 +1490,7 @@ int nfs_atomic_open(struct inode *dir, s
+@@ -1498,7 +1498,7 @@ int nfs_atomic_open(struct inode *dir, s
struct file *file, unsigned open_flags,
umode_t mode, int *opened)
{
@@ -152,7 +152,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
spin_lock(&dentry->d_lock);
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
-@@ -1819,7 +1819,7 @@ bool proc_fill_cache(struct file *file,
+@@ -1834,7 +1834,7 @@ bool proc_fill_cache(struct file *file,
child = d_hash_and_lookup(dir, &qname);
if (!child) {
@@ -163,7 +163,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
goto end_instantiate;
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
-@@ -627,7 +627,7 @@ static bool proc_sys_fill_cache(struct f
+@@ -632,7 +632,7 @@ static bool proc_sys_fill_cache(struct f
child = d_lookup(dir, &qname);
if (!child) {
@@ -194,7 +194,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
extern struct dentry * d_exact_alias(struct dentry *, struct inode *);
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
-@@ -1484,7 +1484,7 @@ struct nfs_unlinkdata {
+@@ -1490,7 +1490,7 @@ struct nfs_unlinkdata {
struct nfs_removeargs args;
struct nfs_removeres res;
struct dentry *dentry;
diff --git a/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch b/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch
index afe4809..7569635 100644
--- a/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch
+++ b/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
bit_spin_locks break under RT.
diff --git a/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch b/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch
index bff0dbe..aa2bfb9 100644
--- a/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch
+++ b/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Mon, 17 Feb 2014 17:30:03 +0100
Subject: fs: jbd2: pull your plug when waiting for space
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Two cps in parallel managed to stall the the ext4 fs. It seems that
journal code is either waiting for locks or sleeping waiting for
diff --git a/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch b/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch
index 015f426..76311ea 100644
--- a/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch
+++ b/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 19 Jul 2009 08:44:27 -0500
Subject: fs: namespace preemption fix
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
On RT we cannot loop with preemption disabled here as
mnt_make_readonly() might have been preempted. We can safely enable
@@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/fs/namespace.c
+++ b/fs/namespace.c
-@@ -353,8 +353,11 @@ int __mnt_want_write(struct vfsmount *m)
+@@ -356,8 +356,11 @@ int __mnt_want_write(struct vfsmount *m)
* incremented count after it has set MNT_WRITE_HOLD.
*/
smp_mb();
diff --git a/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch b/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch
index f299876..1880192 100644
--- a/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch
+++ b/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -22,7 +22,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
-@@ -1805,7 +1805,11 @@ int nfs_rmdir(struct inode *dir, struct
+@@ -1813,7 +1813,11 @@ int nfs_rmdir(struct inode *dir, struct
trace_nfs_rmdir_enter(dir, dentry);
if (d_really_is_positive(dentry)) {
@@ -34,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name);
/* Ensure the VFS deletes this inode */
switch (error) {
-@@ -1815,7 +1819,11 @@ int nfs_rmdir(struct inode *dir, struct
+@@ -1823,7 +1827,11 @@ int nfs_rmdir(struct inode *dir, struct
case -ENOENT:
nfs_dentry_handle_enoent(dentry);
}
diff --git a/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch b/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch
index 9cf6441..bad318f 100644
--- a/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch
+++ b/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch
@@ -1,7 +1,7 @@
From: Mike Galbraith <efault at gmx.de>
Date: Fri, 3 Jul 2009 08:44:12 -0500
Subject: fs: ntfs: disable interrupt only on !RT
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
On Sat, 2007-10-27 at 11:44 +0200, Ingo Molnar wrote:
> * Nick Piggin <nickpiggin at yahoo.com.au> wrote:
diff --git a/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch b/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch
index a2d52ff..760ef0b 100644
--- a/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch
+++ b/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Wrap the bit_spin_lock calls into a separate inline and add the RT
replacements with a real spinlock.
@@ -74,7 +74,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
EXPORT_SYMBOL(end_buffer_async_write);
-@@ -3384,6 +3376,7 @@ struct buffer_head *alloc_buffer_head(gf
+@@ -3383,6 +3375,7 @@ struct buffer_head *alloc_buffer_head(gf
struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags);
if (ret) {
INIT_LIST_HEAD(&ret->b_assoc_buffers);
diff --git a/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch b/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch
index a80f206..9227ff3 100644
--- a/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch
+++ b/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch
@@ -1,7 +1,7 @@
From: Mike Galbraith <umgwanakikbuti at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Line up helper arrows to the right column.
diff --git a/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch b/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch
index 1325267..f52afcd 100644
--- a/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch
+++ b/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
---
diff --git a/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch
index 5fd8c86..14ba250 100644
--- a/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch
+++ b/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
In exit_pi_state_list() we have the following locking construct:
@@ -31,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/futex.c
+++ b/kernel/futex.c
-@@ -895,7 +895,9 @@ void exit_pi_state_list(struct task_stru
+@@ -904,7 +904,9 @@ void exit_pi_state_list(struct task_stru
* task still owns the PI-state:
*/
if (head->next != next) {
diff --git a/debian/patches/features/all/rt/futex-requeue-pi-fix.patch b/debian/patches/features/all/rt/futex-requeue-pi-fix.patch
index 9521a5e..b0b53f8 100644
--- a/debian/patches/features/all/rt/futex-requeue-pi-fix.patch
+++ b/debian/patches/features/all/rt/futex-requeue-pi-fix.patch
@@ -1,7 +1,7 @@
From: Steven Rostedt <rostedt at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Requeue with timeout causes a bug with PREEMPT_RT_FULL.
@@ -104,7 +104,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
RT_MUTEX_FULL_CHAINWALK);
--- a/kernel/locking/rtmutex_common.h
+++ b/kernel/locking/rtmutex_common.h
-@@ -98,6 +98,7 @@ enum rtmutex_chainwalk {
+@@ -99,6 +99,7 @@ enum rtmutex_chainwalk {
* PI-futex support (proxy locking functions, etc.):
*/
#define PI_WAKEUP_INPROGRESS ((struct rt_mutex_waiter *) 1)
diff --git a/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch b/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch
index ca0a33e..c08f042 100644
--- a/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch
+++ b/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Creates long latencies for no value
diff --git a/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch b/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch
index b5971c5..2d79fe6 100644
--- a/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch
+++ b/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Joe Korty reported, that __irq_set_affinity_locked() schedules a
workqueue while holding a rawlock which results in a might_sleep()
diff --git a/debian/patches/features/all/rt/genirq-force-threading.patch b/debian/patches/features/all/rt/genirq-force-threading.patch
index eb14d94..40173a8 100644
--- a/debian/patches/features/all/rt/genirq-force-threading.patch
+++ b/debian/patches/features/all/rt/genirq-force-threading.patch
@@ -1,7 +1,7 @@
Subject: genirq: Force interrupt thread on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 03 Apr 2011 11:57:29 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Force threaded_irqs and optimize the code (force_irqthreads) in regard
to this.
@@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
-@@ -398,9 +398,13 @@ extern int irq_set_irqchip_state(unsigne
+@@ -406,9 +406,13 @@ extern int irq_set_irqchip_state(unsigne
bool state);
#ifdef CONFIG_IRQ_FORCED_THREADING
diff --git a/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch b/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch
index 1c663ce..0e8e0c2 100644
--- a/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch
+++ b/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch
@@ -1,7 +1,7 @@
From: Josh Cartwright <joshc at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/gpu_don_t_check_for_the_lock_owner.patch b/debian/patches/features/all/rt/gpu_don_t_check_for_the_lock_owner.patch
index 9e75ffc..7627c9c 100644
--- a/debian/patches/features/all/rt/gpu_don_t_check_for_the_lock_owner.patch
+++ b/debian/patches/features/all/rt/gpu_don_t_check_for_the_lock_owner.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Tue, 14 Jul 2015 14:26:34 +0200
Subject: gpu: don't check for the lock owner.
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
diff --git a/debian/patches/features/all/rt/hotplug-Use-set_cpus_allowed_ptr-in-sync_unplug_thre.patch b/debian/patches/features/all/rt/hotplug-Use-set_cpus_allowed_ptr-in-sync_unplug_thre.patch
index 842cc51..3816cc3 100644
--- a/debian/patches/features/all/rt/hotplug-Use-set_cpus_allowed_ptr-in-sync_unplug_thre.patch
+++ b/debian/patches/features/all/rt/hotplug-Use-set_cpus_allowed_ptr-in-sync_unplug_thre.patch
@@ -1,7 +1,7 @@
From: Mike Galbraith <umgwanakikbuti at gmail.com>
Date: Tue, 24 Mar 2015 08:14:49 +0100
Subject: hotplug: Use set_cpus_allowed_ptr() in sync_unplug_thread()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
do_set_cpus_allowed() is not safe vs ->sched_class change.
@@ -36,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -345,7 +345,7 @@ static int sync_unplug_thread(void *data
+@@ -418,7 +418,7 @@ static int sync_unplug_thread(void *data
* we don't want any more work on this CPU.
*/
current->flags &= ~PF_NO_SETAFFINITY;
diff --git a/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch b/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch
index e1c5738..2550619 100644
--- a/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch
+++ b/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch
@@ -1,7 +1,7 @@
Subject: hotplug: Lightweight get online cpus
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 15 Jun 2011 12:36:06 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
get_online_cpus() is a heavy weight function which involves a global
mutex. migrate_disable() wants a simpler construct which prevents only
@@ -19,7 +19,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
-@@ -192,9 +192,6 @@ static inline void cpu_notifier_register
+@@ -180,9 +180,6 @@ static inline void cpu_notifier_register
#endif /* CONFIG_SMP */
extern struct bus_type cpu_subsys;
@@ -29,7 +29,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef CONFIG_HOTPLUG_CPU
/* Stop CPUs going up and down. */
-@@ -204,6 +201,8 @@ extern void get_online_cpus(void);
+@@ -192,6 +189,8 @@ extern void get_online_cpus(void);
extern void put_online_cpus(void);
extern void cpu_hotplug_disable(void);
extern void cpu_hotplug_enable(void);
@@ -38,7 +38,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri)
#define __hotcpu_notifier(fn, pri) __cpu_notifier(fn, pri)
#define register_hotcpu_notifier(nb) register_cpu_notifier(nb)
-@@ -221,6 +220,8 @@ static inline void cpu_hotplug_done(void
+@@ -209,6 +208,8 @@ static inline void cpu_hotplug_done(void
#define put_online_cpus() do { } while (0)
#define cpu_hotplug_disable() do { } while (0)
#define cpu_hotplug_enable() do { } while (0)
@@ -49,7 +49,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* These aren't inline functions due to a GCC bug. */
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -166,6 +166,100 @@ static struct {
+@@ -239,6 +239,100 @@ static struct {
#define cpuhp_lock_acquire() lock_map_acquire(&cpu_hotplug.dep_map)
#define cpuhp_lock_release() lock_map_release(&cpu_hotplug.dep_map)
@@ -150,7 +150,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void get_online_cpus(void)
{
-@@ -799,6 +893,8 @@ static int __ref _cpu_down(unsigned int
+@@ -877,6 +971,8 @@ static int __ref _cpu_down(unsigned int
struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
int prev_state, ret = 0;
bool hasdied = false;
@@ -159,7 +159,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (num_online_cpus() == 1)
return -EBUSY;
-@@ -806,7 +902,27 @@ static int __ref _cpu_down(unsigned int
+@@ -884,7 +980,27 @@ static int __ref _cpu_down(unsigned int
if (!cpu_present(cpu))
return -EINVAL;
@@ -187,7 +187,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
cpuhp_tasks_frozen = tasks_frozen;
-@@ -845,6 +961,8 @@ static int __ref _cpu_down(unsigned int
+@@ -923,6 +1039,8 @@ static int __ref _cpu_down(unsigned int
hasdied = prev_state != st->state && st->state == CPUHP_OFFLINE;
out:
diff --git a/debian/patches/features/all/rt/hotplug-sync_unplug-no-27-5cn-27-in-task-name.patch b/debian/patches/features/all/rt/hotplug-sync_unplug-no-27-5cn-27-in-task-name.patch
index 0f1454a..a5e6d51 100644
--- a/debian/patches/features/all/rt/hotplug-sync_unplug-no-27-5cn-27-in-task-name.patch
+++ b/debian/patches/features/all/rt/hotplug-sync_unplug-no-27-5cn-27-in-task-name.patch
@@ -1,7 +1,7 @@
Subject: hotplug: sync_unplug: No "\n" in task name
From: Yong Zhang <yong.zhang0 at gmail.com>
Date: Sun, 16 Oct 2011 18:56:43 +0800
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Otherwise the output will look a little odd.
@@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -245,7 +245,7 @@ static int cpu_unplug_begin(unsigned int
+@@ -318,7 +318,7 @@ static int cpu_unplug_begin(unsigned int
struct task_struct *tsk;
init_completion(&hp->synced);
diff --git a/debian/patches/features/all/rt/hotplug-use-migrate-disable.patch b/debian/patches/features/all/rt/hotplug-use-migrate-disable.patch
index 2f04a7a..fc62ea5 100644
--- a/debian/patches/features/all/rt/hotplug-use-migrate-disable.patch
+++ b/debian/patches/features/all/rt/hotplug-use-migrate-disable.patch
@@ -1,7 +1,7 @@
Subject: hotplug: Use migrate disable on unplug
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 17 Jul 2011 19:35:29 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Migration needs to be disabled accross the unplug handling to make
sure that the unplug thread is off the unplugged cpu.
@@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -910,14 +910,13 @@ static int __ref _cpu_down(unsigned int
+@@ -988,14 +988,13 @@ static int __ref _cpu_down(unsigned int
cpumask_andnot(cpumask, cpu_online_mask, cpumask_of(cpu));
set_cpus_allowed_ptr(current, cpumask);
free_cpumask_var(cpumask);
@@ -30,7 +30,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
cpu_hotplug_begin();
ret = cpu_unplug_begin(cpu);
-@@ -966,6 +965,7 @@ static int __ref _cpu_down(unsigned int
+@@ -1044,6 +1043,7 @@ static int __ref _cpu_down(unsigned int
cpu_unplug_done(cpu);
out_cancel:
cpu_hotplug_done();
diff --git a/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch b/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch
index e5a3629..0461536 100644
--- a/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch
+++ b/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch
@@ -1,7 +1,7 @@
From: Yang Shi <yang.shi at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
When run ltp leapsec_timer test, the following call trace is caught:
diff --git a/debian/patches/features/all/rt/hrtimer-enfore-64byte-alignment.patch b/debian/patches/features/all/rt/hrtimer-enfore-64byte-alignment.patch
index 2b12c0b..7d4ef77 100644
--- a/debian/patches/features/all/rt/hrtimer-enfore-64byte-alignment.patch
+++ b/debian/patches/features/all/rt/hrtimer-enfore-64byte-alignment.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Wed, 23 Dec 2015 20:57:41 +0100
Subject: hrtimer: enfore 64byte alignment
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The patch "hrtimer: Fixup hrtimer callback changes for preempt-rt" adds
a list_head expired to struct hrtimer_clock_base and with it we run into
diff --git a/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch b/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch
index 0f4309e..de3eb9c 100644
--- a/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch
+++ b/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 3 Jul 2009 08:44:31 -0500
Subject: hrtimer: Fixup hrtimer callback changes for preempt-rt
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
In preempt-rt we can not call the callbacks which take sleeping locks
from the timer interrupt context.
@@ -321,7 +321,7 @@ Signed-off-by: Ingo Molnar <mingo at elte.hu>
/**
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
-@@ -1195,6 +1195,7 @@ void tick_setup_sched_timer(void)
+@@ -1198,6 +1198,7 @@ void tick_setup_sched_timer(void)
* Emulate tick processing via per-CPU hrtimers:
*/
hrtimer_init(&ts->sched_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
diff --git a/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch b/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch
index 8d05160..53a3024 100644
--- a/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch
+++ b/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Make cancellation of a running callback in softirq context safe
against preemption.
diff --git a/debian/patches/features/all/rt/hwlat-detector-Don-t-ignore-threshold-module-paramet.patch b/debian/patches/features/all/rt/hwlat-detector-Don-t-ignore-threshold-module-paramet.patch
deleted file mode 100644
index 31099b7..0000000
--- a/debian/patches/features/all/rt/hwlat-detector-Don-t-ignore-threshold-module-paramet.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Mike Galbraith <bitbucket at online.de>
-Date: Fri, 30 Aug 2013 07:57:25 +0200
-Subject: hwlat-detector: Don't ignore threshold module parameter
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-If the user specified a threshold at module load time, use it.
-
-
-Acked-by: Steven Rostedt <rostedt at goodmis.org>
-Signed-off-by: Mike Galbraith <bitbucket at online.de>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- drivers/misc/hwlat_detector.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/misc/hwlat_detector.c
-+++ b/drivers/misc/hwlat_detector.c
-@@ -414,7 +414,7 @@ static int init_stats(void)
- goto out;
-
- __reset_stats();
-- data.threshold = DEFAULT_LAT_THRESHOLD; /* threshold us */
-+ data.threshold = threshold ?: DEFAULT_LAT_THRESHOLD; /* threshold us */
- data.sample_window = DEFAULT_SAMPLE_WINDOW; /* window us */
- data.sample_width = DEFAULT_SAMPLE_WIDTH; /* width us */
-
diff --git a/debian/patches/features/all/rt/hwlat-detector-Update-hwlat_detector-to-add-outer-lo.patch b/debian/patches/features/all/rt/hwlat-detector-Update-hwlat_detector-to-add-outer-lo.patch
deleted file mode 100644
index b282612..0000000
--- a/debian/patches/features/all/rt/hwlat-detector-Update-hwlat_detector-to-add-outer-lo.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From: Steven Rostedt <rostedt at goodmis.org>
-Date: Mon, 19 Aug 2013 17:33:25 -0400
-Subject: hwlat-detector: Update hwlat_detector to add outer loop detection
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-The hwlat_detector reads two timestamps in a row, then reports any
-gap between those calls. The problem is, it misses everything between
-the second reading of the time stamp to the first reading of the time stamp
-in the next loop. That's were most of the time is spent, which means,
-chances are likely that it will miss all hardware latencies. This
-defeats the purpose.
-
-By also testing the first time stamp from the previous loop second
-time stamp (the outer loop), we are more likely to find a latency.
-
-Setting the threshold to 1, here's what the report now looks like:
-
-1347415723.0232202770 0 2
-1347415725.0234202822 0 2
-1347415727.0236202875 0 2
-1347415729.0238202928 0 2
-1347415731.0240202980 0 2
-1347415734.0243203061 0 2
-1347415736.0245203113 0 2
-1347415738.0247203166 2 0
-1347415740.0249203219 0 3
-1347415742.0251203272 0 3
-1347415743.0252203299 0 3
-1347415745.0254203351 0 2
-1347415747.0256203404 0 2
-1347415749.0258203457 0 2
-1347415751.0260203510 0 2
-1347415754.0263203589 0 2
-1347415756.0265203642 0 2
-1347415758.0267203695 0 2
-1347415760.0269203748 0 2
-1347415762.0271203801 0 2
-1347415764.0273203853 2 0
-
-There's some hardware latency that takes 2 microseconds to run.
-
-Signed-off-by: Steven Rostedt <srostedt at redhat.com>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- drivers/misc/hwlat_detector.c | 32 ++++++++++++++++++++++++++------
- 1 file changed, 26 insertions(+), 6 deletions(-)
-
---- a/drivers/misc/hwlat_detector.c
-+++ b/drivers/misc/hwlat_detector.c
-@@ -143,6 +143,7 @@ static void detector_exit(void);
- struct sample {
- u64 seqnum; /* unique sequence */
- u64 duration; /* ktime delta */
-+ u64 outer_duration; /* ktime delta (outer loop) */
- struct timespec timestamp; /* wall time */
- unsigned long lost;
- };
-@@ -219,11 +220,13 @@ static struct sample *buffer_get_sample(
- */
- static int get_sample(void *unused)
- {
-- ktime_t start, t1, t2;
-+ ktime_t start, t1, t2, last_t2;
- s64 diff, total = 0;
- u64 sample = 0;
-+ u64 outer_sample = 0;
- int ret = 1;
-
-+ last_t2.tv64 = 0;
- start = ktime_get(); /* start timestamp */
-
- do {
-@@ -231,7 +234,22 @@ static int get_sample(void *unused)
- t1 = ktime_get(); /* we'll look for a discontinuity */
- t2 = ktime_get();
-
-+ if (last_t2.tv64) {
-+ /* Check the delta from outer loop (t2 to next t1) */
-+ diff = ktime_to_us(ktime_sub(t1, last_t2));
-+ /* This shouldn't happen */
-+ if (diff < 0) {
-+ pr_err(BANNER "time running backwards\n");
-+ goto out;
-+ }
-+ if (diff > outer_sample)
-+ outer_sample = diff;
-+ }
-+ last_t2 = t2;
-+
- total = ktime_to_us(ktime_sub(t2, start)); /* sample width */
-+
-+ /* This checks the inner loop (t1 to t2) */
- diff = ktime_to_us(ktime_sub(t2, t1)); /* current diff */
-
- /* This shouldn't happen */
-@@ -246,12 +264,13 @@ static int get_sample(void *unused)
- } while (total <= data.sample_width);
-
- /* If we exceed the threshold value, we have found a hardware latency */
-- if (sample > data.threshold) {
-+ if (sample > data.threshold || outer_sample > data.threshold) {
- struct sample s;
-
- data.count++;
- s.seqnum = data.count;
- s.duration = sample;
-+ s.outer_duration = outer_sample;
- s.timestamp = CURRENT_TIME;
- __buffer_add_sample(&s);
-
-@@ -738,10 +757,11 @@ static ssize_t debug_sample_fread(struct
- }
- }
-
-- len = snprintf(buf, sizeof(buf), "%010lu.%010lu\t%llu\n",
-- sample->timestamp.tv_sec,
-- sample->timestamp.tv_nsec,
-- sample->duration);
-+ len = snprintf(buf, sizeof(buf), "%010lu.%010lu\t%llu\t%llu\n",
-+ sample->timestamp.tv_sec,
-+ sample->timestamp.tv_nsec,
-+ sample->duration,
-+ sample->outer_duration);
-
-
- /* handling partial reads is more trouble than it's worth */
diff --git a/debian/patches/features/all/rt/hwlat-detector-Use-thread-instead-of-stop-machine.patch b/debian/patches/features/all/rt/hwlat-detector-Use-thread-instead-of-stop-machine.patch
deleted file mode 100644
index 24343d6..0000000
--- a/debian/patches/features/all/rt/hwlat-detector-Use-thread-instead-of-stop-machine.patch
+++ /dev/null
@@ -1,184 +0,0 @@
-From: Steven Rostedt <rostedt at goodmis.org>
-Date: Mon, 19 Aug 2013 17:33:27 -0400
-Subject: hwlat-detector: Use thread instead of stop machine
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-There's no reason to use stop machine to search for hardware latency.
-Simply disabling interrupts while running the loop will do enough to
-check if something comes in that wasn't disabled by interrupts being
-off, which is exactly what stop machine does.
-
-Instead of using stop machine, just have the thread disable interrupts
-while it checks for hardware latency.
-
-Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- drivers/misc/hwlat_detector.c | 60 ++++++++++++++++++------------------------
- 1 file changed, 26 insertions(+), 34 deletions(-)
-
---- a/drivers/misc/hwlat_detector.c
-+++ b/drivers/misc/hwlat_detector.c
-@@ -41,7 +41,6 @@
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/ring_buffer.h>
--#include <linux/stop_machine.h>
- #include <linux/time.h>
- #include <linux/hrtimer.h>
- #include <linux/kthread.h>
-@@ -107,7 +106,6 @@ struct data; /* Global state */
- /* Sampling functions */
- static int __buffer_add_sample(struct sample *sample);
- static struct sample *buffer_get_sample(struct sample *sample);
--static int get_sample(void *unused);
-
- /* Threading and state */
- static int kthread_fn(void *unused);
-@@ -149,7 +147,7 @@ struct sample {
- unsigned long lost;
- };
-
--/* keep the global state somewhere. Mostly used under stop_machine. */
-+/* keep the global state somewhere. */
- static struct data {
-
- struct mutex lock; /* protect changes */
-@@ -172,7 +170,7 @@ static struct data {
- * @sample: The new latency sample value
- *
- * This receives a new latency sample and records it in a global ring buffer.
-- * No additional locking is used in this case - suited for stop_machine use.
-+ * No additional locking is used in this case.
- */
- static int __buffer_add_sample(struct sample *sample)
- {
-@@ -229,18 +227,18 @@ static struct sample *buffer_get_sample(
- #endif
- /**
- * get_sample - sample the CPU TSC and look for likely hardware latencies
-- * @unused: This is not used but is a part of the stop_machine API
- *
- * Used to repeatedly capture the CPU TSC (or similar), looking for potential
-- * hardware-induced latency. Called under stop_machine, with data.lock held.
-+ * hardware-induced latency. Called with interrupts disabled and with
-+ * data.lock held.
- */
--static int get_sample(void *unused)
-+static int get_sample(void)
- {
- time_type start, t1, t2, last_t2;
- s64 diff, total = 0;
- u64 sample = 0;
- u64 outer_sample = 0;
-- int ret = 1;
-+ int ret = -1;
-
- init_time(last_t2, 0);
- start = time_get(); /* start timestamp */
-@@ -279,10 +277,14 @@ static int get_sample(void *unused)
-
- } while (total <= data.sample_width);
-
-+ ret = 0;
-+
- /* If we exceed the threshold value, we have found a hardware latency */
- if (sample > data.threshold || outer_sample > data.threshold) {
- struct sample s;
-
-+ ret = 1;
-+
- data.count++;
- s.seqnum = data.count;
- s.duration = sample;
-@@ -295,7 +297,6 @@ static int get_sample(void *unused)
- data.max_sample = sample;
- }
-
-- ret = 0;
- out:
- return ret;
- }
-@@ -305,32 +306,30 @@ static int get_sample(void *unused)
- * @unused: A required part of the kthread API.
- *
- * Used to periodically sample the CPU TSC via a call to get_sample. We
-- * use stop_machine, whith does (intentionally) introduce latency since we
-+ * disable interrupts, which does (intentionally) introduce latency since we
- * need to ensure nothing else might be running (and thus pre-empting).
- * Obviously this should never be used in production environments.
- *
-- * stop_machine will schedule us typically only on CPU0 which is fine for
-- * almost every real-world hardware latency situation - but we might later
-- * generalize this if we find there are any actualy systems with alternate
-- * SMI delivery or other non CPU0 hardware latencies.
-+ * Currently this runs on which ever CPU it was scheduled on, but most
-+ * real-worald hardware latency situations occur across several CPUs,
-+ * but we might later generalize this if we find there are any actualy
-+ * systems with alternate SMI delivery or other hardware latencies.
- */
- static int kthread_fn(void *unused)
- {
-- int err = 0;
-- u64 interval = 0;
-+ int ret;
-+ u64 interval;
-
- while (!kthread_should_stop()) {
-
- mutex_lock(&data.lock);
-
-- err = stop_machine(get_sample, unused, 0);
-- if (err) {
-- /* Houston, we have a problem */
-- mutex_unlock(&data.lock);
-- goto err_out;
-- }
-+ local_irq_disable();
-+ ret = get_sample();
-+ local_irq_enable();
-
-- wake_up(&data.wq); /* wake up reader(s) */
-+ if (ret > 0)
-+ wake_up(&data.wq); /* wake up reader(s) */
-
- interval = data.sample_window - data.sample_width;
- do_div(interval, USEC_PER_MSEC); /* modifies interval value */
-@@ -338,15 +337,10 @@ static int kthread_fn(void *unused)
- mutex_unlock(&data.lock);
-
- if (msleep_interruptible(interval))
-- goto out;
-+ break;
- }
-- goto out;
--err_out:
-- pr_err(BANNER "could not call stop_machine, disabling\n");
-- enabled = 0;
--out:
-- return err;
-
-+ return 0;
- }
-
- /**
-@@ -442,8 +436,7 @@ static int init_stats(void)
- * This function provides a generic read implementation for the global state
- * "data" structure debugfs filesystem entries. It would be nice to use
- * simple_attr_read directly, but we need to make sure that the data.lock
-- * spinlock is held during the actual read (even though we likely won't ever
-- * actually race here as the updater runs under a stop_machine context).
-+ * is held during the actual read.
- */
- static ssize_t simple_data_read(struct file *filp, char __user *ubuf,
- size_t cnt, loff_t *ppos, const u64 *entry)
-@@ -478,8 +471,7 @@ static ssize_t simple_data_read(struct f
- * This function provides a generic write implementation for the global state
- * "data" structure debugfs filesystem entries. It would be nice to use
- * simple_attr_write directly, but we need to make sure that the data.lock
-- * spinlock is held during the actual write (even though we likely won't ever
-- * actually race here as the updater runs under a stop_machine context).
-+ * is held during the actual write.
- */
- static ssize_t simple_data_write(struct file *filp, const char __user *ubuf,
- size_t cnt, loff_t *ppos, u64 *entry)
diff --git a/debian/patches/features/all/rt/hwlat-detector-Use-trace_clock_local-if-available.patch b/debian/patches/features/all/rt/hwlat-detector-Use-trace_clock_local-if-available.patch
deleted file mode 100644
index de20b13..0000000
--- a/debian/patches/features/all/rt/hwlat-detector-Use-trace_clock_local-if-available.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From: Steven Rostedt <rostedt at goodmis.org>
-Date: Mon, 19 Aug 2013 17:33:26 -0400
-Subject: hwlat-detector: Use trace_clock_local if available
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-As ktime_get() calls into the timing code which does a read_seq(), it
-may be affected by other CPUS that touch that lock. To remove this
-dependency, use the trace_clock_local() which is already exported
-for module use. If CONFIG_TRACING is enabled, use that as the clock,
-otherwise use ktime_get().
-
-Signed-off-by: Steven Rostedt <srostedt at redhat.com>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- drivers/misc/hwlat_detector.c | 34 +++++++++++++++++++++++++---------
- 1 file changed, 25 insertions(+), 9 deletions(-)
-
---- a/drivers/misc/hwlat_detector.c
-+++ b/drivers/misc/hwlat_detector.c
-@@ -51,6 +51,7 @@
- #include <linux/version.h>
- #include <linux/delay.h>
- #include <linux/slab.h>
-+#include <linux/trace_clock.h>
-
- #define BUF_SIZE_DEFAULT 262144UL /* 8K*(sizeof(entry)) */
- #define BUF_FLAGS (RB_FL_OVERWRITE) /* no block on full */
-@@ -211,6 +212,21 @@ static struct sample *buffer_get_sample(
- return sample;
- }
-
-+#ifndef CONFIG_TRACING
-+#define time_type ktime_t
-+#define time_get() ktime_get()
-+#define time_to_us(x) ktime_to_us(x)
-+#define time_sub(a, b) ktime_sub(a, b)
-+#define init_time(a, b) (a).tv64 = b
-+#define time_u64(a) ((a).tv64)
-+#else
-+#define time_type u64
-+#define time_get() trace_clock_local()
-+#define time_to_us(x) div_u64(x, 1000)
-+#define time_sub(a, b) ((a) - (b))
-+#define init_time(a, b) (a = b)
-+#define time_u64(a) a
-+#endif
- /**
- * get_sample - sample the CPU TSC and look for likely hardware latencies
- * @unused: This is not used but is a part of the stop_machine API
-@@ -220,23 +236,23 @@ static struct sample *buffer_get_sample(
- */
- static int get_sample(void *unused)
- {
-- ktime_t start, t1, t2, last_t2;
-+ time_type start, t1, t2, last_t2;
- s64 diff, total = 0;
- u64 sample = 0;
- u64 outer_sample = 0;
- int ret = 1;
-
-- last_t2.tv64 = 0;
-- start = ktime_get(); /* start timestamp */
-+ init_time(last_t2, 0);
-+ start = time_get(); /* start timestamp */
-
- do {
-
-- t1 = ktime_get(); /* we'll look for a discontinuity */
-- t2 = ktime_get();
-+ t1 = time_get(); /* we'll look for a discontinuity */
-+ t2 = time_get();
-
-- if (last_t2.tv64) {
-+ if (time_u64(last_t2)) {
- /* Check the delta from outer loop (t2 to next t1) */
-- diff = ktime_to_us(ktime_sub(t1, last_t2));
-+ diff = time_to_us(time_sub(t1, last_t2));
- /* This shouldn't happen */
- if (diff < 0) {
- pr_err(BANNER "time running backwards\n");
-@@ -247,10 +263,10 @@ static int get_sample(void *unused)
- }
- last_t2 = t2;
-
-- total = ktime_to_us(ktime_sub(t2, start)); /* sample width */
-+ total = time_to_us(time_sub(t2, start)); /* sample width */
-
- /* This checks the inner loop (t1 to t2) */
-- diff = ktime_to_us(ktime_sub(t2, t1)); /* current diff */
-+ diff = time_to_us(time_sub(t2, t1)); /* current diff */
-
- /* This shouldn't happen */
- if (diff < 0) {
diff --git a/debian/patches/features/all/rt/hwlatdetect.patch b/debian/patches/features/all/rt/hwlatdetect.patch
deleted file mode 100644
index c83fcf7..0000000
--- a/debian/patches/features/all/rt/hwlatdetect.patch
+++ /dev/null
@@ -1,1348 +0,0 @@
-Subject: hwlatdetect.patch
-From: Carsten Emde <C.Emde at osadl.org>
-Date: Tue, 19 Jul 2011 13:53:12 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-Jon Masters developed this wonderful SMI detector. For details please
-consult Documentation/hwlat_detector.txt. It could be ported to Linux
-3.0 RT without any major change.
-
-Signed-off-by: Carsten Emde <C.Emde at osadl.org>
-
----
- Documentation/hwlat_detector.txt | 64 ++
- drivers/misc/Kconfig | 29
- drivers/misc/Makefile | 1
- drivers/misc/hwlat_detector.c | 1212 +++++++++++++++++++++++++++++++++++++++
- 4 files changed, 1306 insertions(+)
-
---- /dev/null
-+++ b/Documentation/hwlat_detector.txt
-@@ -0,0 +1,64 @@
-+Introduction:
-+-------------
-+
-+The module hwlat_detector is a special purpose kernel module that is used to
-+detect large system latencies induced by the behavior of certain underlying
-+hardware or firmware, independent of Linux itself. The code was developed
-+originally to detect SMIs (System Management Interrupts) on x86 systems,
-+however there is nothing x86 specific about this patchset. It was
-+originally written for use by the "RT" patch since the Real Time
-+kernel is highly latency sensitive.
-+
-+SMIs are usually not serviced by the Linux kernel, which typically does not
-+even know that they are occuring. SMIs are instead are set up by BIOS code
-+and are serviced by BIOS code, usually for "critical" events such as
-+management of thermal sensors and fans. Sometimes though, SMIs are used for
-+other tasks and those tasks can spend an inordinate amount of time in the
-+handler (sometimes measured in milliseconds). Obviously this is a problem if
-+you are trying to keep event service latencies down in the microsecond range.
-+
-+The hardware latency detector works by hogging all of the cpus for configurable
-+amounts of time (by calling stop_machine()), polling the CPU Time Stamp Counter
-+for some period, then looking for gaps in the TSC data. Any gap indicates a
-+time when the polling was interrupted and since the machine is stopped and
-+interrupts turned off the only thing that could do that would be an SMI.
-+
-+Note that the SMI detector should *NEVER* be used in a production environment.
-+It is intended to be run manually to determine if the hardware platform has a
-+problem with long system firmware service routines.
-+
-+Usage:
-+------
-+
-+Loading the module hwlat_detector passing the parameter "enabled=1" (or by
-+setting the "enable" entry in "hwlat_detector" debugfs toggled on) is the only
-+step required to start the hwlat_detector. It is possible to redefine the
-+threshold in microseconds (us) above which latency spikes will be taken
-+into account (parameter "threshold=").
-+
-+Example:
-+
-+ # modprobe hwlat_detector enabled=1 threshold=100
-+
-+After the module is loaded, it creates a directory named "hwlat_detector" under
-+the debugfs mountpoint, "/debug/hwlat_detector" for this text. It is necessary
-+to have debugfs mounted, which might be on /sys/debug on your system.
-+
-+The /debug/hwlat_detector interface contains the following files:
-+
-+count - number of latency spikes observed since last reset
-+enable - a global enable/disable toggle (0/1), resets count
-+max - maximum hardware latency actually observed (usecs)
-+sample - a pipe from which to read current raw sample data
-+ in the format <timestamp> <latency observed usecs>
-+ (can be opened O_NONBLOCK for a single sample)
-+threshold - minimum latency value to be considered (usecs)
-+width - time period to sample with CPUs held (usecs)
-+ must be less than the total window size (enforced)
-+window - total period of sampling, width being inside (usecs)
-+
-+By default we will set width to 500,000 and window to 1,000,000, meaning that
-+we will sample every 1,000,000 usecs (1s) for 500,000 usecs (0.5s). If we
-+observe any latencies that exceed the threshold (initially 100 usecs),
-+then we write to a global sample ring buffer of 8K samples, which is
-+consumed by reading from the "sample" (pipe) debugfs file interface.
---- a/drivers/misc/Kconfig
-+++ b/drivers/misc/Kconfig
-@@ -122,6 +122,35 @@ config IBM_ASM
- for information on the specific driver level and support statement
- for your IBM server.
-
-+config HWLAT_DETECTOR
-+ tristate "Testing module to detect hardware-induced latencies"
-+ depends on DEBUG_FS
-+ depends on RING_BUFFER
-+ default m
-+ ---help---
-+ A simple hardware latency detector. Use this module to detect
-+ large latencies introduced by the behavior of the underlying
-+ system firmware external to Linux. We do this using periodic
-+ use of stop_machine to grab all available CPUs and measure
-+ for unexplainable gaps in the CPU timestamp counter(s). By
-+ default, the module is not enabled until the "enable" file
-+ within the "hwlat_detector" debugfs directory is toggled.
-+
-+ This module is often used to detect SMI (System Management
-+ Interrupts) on x86 systems, though is not x86 specific. To
-+ this end, we default to using a sample window of 1 second,
-+ during which we will sample for 0.5 seconds. If an SMI or
-+ similar event occurs during that time, it is recorded
-+ into an 8K samples global ring buffer until retreived.
-+
-+ WARNING: This software should never be enabled (it can be built
-+ but should not be turned on after it is loaded) in a production
-+ environment where high latencies are a concern since the
-+ sampling mechanism actually introduces latencies for
-+ regular tasks while the CPU(s) are being held.
-+
-+ If unsure, say N
-+
- config PHANTOM
- tristate "Sensable PHANToM (PCI)"
- depends on PCI
---- a/drivers/misc/Makefile
-+++ b/drivers/misc/Makefile
-@@ -38,6 +38,7 @@ obj-$(CONFIG_C2PORT) += c2port/
- obj-$(CONFIG_HMC6352) += hmc6352.o
- obj-y += eeprom/
- obj-y += cb710/
-+obj-$(CONFIG_HWLAT_DETECTOR) += hwlat_detector.o
- obj-$(CONFIG_SPEAR13XX_PCIE_GADGET) += spear13xx_pcie_gadget.o
- obj-$(CONFIG_VMWARE_BALLOON) += vmw_balloon.o
- obj-$(CONFIG_ARM_CHARLCD) += arm-charlcd.o
---- /dev/null
-+++ b/drivers/misc/hwlat_detector.c
-@@ -0,0 +1,1212 @@
-+/*
-+ * hwlat_detector.c - A simple Hardware Latency detector.
-+ *
-+ * Use this module to detect large system latencies induced by the behavior of
-+ * certain underlying system hardware or firmware, independent of Linux itself.
-+ * The code was developed originally to detect the presence of SMIs on Intel
-+ * and AMD systems, although there is no dependency upon x86 herein.
-+ *
-+ * The classical example usage of this module is in detecting the presence of
-+ * SMIs or System Management Interrupts on Intel and AMD systems. An SMI is a
-+ * somewhat special form of hardware interrupt spawned from earlier CPU debug
-+ * modes in which the (BIOS/EFI/etc.) firmware arranges for the South Bridge
-+ * LPC (or other device) to generate a special interrupt under certain
-+ * circumstances, for example, upon expiration of a special SMI timer device,
-+ * due to certain external thermal readings, on certain I/O address accesses,
-+ * and other situations. An SMI hits a special CPU pin, triggers a special
-+ * SMI mode (complete with special memory map), and the OS is unaware.
-+ *
-+ * Although certain hardware-inducing latencies are necessary (for example,
-+ * a modern system often requires an SMI handler for correct thermal control
-+ * and remote management) they can wreak havoc upon any OS-level performance
-+ * guarantees toward low-latency, especially when the OS is not even made
-+ * aware of the presence of these interrupts. For this reason, we need a
-+ * somewhat brute force mechanism to detect these interrupts. In this case,
-+ * we do it by hogging all of the CPU(s) for configurable timer intervals,
-+ * sampling the built-in CPU timer, looking for discontiguous readings.
-+ *
-+ * WARNING: This implementation necessarily introduces latencies. Therefore,
-+ * you should NEVER use this module in a production environment
-+ * requiring any kind of low-latency performance guarantee(s).
-+ *
-+ * Copyright (C) 2008-2009 Jon Masters, Red Hat, Inc. <jcm at redhat.com>
-+ *
-+ * Includes useful feedback from Clark Williams <clark at redhat.com>
-+ *
-+ * This file is licensed under the terms of the GNU General Public
-+ * License version 2. This program is licensed "as is" without any
-+ * warranty of any kind, whether express or implied.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/ring_buffer.h>
-+#include <linux/stop_machine.h>
-+#include <linux/time.h>
-+#include <linux/hrtimer.h>
-+#include <linux/kthread.h>
-+#include <linux/debugfs.h>
-+#include <linux/seq_file.h>
-+#include <linux/uaccess.h>
-+#include <linux/version.h>
-+#include <linux/delay.h>
-+#include <linux/slab.h>
-+
-+#define BUF_SIZE_DEFAULT 262144UL /* 8K*(sizeof(entry)) */
-+#define BUF_FLAGS (RB_FL_OVERWRITE) /* no block on full */
-+#define U64STR_SIZE 22 /* 20 digits max */
-+
-+#define VERSION "1.0.0"
-+#define BANNER "hwlat_detector: "
-+#define DRVNAME "hwlat_detector"
-+#define DEFAULT_SAMPLE_WINDOW 1000000 /* 1s */
-+#define DEFAULT_SAMPLE_WIDTH 500000 /* 0.5s */
-+#define DEFAULT_LAT_THRESHOLD 10 /* 10us */
-+
-+/* Module metadata */
-+
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Jon Masters <jcm at redhat.com>");
-+MODULE_DESCRIPTION("A simple hardware latency detector");
-+MODULE_VERSION(VERSION);
-+
-+/* Module parameters */
-+
-+static int debug;
-+static int enabled;
-+static int threshold;
-+
-+module_param(debug, int, 0); /* enable debug */
-+module_param(enabled, int, 0); /* enable detector */
-+module_param(threshold, int, 0); /* latency threshold */
-+
-+/* Buffering and sampling */
-+
-+static struct ring_buffer *ring_buffer; /* sample buffer */
-+static DEFINE_MUTEX(ring_buffer_mutex); /* lock changes */
-+static unsigned long buf_size = BUF_SIZE_DEFAULT;
-+static struct task_struct *kthread; /* sampling thread */
-+
-+/* DebugFS filesystem entries */
-+
-+static struct dentry *debug_dir; /* debugfs directory */
-+static struct dentry *debug_max; /* maximum TSC delta */
-+static struct dentry *debug_count; /* total detect count */
-+static struct dentry *debug_sample_width; /* sample width us */
-+static struct dentry *debug_sample_window; /* sample window us */
-+static struct dentry *debug_sample; /* raw samples us */
-+static struct dentry *debug_threshold; /* threshold us */
-+static struct dentry *debug_enable; /* enable/disable */
-+
-+/* Individual samples and global state */
-+
-+struct sample; /* latency sample */
-+struct data; /* Global state */
-+
-+/* Sampling functions */
-+static int __buffer_add_sample(struct sample *sample);
-+static struct sample *buffer_get_sample(struct sample *sample);
-+static int get_sample(void *unused);
-+
-+/* Threading and state */
-+static int kthread_fn(void *unused);
-+static int start_kthread(void);
-+static int stop_kthread(void);
-+static void __reset_stats(void);
-+static int init_stats(void);
-+
-+/* Debugfs interface */
-+static ssize_t simple_data_read(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos, const u64 *entry);
-+static ssize_t simple_data_write(struct file *filp, const char __user *ubuf,
-+ size_t cnt, loff_t *ppos, u64 *entry);
-+static int debug_sample_fopen(struct inode *inode, struct file *filp);
-+static ssize_t debug_sample_fread(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos);
-+static int debug_sample_release(struct inode *inode, struct file *filp);
-+static int debug_enable_fopen(struct inode *inode, struct file *filp);
-+static ssize_t debug_enable_fread(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos);
-+static ssize_t debug_enable_fwrite(struct file *file,
-+ const char __user *user_buffer,
-+ size_t user_size, loff_t *offset);
-+
-+/* Initialization functions */
-+static int init_debugfs(void);
-+static void free_debugfs(void);
-+static int detector_init(void);
-+static void detector_exit(void);
-+
-+/* Individual latency samples are stored here when detected and packed into
-+ * the ring_buffer circular buffer, where they are overwritten when
-+ * more than buf_size/sizeof(sample) samples are received. */
-+struct sample {
-+ u64 seqnum; /* unique sequence */
-+ u64 duration; /* ktime delta */
-+ struct timespec timestamp; /* wall time */
-+ unsigned long lost;
-+};
-+
-+/* keep the global state somewhere. Mostly used under stop_machine. */
-+static struct data {
-+
-+ struct mutex lock; /* protect changes */
-+
-+ u64 count; /* total since reset */
-+ u64 max_sample; /* max hardware latency */
-+ u64 threshold; /* sample threshold level */
-+
-+ u64 sample_window; /* total sampling window (on+off) */
-+ u64 sample_width; /* active sampling portion of window */
-+
-+ atomic_t sample_open; /* whether the sample file is open */
-+
-+ wait_queue_head_t wq; /* waitqeue for new sample values */
-+
-+} data;
-+
-+/**
-+ * __buffer_add_sample - add a new latency sample recording to the ring buffer
-+ * @sample: The new latency sample value
-+ *
-+ * This receives a new latency sample and records it in a global ring buffer.
-+ * No additional locking is used in this case - suited for stop_machine use.
-+ */
-+static int __buffer_add_sample(struct sample *sample)
-+{
-+ return ring_buffer_write(ring_buffer,
-+ sizeof(struct sample), sample);
-+}
-+
-+/**
-+ * buffer_get_sample - remove a hardware latency sample from the ring buffer
-+ * @sample: Pre-allocated storage for the sample
-+ *
-+ * This retrieves a hardware latency sample from the global circular buffer
-+ */
-+static struct sample *buffer_get_sample(struct sample *sample)
-+{
-+ struct ring_buffer_event *e = NULL;
-+ struct sample *s = NULL;
-+ unsigned int cpu = 0;
-+
-+ if (!sample)
-+ return NULL;
-+
-+ mutex_lock(&ring_buffer_mutex);
-+ for_each_online_cpu(cpu) {
-+ e = ring_buffer_consume(ring_buffer, cpu, NULL, &sample->lost);
-+ if (e)
-+ break;
-+ }
-+
-+ if (e) {
-+ s = ring_buffer_event_data(e);
-+ memcpy(sample, s, sizeof(struct sample));
-+ } else
-+ sample = NULL;
-+ mutex_unlock(&ring_buffer_mutex);
-+
-+ return sample;
-+}
-+
-+/**
-+ * get_sample - sample the CPU TSC and look for likely hardware latencies
-+ * @unused: This is not used but is a part of the stop_machine API
-+ *
-+ * Used to repeatedly capture the CPU TSC (or similar), looking for potential
-+ * hardware-induced latency. Called under stop_machine, with data.lock held.
-+ */
-+static int get_sample(void *unused)
-+{
-+ ktime_t start, t1, t2;
-+ s64 diff, total = 0;
-+ u64 sample = 0;
-+ int ret = 1;
-+
-+ start = ktime_get(); /* start timestamp */
-+
-+ do {
-+
-+ t1 = ktime_get(); /* we'll look for a discontinuity */
-+ t2 = ktime_get();
-+
-+ total = ktime_to_us(ktime_sub(t2, start)); /* sample width */
-+ diff = ktime_to_us(ktime_sub(t2, t1)); /* current diff */
-+
-+ /* This shouldn't happen */
-+ if (diff < 0) {
-+ pr_err(BANNER "time running backwards\n");
-+ goto out;
-+ }
-+
-+ if (diff > sample)
-+ sample = diff; /* only want highest value */
-+
-+ } while (total <= data.sample_width);
-+
-+ /* If we exceed the threshold value, we have found a hardware latency */
-+ if (sample > data.threshold) {
-+ struct sample s;
-+
-+ data.count++;
-+ s.seqnum = data.count;
-+ s.duration = sample;
-+ s.timestamp = CURRENT_TIME;
-+ __buffer_add_sample(&s);
-+
-+ /* Keep a running maximum ever recorded hardware latency */
-+ if (sample > data.max_sample)
-+ data.max_sample = sample;
-+ }
-+
-+ ret = 0;
-+out:
-+ return ret;
-+}
-+
-+/*
-+ * kthread_fn - The CPU time sampling/hardware latency detection kernel thread
-+ * @unused: A required part of the kthread API.
-+ *
-+ * Used to periodically sample the CPU TSC via a call to get_sample. We
-+ * use stop_machine, whith does (intentionally) introduce latency since we
-+ * need to ensure nothing else might be running (and thus pre-empting).
-+ * Obviously this should never be used in production environments.
-+ *
-+ * stop_machine will schedule us typically only on CPU0 which is fine for
-+ * almost every real-world hardware latency situation - but we might later
-+ * generalize this if we find there are any actualy systems with alternate
-+ * SMI delivery or other non CPU0 hardware latencies.
-+ */
-+static int kthread_fn(void *unused)
-+{
-+ int err = 0;
-+ u64 interval = 0;
-+
-+ while (!kthread_should_stop()) {
-+
-+ mutex_lock(&data.lock);
-+
-+ err = stop_machine(get_sample, unused, 0);
-+ if (err) {
-+ /* Houston, we have a problem */
-+ mutex_unlock(&data.lock);
-+ goto err_out;
-+ }
-+
-+ wake_up(&data.wq); /* wake up reader(s) */
-+
-+ interval = data.sample_window - data.sample_width;
-+ do_div(interval, USEC_PER_MSEC); /* modifies interval value */
-+
-+ mutex_unlock(&data.lock);
-+
-+ if (msleep_interruptible(interval))
-+ goto out;
-+ }
-+ goto out;
-+err_out:
-+ pr_err(BANNER "could not call stop_machine, disabling\n");
-+ enabled = 0;
-+out:
-+ return err;
-+
-+}
-+
-+/**
-+ * start_kthread - Kick off the hardware latency sampling/detector kthread
-+ *
-+ * This starts a kernel thread that will sit and sample the CPU timestamp
-+ * counter (TSC or similar) and look for potential hardware latencies.
-+ */
-+static int start_kthread(void)
-+{
-+ kthread = kthread_run(kthread_fn, NULL,
-+ DRVNAME);
-+ if (IS_ERR(kthread)) {
-+ pr_err(BANNER "could not start sampling thread\n");
-+ enabled = 0;
-+ return -ENOMEM;
-+ }
-+
-+ return 0;
-+}
-+
-+/**
-+ * stop_kthread - Inform the hardware latency samping/detector kthread to stop
-+ *
-+ * This kicks the running hardware latency sampling/detector kernel thread and
-+ * tells it to stop sampling now. Use this on unload and at system shutdown.
-+ */
-+static int stop_kthread(void)
-+{
-+ int ret;
-+
-+ ret = kthread_stop(kthread);
-+
-+ return ret;
-+}
-+
-+/**
-+ * __reset_stats - Reset statistics for the hardware latency detector
-+ *
-+ * We use data to store various statistics and global state. We call this
-+ * function in order to reset those when "enable" is toggled on or off, and
-+ * also at initialization. Should be called with data.lock held.
-+ */
-+static void __reset_stats(void)
-+{
-+ data.count = 0;
-+ data.max_sample = 0;
-+ ring_buffer_reset(ring_buffer); /* flush out old sample entries */
-+}
-+
-+/**
-+ * init_stats - Setup global state statistics for the hardware latency detector
-+ *
-+ * We use data to store various statistics and global state. We also use
-+ * a global ring buffer (ring_buffer) to keep raw samples of detected hardware
-+ * induced system latencies. This function initializes these structures and
-+ * allocates the global ring buffer also.
-+ */
-+static int init_stats(void)
-+{
-+ int ret = -ENOMEM;
-+
-+ mutex_init(&data.lock);
-+ init_waitqueue_head(&data.wq);
-+ atomic_set(&data.sample_open, 0);
-+
-+ ring_buffer = ring_buffer_alloc(buf_size, BUF_FLAGS);
-+
-+ if (WARN(!ring_buffer, KERN_ERR BANNER
-+ "failed to allocate ring buffer!\n"))
-+ goto out;
-+
-+ __reset_stats();
-+ data.threshold = DEFAULT_LAT_THRESHOLD; /* threshold us */
-+ data.sample_window = DEFAULT_SAMPLE_WINDOW; /* window us */
-+ data.sample_width = DEFAULT_SAMPLE_WIDTH; /* width us */
-+
-+ ret = 0;
-+
-+out:
-+ return ret;
-+
-+}
-+
-+/*
-+ * simple_data_read - Wrapper read function for global state debugfs entries
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The userspace provided buffer to read value into
-+ * @cnt: The maximum number of bytes to read
-+ * @ppos: The current "file" position
-+ * @entry: The entry to read from
-+ *
-+ * This function provides a generic read implementation for the global state
-+ * "data" structure debugfs filesystem entries. It would be nice to use
-+ * simple_attr_read directly, but we need to make sure that the data.lock
-+ * spinlock is held during the actual read (even though we likely won't ever
-+ * actually race here as the updater runs under a stop_machine context).
-+ */
-+static ssize_t simple_data_read(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos, const u64 *entry)
-+{
-+ char buf[U64STR_SIZE];
-+ u64 val = 0;
-+ int len = 0;
-+
-+ memset(buf, 0, sizeof(buf));
-+
-+ if (!entry)
-+ return -EFAULT;
-+
-+ mutex_lock(&data.lock);
-+ val = *entry;
-+ mutex_unlock(&data.lock);
-+
-+ len = snprintf(buf, sizeof(buf), "%llu\n", (unsigned long long)val);
-+
-+ return simple_read_from_buffer(ubuf, cnt, ppos, buf, len);
-+
-+}
-+
-+/*
-+ * simple_data_write - Wrapper write function for global state debugfs entries
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The userspace provided buffer to write value from
-+ * @cnt: The maximum number of bytes to write
-+ * @ppos: The current "file" position
-+ * @entry: The entry to write to
-+ *
-+ * This function provides a generic write implementation for the global state
-+ * "data" structure debugfs filesystem entries. It would be nice to use
-+ * simple_attr_write directly, but we need to make sure that the data.lock
-+ * spinlock is held during the actual write (even though we likely won't ever
-+ * actually race here as the updater runs under a stop_machine context).
-+ */
-+static ssize_t simple_data_write(struct file *filp, const char __user *ubuf,
-+ size_t cnt, loff_t *ppos, u64 *entry)
-+{
-+ char buf[U64STR_SIZE];
-+ int csize = min(cnt, sizeof(buf));
-+ u64 val = 0;
-+ int err = 0;
-+
-+ memset(buf, '\0', sizeof(buf));
-+ if (copy_from_user(buf, ubuf, csize))
-+ return -EFAULT;
-+
-+ buf[U64STR_SIZE-1] = '\0'; /* just in case */
-+ err = kstrtoull(buf, 10, &val);
-+ if (err)
-+ return -EINVAL;
-+
-+ mutex_lock(&data.lock);
-+ *entry = val;
-+ mutex_unlock(&data.lock);
-+
-+ return csize;
-+}
-+
-+/**
-+ * debug_count_fopen - Open function for "count" debugfs entry
-+ * @inode: The in-kernel inode representation of the debugfs "file"
-+ * @filp: The active open file structure for the debugfs "file"
-+ *
-+ * This function provides an open implementation for the "count" debugfs
-+ * interface to the hardware latency detector.
-+ */
-+static int debug_count_fopen(struct inode *inode, struct file *filp)
-+{
-+ return 0;
-+}
-+
-+/**
-+ * debug_count_fread - Read function for "count" debugfs entry
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The userspace provided buffer to read value into
-+ * @cnt: The maximum number of bytes to read
-+ * @ppos: The current "file" position
-+ *
-+ * This function provides a read implementation for the "count" debugfs
-+ * interface to the hardware latency detector. Can be used to read the
-+ * number of latency readings exceeding the configured threshold since
-+ * the detector was last reset (e.g. by writing a zero into "count").
-+ */
-+static ssize_t debug_count_fread(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos)
-+{
-+ return simple_data_read(filp, ubuf, cnt, ppos, &data.count);
-+}
-+
-+/**
-+ * debug_count_fwrite - Write function for "count" debugfs entry
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The user buffer that contains the value to write
-+ * @cnt: The maximum number of bytes to write to "file"
-+ * @ppos: The current position in the debugfs "file"
-+ *
-+ * This function provides a write implementation for the "count" debugfs
-+ * interface to the hardware latency detector. Can be used to write a
-+ * desired value, especially to zero the total count.
-+ */
-+static ssize_t debug_count_fwrite(struct file *filp,
-+ const char __user *ubuf,
-+ size_t cnt,
-+ loff_t *ppos)
-+{
-+ return simple_data_write(filp, ubuf, cnt, ppos, &data.count);
-+}
-+
-+/**
-+ * debug_enable_fopen - Dummy open function for "enable" debugfs interface
-+ * @inode: The in-kernel inode representation of the debugfs "file"
-+ * @filp: The active open file structure for the debugfs "file"
-+ *
-+ * This function provides an open implementation for the "enable" debugfs
-+ * interface to the hardware latency detector.
-+ */
-+static int debug_enable_fopen(struct inode *inode, struct file *filp)
-+{
-+ return 0;
-+}
-+
-+/**
-+ * debug_enable_fread - Read function for "enable" debugfs interface
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The userspace provided buffer to read value into
-+ * @cnt: The maximum number of bytes to read
-+ * @ppos: The current "file" position
-+ *
-+ * This function provides a read implementation for the "enable" debugfs
-+ * interface to the hardware latency detector. Can be used to determine
-+ * whether the detector is currently enabled ("0\n" or "1\n" returned).
-+ */
-+static ssize_t debug_enable_fread(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos)
-+{
-+ char buf[4];
-+
-+ if ((cnt < sizeof(buf)) || (*ppos))
-+ return 0;
-+
-+ buf[0] = enabled ? '1' : '0';
-+ buf[1] = '\n';
-+ buf[2] = '\0';
-+ if (copy_to_user(ubuf, buf, strlen(buf)))
-+ return -EFAULT;
-+ return *ppos = strlen(buf);
-+}
-+
-+/**
-+ * debug_enable_fwrite - Write function for "enable" debugfs interface
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The user buffer that contains the value to write
-+ * @cnt: The maximum number of bytes to write to "file"
-+ * @ppos: The current position in the debugfs "file"
-+ *
-+ * This function provides a write implementation for the "enable" debugfs
-+ * interface to the hardware latency detector. Can be used to enable or
-+ * disable the detector, which will have the side-effect of possibly
-+ * also resetting the global stats and kicking off the measuring
-+ * kthread (on an enable) or the converse (upon a disable).
-+ */
-+static ssize_t debug_enable_fwrite(struct file *filp,
-+ const char __user *ubuf,
-+ size_t cnt,
-+ loff_t *ppos)
-+{
-+ char buf[4];
-+ int csize = min(cnt, sizeof(buf));
-+ long val = 0;
-+ int err = 0;
-+
-+ memset(buf, '\0', sizeof(buf));
-+ if (copy_from_user(buf, ubuf, csize))
-+ return -EFAULT;
-+
-+ buf[sizeof(buf)-1] = '\0'; /* just in case */
-+ err = kstrtoul(buf, 10, &val);
-+ if (err)
-+ return -EINVAL;
-+
-+ if (val) {
-+ if (enabled)
-+ goto unlock;
-+ enabled = 1;
-+ __reset_stats();
-+ if (start_kthread())
-+ return -EFAULT;
-+ } else {
-+ if (!enabled)
-+ goto unlock;
-+ enabled = 0;
-+ err = stop_kthread();
-+ if (err) {
-+ pr_err(BANNER "cannot stop kthread\n");
-+ return -EFAULT;
-+ }
-+ wake_up(&data.wq); /* reader(s) should return */
-+ }
-+unlock:
-+ return csize;
-+}
-+
-+/**
-+ * debug_max_fopen - Open function for "max" debugfs entry
-+ * @inode: The in-kernel inode representation of the debugfs "file"
-+ * @filp: The active open file structure for the debugfs "file"
-+ *
-+ * This function provides an open implementation for the "max" debugfs
-+ * interface to the hardware latency detector.
-+ */
-+static int debug_max_fopen(struct inode *inode, struct file *filp)
-+{
-+ return 0;
-+}
-+
-+/**
-+ * debug_max_fread - Read function for "max" debugfs entry
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The userspace provided buffer to read value into
-+ * @cnt: The maximum number of bytes to read
-+ * @ppos: The current "file" position
-+ *
-+ * This function provides a read implementation for the "max" debugfs
-+ * interface to the hardware latency detector. Can be used to determine
-+ * the maximum latency value observed since it was last reset.
-+ */
-+static ssize_t debug_max_fread(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos)
-+{
-+ return simple_data_read(filp, ubuf, cnt, ppos, &data.max_sample);
-+}
-+
-+/**
-+ * debug_max_fwrite - Write function for "max" debugfs entry
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The user buffer that contains the value to write
-+ * @cnt: The maximum number of bytes to write to "file"
-+ * @ppos: The current position in the debugfs "file"
-+ *
-+ * This function provides a write implementation for the "max" debugfs
-+ * interface to the hardware latency detector. Can be used to reset the
-+ * maximum or set it to some other desired value - if, then, subsequent
-+ * measurements exceed this value, the maximum will be updated.
-+ */
-+static ssize_t debug_max_fwrite(struct file *filp,
-+ const char __user *ubuf,
-+ size_t cnt,
-+ loff_t *ppos)
-+{
-+ return simple_data_write(filp, ubuf, cnt, ppos, &data.max_sample);
-+}
-+
-+
-+/**
-+ * debug_sample_fopen - An open function for "sample" debugfs interface
-+ * @inode: The in-kernel inode representation of this debugfs "file"
-+ * @filp: The active open file structure for the debugfs "file"
-+ *
-+ * This function handles opening the "sample" file within the hardware
-+ * latency detector debugfs directory interface. This file is used to read
-+ * raw samples from the global ring_buffer and allows the user to see a
-+ * running latency history. Can be opened blocking or non-blocking,
-+ * affecting whether it behaves as a buffer read pipe, or does not.
-+ * Implements simple locking to prevent multiple simultaneous use.
-+ */
-+static int debug_sample_fopen(struct inode *inode, struct file *filp)
-+{
-+ if (!atomic_add_unless(&data.sample_open, 1, 1))
-+ return -EBUSY;
-+ else
-+ return 0;
-+}
-+
-+/**
-+ * debug_sample_fread - A read function for "sample" debugfs interface
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The user buffer that will contain the samples read
-+ * @cnt: The maximum bytes to read from the debugfs "file"
-+ * @ppos: The current position in the debugfs "file"
-+ *
-+ * This function handles reading from the "sample" file within the hardware
-+ * latency detector debugfs directory interface. This file is used to read
-+ * raw samples from the global ring_buffer and allows the user to see a
-+ * running latency history. By default this will block pending a new
-+ * value written into the sample buffer, unless there are already a
-+ * number of value(s) waiting in the buffer, or the sample file was
-+ * previously opened in a non-blocking mode of operation.
-+ */
-+static ssize_t debug_sample_fread(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos)
-+{
-+ int len = 0;
-+ char buf[64];
-+ struct sample *sample = NULL;
-+
-+ if (!enabled)
-+ return 0;
-+
-+ sample = kzalloc(sizeof(struct sample), GFP_KERNEL);
-+ if (!sample)
-+ return -ENOMEM;
-+
-+ while (!buffer_get_sample(sample)) {
-+
-+ DEFINE_WAIT(wait);
-+
-+ if (filp->f_flags & O_NONBLOCK) {
-+ len = -EAGAIN;
-+ goto out;
-+ }
-+
-+ prepare_to_wait(&data.wq, &wait, TASK_INTERRUPTIBLE);
-+ schedule();
-+ finish_wait(&data.wq, &wait);
-+
-+ if (signal_pending(current)) {
-+ len = -EINTR;
-+ goto out;
-+ }
-+
-+ if (!enabled) { /* enable was toggled */
-+ len = 0;
-+ goto out;
-+ }
-+ }
-+
-+ len = snprintf(buf, sizeof(buf), "%010lu.%010lu\t%llu\n",
-+ sample->timestamp.tv_sec,
-+ sample->timestamp.tv_nsec,
-+ sample->duration);
-+
-+
-+ /* handling partial reads is more trouble than it's worth */
-+ if (len > cnt)
-+ goto out;
-+
-+ if (copy_to_user(ubuf, buf, len))
-+ len = -EFAULT;
-+
-+out:
-+ kfree(sample);
-+ return len;
-+}
-+
-+/**
-+ * debug_sample_release - Release function for "sample" debugfs interface
-+ * @inode: The in-kernel inode represenation of the debugfs "file"
-+ * @filp: The active open file structure for the debugfs "file"
-+ *
-+ * This function completes the close of the debugfs interface "sample" file.
-+ * Frees the sample_open "lock" so that other users may open the interface.
-+ */
-+static int debug_sample_release(struct inode *inode, struct file *filp)
-+{
-+ atomic_dec(&data.sample_open);
-+
-+ return 0;
-+}
-+
-+/**
-+ * debug_threshold_fopen - Open function for "threshold" debugfs entry
-+ * @inode: The in-kernel inode representation of the debugfs "file"
-+ * @filp: The active open file structure for the debugfs "file"
-+ *
-+ * This function provides an open implementation for the "threshold" debugfs
-+ * interface to the hardware latency detector.
-+ */
-+static int debug_threshold_fopen(struct inode *inode, struct file *filp)
-+{
-+ return 0;
-+}
-+
-+/**
-+ * debug_threshold_fread - Read function for "threshold" debugfs entry
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The userspace provided buffer to read value into
-+ * @cnt: The maximum number of bytes to read
-+ * @ppos: The current "file" position
-+ *
-+ * This function provides a read implementation for the "threshold" debugfs
-+ * interface to the hardware latency detector. It can be used to determine
-+ * the current threshold level at which a latency will be recorded in the
-+ * global ring buffer, typically on the order of 10us.
-+ */
-+static ssize_t debug_threshold_fread(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos)
-+{
-+ return simple_data_read(filp, ubuf, cnt, ppos, &data.threshold);
-+}
-+
-+/**
-+ * debug_threshold_fwrite - Write function for "threshold" debugfs entry
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The user buffer that contains the value to write
-+ * @cnt: The maximum number of bytes to write to "file"
-+ * @ppos: The current position in the debugfs "file"
-+ *
-+ * This function provides a write implementation for the "threshold" debugfs
-+ * interface to the hardware latency detector. It can be used to configure
-+ * the threshold level at which any subsequently detected latencies will
-+ * be recorded into the global ring buffer.
-+ */
-+static ssize_t debug_threshold_fwrite(struct file *filp,
-+ const char __user *ubuf,
-+ size_t cnt,
-+ loff_t *ppos)
-+{
-+ int ret;
-+
-+ ret = simple_data_write(filp, ubuf, cnt, ppos, &data.threshold);
-+
-+ if (enabled)
-+ wake_up_process(kthread);
-+
-+ return ret;
-+}
-+
-+/**
-+ * debug_width_fopen - Open function for "width" debugfs entry
-+ * @inode: The in-kernel inode representation of the debugfs "file"
-+ * @filp: The active open file structure for the debugfs "file"
-+ *
-+ * This function provides an open implementation for the "width" debugfs
-+ * interface to the hardware latency detector.
-+ */
-+static int debug_width_fopen(struct inode *inode, struct file *filp)
-+{
-+ return 0;
-+}
-+
-+/**
-+ * debug_width_fread - Read function for "width" debugfs entry
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The userspace provided buffer to read value into
-+ * @cnt: The maximum number of bytes to read
-+ * @ppos: The current "file" position
-+ *
-+ * This function provides a read implementation for the "width" debugfs
-+ * interface to the hardware latency detector. It can be used to determine
-+ * for how many us of the total window us we will actively sample for any
-+ * hardware-induced latecy periods. Obviously, it is not possible to
-+ * sample constantly and have the system respond to a sample reader, or,
-+ * worse, without having the system appear to have gone out to lunch.
-+ */
-+static ssize_t debug_width_fread(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos)
-+{
-+ return simple_data_read(filp, ubuf, cnt, ppos, &data.sample_width);
-+}
-+
-+/**
-+ * debug_width_fwrite - Write function for "width" debugfs entry
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The user buffer that contains the value to write
-+ * @cnt: The maximum number of bytes to write to "file"
-+ * @ppos: The current position in the debugfs "file"
-+ *
-+ * This function provides a write implementation for the "width" debugfs
-+ * interface to the hardware latency detector. It can be used to configure
-+ * for how many us of the total window us we will actively sample for any
-+ * hardware-induced latency periods. Obviously, it is not possible to
-+ * sample constantly and have the system respond to a sample reader, or,
-+ * worse, without having the system appear to have gone out to lunch. It
-+ * is enforced that width is less that the total window size.
-+ */
-+static ssize_t debug_width_fwrite(struct file *filp,
-+ const char __user *ubuf,
-+ size_t cnt,
-+ loff_t *ppos)
-+{
-+ char buf[U64STR_SIZE];
-+ int csize = min(cnt, sizeof(buf));
-+ u64 val = 0;
-+ int err = 0;
-+
-+ memset(buf, '\0', sizeof(buf));
-+ if (copy_from_user(buf, ubuf, csize))
-+ return -EFAULT;
-+
-+ buf[U64STR_SIZE-1] = '\0'; /* just in case */
-+ err = kstrtoull(buf, 10, &val);
-+ if (err)
-+ return -EINVAL;
-+
-+ mutex_lock(&data.lock);
-+ if (val < data.sample_window)
-+ data.sample_width = val;
-+ else {
-+ mutex_unlock(&data.lock);
-+ return -EINVAL;
-+ }
-+ mutex_unlock(&data.lock);
-+
-+ if (enabled)
-+ wake_up_process(kthread);
-+
-+ return csize;
-+}
-+
-+/**
-+ * debug_window_fopen - Open function for "window" debugfs entry
-+ * @inode: The in-kernel inode representation of the debugfs "file"
-+ * @filp: The active open file structure for the debugfs "file"
-+ *
-+ * This function provides an open implementation for the "window" debugfs
-+ * interface to the hardware latency detector. The window is the total time
-+ * in us that will be considered one sample period. Conceptually, windows
-+ * occur back-to-back and contain a sample width period during which
-+ * actual sampling occurs.
-+ */
-+static int debug_window_fopen(struct inode *inode, struct file *filp)
-+{
-+ return 0;
-+}
-+
-+/**
-+ * debug_window_fread - Read function for "window" debugfs entry
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The userspace provided buffer to read value into
-+ * @cnt: The maximum number of bytes to read
-+ * @ppos: The current "file" position
-+ *
-+ * This function provides a read implementation for the "window" debugfs
-+ * interface to the hardware latency detector. The window is the total time
-+ * in us that will be considered one sample period. Conceptually, windows
-+ * occur back-to-back and contain a sample width period during which
-+ * actual sampling occurs. Can be used to read the total window size.
-+ */
-+static ssize_t debug_window_fread(struct file *filp, char __user *ubuf,
-+ size_t cnt, loff_t *ppos)
-+{
-+ return simple_data_read(filp, ubuf, cnt, ppos, &data.sample_window);
-+}
-+
-+/**
-+ * debug_window_fwrite - Write function for "window" debugfs entry
-+ * @filp: The active open file structure for the debugfs "file"
-+ * @ubuf: The user buffer that contains the value to write
-+ * @cnt: The maximum number of bytes to write to "file"
-+ * @ppos: The current position in the debugfs "file"
-+ *
-+ * This function provides a write implementation for the "window" debufds
-+ * interface to the hardware latency detetector. The window is the total time
-+ * in us that will be considered one sample period. Conceptually, windows
-+ * occur back-to-back and contain a sample width period during which
-+ * actual sampling occurs. Can be used to write a new total window size. It
-+ * is enfoced that any value written must be greater than the sample width
-+ * size, or an error results.
-+ */
-+static ssize_t debug_window_fwrite(struct file *filp,
-+ const char __user *ubuf,
-+ size_t cnt,
-+ loff_t *ppos)
-+{
-+ char buf[U64STR_SIZE];
-+ int csize = min(cnt, sizeof(buf));
-+ u64 val = 0;
-+ int err = 0;
-+
-+ memset(buf, '\0', sizeof(buf));
-+ if (copy_from_user(buf, ubuf, csize))
-+ return -EFAULT;
-+
-+ buf[U64STR_SIZE-1] = '\0'; /* just in case */
-+ err = kstrtoull(buf, 10, &val);
-+ if (err)
-+ return -EINVAL;
-+
-+ mutex_lock(&data.lock);
-+ if (data.sample_width < val)
-+ data.sample_window = val;
-+ else {
-+ mutex_unlock(&data.lock);
-+ return -EINVAL;
-+ }
-+ mutex_unlock(&data.lock);
-+
-+ return csize;
-+}
-+
-+/*
-+ * Function pointers for the "count" debugfs file operations
-+ */
-+static const struct file_operations count_fops = {
-+ .open = debug_count_fopen,
-+ .read = debug_count_fread,
-+ .write = debug_count_fwrite,
-+ .owner = THIS_MODULE,
-+};
-+
-+/*
-+ * Function pointers for the "enable" debugfs file operations
-+ */
-+static const struct file_operations enable_fops = {
-+ .open = debug_enable_fopen,
-+ .read = debug_enable_fread,
-+ .write = debug_enable_fwrite,
-+ .owner = THIS_MODULE,
-+};
-+
-+/*
-+ * Function pointers for the "max" debugfs file operations
-+ */
-+static const struct file_operations max_fops = {
-+ .open = debug_max_fopen,
-+ .read = debug_max_fread,
-+ .write = debug_max_fwrite,
-+ .owner = THIS_MODULE,
-+};
-+
-+/*
-+ * Function pointers for the "sample" debugfs file operations
-+ */
-+static const struct file_operations sample_fops = {
-+ .open = debug_sample_fopen,
-+ .read = debug_sample_fread,
-+ .release = debug_sample_release,
-+ .owner = THIS_MODULE,
-+};
-+
-+/*
-+ * Function pointers for the "threshold" debugfs file operations
-+ */
-+static const struct file_operations threshold_fops = {
-+ .open = debug_threshold_fopen,
-+ .read = debug_threshold_fread,
-+ .write = debug_threshold_fwrite,
-+ .owner = THIS_MODULE,
-+};
-+
-+/*
-+ * Function pointers for the "width" debugfs file operations
-+ */
-+static const struct file_operations width_fops = {
-+ .open = debug_width_fopen,
-+ .read = debug_width_fread,
-+ .write = debug_width_fwrite,
-+ .owner = THIS_MODULE,
-+};
-+
-+/*
-+ * Function pointers for the "window" debugfs file operations
-+ */
-+static const struct file_operations window_fops = {
-+ .open = debug_window_fopen,
-+ .read = debug_window_fread,
-+ .write = debug_window_fwrite,
-+ .owner = THIS_MODULE,
-+};
-+
-+/**
-+ * init_debugfs - A function to initialize the debugfs interface files
-+ *
-+ * This function creates entries in debugfs for "hwlat_detector", including
-+ * files to read values from the detector, current samples, and the
-+ * maximum sample that has been captured since the hardware latency
-+ * dectector was started.
-+ */
-+static int init_debugfs(void)
-+{
-+ int ret = -ENOMEM;
-+
-+ debug_dir = debugfs_create_dir(DRVNAME, NULL);
-+ if (!debug_dir)
-+ goto err_debug_dir;
-+
-+ debug_sample = debugfs_create_file("sample", 0444,
-+ debug_dir, NULL,
-+ &sample_fops);
-+ if (!debug_sample)
-+ goto err_sample;
-+
-+ debug_count = debugfs_create_file("count", 0444,
-+ debug_dir, NULL,
-+ &count_fops);
-+ if (!debug_count)
-+ goto err_count;
-+
-+ debug_max = debugfs_create_file("max", 0444,
-+ debug_dir, NULL,
-+ &max_fops);
-+ if (!debug_max)
-+ goto err_max;
-+
-+ debug_sample_window = debugfs_create_file("window", 0644,
-+ debug_dir, NULL,
-+ &window_fops);
-+ if (!debug_sample_window)
-+ goto err_window;
-+
-+ debug_sample_width = debugfs_create_file("width", 0644,
-+ debug_dir, NULL,
-+ &width_fops);
-+ if (!debug_sample_width)
-+ goto err_width;
-+
-+ debug_threshold = debugfs_create_file("threshold", 0644,
-+ debug_dir, NULL,
-+ &threshold_fops);
-+ if (!debug_threshold)
-+ goto err_threshold;
-+
-+ debug_enable = debugfs_create_file("enable", 0644,
-+ debug_dir, &enabled,
-+ &enable_fops);
-+ if (!debug_enable)
-+ goto err_enable;
-+
-+ else {
-+ ret = 0;
-+ goto out;
-+ }
-+
-+err_enable:
-+ debugfs_remove(debug_threshold);
-+err_threshold:
-+ debugfs_remove(debug_sample_width);
-+err_width:
-+ debugfs_remove(debug_sample_window);
-+err_window:
-+ debugfs_remove(debug_max);
-+err_max:
-+ debugfs_remove(debug_count);
-+err_count:
-+ debugfs_remove(debug_sample);
-+err_sample:
-+ debugfs_remove(debug_dir);
-+err_debug_dir:
-+out:
-+ return ret;
-+}
-+
-+/**
-+ * free_debugfs - A function to cleanup the debugfs file interface
-+ */
-+static void free_debugfs(void)
-+{
-+ /* could also use a debugfs_remove_recursive */
-+ debugfs_remove(debug_enable);
-+ debugfs_remove(debug_threshold);
-+ debugfs_remove(debug_sample_width);
-+ debugfs_remove(debug_sample_window);
-+ debugfs_remove(debug_max);
-+ debugfs_remove(debug_count);
-+ debugfs_remove(debug_sample);
-+ debugfs_remove(debug_dir);
-+}
-+
-+/**
-+ * detector_init - Standard module initialization code
-+ */
-+static int detector_init(void)
-+{
-+ int ret = -ENOMEM;
-+
-+ pr_info(BANNER "version %s\n", VERSION);
-+
-+ ret = init_stats();
-+ if (ret)
-+ goto out;
-+
-+ ret = init_debugfs();
-+ if (ret)
-+ goto err_stats;
-+
-+ if (enabled)
-+ ret = start_kthread();
-+
-+ goto out;
-+
-+err_stats:
-+ ring_buffer_free(ring_buffer);
-+out:
-+ return ret;
-+
-+}
-+
-+/**
-+ * detector_exit - Standard module cleanup code
-+ */
-+static void detector_exit(void)
-+{
-+ int err;
-+
-+ if (enabled) {
-+ enabled = 0;
-+ err = stop_kthread();
-+ if (err)
-+ pr_err(BANNER "cannot stop kthread\n");
-+ }
-+
-+ free_debugfs();
-+ ring_buffer_free(ring_buffer); /* free up the ring buffer */
-+
-+}
-+
-+module_init(detector_init);
-+module_exit(detector_exit);
diff --git a/debian/patches/features/all/rt/i2c-omap-drop-the-lock-hard-irq-context.patch b/debian/patches/features/all/rt/i2c-omap-drop-the-lock-hard-irq-context.patch
deleted file mode 100644
index 6a29586..0000000
--- a/debian/patches/features/all/rt/i2c-omap-drop-the-lock-hard-irq-context.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Thu, 21 Mar 2013 11:35:49 +0100
-Subject: i2c/omap: drop the lock hard irq context
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-The lock is taken while reading two registers. On RT the first lock is
-taken in hard irq where it might sleep and in the threaded irq.
-The threaded irq runs in oneshot mode so the hard irq does not run until
-the thread the completes so there is no reason to grab the lock.
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- drivers/i2c/busses/i2c-omap.c | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
---- a/drivers/i2c/busses/i2c-omap.c
-+++ b/drivers/i2c/busses/i2c-omap.c
-@@ -995,15 +995,12 @@ omap_i2c_isr(int irq, void *dev_id)
- u16 mask;
- u16 stat;
-
-- spin_lock(&omap->lock);
-- mask = omap_i2c_read_reg(omap, OMAP_I2C_IE_REG);
- stat = omap_i2c_read_reg(omap, OMAP_I2C_STAT_REG);
-+ mask = omap_i2c_read_reg(omap, OMAP_I2C_IE_REG);
-
- if (stat & mask)
- ret = IRQ_WAKE_THREAD;
-
-- spin_unlock(&omap->lock);
--
- return ret;
- }
-
diff --git a/debian/patches/features/all/rt/i915-bogus-warning-from-i915-when-running-on-PREEMPT.patch b/debian/patches/features/all/rt/i915-bogus-warning-from-i915-when-running-on-PREEMPT.patch
index cae7c79..b474689 100644
--- a/debian/patches/features/all/rt/i915-bogus-warning-from-i915-when-running-on-PREEMPT.patch
+++ b/debian/patches/features/all/rt/i915-bogus-warning-from-i915-when-running-on-PREEMPT.patch
@@ -1,7 +1,7 @@
From: Clark Williams <williams at redhat.com>
Date: Tue, 26 May 2015 10:43:43 -0500
Subject: i915: bogus warning from i915 when running on PREEMPT_RT
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The i915 driver has a 'WARN_ON(!in_interrupt())' in the display
handler, which whines constanly on the RT kernel (since the interrupt
@@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -11670,7 +11670,7 @@ void intel_check_page_flip(struct drm_i9
+@@ -12142,7 +12142,7 @@ void intel_check_page_flip(struct drm_i9
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct intel_flip_work *work;
diff --git a/debian/patches/features/all/rt/i915_compile_fix.patch b/debian/patches/features/all/rt/i915_compile_fix.patch
deleted file mode 100644
index 341d9fa..0000000
--- a/debian/patches/features/all/rt/i915_compile_fix.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Tue, 14 Jul 2015 14:26:34 +0200
-Subject: gpu/i915: don't open code these things
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-The opencode part is gone in 1f83fee0 ("drm/i915: clear up wedged transitions")
-the owner check is still there.
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- drivers/gpu/drm/i915/i915_gem_shrinker.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
-+++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
-@@ -39,7 +39,7 @@ static bool mutex_is_locked_by(struct mu
- if (!mutex_is_locked(mutex))
- return false;
-
--#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_MUTEXES)
-+#if (defined(CONFIG_SMP) || defined(CONFIG_DEBUG_MUTEXES)) && !defined(CONFIG_PREEMPT_RT_BASE)
- return mutex->owner == task;
- #else
- /* Since UP may be pre-empted, we cannot assume that we own the lock */
diff --git a/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch b/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch
index c1e47a7..6c5bf86 100644
--- a/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch
+++ b/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at elte.hu>
Date: Fri, 3 Jul 2009 08:30:16 -0500
Subject: ide: Do not disable interrupts for PREEMPT-RT
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Use the local_irq_*_nort variants.
diff --git a/debian/patches/features/all/rt/idr-use-local-lock-for-protection.patch b/debian/patches/features/all/rt/idr-use-local-lock-for-protection.patch
index bed8d46..b9e134b 100644
--- a/debian/patches/features/all/rt/idr-use-local-lock-for-protection.patch
+++ b/debian/patches/features/all/rt/idr-use-local-lock-for-protection.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 14 Jul 2015 14:26:34 +0200
Subject: idr: Use local lock instead of preempt enable/disable
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
We need to protect the per cpu variable and prevent migration.
diff --git a/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch b/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch
index bd3158b..0c943fb 100644
--- a/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch
+++ b/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch
@@ -1,7 +1,7 @@
From: Sven-Thorsten Dietrich <sdietrich at novell.com>
Date: Fri, 3 Jul 2009 08:30:35 -0500
Subject: infiniband: Mellanox IB driver patch use _nort() primitives
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Fixes in_atomic stack-dump, when Mellanox module is loaded into the RT
Kernel.
diff --git a/debian/patches/features/all/rt/infiniband-ulp-ipoib-remove-pkey_mutex.patch b/debian/patches/features/all/rt/infiniband-ulp-ipoib-remove-pkey_mutex.patch
deleted file mode 100644
index aaa803c..0000000
--- a/debian/patches/features/all/rt/infiniband-ulp-ipoib-remove-pkey_mutex.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Wed, 11 May 2016 11:52:23 +0200
-Subject: infiniband/ulp/ipoib: remove pkey_mutex
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-The last user of pkey_mutex was removed in db84f8803759 ("IB/ipoib: Use
-P_Key change event instead of P_Key polling mechanism") but the lock
-remained.
-This patch removes it.
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 2 --
- 1 file changed, 2 deletions(-)
-
---- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
-+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
-@@ -51,8 +51,6 @@ MODULE_PARM_DESC(data_debug_level,
- "Enable data path debug tracing if > 0");
- #endif
-
--static DEFINE_MUTEX(pkey_mutex);
--
- struct ipoib_ah *ipoib_create_ah(struct net_device *dev,
- struct ib_pd *pd, struct ib_ah_attr *attr)
- {
diff --git a/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch b/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch
index ee7547d..1e1e1af 100644
--- a/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch
+++ b/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at elte.hu>
Date: Fri, 3 Jul 2009 08:30:16 -0500
Subject: input: gameport: Do not disable interrupts on PREEMPT_RT
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Use the _nort() primitives.
diff --git a/debian/patches/features/all/rt/introduce_migrate_disable_cpu_light.patch b/debian/patches/features/all/rt/introduce_migrate_disable_cpu_light.patch
index 457debc..5778963 100644
--- a/debian/patches/features/all/rt/introduce_migrate_disable_cpu_light.patch
+++ b/debian/patches/features/all/rt/introduce_migrate_disable_cpu_light.patch
@@ -1,7 +1,7 @@
Subject: Intrduce migrate_disable() + cpu_light()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 17 Jun 2011 15:42:38 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Introduce migrate_disable(). The task can't be pushed to another CPU but can
be preempted.
@@ -42,7 +42,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
-@@ -192,6 +192,9 @@ static inline void cpu_notifier_register
+@@ -180,6 +180,9 @@ static inline void cpu_notifier_register
#endif /* CONFIG_SMP */
extern struct bus_type cpu_subsys;
@@ -77,7 +77,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef CONFIG_PREEMPT_NOTIFIERS
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1495,6 +1495,12 @@ struct task_struct {
+@@ -1520,6 +1520,12 @@ struct task_struct {
#endif
unsigned int policy;
@@ -90,8 +90,8 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
int nr_cpus_allowed;
cpumask_t cpus_allowed;
-@@ -1946,14 +1952,6 @@ extern int arch_task_struct_size __read_
- # define arch_task_struct_size (sizeof(struct task_struct))
+@@ -1990,14 +1996,6 @@ static inline struct vm_struct *task_sta
+ }
#endif
-/* Future-safe accessor for struct task_struct's cpus_allowed. */
@@ -105,7 +105,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#define TNF_MIGRATED 0x01
#define TNF_NO_GROUP 0x02
#define TNF_SHARED 0x04
-@@ -3394,6 +3392,31 @@ static inline void set_task_cpu(struct t
+@@ -3515,6 +3513,31 @@ static inline void set_task_cpu(struct t
#endif /* CONFIG_SMP */
@@ -151,7 +151,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
* boot command line:
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -1089,6 +1089,11 @@ void do_set_cpus_allowed(struct task_str
+@@ -1100,6 +1100,11 @@ void do_set_cpus_allowed(struct task_str
lockdep_assert_held(&p->pi_lock);
@@ -163,7 +163,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
queued = task_on_rq_queued(p);
running = task_current(rq, p);
-@@ -1168,7 +1173,7 @@ static int __set_cpus_allowed_ptr(struct
+@@ -1179,7 +1184,7 @@ static int __set_cpus_allowed_ptr(struct
}
/* Can the task run on the task's current CPU? If so, we're done */
@@ -172,8 +172,8 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
goto out;
dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask);
-@@ -3237,6 +3242,69 @@ static inline void schedule_debug(struct
- schedstat_inc(this_rq(), sched_count);
+@@ -3252,6 +3257,69 @@ static inline void schedule_debug(struct
+ schedstat_inc(this_rq()->sched_count);
}
+#if defined(CONFIG_PREEMPT_RT_FULL) && defined(CONFIG_SMP)
@@ -244,7 +244,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
*/
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
-@@ -552,6 +552,9 @@ void print_rt_rq(struct seq_file *m, int
+@@ -558,6 +558,9 @@ void print_rt_rq(struct seq_file *m, int
P(rt_throttled);
PN(rt_time);
PN(rt_runtime);
@@ -254,7 +254,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#undef PN
#undef P
-@@ -947,6 +950,10 @@ void proc_sched_show_task(struct task_st
+@@ -953,6 +956,10 @@ void proc_sched_show_task(struct task_st
#endif
P(policy);
P(prio);
@@ -262,9 +262,9 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
+ P(migrate_disable);
+#endif
+ P(nr_cpus_allowed);
+ #undef PN_SCHEDSTAT
#undef PN
#undef __PN
- #undef P
--- a/lib/smp_processor_id.c
+++ b/lib/smp_processor_id.c
@@ -39,8 +39,9 @@ notrace static unsigned int check_preemp
diff --git a/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch b/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch
index 769fcb3..c2b92f7 100644
--- a/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch
+++ b/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch
@@ -1,7 +1,7 @@
Subject: iommu/amd: Use WARN_ON_NORT in __attach_device()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sat, 27 Feb 2016 10:22:23 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
RT does not disable interrupts here, but the protection is still
correct. Fixup the WARN_ON so it won't yell on RT.
@@ -17,7 +17,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
-@@ -1835,10 +1835,10 @@ static int __attach_device(struct iommu_
+@@ -1923,10 +1923,10 @@ static int __attach_device(struct iommu_
int ret;
/*
@@ -31,7 +31,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* lock domain */
spin_lock(&domain->lock);
-@@ -2006,10 +2006,10 @@ static void __detach_device(struct iommu
+@@ -2094,10 +2094,10 @@ static void __detach_device(struct iommu
struct protection_domain *domain;
/*
diff --git a/debian/patches/features/all/rt/iommu-iova-don-t-disable-preempt-around-this_cpu_ptr.patch b/debian/patches/features/all/rt/iommu-iova-don-t-disable-preempt-around-this_cpu_ptr.patch
index de8615d..266de4f 100644
--- a/debian/patches/features/all/rt/iommu-iova-don-t-disable-preempt-around-this_cpu_ptr.patch
+++ b/debian/patches/features/all/rt/iommu-iova-don-t-disable-preempt-around-this_cpu_ptr.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Thu, 15 Sep 2016 16:58:19 +0200
Subject: [PATCH] iommu/iova: don't disable preempt around this_cpu_ptr()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Commit 583248e6620a ("iommu/iova: Disable preemption around use of
this_cpu_ptr()") disables preemption while accessing a per-CPU variable.
diff --git a/debian/patches/features/all/rt/iommu-vt-d-don-t-disable-preemption-while-accessing-.patch b/debian/patches/features/all/rt/iommu-vt-d-don-t-disable-preemption-while-accessing-.patch
index f8b7566..35c4086 100644
--- a/debian/patches/features/all/rt/iommu-vt-d-don-t-disable-preemption-while-accessing-.patch
+++ b/debian/patches/features/all/rt/iommu-vt-d-don-t-disable-preemption-while-accessing-.patch
@@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Thu, 15 Sep 2016 17:16:44 +0200
Subject: [PATCH] iommu/vt-d: don't disable preemption while accessing
deferred_flush()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
get_cpu() disables preemption and returns the current CPU number. The
CPU number is later only used once while retrieving the address of the
@@ -36,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/* bitmap for indexing intel_iommus */
static int g_num_of_iommus;
-@@ -3649,10 +3649,8 @@ static void add_unmap(struct dmar_domain
+@@ -3696,10 +3696,8 @@ static void add_unmap(struct dmar_domain
struct intel_iommu *iommu;
struct deferred_flush_entry *entry;
struct deferred_flush_data *flush_data;
@@ -48,7 +48,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/* Flush all CPUs' entries to avoid deferring too much. If
* this becomes a bottleneck, can just flush us, and rely on
-@@ -3685,8 +3683,6 @@ static void add_unmap(struct dmar_domain
+@@ -3732,8 +3730,6 @@ static void add_unmap(struct dmar_domain
}
flush_data->size++;
spin_unlock_irqrestore(&flush_data->lock, flags);
diff --git a/debian/patches/features/all/rt/ipc-msg-Implement-lockless-pipelined-wakeups.patch b/debian/patches/features/all/rt/ipc-msg-Implement-lockless-pipelined-wakeups.patch
deleted file mode 100644
index b27dd43..0000000
--- a/debian/patches/features/all/rt/ipc-msg-Implement-lockless-pipelined-wakeups.patch
+++ /dev/null
@@ -1,228 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Fri, 30 Oct 2015 11:59:07 +0100
-Subject: ipc/msg: Implement lockless pipelined wakeups
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-This patch moves the wakeup_process() invocation so it is not done under
-the perm->lock by making use of a lockless wake_q. With this change, the
-waiter is woken up once the message has been assigned and it does not
-need to loop on SMP if the message points to NULL. In the signal case we
-still need to check the pointer under the lock to verify the state.
-
-This change should also avoid the introduction of preempt_disable() in
--RT which avoids a busy-loop which pools for the NULL -> !NULL
-change if the waiter has a higher priority compared to the waker.
-
-Cc: Davidlohr Bueso <dave at stgolabs.net>
-Cc: Manfred Spraul <manfred at colorfullife.com>
-Cc: Andrew Morton <akpm at linux-foundation.org>
-Cc: George Spelvin <linux at horizon.com>
-Cc: Thomas Gleixner <tglx at linutronix.de>
-Cc: Peter Zijlstra <peterz at infradead.org>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
-
- ipc/msg.c | 101 +++++++++++++++++---------------------------------------------
- 1 file changed, 28 insertions(+), 73 deletions(-)
-
---- a/ipc/msg.c
-+++ b/ipc/msg.c
-@@ -183,20 +183,14 @@ static void ss_wakeup(struct list_head *
- }
- }
-
--static void expunge_all(struct msg_queue *msq, int res)
-+static void expunge_all(struct msg_queue *msq, int res,
-+ struct wake_q_head *wake_q)
- {
- struct msg_receiver *msr, *t;
-
- list_for_each_entry_safe(msr, t, &msq->q_receivers, r_list) {
-- msr->r_msg = NULL; /* initialize expunge ordering */
-- wake_up_process(msr->r_tsk);
-- /*
-- * Ensure that the wakeup is visible before setting r_msg as
-- * the receiving end depends on it: either spinning on a nil,
-- * or dealing with -EAGAIN cases. See lockless receive part 1
-- * and 2 in do_msgrcv().
-- */
-- smp_wmb(); /* barrier (B) */
-+
-+ wake_q_add(wake_q, msr->r_tsk);
- msr->r_msg = ERR_PTR(res);
- }
- }
-@@ -213,11 +207,13 @@ static void freeque(struct ipc_namespace
- {
- struct msg_msg *msg, *t;
- struct msg_queue *msq = container_of(ipcp, struct msg_queue, q_perm);
-+ WAKE_Q(wake_q);
-
-- expunge_all(msq, -EIDRM);
-+ expunge_all(msq, -EIDRM, &wake_q);
- ss_wakeup(&msq->q_senders, 1);
- msg_rmid(ns, msq);
- ipc_unlock_object(&msq->q_perm);
-+ wake_up_q(&wake_q);
- rcu_read_unlock();
-
- list_for_each_entry_safe(msg, t, &msq->q_messages, m_list) {
-@@ -342,6 +338,7 @@ static int msgctl_down(struct ipc_namesp
- struct kern_ipc_perm *ipcp;
- struct msqid64_ds uninitialized_var(msqid64);
- struct msg_queue *msq;
-+ WAKE_Q(wake_q);
- int err;
-
- if (cmd == IPC_SET) {
-@@ -389,7 +386,7 @@ static int msgctl_down(struct ipc_namesp
- /* sleeping receivers might be excluded by
- * stricter permissions.
- */
-- expunge_all(msq, -EAGAIN);
-+ expunge_all(msq, -EAGAIN, &wake_q);
- /* sleeping senders might be able to send
- * due to a larger queue size.
- */
-@@ -402,6 +399,7 @@ static int msgctl_down(struct ipc_namesp
-
- out_unlock0:
- ipc_unlock_object(&msq->q_perm);
-+ wake_up_q(&wake_q);
- out_unlock1:
- rcu_read_unlock();
- out_up:
-@@ -566,7 +564,8 @@ static int testmsg(struct msg_msg *msg,
- return 0;
- }
-
--static inline int pipelined_send(struct msg_queue *msq, struct msg_msg *msg)
-+static inline int pipelined_send(struct msg_queue *msq, struct msg_msg *msg,
-+ struct wake_q_head *wake_q)
- {
- struct msg_receiver *msr, *t;
-
-@@ -577,27 +576,13 @@ static inline int pipelined_send(struct
-
- list_del(&msr->r_list);
- if (msr->r_maxsize < msg->m_ts) {
-- /* initialize pipelined send ordering */
-- msr->r_msg = NULL;
-- wake_up_process(msr->r_tsk);
-- /* barrier (B) see barrier comment below */
-- smp_wmb();
-+ wake_q_add(wake_q, msr->r_tsk);
- msr->r_msg = ERR_PTR(-E2BIG);
- } else {
-- msr->r_msg = NULL;
- msq->q_lrpid = task_pid_vnr(msr->r_tsk);
- msq->q_rtime = get_seconds();
-- wake_up_process(msr->r_tsk);
-- /*
-- * Ensure that the wakeup is visible before
-- * setting r_msg, as the receiving can otherwise
-- * exit - once r_msg is set, the receiver can
-- * continue. See lockless receive part 1 and 2
-- * in do_msgrcv(). Barrier (B).
-- */
-- smp_wmb();
-+ wake_q_add(wake_q, msr->r_tsk);
- msr->r_msg = msg;
--
- return 1;
- }
- }
-@@ -613,6 +598,7 @@ long do_msgsnd(int msqid, long mtype, vo
- struct msg_msg *msg;
- int err;
- struct ipc_namespace *ns;
-+ WAKE_Q(wake_q);
-
- ns = current->nsproxy->ipc_ns;
-
-@@ -698,7 +684,7 @@ long do_msgsnd(int msqid, long mtype, vo
- msq->q_lspid = task_tgid_vnr(current);
- msq->q_stime = get_seconds();
-
-- if (!pipelined_send(msq, msg)) {
-+ if (!pipelined_send(msq, msg, &wake_q)) {
- /* no one is waiting for this message, enqueue it */
- list_add_tail(&msg->m_list, &msq->q_messages);
- msq->q_cbytes += msgsz;
-@@ -712,6 +698,7 @@ long do_msgsnd(int msqid, long mtype, vo
-
- out_unlock0:
- ipc_unlock_object(&msq->q_perm);
-+ wake_up_q(&wake_q);
- out_unlock1:
- rcu_read_unlock();
- if (msg != NULL)
-@@ -932,57 +919,25 @@ long do_msgrcv(int msqid, void __user *b
- rcu_read_lock();
-
- /* Lockless receive, part 2:
-- * Wait until pipelined_send or expunge_all are outside of
-- * wake_up_process(). There is a race with exit(), see
-- * ipc/mqueue.c for the details. The correct serialization
-- * ensures that a receiver cannot continue without the wakeup
-- * being visibible _before_ setting r_msg:
-+ * The work in pipelined_send() and expunge_all():
-+ * - Set pointer to message
-+ * - Queue the receiver task for later wakeup
-+ * - Wake up the process after the lock is dropped.
- *
-- * CPU 0 CPU 1
-- * <loop receiver>
-- * smp_rmb(); (A) <-- pair -. <waker thread>
-- * <load ->r_msg> | msr->r_msg = NULL;
-- * | wake_up_process();
-- * <continue> `------> smp_wmb(); (B)
-- * msr->r_msg = msg;
-- *
-- * Where (A) orders the message value read and where (B) orders
-- * the write to the r_msg -- done in both pipelined_send and
-- * expunge_all.
-+ * Should the process wake up before this wakeup (due to a
-+ * signal) it will either see the message and continue …
- */
-- for (;;) {
-- /*
-- * Pairs with writer barrier in pipelined_send
-- * or expunge_all.
-- */
-- smp_rmb(); /* barrier (A) */
-- msg = (struct msg_msg *)msr_d.r_msg;
-- if (msg)
-- break;
-
-- /*
-- * The cpu_relax() call is a compiler barrier
-- * which forces everything in this loop to be
-- * re-loaded.
-- */
-- cpu_relax();
-- }
--
-- /* Lockless receive, part 3:
-- * If there is a message or an error then accept it without
-- * locking.
-- */
-+ msg = (struct msg_msg *)msr_d.r_msg;
- if (msg != ERR_PTR(-EAGAIN))
- goto out_unlock1;
-
-- /* Lockless receive, part 3:
-- * Acquire the queue spinlock.
-- */
-+ /*
-+ * … or see -EAGAIN, acquire the lock to check the message
-+ * again.
-+ */
- ipc_lock_object(&msq->q_perm);
-
-- /* Lockless receive, part 4:
-- * Repeat test after acquiring the spinlock.
-- */
- msg = (struct msg_msg *)msr_d.r_msg;
- if (msg != ERR_PTR(-EAGAIN))
- goto out_unlock0;
diff --git a/debian/patches/features/all/rt/ipc-sem-rework-semaphore-wakeups.patch b/debian/patches/features/all/rt/ipc-sem-rework-semaphore-wakeups.patch
index 1246e3d..7da3ae1 100644
--- a/debian/patches/features/all/rt/ipc-sem-rework-semaphore-wakeups.patch
+++ b/debian/patches/features/all/rt/ipc-sem-rework-semaphore-wakeups.patch
@@ -1,7 +1,7 @@
Subject: ipc/sem: Rework semaphore wakeups
From: Peter Zijlstra <peterz at infradead.org>
Date: Wed, 14 Sep 2011 11:57:04 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Current sysv sems have a weird ass wakeup scheme that involves keeping
preemption disabled over a potential O(n^2) loop and busy waiting on
diff --git a/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch b/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch
index bcf7c18..1b0ce62 100644
--- a/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch
+++ b/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch
@@ -1,7 +1,7 @@
Subject: genirq: Allow disabling of softirq processing in irq thread context
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 31 Jan 2012 13:01:27 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -129,7 +129,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return desc->status_use_accessors & _IRQ_PER_CPU;
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
-@@ -578,6 +578,15 @@ void __local_bh_enable(void)
+@@ -589,6 +589,15 @@ void __local_bh_enable(void)
}
EXPORT_SYMBOL(__local_bh_enable);
diff --git a/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch b/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch
index 68868e5..f07952e 100644
--- a/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch
+++ b/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch
@@ -1,7 +1,7 @@
Subject: irqwork: Move irq safe work to irq context
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 15 Nov 2015 18:40:17 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
On architectures where arch_irq_work_has_interrupt() returns false, we
end up running the irq safe work from the softirq context. That
@@ -65,7 +65,7 @@ Cc: stable-rt at vger.kernel.org
if (in_irq())
irq_work_tick();
#endif
-@@ -1684,9 +1684,7 @@ static void run_timer_softirq(struct sof
+@@ -1684,9 +1684,7 @@ static __latent_entropy void run_timer_s
{
struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]);
diff --git a/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch b/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch
index e491c89..731687f 100644
--- a/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch
+++ b/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch
@@ -1,7 +1,7 @@
Subject: irqwork: push most work into softirq context
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Tue, 23 Jun 2015 15:32:51 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
@@ -154,7 +154,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/* We start is dequeued state, because no RT tasks are queued */
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
-@@ -217,6 +217,7 @@ static void nohz_full_kick_func(struct i
+@@ -220,6 +220,7 @@ static void nohz_full_kick_func(struct i
static DEFINE_PER_CPU(struct irq_work, nohz_full_kick_work) = {
.func = nohz_full_kick_func,
@@ -173,7 +173,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
if (in_irq())
irq_work_tick();
#endif
-@@ -1684,6 +1684,10 @@ static void run_timer_softirq(struct sof
+@@ -1684,6 +1684,10 @@ static __latent_entropy void run_timer_s
{
struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]);
diff --git a/debian/patches/features/all/rt/jump-label-rt.patch b/debian/patches/features/all/rt/jump-label-rt.patch
index f525176..8448f62 100644
--- a/debian/patches/features/all/rt/jump-label-rt.patch
+++ b/debian/patches/features/all/rt/jump-label-rt.patch
@@ -1,7 +1,7 @@
Subject: jump-label: disable if stop_machine() is used
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 08 Jul 2015 17:14:48 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Some architectures are using stop_machine() while switching the opcode which
leads to latency spikes.
diff --git a/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch b/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch
index 75845ed..956fef4 100644
--- a/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch
+++ b/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch
@@ -1,7 +1,7 @@
Subject: kconfig: Disable config options which are not RT compatible
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 24 Jul 2011 12:11:43 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Disable stuff which is known to have issues on RT
diff --git a/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch b/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch
index 8cb911c..bcfa2b3 100644
--- a/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch
+++ b/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch
@@ -1,7 +1,7 @@
Subject: kconfig: Add PREEMPT_RT_FULL
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 29 Jun 2011 14:58:57 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Introduce the final symbol for PREEMPT_RT_FULL.
@@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/init/Makefile
+++ b/init/Makefile
-@@ -33,4 +33,4 @@ mounts-$(CONFIG_BLK_DEV_MD) += do_mounts
+@@ -35,4 +35,4 @@ mounts-$(CONFIG_BLK_DEV_MD) += do_mounts
include/generated/compile.h: FORCE
@$($(quiet)chk_compile.h)
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
diff --git a/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch b/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch
index 4240674..dd345a8 100644
--- a/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch
+++ b/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Tue, 19 Mar 2013 14:44:30 +0100
Subject: kernel/SRCU: provide a static initializer
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
There are macros for static initializer for the three out of four
possible notifier types, that are:
diff --git a/debian/patches/features/all/rt/kernel-cpu-fix-cpu-down-problem-if-kthread-s-cpu-is-.patch b/debian/patches/features/all/rt/kernel-cpu-fix-cpu-down-problem-if-kthread-s-cpu-is-.patch
index d7f6b84..52b91d7 100644
--- a/debian/patches/features/all/rt/kernel-cpu-fix-cpu-down-problem-if-kthread-s-cpu-is-.patch
+++ b/debian/patches/features/all/rt/kernel-cpu-fix-cpu-down-problem-if-kthread-s-cpu-is-.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Fri, 7 Jun 2013 22:37:06 +0200
Subject: kernel/cpu: fix cpu down problem if kthread's cpu is going down
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
If kthread is pinned to CPUx and CPUx is going down then we get into
trouble:
@@ -27,7 +27,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -186,6 +186,7 @@ struct hotplug_pcp {
+@@ -259,6 +259,7 @@ struct hotplug_pcp {
int refcount;
int grab_lock;
struct completion synced;
@@ -35,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#ifdef CONFIG_PREEMPT_RT_FULL
/*
* Note, on PREEMPT_RT, the hotplug lock must save the state of
-@@ -289,6 +290,7 @@ static int sync_unplug_thread(void *data
+@@ -362,6 +363,7 @@ static int sync_unplug_thread(void *data
{
struct hotplug_pcp *hp = data;
@@ -43,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
preempt_disable();
hp->unplug = current;
wait_for_pinned_cpus(hp);
-@@ -354,6 +356,14 @@ static void __cpu_unplug_sync(struct hot
+@@ -427,6 +429,14 @@ static void __cpu_unplug_sync(struct hot
wait_for_completion(&hp->synced);
}
@@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/*
* Start the sync_unplug_thread on the target cpu and wait for it to
* complete.
-@@ -377,6 +387,7 @@ static int cpu_unplug_begin(unsigned int
+@@ -450,6 +460,7 @@ static int cpu_unplug_begin(unsigned int
tell_sched_cpu_down_begin(cpu);
init_completion(&hp->synced);
@@ -66,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
hp->sync_tsk = kthread_create(sync_unplug_thread, hp, "sync_unplug/%d", cpu);
if (IS_ERR(hp->sync_tsk)) {
-@@ -392,8 +403,7 @@ static int cpu_unplug_begin(unsigned int
+@@ -465,8 +476,7 @@ static int cpu_unplug_begin(unsigned int
* wait for tasks that are going to enter these sections and
* we must not have them block.
*/
@@ -76,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
return 0;
}
-@@ -983,6 +993,7 @@ static int takedown_cpu(unsigned int cpu
+@@ -1062,6 +1072,7 @@ static int takedown_cpu(unsigned int cpu
struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
int err;
diff --git a/debian/patches/features/all/rt/kernel-futex-don-t-deboost-too-early.patch b/debian/patches/features/all/rt/kernel-futex-don-t-deboost-too-early.patch
index 5c20814..0065aaa 100644
--- a/debian/patches/features/all/rt/kernel-futex-don-t-deboost-too-early.patch
+++ b/debian/patches/features/all/rt/kernel-futex-don-t-deboost-too-early.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Thu, 29 Sep 2016 18:49:22 +0200
Subject: [PATCH] kernel/futex: don't deboost too early
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The sequence:
T1 holds futex
@@ -59,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
do { \
--- a/kernel/futex.c
+++ b/kernel/futex.c
-@@ -1368,7 +1368,7 @@ static int wake_futex_pi(u32 __user *uad
+@@ -1377,7 +1377,7 @@ static int wake_futex_pi(u32 __user *uad
* deboost first (and lose our higher priority), then the task might get
* scheduled away before the wake up can take place.
*/
diff --git a/debian/patches/features/all/rt/kernel-hotplug-restore-original-cpu-mask-oncpu-down.patch b/debian/patches/features/all/rt/kernel-hotplug-restore-original-cpu-mask-oncpu-down.patch
index dae2991..a0642f9 100644
--- a/debian/patches/features/all/rt/kernel-hotplug-restore-original-cpu-mask-oncpu-down.patch
+++ b/debian/patches/features/all/rt/kernel-hotplug-restore-original-cpu-mask-oncpu-down.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Fri, 14 Jun 2013 17:16:35 +0200
Subject: kernel/hotplug: restore original cpu mask oncpu/down
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
If a task which is allowed to run only on CPU X puts CPU Y down then it
will be allowed on all CPUs but the on CPU Y after it comes back from
@@ -16,7 +16,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -1088,6 +1088,7 @@ static int __ref _cpu_down(unsigned int
+@@ -1166,6 +1166,7 @@ static int __ref _cpu_down(unsigned int
bool hasdied = false;
int mycpu;
cpumask_var_t cpumask;
@@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
if (num_online_cpus() == 1)
return -EBUSY;
-@@ -1098,6 +1099,12 @@ static int __ref _cpu_down(unsigned int
+@@ -1176,6 +1177,12 @@ static int __ref _cpu_down(unsigned int
/* Move the downtaker off the unplug cpu */
if (!alloc_cpumask_var(&cpumask, GFP_KERNEL))
return -ENOMEM;
@@ -37,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
cpumask_andnot(cpumask, cpu_online_mask, cpumask_of(cpu));
set_cpus_allowed_ptr(current, cpumask);
free_cpumask_var(cpumask);
-@@ -1106,7 +1113,8 @@ static int __ref _cpu_down(unsigned int
+@@ -1184,7 +1191,8 @@ static int __ref _cpu_down(unsigned int
if (mycpu == cpu) {
printk(KERN_ERR "Yuck! Still on unplug CPU\n!");
migrate_enable();
@@ -47,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
cpu_hotplug_begin();
-@@ -1160,6 +1168,9 @@ static int __ref _cpu_down(unsigned int
+@@ -1238,6 +1246,9 @@ static int __ref _cpu_down(unsigned int
/* This post dead nonsense must die */
if (!ret && hasdied)
cpu_notify_nofail(CPU_POST_DEAD, cpu);
diff --git a/debian/patches/features/all/rt/kernel-migrate_disable-do-fastpath-in-atomic-irqs-of.patch b/debian/patches/features/all/rt/kernel-migrate_disable-do-fastpath-in-atomic-irqs-of.patch
index 3ba1d7a..f121e5d 100644
--- a/debian/patches/features/all/rt/kernel-migrate_disable-do-fastpath-in-atomic-irqs-of.patch
+++ b/debian/patches/features/all/rt/kernel-migrate_disable-do-fastpath-in-atomic-irqs-of.patch
@@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Tue, 9 Feb 2016 18:18:01 +0100
Subject: kernel: migrate_disable() do fastpath in atomic &
irqs-off
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
With interrupts off it makes no sense to do the long path since we can't
leave the CPU anyway. Also we might end up in a recursion with lockdep.
@@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -3293,7 +3293,7 @@ void migrate_disable(void)
+@@ -3299,7 +3299,7 @@ void migrate_disable(void)
{
struct task_struct *p = current;
@@ -23,7 +23,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#ifdef CONFIG_SCHED_DEBUG
p->migrate_disable_atomic++;
#endif
-@@ -3320,7 +3320,7 @@ void migrate_enable(void)
+@@ -3326,7 +3326,7 @@ void migrate_enable(void)
{
struct task_struct *p = current;
diff --git a/debian/patches/features/all/rt/kernel-perf-mark-perf_cpu_context-s-timer-as-irqsafe.patch b/debian/patches/features/all/rt/kernel-perf-mark-perf_cpu_context-s-timer-as-irqsafe.patch
index 85b0d41..e426d1a 100644
--- a/debian/patches/features/all/rt/kernel-perf-mark-perf_cpu_context-s-timer-as-irqsafe.patch
+++ b/debian/patches/features/all/rt/kernel-perf-mark-perf_cpu_context-s-timer-as-irqsafe.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Thu, 4 Feb 2016 16:38:10 +0100
Subject: [PATCH] kernel/perf: mark perf_cpu_context's timer as irqsafe
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Otherwise we get a WARN_ON() backtrace and some events are reported as
"not counted".
@@ -15,7 +15,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
-@@ -1042,6 +1042,7 @@ static void __perf_mux_hrtimer_init(stru
+@@ -1050,6 +1050,7 @@ static void __perf_mux_hrtimer_init(stru
raw_spin_lock_init(&cpuctx->hrtimer_lock);
hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED);
timer->function = perf_mux_hrtimer_handler;
diff --git a/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch b/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch
index ed74ffd..7ece56e 100644
--- a/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch
+++ b/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -16,7 +16,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -1631,6 +1631,11 @@ static void call_console_drivers(int lev
+@@ -1628,6 +1628,11 @@ static void call_console_drivers(int lev
if (!console_drivers)
return;
@@ -28,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
migrate_disable();
for_each_console(con) {
if (exclusive_console && con != exclusive_console)
-@@ -2565,6 +2570,11 @@ void console_unblank(void)
+@@ -2556,6 +2561,11 @@ void console_unblank(void)
{
struct console *c;
diff --git a/debian/patches/features/all/rt/kernel-rtmutex-only-warn-once-on-a-try-lock-from-bad.patch b/debian/patches/features/all/rt/kernel-rtmutex-only-warn-once-on-a-try-lock-from-bad.patch
deleted file mode 100644
index 69b921b..0000000
--- a/debian/patches/features/all/rt/kernel-rtmutex-only-warn-once-on-a-try-lock-from-bad.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Thu, 19 May 2016 17:12:34 +0200
-Subject: [PATCH] kernel/rtmutex: only warn once on a try lock from bad
- context
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-One warning should be enough to get one motivated to fix this. It is
-possible that this happens more than once and so starts flooding the
-output. Later the prints will be suppressed so we only get half of it.
-Depending on the console system used it might not be helpfull.
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- kernel/locking/rtmutex.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/kernel/locking/rtmutex.c
-+++ b/kernel/locking/rtmutex.c
-@@ -1479,7 +1479,7 @@ EXPORT_SYMBOL_GPL(rt_mutex_timed_lock);
- int __sched rt_mutex_trylock(struct rt_mutex *lock)
- {
- #ifdef CONFIG_PREEMPT_RT_FULL
-- if (WARN_ON(in_irq() || in_nmi()))
-+ if (WARN_ON_ONCE(in_irq() || in_nmi()))
- #else
- if (WARN_ON(in_irq() || in_nmi() || in_serving_softirq()))
- #endif
diff --git a/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch
new file mode 100644
index 0000000..e6476b2
--- /dev/null
+++ b/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch
@@ -0,0 +1,61 @@
+From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+Date: Mon, 21 Nov 2016 19:31:08 +0100
+Subject: [PATCH] kernel/sched: move stack + kprobe clean up to
+ __put_task_struct()
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
+
+There is no need to free the stack before the task struct. This also
+comes handy on -RT because we can't free memory in preempt disabled
+region.
+
+Cc: stable-rt at vger.kernel.org #for kprobe_flush_task()
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+---
+ kernel/fork.c | 10 ++++++++++
+ kernel/sched/core.c | 9 ---------
+ 2 files changed, 10 insertions(+), 9 deletions(-)
+
+--- a/kernel/fork.c
++++ b/kernel/fork.c
+@@ -76,6 +76,7 @@
+ #include <linux/compiler.h>
+ #include <linux/sysctl.h>
+ #include <linux/kcov.h>
++#include <linux/kprobes.h>
+
+ #include <asm/pgtable.h>
+ #include <asm/pgalloc.h>
+@@ -385,6 +386,15 @@ void __put_task_struct(struct task_struc
+ WARN_ON(atomic_read(&tsk->usage));
+ WARN_ON(tsk == current);
+
++ /*
++ * Remove function-return probe instances associated with this
++ * task and put them back on the free list.
++ */
++ kprobe_flush_task(tsk);
++
++ /* Task is done with its stack. */
++ put_task_stack(tsk);
++
+ cgroup_free(tsk);
+ task_numa_free(tsk);
+ security_task_free(tsk);
+--- a/kernel/sched/core.c
++++ b/kernel/sched/core.c
+@@ -2795,15 +2795,6 @@ static struct rq *finish_task_switch(str
+ if (prev->sched_class->task_dead)
+ prev->sched_class->task_dead(prev);
+
+- /*
+- * Remove function-return probe instances associated with this
+- * task and put them back on the free list.
+- */
+- kprobe_flush_task(prev);
+-
+- /* Task is done with its stack. */
+- put_task_stack(prev);
+-
+ put_task_struct(prev);
+ }
+
diff --git a/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch b/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch
index 9a8f0df..20ae1f3 100644
--- a/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch
+++ b/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Tue, 9 Feb 2016 18:17:18 +0100
Subject: kernel: softirq: unlock with irqs on
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
We unlock the lock while the interrupts are off. This isn't a problem
now but will get because the migrate_disable() + enable are not
@@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
-@@ -549,8 +549,10 @@ static void do_current_softirqs(void)
+@@ -560,8 +560,10 @@ static void do_current_softirqs(void)
do_single_softirq(i);
}
softirq_clr_runner(i);
diff --git a/debian/patches/features/all/rt/kgb-serial-hackaround.patch b/debian/patches/features/all/rt/kgb-serial-hackaround.patch
index cb27785..8f9d76d 100644
--- a/debian/patches/features/all/rt/kgb-serial-hackaround.patch
+++ b/debian/patches/features/all/rt/kgb-serial-hackaround.patch
@@ -1,7 +1,7 @@
From: Jason Wessel <jason.wessel at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
On 07/27/2011 04:37 PM, Thomas Gleixner wrote:
> - KGDB (not yet disabled) is reportedly unusable on -rt right now due
@@ -34,7 +34,7 @@ Jason.
#include <linux/uaccess.h>
#include <linux/pm_runtime.h>
#include <linux/timer.h>
-@@ -3111,6 +3112,8 @@ void serial8250_console_write(struct uar
+@@ -3146,6 +3147,8 @@ void serial8250_console_write(struct uar
if (port->sysrq || oops_in_progress)
locked = 0;
diff --git a/debian/patches/features/all/rt/latency-hist.patch b/debian/patches/features/all/rt/latency-hist.patch
index bcb438c..07e0303 100644
--- a/debian/patches/features/all/rt/latency-hist.patch
+++ b/debian/patches/features/all/rt/latency-hist.patch
@@ -1,7 +1,7 @@
Subject: tracing: Add latency histograms
From: Carsten Emde <C.Emde at osadl.org>
Date: Tue, 19 Jul 2011 14:03:41 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
This patch provides a recording mechanism to store data of potential
sources of system latencies. The recordings separately determine the
@@ -237,7 +237,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
int start_pid;
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1892,6 +1892,12 @@ struct task_struct {
+@@ -1917,6 +1917,12 @@ struct task_struct {
/* bitmask and counter of trace recursion */
unsigned long trace_recursion;
#endif /* CONFIG_TRACING */
@@ -412,7 +412,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
* minimizing wakeups, not running timers at the
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
-@@ -187,6 +187,24 @@ config IRQSOFF_TRACER
+@@ -182,6 +182,24 @@ config IRQSOFF_TRACER
enabled. This option and the preempt-off timing option can be
used together or separately.)
@@ -437,7 +437,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
config PREEMPT_TRACER
bool "Preemption-off Latency Tracer"
default n
-@@ -212,6 +230,24 @@ config PREEMPT_TRACER
+@@ -206,6 +224,24 @@ config PREEMPT_TRACER
enabled. This option and the irqs-off timing option can be
used together or separately.)
@@ -462,9 +462,9 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
config SCHED_TRACER
bool "Scheduling Latency Tracer"
select GENERIC_TRACER
-@@ -222,6 +258,74 @@ config SCHED_TRACER
- This tracer tracks the latency of the highest priority task
- to be scheduled in, starting from the point it has woken up.
+@@ -251,6 +287,74 @@ config HWLAT_TRACER
+ file. Every time a latency is greater than tracing_thresh, it will
+ be recorded into the ring buffer.
+config WAKEUP_LATENCY_HIST
+ bool "Scheduling Latency Histogram"
@@ -539,10 +539,10 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
depends on !GENERIC_TRACER
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
-@@ -37,6 +37,10 @@ obj-$(CONFIG_FUNCTION_TRACER) += trace_f
- obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o
+@@ -38,6 +38,10 @@ obj-$(CONFIG_IRQSOFF_TRACER) += trace_ir
obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o
obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o
+ obj-$(CONFIG_HWLAT_TRACER) += trace_hwlat.o
+obj-$(CONFIG_INTERRUPT_OFF_HIST) += latency_hist.o
+obj-$(CONFIG_PREEMPT_OFF_HIST) += latency_hist.o
+obj-$(CONFIG_WAKEUP_LATENCY_HIST) += latency_hist.o
diff --git a/debian/patches/features/all/rt/latency_hist-update-sched_wakeup-probe.patch b/debian/patches/features/all/rt/latency_hist-update-sched_wakeup-probe.patch
index dfe0eab..fd77f0f 100644
--- a/debian/patches/features/all/rt/latency_hist-update-sched_wakeup-probe.patch
+++ b/debian/patches/features/all/rt/latency_hist-update-sched_wakeup-probe.patch
@@ -1,7 +1,7 @@
Subject: latency_hist: Update sched_wakeup probe
From: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date: Sun, 25 Oct 2015 18:06:05 -0400
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
"sched: Introduce the 'trace_sched_waking' tracepoint" introduces a
prototype change for the sched_wakeup probe: the "success" argument is
diff --git a/debian/patches/features/all/rt/latencyhist-disable-jump-labels.patch b/debian/patches/features/all/rt/latencyhist-disable-jump-labels.patch
index 505e7bd..798aa4c 100644
--- a/debian/patches/features/all/rt/latencyhist-disable-jump-labels.patch
+++ b/debian/patches/features/all/rt/latencyhist-disable-jump-labels.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Thu, 4 Feb 2016 14:08:06 +0100
Subject: latencyhist: disable jump-labels
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Atleast on X86 we die a recursive death
diff --git a/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch b/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch
index c6a91b1..1c26ec0 100644
--- a/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch
+++ b/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
as it triggers:
|CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141
diff --git a/debian/patches/features/all/rt/lglocks-rt.patch b/debian/patches/features/all/rt/lglocks-rt.patch
deleted file mode 100644
index 27eacbe..0000000
--- a/debian/patches/features/all/rt/lglocks-rt.patch
+++ /dev/null
@@ -1,200 +0,0 @@
-Subject: lglocks: Provide a RT safe variant
-From: Thomas Gleixner <tglx at linutronix.de>
-Date: Wed, 15 Jun 2011 11:02:21 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-lglocks by itself will spin in order to get the lock. This will end up
-badly if a task with the highest priority keeps spinning while a task
-with the lowest priority owns the lock.
-
-Lets replace them with rt_mutex based locks so they can sleep, track
-owner and boost if needed.
-
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
----
- include/linux/lglock.h | 18 +++++++++++++
- kernel/locking/lglock.c | 62 ++++++++++++++++++++++++++++++------------------
- 2 files changed, 58 insertions(+), 22 deletions(-)
-
---- a/include/linux/lglock.h
-+++ b/include/linux/lglock.h
-@@ -34,13 +34,30 @@
- #endif
-
- struct lglock {
-+#ifdef CONFIG_PREEMPT_RT_FULL
-+ struct rt_mutex __percpu *lock;
-+#else
- arch_spinlock_t __percpu *lock;
-+#endif
- #ifdef CONFIG_DEBUG_LOCK_ALLOC
- struct lock_class_key lock_key;
- struct lockdep_map lock_dep_map;
- #endif
- };
-
-+#ifdef CONFIG_PREEMPT_RT_FULL
-+# define DEFINE_LGLOCK(name) \
-+ static DEFINE_PER_CPU(struct rt_mutex, name ## _lock) \
-+ = __RT_MUTEX_INITIALIZER( name ## _lock); \
-+ struct lglock name = { .lock = &name ## _lock }
-+
-+# define DEFINE_STATIC_LGLOCK(name) \
-+ static DEFINE_PER_CPU(struct rt_mutex, name ## _lock) \
-+ = __RT_MUTEX_INITIALIZER( name ## _lock); \
-+ static struct lglock name = { .lock = &name ## _lock }
-+
-+#else
-+
- #define DEFINE_LGLOCK(name) \
- static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \
- = __ARCH_SPIN_LOCK_UNLOCKED; \
-@@ -50,6 +67,7 @@ struct lglock {
- static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \
- = __ARCH_SPIN_LOCK_UNLOCKED; \
- static struct lglock name = { .lock = &name ## _lock }
-+#endif
-
- void lg_lock_init(struct lglock *lg, char *name);
-
---- a/kernel/locking/lglock.c
-+++ b/kernel/locking/lglock.c
-@@ -4,6 +4,15 @@
- #include <linux/cpu.h>
- #include <linux/string.h>
-
-+#ifndef CONFIG_PREEMPT_RT_FULL
-+# define lg_lock_ptr arch_spinlock_t
-+# define lg_do_lock(l) arch_spin_lock(l)
-+# define lg_do_unlock(l) arch_spin_unlock(l)
-+#else
-+# define lg_lock_ptr struct rt_mutex
-+# define lg_do_lock(l) __rt_spin_lock__no_mg(l)
-+# define lg_do_unlock(l) __rt_spin_unlock(l)
-+#endif
- /*
- * Note there is no uninit, so lglocks cannot be defined in
- * modules (but it's fine to use them from there)
-@@ -12,51 +21,60 @@
-
- void lg_lock_init(struct lglock *lg, char *name)
- {
-+#ifdef CONFIG_PREEMPT_RT_FULL
-+ int i;
-+
-+ for_each_possible_cpu(i) {
-+ struct rt_mutex *lock = per_cpu_ptr(lg->lock, i);
-+
-+ rt_mutex_init(lock);
-+ }
-+#endif
- LOCKDEP_INIT_MAP(&lg->lock_dep_map, name, &lg->lock_key, 0);
- }
- EXPORT_SYMBOL(lg_lock_init);
-
- void lg_local_lock(struct lglock *lg)
- {
-- arch_spinlock_t *lock;
-+ lg_lock_ptr *lock;
-
-- preempt_disable();
-+ migrate_disable();
- lock_acquire_shared(&lg->lock_dep_map, 0, 0, NULL, _RET_IP_);
- lock = this_cpu_ptr(lg->lock);
-- arch_spin_lock(lock);
-+ lg_do_lock(lock);
- }
- EXPORT_SYMBOL(lg_local_lock);
-
- void lg_local_unlock(struct lglock *lg)
- {
-- arch_spinlock_t *lock;
-+ lg_lock_ptr *lock;
-
- lock_release(&lg->lock_dep_map, 1, _RET_IP_);
- lock = this_cpu_ptr(lg->lock);
-- arch_spin_unlock(lock);
-- preempt_enable();
-+ lg_do_unlock(lock);
-+ migrate_enable();
- }
- EXPORT_SYMBOL(lg_local_unlock);
-
- void lg_local_lock_cpu(struct lglock *lg, int cpu)
- {
-- arch_spinlock_t *lock;
-+ lg_lock_ptr *lock;
-
-- preempt_disable();
-+ preempt_disable_nort();
- lock_acquire_shared(&lg->lock_dep_map, 0, 0, NULL, _RET_IP_);
- lock = per_cpu_ptr(lg->lock, cpu);
-- arch_spin_lock(lock);
-+ lg_do_lock(lock);
- }
- EXPORT_SYMBOL(lg_local_lock_cpu);
-
- void lg_local_unlock_cpu(struct lglock *lg, int cpu)
- {
-- arch_spinlock_t *lock;
-+ lg_lock_ptr *lock;
-
- lock_release(&lg->lock_dep_map, 1, _RET_IP_);
- lock = per_cpu_ptr(lg->lock, cpu);
-- arch_spin_unlock(lock);
-- preempt_enable();
-+ lg_do_unlock(lock);
-+ preempt_enable_nort();
- }
- EXPORT_SYMBOL(lg_local_unlock_cpu);
-
-@@ -70,15 +88,15 @@ void lg_double_lock(struct lglock *lg, i
-
- preempt_disable();
- lock_acquire_shared(&lg->lock_dep_map, 0, 0, NULL, _RET_IP_);
-- arch_spin_lock(per_cpu_ptr(lg->lock, cpu1));
-- arch_spin_lock(per_cpu_ptr(lg->lock, cpu2));
-+ lg_do_lock(per_cpu_ptr(lg->lock, cpu1));
-+ lg_do_lock(per_cpu_ptr(lg->lock, cpu2));
- }
-
- void lg_double_unlock(struct lglock *lg, int cpu1, int cpu2)
- {
- lock_release(&lg->lock_dep_map, 1, _RET_IP_);
-- arch_spin_unlock(per_cpu_ptr(lg->lock, cpu1));
-- arch_spin_unlock(per_cpu_ptr(lg->lock, cpu2));
-+ lg_do_unlock(per_cpu_ptr(lg->lock, cpu1));
-+ lg_do_unlock(per_cpu_ptr(lg->lock, cpu2));
- preempt_enable();
- }
-
-@@ -86,12 +104,12 @@ void lg_global_lock(struct lglock *lg)
- {
- int i;
-
-- preempt_disable();
-+ preempt_disable_nort();
- lock_acquire_exclusive(&lg->lock_dep_map, 0, 0, NULL, _RET_IP_);
- for_each_possible_cpu(i) {
-- arch_spinlock_t *lock;
-+ lg_lock_ptr *lock;
- lock = per_cpu_ptr(lg->lock, i);
-- arch_spin_lock(lock);
-+ lg_do_lock(lock);
- }
- }
- EXPORT_SYMBOL(lg_global_lock);
-@@ -102,10 +120,10 @@ void lg_global_unlock(struct lglock *lg)
-
- lock_release(&lg->lock_dep_map, 1, _RET_IP_);
- for_each_possible_cpu(i) {
-- arch_spinlock_t *lock;
-+ lg_lock_ptr *lock;
- lock = per_cpu_ptr(lg->lock, i);
-- arch_spin_unlock(lock);
-+ lg_do_unlock(lock);
- }
-- preempt_enable();
-+ preempt_enable_nort();
- }
- EXPORT_SYMBOL(lg_global_unlock);
diff --git a/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch b/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch
index cf10dfd..f47e7b4 100644
--- a/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch
+++ b/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch
@@ -1,7 +1,7 @@
From: Josh Cartwright <joshc at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
At first glance, the use of 'static inline' seems appropriate for
INIT_HLIST_BL_HEAD().
diff --git a/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch b/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch
index 9216656..4b95ddd 100644
--- a/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch
+++ b/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch
@@ -1,7 +1,7 @@
From: Paul Gortmaker <paul.gortmaker at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch b/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch
index 97d22e4..d58b4e0 100644
--- a/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch
+++ b/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 21 Jul 2009 22:34:14 +0200
Subject: rt: local_irq_* variants depending on RT/!RT
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Add local_irq_*_(no)rt variant which are mainly used to break
interrupt disabled sections on PREEMPT_RT or to explicitely disable
diff --git a/debian/patches/features/all/rt/locallock-add-local_lock_on.patch b/debian/patches/features/all/rt/locallock-add-local_lock_on.patch
index 89d528d..4ada352 100644
--- a/debian/patches/features/all/rt/locallock-add-local_lock_on.patch
+++ b/debian/patches/features/all/rt/locallock-add-local_lock_on.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Fri, 27 May 2016 15:11:51 +0200
Subject: [PATCH] locallock: add local_lock_on()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
diff --git a/debian/patches/features/all/rt/localversion.patch b/debian/patches/features/all/rt/localversion.patch
index c22f937..a1044be 100644
--- a/debian/patches/features/all/rt/localversion.patch
+++ b/debian/patches/features/all/rt/localversion.patch
@@ -1,7 +1,7 @@
Subject: Add localversion for -RT release
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 08 Jul 2011 20:25:16 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
---
@@ -11,4 +11,4 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- /dev/null
+++ b/localversion-rt
@@ -0,0 +1 @@
-+-rt9
++-rt1
diff --git a/debian/patches/features/all/rt/lockdep-Quiet-gcc-about-dangerous-__builtin_return_a.patch b/debian/patches/features/all/rt/lockdep-Quiet-gcc-about-dangerous-__builtin_return_a.patch
deleted file mode 100644
index 13a075c..0000000
--- a/debian/patches/features/all/rt/lockdep-Quiet-gcc-about-dangerous-__builtin_return_a.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From: Steven Rostedt <rostedt at goodmis.org>
-Date: Thu, 8 Sep 2016 12:34:33 -0400
-Subject: [PATCH] lockdep: Quiet gcc about dangerous __builtin_return_address()
- operations
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-[
- Boris, does this quiet gcc for you?
- I haven't fully tested this yet, as I still don't have a compiler
- that does the warning.
-]
-
-Gcc's new warnings about __builtin_return_address(n) operations with
-n > 0 is popping up around the kernel. The operation is dangerous, and
-the warning is "good to know". But there's instances that we use
-__builtin_return_address(n) with n > 0 and are aware of the issues,
-and work around them. And its used mostly for tracing and debugging. In
-these cases, the warning becomes a distraction and is not helpful.
-
-To get better lock issue traces, a function like get_lock_parent_ip()
-uses __builtin_return_address() to find the caller of the lock, and
-skip over the internal callers of the lock itself. Currently it is only
-used in the kernel/ directory and only if certain configs are enabled.
-
-Create a new config called CONFIG_USING_GET_LOCK_PARENT_IP that gets
-selected when another config relies on get_lock_parent_ip(), and this
-will now enable the function get_lock_parent_ip(), otherwise it wont be
-defined. It will also disable the frame-address warnings from gcc in
-the kernel directory.
-
-Reported-by: Borislav Petkov <bp at alien8.de>
-Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
----
- include/linux/ftrace.h | 2 ++
- kernel/Makefile | 7 +++++++
- kernel/trace/Kconfig | 1 +
- lib/Kconfig.debug | 10 ++++++++++
- 4 files changed, 20 insertions(+)
-
---- a/include/linux/ftrace.h
-+++ b/include/linux/ftrace.h
-@@ -714,6 +714,7 @@ static inline void __ftrace_enabled_rest
- #define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5))
- #define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6))
-
-+#ifdef CONFIG_USING_GET_LOCK_PARENT_IP
- static inline unsigned long get_lock_parent_ip(void)
- {
- unsigned long addr = CALLER_ADDR0;
-@@ -725,6 +726,7 @@ static inline unsigned long get_lock_par
- return addr;
- return CALLER_ADDR2;
- }
-+#endif
-
- #ifdef CONFIG_IRQSOFF_TRACER
- extern void time_hardirqs_on(unsigned long a0, unsigned long a1);
---- a/kernel/Makefile
-+++ b/kernel/Makefile
-@@ -11,6 +11,13 @@ obj-y = fork.o exec_domain.o panic.o
- notifier.o ksysfs.o cred.o reboot.o \
- async.o range.o smpboot.o
-
-+# Tracing may do some dangerous __builtin_return_address() operations
-+# We know they are dangerous, we don't need gcc telling us that.
-+ifdef CONFIG_USING_GET_LOCK_PARENT_IP
-+FRAME_CFLAGS := $(call cc-disable-warning,frame-address)
-+KBUILD_CFLAGS += $(FRAME_CFLAGS)
-+endif
-+
- obj-$(CONFIG_MULTIUSER) += groups.o
-
- ifdef CONFIG_FUNCTION_TRACER
---- a/kernel/trace/Kconfig
-+++ b/kernel/trace/Kconfig
-@@ -197,6 +197,7 @@ config PREEMPT_TRACER
- select RING_BUFFER_ALLOW_SWAP
- select TRACER_SNAPSHOT
- select TRACER_SNAPSHOT_PER_CPU_SWAP
-+ select USING_GET_LOCK_PARENT_IP
- help
- This option measures the time spent in preemption-off critical
- sections, with microsecond accuracy.
---- a/lib/Kconfig.debug
-+++ b/lib/Kconfig.debug
-@@ -977,6 +977,7 @@ config TIMER_STATS
- config DEBUG_PREEMPT
- bool "Debug preemptible kernel"
- depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT
-+ select USING_GET_LOCK_PARENT_IP
- default y
- help
- If you say Y here then the kernel will use a debug variant of the
-@@ -1159,8 +1160,17 @@ config LOCK_TORTURE_TEST
-
- endmenu # lock debugging
-
-+config USING_GET_LOCK_PARENT_IP
-+ bool
-+ help
-+ Enables the use of the function get_lock_parent_ip() that
-+ will use __builtin_return_address(n) with n > 0 causing
-+ some gcc warnings. When this is selected, those warnings
-+ will be suppressed.
-+
- config TRACE_IRQFLAGS
- bool
-+ select USING_GET_LOCK_PARENT_IP
- help
- Enables hooks to interrupt enabling and disabling for
- either tracing or lock debugging.
diff --git a/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch b/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch
index d25e95b..742dbe5 100644
--- a/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch
+++ b/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch
@@ -1,7 +1,7 @@
Subject: lockdep: Make it RT aware
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 17 Jul 2011 18:51:23 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
teach lockdep that we don't really do softirqs on -RT.
@@ -41,7 +41,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#if defined(CONFIG_IRQSOFF_TRACER) || \
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
-@@ -3686,6 +3686,7 @@ static void check_flags(unsigned long fl
+@@ -3689,6 +3689,7 @@ static void check_flags(unsigned long fl
}
}
@@ -49,7 +49,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* We dont accurately track softirq state in e.g.
* hardirq contexts (such as on 4KSTACKS), so only
-@@ -3700,6 +3701,7 @@ static void check_flags(unsigned long fl
+@@ -3703,6 +3704,7 @@ static void check_flags(unsigned long fl
DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled);
}
}
diff --git a/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch
index d536265..5a43e05 100644
--- a/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch
+++ b/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch
@@ -1,7 +1,7 @@
From: Josh Cartwright <josh.cartwright at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
"lockdep: Selftest: Only do hardirq context test for raw spinlock"
disabled the execution of certain tests with PREEMPT_RT_FULL, but did
diff --git a/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch b/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch
index 314ac8d..3934a75 100644
--- a/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch
+++ b/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch
@@ -1,7 +1,7 @@
Subject: lockdep: selftest: Only do hardirq context test for raw spinlock
From: Yong Zhang <yong.zhang0 at gmail.com>
Date: Mon, 16 Apr 2012 15:01:56 +0800
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
From: Yong Zhang <yong.zhang at windriver.com>
diff --git a/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch b/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch
index a0807be..944948d 100644
--- a/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch
+++ b/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch
@@ -1,7 +1,7 @@
From: "Wolfgang M. Reimer" <linuxball at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Including rwlock.h directly will cause kernel builds to fail
if CONFIG_PREEMPT_RT_FULL is defined. The correct header file
diff --git a/debian/patches/features/all/rt/locking-percpu-rwsem-use-swait-for-the-wating-writer.patch b/debian/patches/features/all/rt/locking-percpu-rwsem-use-swait-for-the-wating-writer.patch
new file mode 100644
index 0000000..b5d5a34
--- /dev/null
+++ b/debian/patches/features/all/rt/locking-percpu-rwsem-use-swait-for-the-wating-writer.patch
@@ -0,0 +1,73 @@
+From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+Date: Mon, 21 Nov 2016 19:26:15 +0100
+Subject: [PATCH] locking/percpu-rwsem: use swait for the wating writer
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
+
+Use struct swait_queue_head instead of wait_queue_head_t for the waiting
+writer. The swait implementation is smaller and lightweight compared to
+wait_queue_head_t.
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+---
+ include/linux/percpu-rwsem.h | 6 +++---
+ kernel/locking/percpu-rwsem.c | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+--- a/include/linux/percpu-rwsem.h
++++ b/include/linux/percpu-rwsem.h
+@@ -4,7 +4,7 @@
+ #include <linux/atomic.h>
+ #include <linux/rwsem.h>
+ #include <linux/percpu.h>
+-#include <linux/wait.h>
++#include <linux/swait.h>
+ #include <linux/rcu_sync.h>
+ #include <linux/lockdep.h>
+
+@@ -12,7 +12,7 @@ struct percpu_rw_semaphore {
+ struct rcu_sync rss;
+ unsigned int __percpu *read_count;
+ struct rw_semaphore rw_sem;
+- wait_queue_head_t writer;
++ struct swait_queue_head writer;
+ int readers_block;
+ };
+
+@@ -22,7 +22,7 @@ static struct percpu_rw_semaphore name =
+ .rss = __RCU_SYNC_INITIALIZER(name.rss, RCU_SCHED_SYNC), \
+ .read_count = &__percpu_rwsem_rc_##name, \
+ .rw_sem = __RWSEM_INITIALIZER(name.rw_sem), \
+- .writer = __WAIT_QUEUE_HEAD_INITIALIZER(name.writer), \
++ .writer = __SWAIT_QUEUE_HEAD_INITIALIZER(name.writer), \
+ }
+
+ extern int __percpu_down_read(struct percpu_rw_semaphore *, int);
+--- a/kernel/locking/percpu-rwsem.c
++++ b/kernel/locking/percpu-rwsem.c
+@@ -18,7 +18,7 @@ int __percpu_init_rwsem(struct percpu_rw
+ /* ->rw_sem represents the whole percpu_rw_semaphore for lockdep */
+ rcu_sync_init(&sem->rss, RCU_SCHED_SYNC);
+ __init_rwsem(&sem->rw_sem, name, rwsem_key);
+- init_waitqueue_head(&sem->writer);
++ init_swait_queue_head(&sem->writer);
+ sem->readers_block = 0;
+ return 0;
+ }
+@@ -103,7 +103,7 @@ void __percpu_up_read(struct percpu_rw_s
+ __this_cpu_dec(*sem->read_count);
+
+ /* Prod writer to recheck readers_active */
+- wake_up(&sem->writer);
++ swake_up(&sem->writer);
+ }
+ EXPORT_SYMBOL_GPL(__percpu_up_read);
+
+@@ -160,7 +160,7 @@ void percpu_down_write(struct percpu_rw_
+ */
+
+ /* Wait for all now active readers to complete. */
+- wait_event(sem->writer, readers_active_check(sem));
++ swait_event(sem->writer, readers_active_check(sem));
+ }
+ EXPORT_SYMBOL_GPL(percpu_down_write);
+
diff --git a/debian/patches/features/all/rt/lockinglglocks_Use_preempt_enabledisable_nort()_in_lg_double_locklg_double_unlock.patch b/debian/patches/features/all/rt/lockinglglocks_Use_preempt_enabledisable_nort()_in_lg_double_locklg_double_unlock.patch
deleted file mode 100644
index 606b1cb..0000000
--- a/debian/patches/features/all/rt/lockinglglocks_Use_preempt_enabledisable_nort()_in_lg_double_locklg_double_unlock.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Subject: locking/lglocks: Use preempt_enable/disable_nort() in lg_double_[un]lock
-From: Mike Galbraith <umgwanakikbuti at gmail.com>
-Date: Sat, 27 Feb 2016 08:34:43 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-Let's not do that when snagging an rtmutex.
-
-Signed-off-by: Mike Galbraith <umgwanakilbuti at gmail.com>
-Cc: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Cc: linux-rt-users <linux-rt-users at vger.kernel.org>
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
----
- kernel/locking/lglock.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/kernel/locking/lglock.c
-+++ b/kernel/locking/lglock.c
-@@ -86,7 +86,7 @@ void lg_double_lock(struct lglock *lg, i
- if (cpu2 < cpu1)
- swap(cpu1, cpu2);
-
-- preempt_disable();
-+ preempt_disable_nort();
- lock_acquire_shared(&lg->lock_dep_map, 0, 0, NULL, _RET_IP_);
- lg_do_lock(per_cpu_ptr(lg->lock, cpu1));
- lg_do_lock(per_cpu_ptr(lg->lock, cpu2));
-@@ -97,7 +97,7 @@ void lg_double_unlock(struct lglock *lg,
- lock_release(&lg->lock_dep_map, 1, _RET_IP_);
- lg_do_unlock(per_cpu_ptr(lg->lock, cpu1));
- lg_do_unlock(per_cpu_ptr(lg->lock, cpu2));
-- preempt_enable();
-+ preempt_enable_nort();
- }
-
- void lg_global_lock(struct lglock *lg)
diff --git a/debian/patches/features/all/rt/lockinglglocks_Use_preempt_enabledisable_nort.patch b/debian/patches/features/all/rt/lockinglglocks_Use_preempt_enabledisable_nort.patch
deleted file mode 100644
index 0810097..0000000
--- a/debian/patches/features/all/rt/lockinglglocks_Use_preempt_enabledisable_nort.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Subject: locking/lglocks: Use preempt_enable/disable_nort() in lg_double_[un]lock
-From: Mike Galbraith <umgwanakikbuti at gmail.com>
-Date: Sat, 27 Feb 2016 08:34:43 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-Let's not do that when snagging an rtmutex.
-
-Signed-off-by: Mike Galbraith <umgwanakilbuti at gmail.com>
-Cc: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Cc: linux-rt-users <linux-rt-users at vger.kernel.org>
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
----
- kernel/locking/lglock.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/kernel/locking/lglock.c
-+++ b/kernel/locking/lglock.c
-@@ -86,7 +86,7 @@ void lg_double_lock(struct lglock *lg, i
- if (cpu2 < cpu1)
- swap(cpu1, cpu2);
-
-- preempt_disable();
-+ preempt_disable_nort();
- lock_acquire_shared(&lg->lock_dep_map, 0, 0, NULL, _RET_IP_);
- lg_do_lock(per_cpu_ptr(lg->lock, cpu1));
- lg_do_lock(per_cpu_ptr(lg->lock, cpu2));
-@@ -97,7 +97,7 @@ void lg_double_unlock(struct lglock *lg,
- lock_release(&lg->lock_dep_map, 1, _RET_IP_);
- lg_do_unlock(per_cpu_ptr(lg->lock, cpu1));
- lg_do_unlock(per_cpu_ptr(lg->lock, cpu2));
-- preempt_enable();
-+ preempt_enable_nort();
- }
-
- void lg_global_lock(struct lglock *lg)
diff --git a/debian/patches/features/all/rt/md-disable-bcache.patch b/debian/patches/features/all/rt/md-disable-bcache.patch
index 63e6f6a..dc5a173 100644
--- a/debian/patches/features/all/rt/md-disable-bcache.patch
+++ b/debian/patches/features/all/rt/md-disable-bcache.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
It uses anon semaphores
|drivers/md/bcache/request.c: In function ‘cached_dev_write_complete’:
diff --git a/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch b/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch
index 37083dc..3e0d91f 100644
--- a/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch
+++ b/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
__raid_run_ops() disables preemption with get_cpu() around the access
to the raid5_percpu variables. That causes scheduling while atomic
@@ -15,9 +15,9 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
Tested-by: Udo van den Heuvel <udovdh at xs4all.nl>
---
- drivers/md/raid5.c | 7 +++++--
+ drivers/md/raid5.c | 8 +++++---
drivers/md/raid5.h | 1 +
- 2 files changed, 6 insertions(+), 2 deletions(-)
+ 2 files changed, 6 insertions(+), 3 deletions(-)
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -42,14 +42,22 @@ Tested-by: Udo van den Heuvel <udovdh at xs4all.nl>
}
static struct stripe_head *alloc_stripe(struct kmem_cache *sc, gfp_t gfp,
-@@ -6438,6 +6440,7 @@ static int raid5_alloc_percpu(struct r5c
- __func__, cpu);
- break;
- }
-+ spin_lock_init(&per_cpu_ptr(conf->percpu, cpu)->lock);
+@@ -6391,6 +6393,7 @@ static int raid456_cpu_up_prepare(unsign
+ __func__, cpu);
+ return -ENOMEM;
}
- put_online_cpus();
++ spin_lock_init(&per_cpu_ptr(conf->percpu, cpu)->lock);
+ return 0;
+ }
+@@ -6401,7 +6404,6 @@ static int raid5_alloc_percpu(struct r5c
+ conf->percpu = alloc_percpu(struct raid5_percpu);
+ if (!conf->percpu)
+ return -ENOMEM;
+-
+ err = cpuhp_state_add_instance(CPUHP_MD_RAID5_PREPARE, &conf->node);
+ if (!err) {
+ conf->scribble_disks = max(conf->raid_disks,
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -504,6 +504,7 @@ struct r5conf {
diff --git a/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch b/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch
index 0bf993f..22bb9c7 100644
--- a/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch
+++ b/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch
@@ -1,7 +1,7 @@
Subject: mips: Disable highmem on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 18 Jul 2011 17:10:12 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The current highmem handling on -RT is not compatible and needs fixups.
@@ -12,7 +12,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -2480,7 +2480,7 @@ config MIPS_ASID_BITS_VARIABLE
+@@ -2514,7 +2514,7 @@ config MIPS_ASID_BITS_VARIABLE
#
config HIGHMEM
bool "High Memory Support"
diff --git a/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT b/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT
deleted file mode 100644
index a43e023..0000000
--- a/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT
+++ /dev/null
@@ -1,41 +0,0 @@
-Subject: mm: rt: Fix generic kmap_atomic for RT
-From: Thomas Gleixner <tglx at linutronix.de>
-Date: Sat, 19 Sep 2015 10:15:00 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz
-
-The update to 4.1 brought in the mainline variant of the pagefault
-disable distangling from preempt count. That introduced a
-preempt_disable/enable pair in the generic kmap_atomic/kunmap_atomic
-implementations which got not converted to the _nort() variant.
-
-That results in massive 'scheduling while atomic/sleeping function
-called from invalid context' splats.
-
-Fix that up.
-
-Reported-and-tested-by: Juergen Borleis <jbe at pengutronix.de>
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
----
- include/linux/highmem.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/include/linux/highmem.h
-+++ b/include/linux/highmem.h
-@@ -65,7 +65,7 @@ static inline void kunmap(struct page *p
-
- static inline void *kmap_atomic(struct page *page)
- {
-- preempt_disable();
-+ preempt_disable_nort();
- pagefault_disable();
- return page_address(page);
- }
-@@ -74,7 +74,7 @@ static inline void *kmap_atomic(struct p
- static inline void __kunmap_atomic(void *addr)
- {
- pagefault_enable();
-- preempt_enable();
-+ preempt_enable_nort();
- }
-
- #define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn))
diff --git a/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch b/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch
index 02e4e28..66494e9 100644
--- a/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch
+++ b/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch
@@ -1,7 +1,7 @@
Subject: mm: rt: Fix generic kmap_atomic for RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sat, 19 Sep 2015 10:15:00 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The update to 4.1 brought in the mainline variant of the pagefault
disable distangling from preempt count. That introduced a
diff --git a/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch b/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch
index d4c5d83..83a68a8 100644
--- a/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch
+++ b/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Fri, 5 Feb 2016 12:17:14 +0100
Subject: mm: backing-dev: don't disable IRQs in wb_congested_put()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
it triggers:
|BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:930
diff --git a/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch b/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch
index 8831358..690ed91 100644
--- a/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch
+++ b/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch
@@ -1,7 +1,7 @@
Subject: mm: bounce: Use local_irq_save_nort
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 09 Jan 2013 10:33:09 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
kmap_atomic() is preemptible on RT.
diff --git a/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch b/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch
index fbbfd94..fbd409e 100644
--- a/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch
+++ b/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Replace global locks (get_cpu + local_irq_save) with "local_locks()".
Currently there is one of for "rotate" and one for "swap".
@@ -18,7 +18,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
-@@ -290,6 +290,7 @@ extern unsigned long nr_free_pagecache_p
+@@ -293,6 +293,7 @@ extern unsigned long nr_free_pagecache_p
/* linux/mm/swap.c */
@@ -28,7 +28,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
extern void lru_cache_add_file(struct page *page);
--- a/mm/compaction.c
+++ b/mm/compaction.c
-@@ -1585,10 +1585,12 @@ static enum compact_result compact_zone(
+@@ -1612,10 +1612,12 @@ static enum compact_result compact_zone(
block_start_pfn(cc->migrate_pfn, cc->order);
if (cc->last_migrated_pfn < current_block_start) {
@@ -45,7 +45,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -6600,7 +6600,9 @@ static int page_alloc_cpu_notify(struct
+@@ -6559,7 +6559,9 @@ static int page_alloc_cpu_notify(struct
int cpu = (unsigned long)hcpu;
if (action == CPU_DEAD || action == CPU_DEAD_FROZEN) {
diff --git a/debian/patches/features/all/rt/mm-disable-sloub-rt.patch b/debian/patches/features/all/rt/mm-disable-sloub-rt.patch
index 4f982da..2ff11c1 100644
--- a/debian/patches/features/all/rt/mm-disable-sloub-rt.patch
+++ b/debian/patches/features/all/rt/mm-disable-sloub-rt.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs.
@@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1748,6 +1748,7 @@ choice
+@@ -1759,6 +1759,7 @@ choice
config SLAB
bool "SLAB"
@@ -22,7 +22,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
select HAVE_HARDENED_USERCOPY_ALLOCATOR
help
The regular slab allocator that is established and known to work
-@@ -1768,6 +1769,7 @@ config SLUB
+@@ -1779,6 +1780,7 @@ config SLUB
config SLOB
depends on EXPERT
bool "SLOB (Simple Allocator)"
diff --git a/debian/patches/features/all/rt/mm-enable-slub.patch b/debian/patches/features/all/rt/mm-enable-slub.patch
index 7fbca80..1711fbb 100644
--- a/debian/patches/features/all/rt/mm-enable-slub.patch
+++ b/debian/patches/features/all/rt/mm-enable-slub.patch
@@ -1,7 +1,7 @@
Subject: mm: Enable SLUB for RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 25 Oct 2012 10:32:35 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Make SLUB RT aware by converting locks to raw and using free lists to
move the freeing out of the lock held region.
@@ -28,7 +28,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
struct list_head slabs_partial; /* partial list first, better asm code */
--- a/mm/slub.c
+++ b/mm/slub.c
-@@ -1145,7 +1145,7 @@ static noinline int free_debug_processin
+@@ -1141,7 +1141,7 @@ static noinline int free_debug_processin
unsigned long uninitialized_var(flags);
int ret = 0;
@@ -37,7 +37,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
slab_lock(page);
if (s->flags & SLAB_CONSISTENCY_CHECKS) {
-@@ -1180,7 +1180,7 @@ static noinline int free_debug_processin
+@@ -1176,7 +1176,7 @@ static noinline int free_debug_processin
bulk_cnt, cnt);
slab_unlock(page);
@@ -46,7 +46,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (!ret)
slab_fix(s, "Object at 0x%p not freed", object);
return ret;
-@@ -1308,6 +1308,12 @@ static inline void dec_slabs_node(struct
+@@ -1304,6 +1304,12 @@ static inline void dec_slabs_node(struct
#endif /* CONFIG_SLUB_DEBUG */
@@ -59,7 +59,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Hooks for other subsystems that check memory allocations. In a typical
* production configuration these hooks all should produce no code at all.
-@@ -1530,7 +1536,11 @@ static struct page *allocate_slab(struct
+@@ -1526,7 +1532,11 @@ static struct page *allocate_slab(struct
flags &= gfp_allowed_mask;
@@ -71,7 +71,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
local_irq_enable();
flags |= s->allocflags;
-@@ -1605,7 +1615,11 @@ static struct page *allocate_slab(struct
+@@ -1601,7 +1611,11 @@ static struct page *allocate_slab(struct
page->frozen = 1;
out:
@@ -83,7 +83,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
local_irq_disable();
if (!page)
return NULL;
-@@ -1664,6 +1678,16 @@ static void __free_slab(struct kmem_cach
+@@ -1660,6 +1674,16 @@ static void __free_slab(struct kmem_cach
__free_pages(page, order);
}
@@ -100,7 +100,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#define need_reserve_slab_rcu \
(sizeof(((struct page *)NULL)->lru) < sizeof(struct rcu_head))
-@@ -1695,6 +1719,12 @@ static void free_slab(struct kmem_cache
+@@ -1691,6 +1715,12 @@ static void free_slab(struct kmem_cache
}
call_rcu(head, rcu_free_slab);
@@ -113,7 +113,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
} else
__free_slab(s, page);
}
-@@ -1802,7 +1832,7 @@ static void *get_partial_node(struct kme
+@@ -1798,7 +1828,7 @@ static void *get_partial_node(struct kme
if (!n || !n->nr_partial)
return NULL;
@@ -122,7 +122,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
list_for_each_entry_safe(page, page2, &n->partial, lru) {
void *t;
-@@ -1827,7 +1857,7 @@ static void *get_partial_node(struct kme
+@@ -1823,7 +1853,7 @@ static void *get_partial_node(struct kme
break;
}
@@ -131,7 +131,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return object;
}
-@@ -2073,7 +2103,7 @@ static void deactivate_slab(struct kmem_
+@@ -2069,7 +2099,7 @@ static void deactivate_slab(struct kmem_
* that acquire_slab() will see a slab page that
* is frozen
*/
@@ -140,7 +140,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
} else {
m = M_FULL;
-@@ -2084,7 +2114,7 @@ static void deactivate_slab(struct kmem_
+@@ -2080,7 +2110,7 @@ static void deactivate_slab(struct kmem_
* slabs from diagnostic functions will not see
* any frozen slabs.
*/
@@ -149,7 +149,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
}
-@@ -2119,7 +2149,7 @@ static void deactivate_slab(struct kmem_
+@@ -2115,7 +2145,7 @@ static void deactivate_slab(struct kmem_
goto redo;
if (lock)
@@ -158,7 +158,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (m == M_FREE) {
stat(s, DEACTIVATE_EMPTY);
-@@ -2151,10 +2181,10 @@ static void unfreeze_partials(struct kme
+@@ -2147,10 +2177,10 @@ static void unfreeze_partials(struct kme
n2 = get_node(s, page_to_nid(page));
if (n != n2) {
if (n)
@@ -171,7 +171,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
do {
-@@ -2183,7 +2213,7 @@ static void unfreeze_partials(struct kme
+@@ -2179,7 +2209,7 @@ static void unfreeze_partials(struct kme
}
if (n)
@@ -180,7 +180,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
while (discard_page) {
page = discard_page;
-@@ -2222,14 +2252,21 @@ static void put_cpu_partial(struct kmem_
+@@ -2218,14 +2248,21 @@ static void put_cpu_partial(struct kmem_
pobjects = oldpage->pobjects;
pages = oldpage->pages;
if (drain && pobjects > s->cpu_partial) {
@@ -202,7 +202,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
oldpage = NULL;
pobjects = 0;
pages = 0;
-@@ -2301,7 +2338,22 @@ static bool has_cpu_slab(int cpu, void *
+@@ -2297,7 +2334,22 @@ static bool has_cpu_slab(int cpu, void *
static void flush_all(struct kmem_cache *s)
{
@@ -225,7 +225,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -2337,10 +2389,10 @@ static unsigned long count_partial(struc
+@@ -2352,10 +2404,10 @@ static unsigned long count_partial(struc
unsigned long x = 0;
struct page *page;
@@ -238,7 +238,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return x;
}
#endif /* CONFIG_SLUB_DEBUG || CONFIG_SYSFS */
-@@ -2478,8 +2530,10 @@ static inline void *get_freelist(struct
+@@ -2493,8 +2545,10 @@ static inline void *get_freelist(struct
* already disabled (which is the case for bulk allocation).
*/
static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
@@ -250,7 +250,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void *freelist;
struct page *page;
-@@ -2539,6 +2593,13 @@ static void *___slab_alloc(struct kmem_c
+@@ -2554,6 +2608,13 @@ static void *___slab_alloc(struct kmem_c
VM_BUG_ON(!c->page->frozen);
c->freelist = get_freepointer(s, freelist);
c->tid = next_tid(c->tid);
@@ -264,7 +264,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return freelist;
new_slab:
-@@ -2570,7 +2631,7 @@ static void *___slab_alloc(struct kmem_c
+@@ -2585,7 +2646,7 @@ static void *___slab_alloc(struct kmem_c
deactivate_slab(s, page, get_freepointer(s, freelist));
c->page = NULL;
c->freelist = NULL;
@@ -273,7 +273,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -2582,6 +2643,7 @@ static void *__slab_alloc(struct kmem_ca
+@@ -2597,6 +2658,7 @@ static void *__slab_alloc(struct kmem_ca
{
void *p;
unsigned long flags;
@@ -281,7 +281,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
local_irq_save(flags);
#ifdef CONFIG_PREEMPT
-@@ -2593,8 +2655,9 @@ static void *__slab_alloc(struct kmem_ca
+@@ -2608,8 +2670,9 @@ static void *__slab_alloc(struct kmem_ca
c = this_cpu_ptr(s->cpu_slab);
#endif
@@ -292,7 +292,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return p;
}
-@@ -2780,7 +2843,7 @@ static void __slab_free(struct kmem_cach
+@@ -2795,7 +2858,7 @@ static void __slab_free(struct kmem_cach
do {
if (unlikely(n)) {
@@ -301,7 +301,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
n = NULL;
}
prior = page->freelist;
-@@ -2812,7 +2875,7 @@ static void __slab_free(struct kmem_cach
+@@ -2827,7 +2890,7 @@ static void __slab_free(struct kmem_cach
* Otherwise the list_lock will synchronize with
* other processors updating the list of slabs.
*/
@@ -310,7 +310,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
}
-@@ -2854,7 +2917,7 @@ static void __slab_free(struct kmem_cach
+@@ -2869,7 +2932,7 @@ static void __slab_free(struct kmem_cach
add_partial(n, page, DEACTIVATE_TO_TAIL);
stat(s, FREE_ADD_PARTIAL);
}
@@ -319,7 +319,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return;
slab_empty:
-@@ -2869,7 +2932,7 @@ static void __slab_free(struct kmem_cach
+@@ -2884,7 +2947,7 @@ static void __slab_free(struct kmem_cach
remove_full(s, n, page);
}
@@ -328,7 +328,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
stat(s, FREE_SLAB);
discard_slab(s, page);
}
-@@ -3074,6 +3137,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca
+@@ -3089,6 +3152,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca
void **p)
{
struct kmem_cache_cpu *c;
@@ -336,7 +336,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
int i;
/* memcg and kmem_cache debug support */
-@@ -3097,7 +3161,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca
+@@ -3112,7 +3176,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca
* of re-populating per CPU c->freelist
*/
p[i] = ___slab_alloc(s, flags, NUMA_NO_NODE,
@@ -345,7 +345,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (unlikely(!p[i]))
goto error;
-@@ -3109,6 +3173,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca
+@@ -3124,6 +3188,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca
}
c->tid = next_tid(c->tid);
local_irq_enable();
@@ -353,7 +353,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Clear memory outside IRQ disabled fastpath loop */
if (unlikely(flags & __GFP_ZERO)) {
-@@ -3256,7 +3321,7 @@ static void
+@@ -3271,7 +3336,7 @@ static void
init_kmem_cache_node(struct kmem_cache_node *n)
{
n->nr_partial = 0;
@@ -362,7 +362,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
INIT_LIST_HEAD(&n->partial);
#ifdef CONFIG_SLUB_DEBUG
atomic_long_set(&n->nr_slabs, 0);
-@@ -3600,6 +3665,10 @@ static void list_slab_objects(struct kme
+@@ -3615,6 +3680,10 @@ static void list_slab_objects(struct kme
const char *text)
{
#ifdef CONFIG_SLUB_DEBUG
@@ -373,7 +373,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void *addr = page_address(page);
void *p;
unsigned long *map = kzalloc(BITS_TO_LONGS(page->objects) *
-@@ -3620,6 +3689,7 @@ static void list_slab_objects(struct kme
+@@ -3635,6 +3704,7 @@ static void list_slab_objects(struct kme
slab_unlock(page);
kfree(map);
#endif
@@ -381,7 +381,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -3633,7 +3703,7 @@ static void free_partial(struct kmem_cac
+@@ -3648,7 +3718,7 @@ static void free_partial(struct kmem_cac
struct page *page, *h;
BUG_ON(irqs_disabled());
@@ -390,7 +390,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
list_for_each_entry_safe(page, h, &n->partial, lru) {
if (!page->inuse) {
remove_partial(n, page);
-@@ -3643,7 +3713,7 @@ static void free_partial(struct kmem_cac
+@@ -3658,7 +3728,7 @@ static void free_partial(struct kmem_cac
"Objects remaining in %s on __kmem_cache_shutdown()");
}
}
@@ -399,7 +399,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
list_for_each_entry_safe(page, h, &discard, lru)
discard_slab(s, page);
-@@ -3901,7 +3971,7 @@ int __kmem_cache_shrink(struct kmem_cach
+@@ -3916,7 +3986,7 @@ int __kmem_cache_shrink(struct kmem_cach
for (i = 0; i < SHRINK_PROMOTE_MAX; i++)
INIT_LIST_HEAD(promote + i);
@@ -408,7 +408,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Build lists of slabs to discard or promote.
-@@ -3932,7 +4002,7 @@ int __kmem_cache_shrink(struct kmem_cach
+@@ -3947,7 +4017,7 @@ int __kmem_cache_shrink(struct kmem_cach
for (i = SHRINK_PROMOTE_MAX - 1; i >= 0; i--)
list_splice(promote + i, &n->partial);
@@ -417,7 +417,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Release empty slabs */
list_for_each_entry_safe(page, t, &discard, lru)
-@@ -4108,6 +4178,12 @@ void __init kmem_cache_init(void)
+@@ -4123,6 +4193,12 @@ void __init kmem_cache_init(void)
{
static __initdata struct kmem_cache boot_kmem_cache,
boot_kmem_cache_node;
@@ -430,7 +430,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (debug_guardpage_minorder())
slub_max_order = 0;
-@@ -4354,7 +4430,7 @@ static int validate_slab_node(struct kme
+@@ -4331,7 +4407,7 @@ static int validate_slab_node(struct kme
struct page *page;
unsigned long flags;
@@ -439,7 +439,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
list_for_each_entry(page, &n->partial, lru) {
validate_slab_slab(s, page, map);
-@@ -4376,7 +4452,7 @@ static int validate_slab_node(struct kme
+@@ -4353,7 +4429,7 @@ static int validate_slab_node(struct kme
s->name, count, atomic_long_read(&n->nr_slabs));
out:
@@ -448,7 +448,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return count;
}
-@@ -4564,12 +4640,12 @@ static int list_locations(struct kmem_ca
+@@ -4541,12 +4617,12 @@ static int list_locations(struct kmem_ca
if (!atomic_long_read(&n->nr_slabs))
continue;
diff --git a/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch b/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch
index 9fb4a42..39bcf87 100644
--- a/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch
+++ b/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch
index 532a87e..ea8516c 100644
--- a/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch
+++ b/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch
@@ -1,7 +1,7 @@
From: Yang Shi <yang.shi at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The following trace is triggered when running ltp oom test cases:
@@ -49,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
-@@ -1824,7 +1824,7 @@ static void drain_all_stock(struct mem_c
+@@ -1794,7 +1794,7 @@ static void drain_all_stock(struct mem_c
return;
/* Notify other cpus that system-wide "drain" is running */
get_online_cpus();
@@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
for_each_online_cpu(cpu) {
struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu);
struct mem_cgroup *memcg;
-@@ -1841,7 +1841,7 @@ static void drain_all_stock(struct mem_c
+@@ -1811,7 +1811,7 @@ static void drain_all_stock(struct mem_c
schedule_work_on(cpu, &stock->work);
}
}
diff --git a/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch b/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch
index fbb5782..3e69703 100644
--- a/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch
+++ b/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
There are a few local_irq_disable() which then take sleeping locks. This
patch converts them local locks.
@@ -30,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/* Whether legacy memory+swap accounting is active */
static bool do_memsw_account(void)
{
-@@ -4575,12 +4578,12 @@ static int mem_cgroup_move_account(struc
+@@ -4550,12 +4553,12 @@ static int mem_cgroup_move_account(struc
ret = 0;
@@ -45,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
out_unlock:
unlock_page(page);
out:
-@@ -5453,10 +5456,10 @@ void mem_cgroup_commit_charge(struct pag
+@@ -5430,10 +5433,10 @@ void mem_cgroup_commit_charge(struct pag
commit_charge(page, memcg, lrucare);
@@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
if (do_memsw_account() && PageSwapCache(page)) {
swp_entry_t entry = { .val = page_private(page) };
-@@ -5512,14 +5515,14 @@ static void uncharge_batch(struct mem_cg
+@@ -5489,14 +5492,14 @@ static void uncharge_batch(struct mem_cg
memcg_oom_recover(memcg);
}
@@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
if (!mem_cgroup_is_root(memcg))
css_put_many(&memcg->css, nr_pages);
-@@ -5854,6 +5857,7 @@ void mem_cgroup_swapout(struct page *pag
+@@ -5834,6 +5837,7 @@ void mem_cgroup_swapout(struct page *pag
{
struct mem_cgroup *memcg, *swap_memcg;
unsigned short oldid;
@@ -83,7 +83,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
VM_BUG_ON_PAGE(PageLRU(page), page);
VM_BUG_ON_PAGE(page_count(page), page);
-@@ -5894,12 +5898,16 @@ void mem_cgroup_swapout(struct page *pag
+@@ -5874,12 +5878,16 @@ void mem_cgroup_swapout(struct page *pag
* important here to have the interrupts disabled because it is the
* only synchronisation we have for udpating the per-CPU variables.
*/
diff --git a/debian/patches/features/all/rt/mm-memcontrol-mem_cgroup_migrate-replace-another-loc.patch b/debian/patches/features/all/rt/mm-memcontrol-mem_cgroup_migrate-replace-another-loc.patch
index 4bdce5f..2ada34c 100644
--- a/debian/patches/features/all/rt/mm-memcontrol-mem_cgroup_migrate-replace-another-loc.patch
+++ b/debian/patches/features/all/rt/mm-memcontrol-mem_cgroup_migrate-replace-another-loc.patch
@@ -2,7 +2,7 @@ From: Mike Galbraith <umgwanakikbuti at gmail.com>
Date: Sun, 5 Jun 2016 08:11:13 +0200
Subject: [PATCH] mm/memcontrol: mem_cgroup_migrate() - replace another
local_irq_disable() w. local_lock_irq()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
v4.6 grew a local_irq_disable() in mm/memcontrol.c::mem_cgroup_migrate().
Convert it to use the existing local lock (event_lock) like the others.
@@ -15,7 +15,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
-@@ -5677,10 +5677,10 @@ void mem_cgroup_migrate(struct page *old
+@@ -5654,10 +5654,10 @@ void mem_cgroup_migrate(struct page *old
commit_charge(newpage, memcg, false);
diff --git a/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch b/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch
index 64677c5..2a48235 100644
--- a/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch
+++ b/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch
@@ -1,7 +1,7 @@
Subject: mm: page_alloc: Use local_lock_on() instead of plain spinlock
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 27 Sep 2012 11:11:46 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The plain spinlock while sufficient does not update the local_lock
internals. Use a proper local_lock function instead to ease debugging.
@@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -281,9 +281,9 @@ static DEFINE_LOCAL_IRQ_LOCK(pa_lock);
+@@ -286,9 +286,9 @@ static DEFINE_LOCAL_IRQ_LOCK(pa_lock);
#ifdef CONFIG_PREEMPT_RT_BASE
# define cpu_lock_irqsave(cpu, flags) \
diff --git a/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch b/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch
index 5a78bd0..9d9e6ba 100644
--- a/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch
+++ b/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch
@@ -1,7 +1,7 @@
From: Peter Zijlstra <peterz at infradead.org>
Date: Fri Jul 3 08:44:37 2009 -0500
Subject: mm: page_alloc: Reduce lock sections further
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Split out the pages which are to be freed into a separate list and
call free_pages_bulk() outside of the percpu page allocator locks.
@@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -1069,7 +1069,7 @@ static bool bulkfree_pcp_prepare(struct
+@@ -1085,7 +1085,7 @@ static bool bulkfree_pcp_prepare(struct
#endif /* CONFIG_DEBUG_VM */
/*
@@ -23,7 +23,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
* Assumes all pages on list are in same zone, and of same order.
* count is the number of pages to free.
*
-@@ -1080,19 +1080,58 @@ static bool bulkfree_pcp_prepare(struct
+@@ -1096,19 +1096,58 @@ static bool bulkfree_pcp_prepare(struct
* pinned" detection logic.
*/
static void free_pcppages_bulk(struct zone *zone, int count,
@@ -86,7 +86,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
while (count) {
struct page *page;
struct list_head *list;
-@@ -1108,7 +1147,7 @@ static void free_pcppages_bulk(struct zo
+@@ -1124,7 +1163,7 @@ static void free_pcppages_bulk(struct zo
batch_free++;
if (++migratetype == MIGRATE_PCPTYPES)
migratetype = 0;
@@ -95,7 +95,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
} while (list_empty(list));
/* This is the only non-empty list. Free them all. */
-@@ -1116,27 +1155,12 @@ static void free_pcppages_bulk(struct zo
+@@ -1132,27 +1171,12 @@ static void free_pcppages_bulk(struct zo
batch_free = count;
do {
@@ -124,7 +124,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
static void free_one_page(struct zone *zone,
-@@ -1145,7 +1169,9 @@ static void free_one_page(struct zone *z
+@@ -1161,7 +1185,9 @@ static void free_one_page(struct zone *z
int migratetype)
{
unsigned long nr_scanned;
@@ -135,7 +135,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
nr_scanned = node_page_state(zone->zone_pgdat, NR_PAGES_SCANNED);
if (nr_scanned)
__mod_node_page_state(zone->zone_pgdat, NR_PAGES_SCANNED, -nr_scanned);
-@@ -1155,7 +1181,7 @@ static void free_one_page(struct zone *z
+@@ -1171,7 +1197,7 @@ static void free_one_page(struct zone *z
migratetype = get_pfnblock_migratetype(page, pfn);
}
__free_one_page(page, pfn, zone, order, migratetype);
@@ -144,7 +144,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
static void __meminit __init_single_page(struct page *page, unsigned long pfn,
-@@ -2232,16 +2258,18 @@ static int rmqueue_bulk(struct zone *zon
+@@ -2251,16 +2277,18 @@ static int rmqueue_bulk(struct zone *zon
void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp)
{
unsigned long flags;
@@ -164,7 +164,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
#endif
-@@ -2257,16 +2285,21 @@ static void drain_pages_zone(unsigned in
+@@ -2276,16 +2304,21 @@ static void drain_pages_zone(unsigned in
unsigned long flags;
struct per_cpu_pageset *pset;
struct per_cpu_pages *pcp;
@@ -188,7 +188,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -2448,8 +2481,13 @@ void free_hot_cold_page(struct page *pag
+@@ -2467,8 +2500,13 @@ void free_hot_cold_page(struct page *pag
pcp->count++;
if (pcp->count >= pcp->high) {
unsigned long batch = READ_ONCE(pcp->batch);
diff --git a/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch b/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch
index 570dcec..34ae6fb 100644
--- a/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch
+++ b/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
rt-friendly per-cpu pages: convert the irqs-off per-cpu locking
method into a preemptible, explicit-per-cpu-locks method.
@@ -26,7 +26,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#include <linux/page_owner.h>
#include <linux/kthread.h>
#include <linux/memcontrol.h>
-@@ -276,6 +277,18 @@ EXPORT_SYMBOL(nr_node_ids);
+@@ -281,6 +282,18 @@ EXPORT_SYMBOL(nr_node_ids);
EXPORT_SYMBOL(nr_online_nodes);
#endif
@@ -45,7 +45,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
int page_group_by_mobility_disabled __read_mostly;
#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
-@@ -1228,10 +1241,10 @@ static void __free_pages_ok(struct page
+@@ -1244,10 +1257,10 @@ static void __free_pages_ok(struct page
return;
migratetype = get_pfnblock_migratetype(page, pfn);
@@ -58,7 +58,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
static void __init __free_pages_boot_core(struct page *page, unsigned int order)
-@@ -2221,14 +2234,14 @@ void drain_zone_pages(struct zone *zone,
+@@ -2240,14 +2253,14 @@ void drain_zone_pages(struct zone *zone,
unsigned long flags;
int to_drain, batch;
@@ -75,7 +75,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
#endif
-@@ -2245,7 +2258,7 @@ static void drain_pages_zone(unsigned in
+@@ -2264,7 +2277,7 @@ static void drain_pages_zone(unsigned in
struct per_cpu_pageset *pset;
struct per_cpu_pages *pcp;
@@ -84,7 +84,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
pset = per_cpu_ptr(zone->pageset, cpu);
pcp = &pset->pcp;
-@@ -2253,7 +2266,7 @@ static void drain_pages_zone(unsigned in
+@@ -2272,7 +2285,7 @@ static void drain_pages_zone(unsigned in
free_pcppages_bulk(zone, pcp->count, pcp);
pcp->count = 0;
}
@@ -93,7 +93,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -2339,8 +2352,17 @@ void drain_all_pages(struct zone *zone)
+@@ -2358,8 +2371,17 @@ void drain_all_pages(struct zone *zone)
else
cpumask_clear_cpu(cpu, &cpus_with_pcps);
}
@@ -111,7 +111,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
#ifdef CONFIG_HIBERNATION
-@@ -2400,7 +2422,7 @@ void free_hot_cold_page(struct page *pag
+@@ -2419,7 +2441,7 @@ void free_hot_cold_page(struct page *pag
migratetype = get_pfnblock_migratetype(page, pfn);
set_pcppage_migratetype(page, migratetype);
@@ -120,7 +120,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
__count_vm_event(PGFREE);
/*
-@@ -2431,7 +2453,7 @@ void free_hot_cold_page(struct page *pag
+@@ -2450,7 +2472,7 @@ void free_hot_cold_page(struct page *pag
}
out:
@@ -129,7 +129,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -2568,7 +2590,7 @@ struct page *buffered_rmqueue(struct zon
+@@ -2592,7 +2614,7 @@ struct page *buffered_rmqueue(struct zon
struct per_cpu_pages *pcp;
struct list_head *list;
@@ -138,7 +138,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
do {
pcp = &this_cpu_ptr(zone->pageset)->pcp;
list = &pcp->lists[migratetype];
-@@ -2595,7 +2617,7 @@ struct page *buffered_rmqueue(struct zon
+@@ -2619,7 +2641,7 @@ struct page *buffered_rmqueue(struct zon
* allocate greater than order-1 page units with __GFP_NOFAIL.
*/
WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1));
@@ -147,7 +147,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
do {
page = NULL;
-@@ -2607,22 +2629,24 @@ struct page *buffered_rmqueue(struct zon
+@@ -2631,22 +2653,24 @@ struct page *buffered_rmqueue(struct zon
if (!page)
page = __rmqueue(zone, order, migratetype);
} while (page && check_new_pages(page, order));
@@ -176,7 +176,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return NULL;
}
-@@ -6564,6 +6588,7 @@ static int page_alloc_cpu_notify(struct
+@@ -6523,6 +6547,7 @@ static int page_alloc_cpu_notify(struct
void __init page_alloc_init(void)
{
hotcpu_notifier(page_alloc_cpu_notify, 0);
@@ -184,7 +184,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -7380,7 +7405,7 @@ void zone_pcp_reset(struct zone *zone)
+@@ -7351,7 +7376,7 @@ void zone_pcp_reset(struct zone *zone)
struct per_cpu_pageset *pset;
/* avoid races with drain_pages() */
@@ -193,7 +193,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (zone->pageset != &boot_pageset) {
for_each_online_cpu(cpu) {
pset = per_cpu_ptr(zone->pageset, cpu);
-@@ -7389,7 +7414,7 @@ void zone_pcp_reset(struct zone *zone)
+@@ -7360,7 +7385,7 @@ void zone_pcp_reset(struct zone *zone)
free_percpu(zone->pageset);
zone->pageset = &boot_pageset;
}
diff --git a/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch b/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch
index 0c47eab..3345ee3 100644
--- a/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch
+++ b/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch
@@ -1,7 +1,7 @@
From: Luiz Capitulino <lcapitulino at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch b/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch
index b198a9e..887e63a 100644
--- a/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch
+++ b/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch
@@ -1,7 +1,7 @@
From: Yong Zhang <yong.zhang0 at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
User preempt_*_rt instead of local_irq_*_rt or otherwise there will be
warning on ARM like below:
@@ -37,7 +37,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/fs/exec.c
+++ b/fs/exec.c
-@@ -1012,12 +1012,14 @@ static int exec_mmap(struct mm_struct *m
+@@ -1017,12 +1017,14 @@ static int exec_mmap(struct mm_struct *m
}
}
task_lock(tsk);
diff --git a/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch b/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch
index 6eced4f..6a7ab41 100644
--- a/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch
+++ b/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch
@@ -1,7 +1,7 @@
Subject: mm, rt: kmap_atomic scheduling
From: Peter Zijlstra <peterz at infradead.org>
Date: Thu, 28 Jul 2011 10:43:51 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -39,7 +39,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins
#include <asm/pgtable.h>
#include <asm/ldt.h>
-@@ -210,6 +211,35 @@ start_thread(struct pt_regs *regs, unsig
+@@ -195,6 +196,35 @@ start_thread(struct pt_regs *regs, unsig
}
EXPORT_SYMBOL_GPL(start_thread);
@@ -75,7 +75,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins
/*
* switch_to(x,y) should switch tasks from x to y.
-@@ -286,6 +316,8 @@ EXPORT_SYMBOL_GPL(start_thread);
+@@ -271,6 +301,8 @@ EXPORT_SYMBOL_GPL(start_thread);
task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT))
__switch_to_xtra(prev_p, next_p, tss);
@@ -230,7 +230,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins
#include <asm/page.h>
#include <asm/ptrace.h>
-@@ -1954,6 +1955,12 @@ struct task_struct {
+@@ -1979,6 +1980,12 @@ struct task_struct {
int softirq_nestcnt;
unsigned int softirqs_raised;
#endif
diff --git a/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch b/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch
index 870264b..1b641e5 100644
--- a/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch
+++ b/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The local_irq_save() is not only used to get things done "fast" but
also to ensure that in case of SG_MITER_ATOMIC we are in "atomic"
diff --git a/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch b/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch
index 40b3743..aa6b339 100644
--- a/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch
+++ b/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch
@@ -1,7 +1,7 @@
Subject: mm/vmalloc: Another preempt disable region which sucks
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 12 Jul 2011 11:39:36 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Avoid the preempt disable version of get_cpu_var(). The inner-lock should
provide enough serialisation.
diff --git a/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch b/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch
index 47e7edc..ba82834 100644
--- a/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch
+++ b/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Thu, 29 Jan 2015 17:19:44 +0100
Subject: mm/workingset: Do not protect workingset_shadow_nodes with irq off
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
workingset_shadow_nodes is protected by local_irq_disable(). Some users
use spin_lock_irq().
@@ -26,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#include <asm/page.h>
struct notifier_block;
-@@ -243,7 +244,8 @@ struct swap_info_struct {
+@@ -246,7 +247,8 @@ struct swap_info_struct {
void *workingset_eviction(struct address_space *mapping, struct page *page);
bool workingset_refault(void *shadow);
void workingset_activation(struct page *page);
diff --git a/debian/patches/features/all/rt/mm-zsmalloc-Use-get-put_cpu_light-in-zs_map_object-z.patch b/debian/patches/features/all/rt/mm-zsmalloc-Use-get-put_cpu_light-in-zs_map_object-z.patch
deleted file mode 100644
index a9df21d..0000000
--- a/debian/patches/features/all/rt/mm-zsmalloc-Use-get-put_cpu_light-in-zs_map_object-z.patch
+++ /dev/null
@@ -1,165 +0,0 @@
-From: Mike Galbraith <umgwanakikbuti at gmail.com>
-Date: Tue, 22 Mar 2016 11:16:09 +0100
-Subject: [PATCH] mm/zsmalloc: Use get/put_cpu_light in
- zs_map_object()/zs_unmap_object()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.2-rt2.tar.xz
-
-Otherwise, we get a ___might_sleep() splat.
-
-
-Signed-off-by: Mike Galbraith <umgwanakikbuti at gmail.com>
-[bigeasy: replace the bitspin_lock() with a mutex]
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- mm/zsmalloc.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
- 1 file changed, 69 insertions(+), 4 deletions(-)
-
---- a/mm/zsmalloc.c
-+++ b/mm/zsmalloc.c
-@@ -71,7 +71,19 @@
- #define ZS_MAX_ZSPAGE_ORDER 2
- #define ZS_MAX_PAGES_PER_ZSPAGE (_AC(1, UL) << ZS_MAX_ZSPAGE_ORDER)
-
-+#ifdef CONFIG_PREEMPT_RT_BASE
-+
-+struct zsmalloc_handle {
-+ unsigned long addr;
-+ struct mutex lock;
-+};
-+
-+#define ZS_HANDLE_SIZE (sizeof(struct zsmalloc_handle))
-+
-+#else
-+
- #define ZS_HANDLE_SIZE (sizeof(unsigned long))
-+#endif
-
- /*
- * Object location (<PFN>, <obj_idx>) is encoded as
-@@ -351,9 +363,26 @@ static void destroy_cache(struct zs_pool
-
- static unsigned long cache_alloc_handle(struct zs_pool *pool, gfp_t gfp)
- {
-- return (unsigned long)kmem_cache_alloc(pool->handle_cachep,
-- gfp & ~(__GFP_HIGHMEM|__GFP_MOVABLE));
-+ void *p;
-+
-+ p = kmem_cache_alloc(pool->handle_cachep,
-+ gfp & ~(__GFP_HIGHMEM|__GFP_MOVABLE));
-+#ifdef CONFIG_PREEMPT_RT_BASE
-+ if (p) {
-+ struct zsmalloc_handle *zh = p;
-+
-+ mutex_init(&zh->lock);
-+ }
-+#endif
-+ return (unsigned long)p;
-+}
-+
-+#ifdef CONFIG_PREEMPT_RT_BASE
-+static struct zsmalloc_handle *zs_get_pure_handle(unsigned long handle)
-+{
-+ return (void *)(handle &~((1 << OBJ_TAG_BITS) - 1));
- }
-+#endif
-
- static void cache_free_handle(struct zs_pool *pool, unsigned long handle)
- {
-@@ -373,12 +402,18 @@ static void cache_free_zspage(struct zs_
-
- static void record_obj(unsigned long handle, unsigned long obj)
- {
-+#ifdef CONFIG_PREEMPT_RT_BASE
-+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle);
-+
-+ WRITE_ONCE(zh->addr, obj);
-+#else
- /*
- * lsb of @obj represents handle lock while other bits
- * represent object value the handle is pointing so
- * updating shouldn't do store tearing.
- */
- WRITE_ONCE(*(unsigned long *)handle, obj);
-+#endif
- }
-
- /* zpool driver */
-@@ -902,7 +937,13 @@ static unsigned long location_to_obj(str
-
- static unsigned long handle_to_obj(unsigned long handle)
- {
-+#ifdef CONFIG_PREEMPT_RT_BASE
-+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle);
-+
-+ return zh->addr;
-+#else
- return *(unsigned long *)handle;
-+#endif
- }
-
- static unsigned long obj_to_head(struct page *page, void *obj)
-@@ -916,22 +957,46 @@ static unsigned long obj_to_head(struct
-
- static inline int testpin_tag(unsigned long handle)
- {
-+#ifdef CONFIG_PREEMPT_RT_BASE
-+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle);
-+
-+ return mutex_is_locked(&zh->lock);
-+#else
- return bit_spin_is_locked(HANDLE_PIN_BIT, (unsigned long *)handle);
-+#endif
- }
-
- static inline int trypin_tag(unsigned long handle)
- {
-+#ifdef CONFIG_PREEMPT_RT_BASE
-+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle);
-+
-+ return mutex_trylock(&zh->lock);
-+#else
- return bit_spin_trylock(HANDLE_PIN_BIT, (unsigned long *)handle);
-+#endif
- }
-
- static void pin_tag(unsigned long handle)
- {
-+#ifdef CONFIG_PREEMPT_RT_BASE
-+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle);
-+
-+ return mutex_lock(&zh->lock);
-+#else
- bit_spin_lock(HANDLE_PIN_BIT, (unsigned long *)handle);
-+#endif
- }
-
- static void unpin_tag(unsigned long handle)
- {
-+#ifdef CONFIG_PREEMPT_RT_BASE
-+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle);
-+
-+ return mutex_unlock(&zh->lock);
-+#else
- bit_spin_unlock(HANDLE_PIN_BIT, (unsigned long *)handle);
-+#endif
- }
-
- static void reset_page(struct page *page)
-@@ -1423,7 +1488,7 @@ void *zs_map_object(struct zs_pool *pool
- class = pool->size_class[class_idx];
- off = (class->size * obj_idx) & ~PAGE_MASK;
-
-- area = &get_cpu_var(zs_map_area);
-+ area = per_cpu_ptr(&zs_map_area, get_cpu_light());
- area->vm_mm = mm;
- if (off + class->size <= PAGE_SIZE) {
- /* this object is contained entirely within a page */
-@@ -1477,7 +1542,7 @@ void zs_unmap_object(struct zs_pool *poo
-
- __zs_unmap_object(area, pages, off, class->size);
- }
-- put_cpu_var(zs_map_area);
-+ put_cpu_light();
-
- migrate_read_unlock(zspage);
- unpin_tag(handle);
diff --git a/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch b/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch
index 43c7b58..bb86b48 100644
--- a/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch
+++ b/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch
@@ -1,7 +1,7 @@
From: Mike Galbraith <umgwanakikbuti at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
get_cpu_var() disables preemption and triggers a might_sleep() splat later.
This is replaced with get_locked_var().
diff --git a/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch b/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch
index 4564415..a1ca8f4 100644
--- a/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch
+++ b/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch
@@ -1,7 +1,7 @@
Subject: mmci: Remove bogus local_irq_save()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 09 Jan 2013 12:11:12 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
On !RT interrupt runs with interrupts disabled. On RT it's in a
thread, so no need to disable interrupts at all.
diff --git a/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch b/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch
index 00fa8f8..89278db 100644
--- a/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch
+++ b/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch
@@ -1,7 +1,7 @@
Date: Wed, 26 Jun 2013 15:28:11 -0400
From: Steven Rostedt <rostedt at goodmis.org>
Subject: rt,ntp: Move call to schedule_delayed_work() to helper thread
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The ntp code for notify_cmos_timer() is called from a hard interrupt
context. schedule_delayed_work() under PREEMPT_RT_FULL calls spinlocks
diff --git a/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch b/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch
index 69d53a8..89e26ce 100644
--- a/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch
+++ b/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Drop spin on owner for mutex / rwsem. We are most likely not using it
but…
diff --git a/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch b/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch
index 7cb270c..4faf187 100644
--- a/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch
+++ b/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch
@@ -2,7 +2,7 @@ From: Steven Rostedt <rostedt at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
A customer hit a crash where the napi sd->poll_list became corrupted.
The customer had the bnx2x driver, which does a
@@ -29,7 +29,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -395,7 +395,19 @@ typedef enum rx_handler_result rx_handle
+@@ -396,7 +396,19 @@ typedef enum rx_handler_result rx_handle
typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb);
void __napi_schedule(struct napi_struct *n);
@@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
{
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -4906,6 +4906,7 @@ void __napi_schedule(struct napi_struct
+@@ -4914,6 +4914,7 @@ void __napi_schedule(struct napi_struct
}
EXPORT_SYMBOL(__napi_schedule);
@@ -59,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/**
* __napi_schedule_irqoff - schedule for receive
* @n: entry to schedule
-@@ -4917,6 +4918,7 @@ void __napi_schedule_irqoff(struct napi_
+@@ -4925,6 +4926,7 @@ void __napi_schedule_irqoff(struct napi_
____napi_schedule(this_cpu_ptr(&softnet_data), n);
}
EXPORT_SYMBOL(__napi_schedule_irqoff);
diff --git a/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch b/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch
index 288ae62..03d435e 100644
--- a/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch
+++ b/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -108,16 +108,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
struct Qdisc_ops;
struct qdisc_walker;
-@@ -78,7 +79,7 @@ struct Qdisc {
+@@ -86,7 +87,7 @@ struct Qdisc {
struct sk_buff *gso_skb ____cacheline_aligned_in_smp;
- struct sk_buff_head q;
+ struct qdisc_skb_head q;
struct gnet_stats_basic_packed bstats;
- seqcount_t running;
+ net_seqlock_t running;
struct gnet_stats_queue qstats;
unsigned long state;
struct Qdisc *next_sched;
-@@ -90,13 +91,22 @@ struct Qdisc {
+@@ -98,13 +99,22 @@ struct Qdisc {
spinlock_t busylock ____cacheline_aligned_in_smp;
};
@@ -141,7 +141,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
if (qdisc_is_running(qdisc))
return false;
/* Variant of write_seqcount_begin() telling lockdep a trylock
-@@ -105,11 +115,16 @@ static inline bool qdisc_run_begin(struc
+@@ -113,11 +123,16 @@ static inline bool qdisc_run_begin(struc
raw_write_seqcount_begin(&qdisc->running);
seqcount_acquire(&qdisc->running.dep_map, 0, 1, _RET_IP_);
return true;
@@ -158,7 +158,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
static inline bool qdisc_may_bulk(const struct Qdisc *qdisc)
-@@ -300,7 +315,7 @@ static inline spinlock_t *qdisc_root_sle
+@@ -308,7 +323,7 @@ static inline spinlock_t *qdisc_root_sle
return qdisc_lock(root);
}
@@ -231,7 +231,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
struct gnet_stats_basic_packed *b)
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
-@@ -975,7 +975,7 @@ qdisc_create(struct net_device *dev, str
+@@ -981,7 +981,7 @@ static struct Qdisc *qdisc_create(struct
rcu_assign_pointer(sch->stab, stab);
}
if (tca[TCA_RATE]) {
@@ -242,8 +242,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
if (sch->flags & TCQ_F_MQROOT)
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
-@@ -426,7 +426,11 @@ struct Qdisc noop_qdisc = {
- .list = LIST_HEAD_INIT(noop_qdisc.list),
+@@ -425,7 +425,11 @@ struct Qdisc noop_qdisc = {
+ .ops = &noop_qdisc_ops,
.q.lock = __SPIN_LOCK_UNLOCKED(noop_qdisc.q.lock),
.dev_queue = &noop_netdev_queue,
+#ifdef CONFIG_PREEMPT_RT_BASE
@@ -254,7 +254,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
.busylock = __SPIN_LOCK_UNLOCKED(noop_qdisc.busylock),
};
EXPORT_SYMBOL(noop_qdisc);
-@@ -620,9 +624,17 @@ struct Qdisc *qdisc_alloc(struct netdev_
+@@ -624,9 +628,17 @@ struct Qdisc *qdisc_alloc(struct netdev_
lockdep_set_class(&sch->busylock,
dev->qdisc_tx_busylock ?: &qdisc_tx_busylock);
diff --git a/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch b/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch
index d8436c3..406491c 100644
--- a/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch
+++ b/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch b/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch
index db6c4c2..2890a5d 100644
--- a/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch
+++ b/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] net: add back the missing serialization in
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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#include <net/net_namespace.h>
#include <net/icmp.h>
-@@ -565,6 +566,7 @@ void tcp_v4_send_check(struct sock *sk,
+@@ -564,6 +565,7 @@ void tcp_v4_send_check(struct sock *sk,
}
EXPORT_SYMBOL(tcp_v4_send_check);
@@ -59,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/*
* This routine will send an RST to the other tcp.
*
-@@ -692,6 +694,8 @@ static void tcp_v4_send_reset(const stru
+@@ -691,6 +693,8 @@ static void tcp_v4_send_reset(const stru
offsetof(struct inet_timewait_sock, tw_bound_dev_if));
arg.tos = ip_hdr(skb)->tos;
@@ -68,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
local_bh_disable();
ip_send_unicast_reply(*this_cpu_ptr(net->ipv4.tcp_sk),
skb, &TCP_SKB_CB(skb)->header.h4.opt,
-@@ -701,6 +705,7 @@ static void tcp_v4_send_reset(const stru
+@@ -700,6 +704,7 @@ static void tcp_v4_send_reset(const stru
__TCP_INC_STATS(net, TCP_MIB_OUTSEGS);
__TCP_INC_STATS(net, TCP_MIB_OUTRSTS);
local_bh_enable();
@@ -76,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#ifdef CONFIG_TCP_MD5SIG
out:
-@@ -776,6 +781,7 @@ static void tcp_v4_send_ack(struct net *
+@@ -775,6 +780,7 @@ static void tcp_v4_send_ack(struct net *
if (oif)
arg.bound_dev_if = oif;
arg.tos = tos;
@@ -84,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
local_bh_disable();
ip_send_unicast_reply(*this_cpu_ptr(net->ipv4.tcp_sk),
skb, &TCP_SKB_CB(skb)->header.h4.opt,
-@@ -784,6 +790,7 @@ static void tcp_v4_send_ack(struct net *
+@@ -783,6 +789,7 @@ static void tcp_v4_send_ack(struct net *
__TCP_INC_STATS(net, TCP_MIB_OUTSEGS);
local_bh_enable();
diff --git a/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch b/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch
index 6aa9e49..3b0532d 100644
--- a/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch
+++ b/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Replace it by a local lock. Though that's pretty inefficient :(
diff --git a/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch b/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch
index 248e6d1..a7ddead 100644
--- a/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch
+++ b/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch
@@ -1,7 +1,7 @@
Subject: net/core/cpuhotplug: Drain input_pkt_queue lockless
From: Grygorii Strashko <grygorii.strashko at ti.com>
Date: Fri, 9 Oct 2015 09:25:49 -0500
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
I can constantly see below error report with 4.1 RT-kernel on TI ARM dra7-evm
if I'm trying to unplug cpu1:
@@ -36,7 +36,7 @@ Cc: stable-rt at vger.kernel.org
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -8011,7 +8011,7 @@ static int dev_cpu_callback(struct notif
+@@ -8022,7 +8022,7 @@ static int dev_cpu_callback(struct notif
netif_rx_ni(skb);
input_queue_head_incr(oldsd);
}
diff --git a/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch b/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch
index 5ceef84..04abd8c 100644
--- a/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch
+++ b/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch
@@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Fri, 15 Jan 2016 16:33:34 +0100
Subject: net/core: protect users of napi_alloc_cache against
reentrance
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch
index 040018d..84d4397 100644
--- a/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch
+++ b/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -21,7 +21,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -3085,7 +3085,11 @@ static inline int __dev_xmit_skb(struct
+@@ -3080,7 +3080,11 @@ static inline int __dev_xmit_skb(struct
* This permits qdisc->running owner to get the lock more
* often and dequeue packets faster.
*/
diff --git a/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch b/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch
index 60078ed..c8c4c5a 100644
--- a/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch
+++ b/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch
@@ -1,7 +1,7 @@
Subject: net: netfilter: Serialize xt_write_recseq sections on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 28 Oct 2012 11:18:08 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The netfilter code relies only on the implicit semantics of
local_bh_disable() for serializing wt_write_recseq sections. RT breaks
@@ -54,11 +54,12 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
-@@ -22,11 +22,17 @@
+@@ -22,12 +22,18 @@
#include <linux/proc_fs.h>
#include <linux/mutex.h>
#include <linux/slab.h>
+#include <linux/locallock.h>
+ #include <linux/rcupdate.h>
#include <net/net_namespace.h>
#include <net/sock.h>
diff --git a/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch b/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch
index 15d85f3..9bd5ea3 100644
--- a/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch
+++ b/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
On RT write_seqcount_begin() disables preemption and device_rename()
allocates memory with GFP_KERNEL and grabs later the sysfs_mutex
diff --git a/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch b/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch
index a4e33a1..54f3455 100644
--- a/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch
+++ b/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -2446,14 +2446,53 @@ void netdev_freemem(struct net_device *d
+@@ -2461,14 +2461,53 @@ void netdev_freemem(struct net_device *d
void synchronize_net(void);
int init_dummy_netdev(struct net_device *dev);
@@ -81,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1957,6 +1957,9 @@ struct task_struct {
+@@ -1982,6 +1982,9 @@ struct task_struct {
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
unsigned long task_state_change;
#endif
@@ -93,7 +93,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
struct task_struct *oom_reaper_list;
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -3148,8 +3148,10 @@ static void skb_update_prio(struct sk_bu
+@@ -3143,8 +3143,10 @@ static void skb_update_prio(struct sk_bu
#define skb_update_prio(skb)
#endif
@@ -104,7 +104,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/**
* dev_loopback_xmit - loop back @skb
-@@ -3393,8 +3395,7 @@ static int __dev_queue_xmit(struct sk_bu
+@@ -3378,8 +3380,7 @@ static int __dev_queue_xmit(struct sk_bu
int cpu = smp_processor_id(); /* ok because BHs are off */
if (txq->xmit_lock_owner != cpu) {
@@ -114,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
goto recursion_alert;
skb = validate_xmit_skb(skb, dev);
-@@ -3404,9 +3405,9 @@ static int __dev_queue_xmit(struct sk_bu
+@@ -3389,9 +3390,9 @@ static int __dev_queue_xmit(struct sk_bu
HARD_TX_LOCK(dev, txq, cpu);
if (!netif_xmit_stopped(txq)) {
@@ -128,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
goto out;
--- a/net/core/filter.c
+++ b/net/core/filter.c
-@@ -1592,7 +1592,7 @@ static inline int __bpf_tx_skb(struct ne
+@@ -1645,7 +1645,7 @@ static inline int __bpf_tx_skb(struct ne
{
int ret;
@@ -137,7 +137,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
net_crit_ratelimited("bpf: recursion limit reached on datapath, buggy bpf program?\n");
kfree_skb(skb);
return -ENETDOWN;
-@@ -1600,9 +1600,9 @@ static inline int __bpf_tx_skb(struct ne
+@@ -1653,9 +1653,9 @@ static inline int __bpf_tx_skb(struct ne
skb->dev = dev;
diff --git a/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch b/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch
index de8eb2d..7e5f298 100644
--- a/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch
+++ b/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch
@@ -1,7 +1,7 @@
Subject: net-flip-lock-dep-thingy.patch
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 28 Jun 2011 10:59:58 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
=======================================================
[ INFO: possible circular locking dependency detected ]
@@ -96,7 +96,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/net/core/sock.c
+++ b/net/core/sock.c
-@@ -2510,12 +2510,11 @@ void lock_sock_nested(struct sock *sk, i
+@@ -2488,12 +2488,11 @@ void lock_sock_nested(struct sock *sk, i
if (sk->sk_lock.owned)
__lock_sock(sk);
sk->sk_lock.owned = 1;
diff --git a/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch b/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch
index a8d8531..15a2d78 100644
--- a/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch
+++ b/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch
@@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -21,7 +21,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
-@@ -488,6 +488,14 @@ extern void thread_do_softirq(void);
+@@ -496,6 +496,14 @@ extern void thread_do_softirq(void);
extern void open_softirq(int nr, void (*action)(struct softirq_action *));
extern void softirq_init(void);
extern void __raise_softirq_irqoff(unsigned int nr);
@@ -38,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
extern void raise_softirq(unsigned int nr);
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
-@@ -675,6 +675,27 @@ void __raise_softirq_irqoff(unsigned int
+@@ -685,6 +685,27 @@ void __raise_softirq_irqoff(unsigned int
}
/*
@@ -68,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
void raise_softirq_irqoff(unsigned int nr)
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -5247,7 +5247,7 @@ static void net_rx_action(struct softirq
+@@ -5255,7 +5255,7 @@ static __latent_entropy void net_rx_acti
list_splice_tail(&repoll, &list);
list_splice(&list, &sd->poll_list);
if (!list_empty(&sd->poll_list))
diff --git a/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch b/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch
index 28ef1f8..e7093b6 100644
--- a/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch
+++ b/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch
@@ -1,7 +1,7 @@
From: Marc Kleine-Budde <mkl at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -47,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
-@@ -917,7 +917,7 @@ void dev_deactivate_many(struct list_hea
+@@ -925,7 +925,7 @@ void dev_deactivate_many(struct list_hea
/* Wait for outstanding qdisc_run calls. */
list_for_each_entry(dev, head, close_list)
while (some_qdisc_is_busy(dev))
diff --git a/debian/patches/features/all/rt/net-tx-action-avoid-livelock-on-rt.patch b/debian/patches/features/all/rt/net-tx-action-avoid-livelock-on-rt.patch
deleted file mode 100644
index 418b2af..0000000
--- a/debian/patches/features/all/rt/net-tx-action-avoid-livelock-on-rt.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-Subject: net: Avoid livelock in net_tx_action() on RT
-From: Steven Rostedt <srostedt at redhat.com>
-Date: Thu, 06 Oct 2011 10:48:39 -0400
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-qdisc_lock is taken w/o disabling interrupts or bottom halfs. So code
-holding a qdisc_lock() can be interrupted and softirqs can run on the
-return of interrupt in !RT.
-
-The spin_trylock() in net_tx_action() makes sure, that the softirq
-does not deadlock. When the lock can't be acquired q is requeued and
-the NET_TX softirq is raised. That causes the softirq to run over and
-over.
-
-That works in mainline as do_softirq() has a retry loop limit and
-leaves the softirq processing in the interrupt return path and
-schedules ksoftirqd. The task which holds qdisc_lock cannot be
-preempted, so the lock is released and either ksoftirqd or the next
-softirq in the return from interrupt path can proceed. Though it's a
-bit strange to actually run MAX_SOFTIRQ_RESTART (10) loops before it
-decides to bail out even if it's clear in the first iteration :)
-
-On RT all softirq processing is done in a FIFO thread and we don't
-have a loop limit, so ksoftirqd preempts the lock holder forever and
-unqueues and requeues until the reset button is hit.
-
-Due to the forced threading of ksoftirqd on RT we actually cannot
-deadlock on qdisc_lock because it's a "sleeping lock". So it's safe to
-replace the spin_trylock() with a spin_lock(). When contended,
-ksoftirqd is scheduled out and the lock holder can proceed.
-
-[ tglx: Massaged changelog and code comments ]
-
-Solved-by: Thomas Gleixner <tglx at linuxtronix.de>
-Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
-Tested-by: Carsten Emde <cbe at osadl.org>
-Cc: Clark Williams <williams at redhat.com>
-Cc: John Kacur <jkacur at redhat.com>
-Cc: Luis Claudio R. Goncalves <lclaudio at redhat.com>
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
-
----
- net/core/dev.c | 32 +++++++++++++++++++++++++++++++-
- 1 file changed, 31 insertions(+), 1 deletion(-)
-
---- a/net/core/dev.c
-+++ b/net/core/dev.c
-@@ -3848,6 +3848,36 @@ int netif_rx_ni(struct sk_buff *skb)
- }
- EXPORT_SYMBOL(netif_rx_ni);
-
-+#ifdef CONFIG_PREEMPT_RT_FULL
-+/*
-+ * RT runs ksoftirqd as a real time thread and the root_lock is a
-+ * "sleeping spinlock". If the trylock fails then we can go into an
-+ * infinite loop when ksoftirqd preempted the task which actually
-+ * holds the lock, because we requeue q and raise NET_TX softirq
-+ * causing ksoftirqd to loop forever.
-+ *
-+ * It's safe to use spin_lock on RT here as softirqs run in thread
-+ * context and cannot deadlock against the thread which is holding
-+ * root_lock.
-+ *
-+ * On !RT the trylock might fail, but there we bail out from the
-+ * softirq loop after 10 attempts which we can't do on RT. And the
-+ * task holding root_lock cannot be preempted, so the only downside of
-+ * that trylock is that we need 10 loops to decide that we should have
-+ * given up in the first one :)
-+ */
-+static inline int take_root_lock(spinlock_t *lock)
-+{
-+ spin_lock(lock);
-+ return 1;
-+}
-+#else
-+static inline int take_root_lock(spinlock_t *lock)
-+{
-+ return spin_trylock(lock);
-+}
-+#endif
-+
- static void net_tx_action(struct softirq_action *h)
- {
- struct softnet_data *sd = this_cpu_ptr(&softnet_data);
-@@ -3895,7 +3925,7 @@ static void net_tx_action(struct softirq
- head = head->next_sched;
-
- root_lock = qdisc_lock(q);
-- if (spin_trylock(root_lock)) {
-+ if (take_root_lock(root_lock)) {
- smp_mb__before_atomic();
- clear_bit(__QDISC_STATE_SCHED,
- &q->state);
diff --git a/debian/patches/features/all/rt/net-use-cpu-chill.patch b/debian/patches/features/all/rt/net-use-cpu-chill.patch
index ffcd98b..c61ece2 100644
--- a/debian/patches/features/all/rt/net-use-cpu-chill.patch
+++ b/debian/patches/features/all/rt/net-use-cpu-chill.patch
@@ -1,7 +1,7 @@
Subject: net: Use cpu_chill() instead of cpu_relax()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 07 Mar 2012 21:10:04 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/net-wireless-warn-nort.patch b/debian/patches/features/all/rt/net-wireless-warn-nort.patch
index a2d7448..be4d8f1 100644
--- a/debian/patches/features/all/rt/net-wireless-warn-nort.patch
+++ b/debian/patches/features/all/rt/net-wireless-warn-nort.patch
@@ -1,7 +1,7 @@
Subject: net/wireless: Use WARN_ON_NORT()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 21 Jul 2011 21:05:33 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The softirq counter is meaningless on RT, so the check triggers a
false positive.
@@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
-@@ -4070,7 +4070,7 @@ void ieee80211_rx_napi(struct ieee80211_
+@@ -4156,7 +4156,7 @@ void ieee80211_rx_napi(struct ieee80211_
struct ieee80211_supported_band *sband;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
diff --git a/debian/patches/features/all/rt/net__Make_synchronize-rcu_expedited_conditional-on-non-rt b/debian/patches/features/all/rt/net__Make_synchronize-rcu_expedited_conditional-on-non-rt
deleted file mode 100644
index 0debdb6..0000000
--- a/debian/patches/features/all/rt/net__Make_synchronize-rcu_expedited_conditional-on-non-rt
+++ /dev/null
@@ -1,36 +0,0 @@
-Date: Tue, 27 Oct 2015 07:31:53 -0500
-From: Josh Cartwright <joshc at ni.com>
-Subject: net: Make synchronize_rcu_expedited() conditional on !RT_FULL
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz
-
-While the use of synchronize_rcu_expedited() might make
-synchronize_net() "faster", it does so at significant cost on RT
-systems, as expediting a grace period forcibly preempts any
-high-priority RT tasks (via the stop_machine() mechanism).
-
-Without this change, we can observe a latency spike up to 30us with
-cyclictest by rapidly unplugging/reestablishing an ethernet link.
-
-Suggested-by: Paul E. McKenney <paulmck at linux.vnet.ibm.com>
-Signed-off-by: Josh Cartwright <joshc at ni.com>
-Cc: bigeasy at linutronix.de
-Acked-by: Eric Dumazet <eric.dumazet at gmail.com>
-Acked-by: David S. Miller <davem at davemloft.net>
-Cc: Paul E. McKenney <paulmck at linux.vnet.ibm.com>
-Link: http://lkml.kernel.org/r/20151027123153.GG8245@jcartwri.amer.corp.natinst.com
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
----
- net/core/dev.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/net/core/dev.c
-+++ b/net/core/dev.c
-@@ -7217,7 +7217,7 @@ EXPORT_SYMBOL(free_netdev);
- void synchronize_net(void)
- {
- might_sleep();
-- if (rtnl_is_locked())
-+ if (rtnl_is_locked() && !IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
- synchronize_rcu_expedited();
- else
- synchronize_rcu();
diff --git a/debian/patches/features/all/rt/oleg-signal-rt-fix.patch b/debian/patches/features/all/rt/oleg-signal-rt-fix.patch
index d305e3b..58eb72f 100644
--- a/debian/patches/features/all/rt/oleg-signal-rt-fix.patch
+++ b/debian/patches/features/all/rt/oleg-signal-rt-fix.patch
@@ -1,7 +1,7 @@
From: Oleg Nesterov <oleg at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -39,7 +39,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
-@@ -155,6 +155,13 @@ static void exit_to_usermode_loop(struct
+@@ -148,6 +148,13 @@ static void exit_to_usermode_loop(struct
if (cached_flags & _TIF_NEED_RESCHED)
schedule();
@@ -55,9 +55,9 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/x86/include/asm/signal.h
+++ b/arch/x86/include/asm/signal.h
-@@ -23,6 +23,19 @@ typedef struct {
- unsigned long sig[_NSIG_WORDS];
- } sigset_t;
+@@ -27,6 +27,19 @@ typedef struct {
+ #define SA_IA32_ABI 0x02000000u
+ #define SA_X32_ABI 0x01000000u
+/*
+ * Because some traps use the IST stack, we must keep preemption
@@ -77,7 +77,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#endif
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1670,6 +1670,10 @@ struct task_struct {
+@@ -1695,6 +1695,10 @@ struct task_struct {
sigset_t blocked, real_blocked;
sigset_t saved_sigmask; /* restored if set_restore_sigmask() was used */
struct sigpending pending;
diff --git a/debian/patches/features/all/rt/panic-disable-random-on-rt.patch b/debian/patches/features/all/rt/panic-disable-random-on-rt.patch
index 4b68734..dfc0131 100644
--- a/debian/patches/features/all/rt/panic-disable-random-on-rt.patch
+++ b/debian/patches/features/all/rt/panic-disable-random-on-rt.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Disable on -RT. If this is invoked from irq-context we will have problems
to acquire the sleeping lock.
@@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/panic.c
+++ b/kernel/panic.c
-@@ -449,9 +449,11 @@ static u64 oops_id;
+@@ -482,9 +482,11 @@ static u64 oops_id;
static int init_oops_id(void)
{
diff --git a/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch b/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch
index bd3e61a..c060ec9 100644
--- a/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch
+++ b/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch
@@ -1,7 +1,7 @@
Subject: rcu: Make ksoftirqd do RCU quiescent states
From: "Paul E. McKenney" <paulmck at linux.vnet.ibm.com>
Date: Wed, 5 Oct 2011 11:45:18 -0700
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Implementing RCU-bh in terms of RCU-preempt makes the system vulnerable
to network-based denial-of-service attacks. This patch therefore
@@ -42,10 +42,10 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
-#endif
void rcu_check_callbacks(int user);
void rcu_report_dead(unsigned int cpu);
-
+ void rcu_cpu_starting(unsigned int cpu);
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
-@@ -259,7 +259,14 @@ void rcu_sched_qs(void)
+@@ -257,7 +257,14 @@ void rcu_sched_qs(void)
this_cpu_ptr(&rcu_sched_data), true);
}
diff --git a/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch b/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch
index c36b3e3..cd4d576 100644
--- a/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch
+++ b/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch
@@ -1,7 +1,7 @@
Subject: pci: Use __wake_up_all_locked in pci_unblock_user_cfg_access()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 01 Dec 2011 00:07:16 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The waitqueue is protected by the pci_lock, so we can just avoid to
lock the waitqueue lock itself. That prevents the
diff --git a/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch b/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch
index 66f20bc..372a693 100644
--- a/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch
+++ b/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Wed, 9 Apr 2014 11:58:17 +0200
Subject: percpu_ida: Use local locks
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
the local_irq_save() + spin_lock() does not work that well on -RT
diff --git a/debian/patches/features/all/rt/perf-make-swevent-hrtimer-irqsafe.patch b/debian/patches/features/all/rt/perf-make-swevent-hrtimer-irqsafe.patch
index 37118a8..a91cdf6 100644
--- a/debian/patches/features/all/rt/perf-make-swevent-hrtimer-irqsafe.patch
+++ b/debian/patches/features/all/rt/perf-make-swevent-hrtimer-irqsafe.patch
@@ -1,7 +1,7 @@
From: Yong Zhang <yong.zhang at windriver.com>
Date: Wed, 11 Jul 2012 22:05:21 +0000
Subject: perf: Make swevent hrtimer run in irq instead of softirq
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Otherwise we get a deadlock like below:
@@ -59,7 +59,7 @@ Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
-@@ -8217,6 +8217,7 @@ static void perf_swevent_init_hrtimer(st
+@@ -8335,6 +8335,7 @@ static void perf_swevent_init_hrtimer(st
hrtimer_init(&hwc->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hwc->hrtimer.function = perf_swevent_hrtimer;
diff --git a/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch b/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch
index 38ea73e..96440e1 100644
--- a/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch
+++ b/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch
@@ -1,7 +1,7 @@
Subject: rcu: Frob softirq test
From: Peter Zijlstra <a.p.zijlstra at chello.nl>
Date: Sat Aug 13 00:23:17 CEST 2011
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
With RT_FULL we get the below wreckage:
diff --git a/debian/patches/features/all/rt/peterz-percpu-rwsem-rt.patch b/debian/patches/features/all/rt/peterz-percpu-rwsem-rt.patch
new file mode 100644
index 0000000..b8ecd73
--- /dev/null
+++ b/debian/patches/features/all/rt/peterz-percpu-rwsem-rt.patch
@@ -0,0 +1,219 @@
+Subject: locking/percpu-rwsem: Remove preempt_disable variants
+From: Peter Zijlstra <peterz at infradead.org>
+Date: Wed Nov 23 16:29:32 CET 2016
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
+
+Effective revert commit:
+
+ 87709e28dc7c ("fs/locks: Use percpu_down_read_preempt_disable()")
+
+This is causing major pain for PREEMPT_RT and is only a very small
+performance issue for PREEMPT=y.
+
+Signed-off-by: Peter Zijlstra (Intel) <peterz at infradead.org>
+---
+---
+ fs/locks.c | 32 ++++++++++++++++----------------
+ include/linux/percpu-rwsem.h | 24 ++++--------------------
+ 2 files changed, 20 insertions(+), 36 deletions(-)
+
+--- a/fs/locks.c
++++ b/fs/locks.c
+@@ -935,7 +935,7 @@ static int flock_lock_inode(struct inode
+ return -ENOMEM;
+ }
+
+- percpu_down_read_preempt_disable(&file_rwsem);
++ percpu_down_read(&file_rwsem);
+ spin_lock(&ctx->flc_lock);
+ if (request->fl_flags & FL_ACCESS)
+ goto find_conflict;
+@@ -976,7 +976,7 @@ static int flock_lock_inode(struct inode
+
+ out:
+ spin_unlock(&ctx->flc_lock);
+- percpu_up_read_preempt_enable(&file_rwsem);
++ percpu_up_read(&file_rwsem);
+ if (new_fl)
+ locks_free_lock(new_fl);
+ locks_dispose_list(&dispose);
+@@ -1013,7 +1013,7 @@ static int posix_lock_inode(struct inode
+ new_fl2 = locks_alloc_lock();
+ }
+
+- percpu_down_read_preempt_disable(&file_rwsem);
++ percpu_down_read(&file_rwsem);
+ spin_lock(&ctx->flc_lock);
+ /*
+ * New lock request. Walk all POSIX locks and look for conflicts. If
+@@ -1185,7 +1185,7 @@ static int posix_lock_inode(struct inode
+ }
+ out:
+ spin_unlock(&ctx->flc_lock);
+- percpu_up_read_preempt_enable(&file_rwsem);
++ percpu_up_read(&file_rwsem);
+ /*
+ * Free any unused locks.
+ */
+@@ -1460,7 +1460,7 @@ int __break_lease(struct inode *inode, u
+ return error;
+ }
+
+- percpu_down_read_preempt_disable(&file_rwsem);
++ percpu_down_read(&file_rwsem);
+ spin_lock(&ctx->flc_lock);
+
+ time_out_leases(inode, &dispose);
+@@ -1512,13 +1512,13 @@ int __break_lease(struct inode *inode, u
+ locks_insert_block(fl, new_fl);
+ trace_break_lease_block(inode, new_fl);
+ spin_unlock(&ctx->flc_lock);
+- percpu_up_read_preempt_enable(&file_rwsem);
++ percpu_up_read(&file_rwsem);
+
+ locks_dispose_list(&dispose);
+ error = wait_event_interruptible_timeout(new_fl->fl_wait,
+ !new_fl->fl_next, break_time);
+
+- percpu_down_read_preempt_disable(&file_rwsem);
++ percpu_down_read(&file_rwsem);
+ spin_lock(&ctx->flc_lock);
+ trace_break_lease_unblock(inode, new_fl);
+ locks_delete_block(new_fl);
+@@ -1535,7 +1535,7 @@ int __break_lease(struct inode *inode, u
+ }
+ out:
+ spin_unlock(&ctx->flc_lock);
+- percpu_up_read_preempt_enable(&file_rwsem);
++ percpu_up_read(&file_rwsem);
+ locks_dispose_list(&dispose);
+ locks_free_lock(new_fl);
+ return error;
+@@ -1609,7 +1609,7 @@ int fcntl_getlease(struct file *filp)
+
+ ctx = smp_load_acquire(&inode->i_flctx);
+ if (ctx && !list_empty_careful(&ctx->flc_lease)) {
+- percpu_down_read_preempt_disable(&file_rwsem);
++ percpu_down_read(&file_rwsem);
+ spin_lock(&ctx->flc_lock);
+ time_out_leases(inode, &dispose);
+ list_for_each_entry(fl, &ctx->flc_lease, fl_list) {
+@@ -1619,7 +1619,7 @@ int fcntl_getlease(struct file *filp)
+ break;
+ }
+ spin_unlock(&ctx->flc_lock);
+- percpu_up_read_preempt_enable(&file_rwsem);
++ percpu_up_read(&file_rwsem);
+
+ locks_dispose_list(&dispose);
+ }
+@@ -1694,7 +1694,7 @@ generic_add_lease(struct file *filp, lon
+ return -EINVAL;
+ }
+
+- percpu_down_read_preempt_disable(&file_rwsem);
++ percpu_down_read(&file_rwsem);
+ spin_lock(&ctx->flc_lock);
+ time_out_leases(inode, &dispose);
+ error = check_conflicting_open(dentry, arg, lease->fl_flags);
+@@ -1765,7 +1765,7 @@ generic_add_lease(struct file *filp, lon
+ lease->fl_lmops->lm_setup(lease, priv);
+ out:
+ spin_unlock(&ctx->flc_lock);
+- percpu_up_read_preempt_enable(&file_rwsem);
++ percpu_up_read(&file_rwsem);
+ locks_dispose_list(&dispose);
+ if (is_deleg)
+ inode_unlock(inode);
+@@ -1788,7 +1788,7 @@ static int generic_delete_lease(struct f
+ return error;
+ }
+
+- percpu_down_read_preempt_disable(&file_rwsem);
++ percpu_down_read(&file_rwsem);
+ spin_lock(&ctx->flc_lock);
+ list_for_each_entry(fl, &ctx->flc_lease, fl_list) {
+ if (fl->fl_file == filp &&
+@@ -1801,7 +1801,7 @@ static int generic_delete_lease(struct f
+ if (victim)
+ error = fl->fl_lmops->lm_change(victim, F_UNLCK, &dispose);
+ spin_unlock(&ctx->flc_lock);
+- percpu_up_read_preempt_enable(&file_rwsem);
++ percpu_up_read(&file_rwsem);
+ locks_dispose_list(&dispose);
+ return error;
+ }
+@@ -2532,13 +2532,13 @@ locks_remove_lease(struct file *filp, st
+ if (list_empty(&ctx->flc_lease))
+ return;
+
+- percpu_down_read_preempt_disable(&file_rwsem);
++ percpu_down_read(&file_rwsem);
+ spin_lock(&ctx->flc_lock);
+ list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list)
+ if (filp == fl->fl_file)
+ lease_modify(fl, F_UNLCK, &dispose);
+ spin_unlock(&ctx->flc_lock);
+- percpu_up_read_preempt_enable(&file_rwsem);
++ percpu_up_read(&file_rwsem);
+
+ locks_dispose_list(&dispose);
+ }
+--- a/include/linux/percpu-rwsem.h
++++ b/include/linux/percpu-rwsem.h
+@@ -28,7 +28,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 *);
+
+-static inline void percpu_down_read_preempt_disable(struct percpu_rw_semaphore *sem)
++static inline void percpu_down_read(struct percpu_rw_semaphore *sem)
+ {
+ might_sleep();
+
+@@ -46,16 +46,10 @@ static inline void percpu_down_read_pree
+ __this_cpu_inc(*sem->read_count);
+ if (unlikely(!rcu_sync_is_idle(&sem->rss)))
+ __percpu_down_read(sem, false); /* Unconditional memory barrier */
+- barrier();
+ /*
+- * The barrier() prevents the compiler from
++ * The preempt_enable() prevents the compiler from
+ * bleeding the critical section out.
+ */
+-}
+-
+-static inline void percpu_down_read(struct percpu_rw_semaphore *sem)
+-{
+- percpu_down_read_preempt_disable(sem);
+ preempt_enable();
+ }
+
+@@ -82,13 +76,9 @@ static inline int percpu_down_read_trylo
+ return ret;
+ }
+
+-static inline void percpu_up_read_preempt_enable(struct percpu_rw_semaphore *sem)
++static inline void percpu_up_read(struct percpu_rw_semaphore *sem)
+ {
+- /*
+- * The barrier() prevents the compiler from
+- * bleeding the critical section out.
+- */
+- barrier();
++ preempt_disable();
+ /*
+ * Same as in percpu_down_read().
+ */
+@@ -101,12 +91,6 @@ static inline void percpu_up_read_preemp
+ rwsem_release(&sem->rw_sem.dep_map, 1, _RET_IP_);
+ }
+
+-static inline void percpu_up_read(struct percpu_rw_semaphore *sem)
+-{
+- preempt_disable();
+- percpu_up_read_preempt_enable(sem);
+-}
+-
+ extern void percpu_down_write(struct percpu_rw_semaphore *);
+ extern void percpu_up_write(struct percpu_rw_semaphore *);
+
diff --git a/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch b/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch
index 76435a1..9c58c96 100644
--- a/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch
+++ b/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch
@@ -1,7 +1,7 @@
Subject: crypto: Convert crypto notifier chain to SRCU
From: Peter Zijlstra <peterz at infradead.org>
Date: Fri, 05 Oct 2012 09:03:24 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The crypto notifier deadlocks on RT. Though this can be a real deadlock
on mainline as well due to fifo fair rwsems.
diff --git a/debian/patches/features/all/rt/pid.h-include-atomic.h.patch b/debian/patches/features/all/rt/pid.h-include-atomic.h.patch
index ca8dd55..422ba18 100644
--- a/debian/patches/features/all/rt/pid.h-include-atomic.h.patch
+++ b/debian/patches/features/all/rt/pid.h-include-atomic.h.patch
@@ -1,7 +1,7 @@
From: Grygorii Strashko <Grygorii.Strashko at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
This patch fixes build error:
CC kernel/pid_namespace.o
diff --git a/debian/patches/features/all/rt/ping-sysrq.patch b/debian/patches/features/all/rt/ping-sysrq.patch
index a1c1d04..5d243a9 100644
--- a/debian/patches/features/all/rt/ping-sysrq.patch
+++ b/debian/patches/features/all/rt/ping-sysrq.patch
@@ -1,7 +1,7 @@
Subject: net: sysrq via icmp
From: Carsten Emde <C.Emde at osadl.org>
Date: Tue, 19 Jul 2011 13:51:17 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
There are (probably rare) situations when a system crashed and the system
console becomes unresponsive but the network icmp layer still is alive.
@@ -43,7 +43,7 @@ Signed-off-by: Carsten Emde <C.Emde at osadl.org>
'b' - Will immediately reboot the system without syncing or unmounting
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
-@@ -70,6 +70,7 @@ struct netns_ipv4 {
+@@ -69,6 +69,7 @@ struct netns_ipv4 {
int sysctl_icmp_echo_ignore_all;
int sysctl_icmp_echo_ignore_broadcasts;
diff --git a/debian/patches/features/all/rt/posix-timers-no-broadcast.patch b/debian/patches/features/all/rt/posix-timers-no-broadcast.patch
index e9435d4..946c89a 100644
--- a/debian/patches/features/all/rt/posix-timers-no-broadcast.patch
+++ b/debian/patches/features/all/rt/posix-timers-no-broadcast.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 3 Jul 2009 08:29:20 -0500
Subject: posix-timers: Prevent broadcast signals
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Posix timers should not send broadcast signals and kernel only
signals. Prevent it.
diff --git a/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch b/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch
index 26dfd33..05b2111 100644
--- a/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch
+++ b/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch
@@ -1,7 +1,7 @@
From: John Stultz <johnstul at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
posix-cpu-timer code takes non -rt safe locks in hard irq
context. Move it to a thread.
@@ -20,7 +20,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
-@@ -148,6 +148,12 @@ extern struct task_group root_task_group
+@@ -150,6 +150,12 @@ extern struct task_group root_task_group
# define INIT_PERF_EVENTS(tsk)
#endif
@@ -33,7 +33,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
# define INIT_VTIME(tsk) \
.vtime_seqcount = SEQCNT_ZERO(tsk.vtime_seqcount), \
-@@ -239,6 +245,7 @@ extern struct task_group root_task_group
+@@ -250,6 +256,7 @@ extern struct task_group root_task_group
.cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
.pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \
.timer_slack_ns = 50000, /* 50 usec default slack */ \
@@ -43,7 +43,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
[PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1635,6 +1635,9 @@ struct task_struct {
+@@ -1660,6 +1660,9 @@ struct task_struct {
struct task_cputime cputime_expires;
struct list_head cpu_timers[3];
@@ -55,7 +55,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
const struct cred __rcu *real_cred; /* objective and real subjective task
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -1274,6 +1274,9 @@ static void rt_mutex_init_task(struct ta
+@@ -1423,6 +1423,9 @@ static void rt_mutex_init_task(struct ta
*/
static void posix_cpu_timers_init(struct task_struct *tsk)
{
diff --git a/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch b/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch
index 744eb72..cb760e9 100644
--- a/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch
+++ b/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch
@@ -1,7 +1,7 @@
Subject: powerpc: Disable highmem on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 18 Jul 2011 17:08:34 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The current highmem handling on -RT is not compatible and needs fixups.
@@ -12,7 +12,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
-@@ -327,7 +327,7 @@ menu "Kernel options"
+@@ -322,7 +322,7 @@ menu "Kernel options"
config HIGHMEM
bool "High memory support"
diff --git a/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch b/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch
index 8bf649e..f11b8d5 100644
--- a/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch
+++ b/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Use generic code which uses rtmutex
@@ -12,7 +12,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
-@@ -57,10 +57,11 @@ config LOCKDEP_SUPPORT
+@@ -52,10 +52,11 @@ config LOCKDEP_SUPPORT
config RWSEM_GENERIC_SPINLOCK
bool
diff --git a/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch
index 83e9598..1f956fc 100644
--- a/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch
+++ b/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch
@@ -1,7 +1,7 @@
From: Bogdan Purcareata <bogdan.purcareata at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -28,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/arch/powerpc/kvm/Kconfig
+++ b/arch/powerpc/kvm/Kconfig
-@@ -172,6 +172,7 @@ config KVM_E500MC
+@@ -175,6 +175,7 @@ config KVM_E500MC
config KVM_MPIC
bool "KVM in-kernel MPIC emulation"
depends on KVM && E500
diff --git a/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch b/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch
index dd96d45..42b8fa0 100644
--- a/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch
+++ b/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Implement the powerpc pieces for lazy preempt.
@@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
-@@ -141,6 +141,7 @@ config PPC
+@@ -135,6 +135,7 @@ config PPC
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
@@ -134,7 +134,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
beq restore_user
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
-@@ -657,7 +657,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG
+@@ -656,7 +656,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG
bl restore_math
b restore
#endif
@@ -143,7 +143,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
beq 2f
bl restore_interrupts
SCHEDULE_USER
-@@ -719,10 +719,18 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG
+@@ -718,10 +718,18 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG
#ifdef CONFIG_PREEMPT
/* Check if we need to preempt */
@@ -163,7 +163,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
cmpwi cr1,r8,0
ld r0,SOFTE(r1)
cmpdi r0,0
-@@ -739,7 +747,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG
+@@ -738,7 +746,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG
/* Re-test flags and eventually loop */
CURRENT_THREAD_INFO(r9, r1)
ld r4,TI_FLAGS(r9)
diff --git a/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch b/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch
index cfe9e4c..6235bb7 100644
--- a/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch
+++ b/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch
@@ -1,7 +1,7 @@
From: Paul Gortmaker <paul.gortmaker at windriver.com>
Date: Sun, 31 May 2015 14:44:42 -0400
Subject: powerpc: ps3/device-init.c - adapt to completions using swait vs wait
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
To fix:
diff --git a/debian/patches/features/all/rt/preempt-lazy-check-preempt_schedule.patch b/debian/patches/features/all/rt/preempt-lazy-check-preempt_schedule.patch
deleted file mode 100644
index 86d3b2c..0000000
--- a/debian/patches/features/all/rt/preempt-lazy-check-preempt_schedule.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Wed, 20 Jan 2016 15:13:30 +0100
-Subject: preempt-lazy: Add the lazy-preemption check to preempt_schedule()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-Probably in the rebase onto v4.1 this check got moved into less commonly used
-preempt_schedule_notrace(). This patch ensures that both functions use it.
-
-Reported-by: Mike Galbraith <umgwanakikbuti at gmail.com>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- kernel/sched/core.c | 36 ++++++++++++++++++++++++++++--------
- 1 file changed, 28 insertions(+), 8 deletions(-)
-
---- a/kernel/sched/core.c
-+++ b/kernel/sched/core.c
-@@ -3500,6 +3500,30 @@ static void __sched notrace preempt_sche
- } while (need_resched());
- }
-
-+#ifdef CONFIG_PREEMPT_LAZY
-+/*
-+ * If TIF_NEED_RESCHED is then we allow to be scheduled away since this is
-+ * set by a RT task. Oterwise we try to avoid beeing scheduled out as long as
-+ * preempt_lazy_count counter >0.
-+ */
-+static __always_inline int preemptible_lazy(void)
-+{
-+ if (test_thread_flag(TIF_NEED_RESCHED))
-+ return 1;
-+ if (current_thread_info()->preempt_lazy_count)
-+ return 0;
-+ return 1;
-+}
-+
-+#else
-+
-+static int preemptible_lazy(void)
-+{
-+ return 1;
-+}
-+
-+#endif
-+
- #ifdef CONFIG_PREEMPT
- /*
- * this is the entry point to schedule() from in-kernel preemption
-@@ -3514,6 +3538,8 @@ asmlinkage __visible void __sched notrac
- */
- if (likely(!preemptible()))
- return;
-+ if (!preemptible_lazy())
-+ return;
-
- preempt_schedule_common();
- }
-@@ -3540,15 +3566,9 @@ asmlinkage __visible void __sched notrac
-
- if (likely(!preemptible()))
- return;
--
--#ifdef CONFIG_PREEMPT_LAZY
-- /*
-- * Check for lazy preemption
-- */
-- if (current_thread_info()->preempt_lazy_count &&
-- !test_thread_flag(TIF_NEED_RESCHED))
-+ if (!preemptible_lazy())
- return;
--#endif
-+
- do {
- preempt_disable_notrace();
- /*
diff --git a/debian/patches/features/all/rt/preempt-lazy-support.patch b/debian/patches/features/all/rt/preempt-lazy-support.patch
index 80aa8a1..711947e 100644
--- a/debian/patches/features/all/rt/preempt-lazy-support.patch
+++ b/debian/patches/features/all/rt/preempt-lazy-support.patch
@@ -1,7 +1,7 @@
Subject: sched: Add support for lazy preemption
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 26 Oct 2012 18:50:54 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
It has become an obsession to mitigate the determinism vs. throughput
loss of RT. Looking at the mainline semantics of preemption points
@@ -128,7 +128,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -3238,6 +3238,43 @@ static inline int test_tsk_need_resched(
+@@ -3342,6 +3342,43 @@ static inline int test_tsk_need_resched(
return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED));
}
@@ -174,7 +174,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
set_tsk_thread_flag(current, TIF_SIGPENDING);
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
-@@ -103,7 +103,17 @@ static inline int test_ti_thread_flag(st
+@@ -107,7 +107,17 @@ static inline int test_ti_thread_flag(st
#define test_thread_flag(flag) \
test_ti_thread_flag(current_thread_info(), flag)
@@ -259,7 +259,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void resched_cpu(int cpu)
{
struct rq *rq = cpu_rq(cpu);
-@@ -2522,6 +2554,9 @@ int sched_fork(unsigned long clone_flags
+@@ -2531,6 +2563,9 @@ int sched_fork(unsigned long clone_flags
p->on_cpu = 0;
#endif
init_task_preempt_count(p);
@@ -269,7 +269,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef CONFIG_SMP
plist_node_init(&p->pushable_tasks, MAX_PRIO);
RB_CLEAR_NODE(&p->pushable_dl_tasks);
-@@ -3356,6 +3391,7 @@ void migrate_disable(void)
+@@ -3362,6 +3397,7 @@ void migrate_disable(void)
}
preempt_disable();
@@ -277,7 +277,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
pin_current_cpu();
p->migrate_disable = 1;
preempt_enable();
-@@ -3395,6 +3431,7 @@ void migrate_enable(void)
+@@ -3401,6 +3437,7 @@ void migrate_enable(void)
unpin_current_cpu();
preempt_enable();
@@ -285,7 +285,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
EXPORT_SYMBOL(migrate_enable);
#endif
-@@ -3535,6 +3572,7 @@ static void __sched notrace __schedule(b
+@@ -3530,6 +3567,7 @@ static void __sched notrace __schedule(b
next = pick_next_task(rq, prev, cookie);
clear_tsk_need_resched(prev);
@@ -293,7 +293,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
clear_preempt_need_resched();
rq->clock_skip_update = 0;
-@@ -3654,6 +3692,30 @@ static void __sched notrace preempt_sche
+@@ -3675,6 +3713,30 @@ static void __sched notrace preempt_sche
} while (need_resched());
}
@@ -324,7 +324,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef CONFIG_PREEMPT
/*
* this is the entry point to schedule() from in-kernel preemption
-@@ -3668,7 +3730,8 @@ asmlinkage __visible void __sched notrac
+@@ -3689,7 +3751,8 @@ asmlinkage __visible void __sched notrac
*/
if (likely(!preemptible()))
return;
@@ -334,7 +334,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
preempt_schedule_common();
}
NOKPROBE_SYMBOL(preempt_schedule);
-@@ -3695,6 +3758,9 @@ asmlinkage __visible void __sched notrac
+@@ -3716,6 +3779,9 @@ asmlinkage __visible void __sched notrac
if (likely(!preemptible()))
return;
@@ -344,7 +344,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
do {
/*
* Because the function tracer can trace preempt_count_sub()
-@@ -5458,7 +5524,9 @@ void init_idle(struct task_struct *idle,
+@@ -5481,7 +5547,9 @@ void init_idle(struct task_struct *idle,
/* Set the preempt count _outside_ the spinlocks! */
init_idle_preempt_count(idle, cpu);
@@ -357,7 +357,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
*/
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
-@@ -3508,7 +3508,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq
+@@ -3518,7 +3518,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq
ideal_runtime = sched_slice(cfs_rq, curr);
delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
if (delta_exec > ideal_runtime) {
@@ -366,7 +366,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* The current task ran long enough, ensure it doesn't get
* re-elected due to buddy favours.
-@@ -3532,7 +3532,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq
+@@ -3542,7 +3542,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq
return;
if (delta > ideal_runtime)
@@ -375,7 +375,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
static void
-@@ -3677,7 +3677,7 @@ entity_tick(struct cfs_rq *cfs_rq, struc
+@@ -3684,7 +3684,7 @@ entity_tick(struct cfs_rq *cfs_rq, struc
* validating it and just reschedule.
*/
if (queued) {
@@ -384,7 +384,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return;
}
/*
-@@ -3859,7 +3859,7 @@ static void __account_cfs_rq_runtime(str
+@@ -3866,7 +3866,7 @@ static void __account_cfs_rq_runtime(str
* hierarchy can be throttled
*/
if (!assign_cfs_rq_runtime(cfs_rq) && likely(cfs_rq->curr))
@@ -393,7 +393,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
static __always_inline
-@@ -4487,7 +4487,7 @@ static void hrtick_start_fair(struct rq
+@@ -4494,7 +4494,7 @@ static void hrtick_start_fair(struct rq
if (delta < 0) {
if (rq->curr == p)
@@ -402,7 +402,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return;
}
hrtick_start(rq, delta);
-@@ -5676,7 +5676,7 @@ static void check_preempt_wakeup(struct
+@@ -5905,7 +5905,7 @@ static void check_preempt_wakeup(struct
return;
preempt:
@@ -411,7 +411,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Only set the backward buddy when the current task is still
* on the rq. This can happen when a wakeup gets interleaved
-@@ -8402,7 +8402,7 @@ static void task_fork_fair(struct task_s
+@@ -8631,7 +8631,7 @@ static void task_fork_fair(struct task_s
* 'current' within the tree based on its new key value.
*/
swap(curr->vruntime, se->vruntime);
@@ -420,7 +420,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
se->vruntime -= cfs_rq->min_vruntime;
-@@ -8426,7 +8426,7 @@ prio_changed_fair(struct rq *rq, struct
+@@ -8655,7 +8655,7 @@ prio_changed_fair(struct rq *rq, struct
*/
if (rq->curr == p) {
if (p->prio > oldprio)
@@ -443,7 +443,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
-@@ -1317,6 +1317,15 @@ extern void init_sched_fair_class(void);
+@@ -1347,6 +1347,15 @@ extern void init_sched_fair_class(void);
extern void resched_curr(struct rq *rq);
extern void resched_cpu(int cpu);
@@ -528,7 +528,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
-@@ -123,6 +123,7 @@ struct kretprobe_trace_entry_head {
+@@ -124,6 +124,7 @@ struct kretprobe_trace_entry_head {
* NEED_RESCHED - reschedule is requested
* HARDIRQ - inside an interrupt handler
* SOFTIRQ - inside a softirq handler
@@ -536,7 +536,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
*/
enum trace_flag_type {
TRACE_FLAG_IRQS_OFF = 0x01,
-@@ -132,6 +133,7 @@ enum trace_flag_type {
+@@ -133,6 +134,7 @@ enum trace_flag_type {
TRACE_FLAG_SOFTIRQ = 0x10,
TRACE_FLAG_PREEMPT_RESCHED = 0x20,
TRACE_FLAG_NMI = 0x40,
diff --git a/debian/patches/features/all/rt/preempt-nort-rt-variants.patch b/debian/patches/features/all/rt/preempt-nort-rt-variants.patch
index d041c19..571ea6e 100644
--- a/debian/patches/features/all/rt/preempt-nort-rt-variants.patch
+++ b/debian/patches/features/all/rt/preempt-nort-rt-variants.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
RT needs a few preempt_disable/enable points which are not necessary
otherwise. Implement variants to avoid #ifdeffery.
diff --git a/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch b/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch
index c2c0cce..a5f1076 100644
--- a/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch
+++ b/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch
@@ -1,7 +1,7 @@
Subject: printk: Add "force_early_printk" boot param to help with debugging
From: Peter Zijlstra <peterz at infradead.org>
Date: Fri, 02 Sep 2011 14:41:29 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Gives me an option to screw printk and actually see what the machine
says.
diff --git a/debian/patches/features/all/rt/printk-kill.patch b/debian/patches/features/all/rt/printk-kill.patch
index 3e1e2a6..09764aa 100644
--- a/debian/patches/features/all/rt/printk-kill.patch
+++ b/debian/patches/features/all/rt/printk-kill.patch
@@ -1,7 +1,7 @@
Subject: printk: Add a printk kill switch
From: Ingo Molnar <mingo at elte.hu>
Date: Fri, 22 Jul 2011 17:58:40 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
@@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
-@@ -125,9 +125,11 @@ struct va_format {
+@@ -126,9 +126,11 @@ struct va_format {
#ifdef CONFIG_EARLY_PRINTK
extern asmlinkage __printf(1, 2)
void early_printk(const char *fmt, ...);
@@ -88,7 +88,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef CONFIG_PRINTK
DECLARE_WAIT_QUEUE_HEAD(log_wait);
/* the next printk record to read by syslog(READ) or /proc/kmsg */
-@@ -1750,6 +1802,13 @@ asmlinkage int vprintk_emit(int facility
+@@ -1781,6 +1833,13 @@ asmlinkage int vprintk_emit(int facility
/* cpu currently holding logbuf_lock in this function */
static unsigned int logbuf_cpu = UINT_MAX;
@@ -102,7 +102,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (level == LOGLEVEL_SCHED) {
level = LOGLEVEL_DEFAULT;
in_sched = true;
-@@ -2023,26 +2082,6 @@ DEFINE_PER_CPU(printk_func_t, printk_fun
+@@ -2014,26 +2073,6 @@ DEFINE_PER_CPU(printk_func_t, printk_fun
#endif /* CONFIG_PRINTK */
diff --git a/debian/patches/features/all/rt/printk-rt-aware.patch b/debian/patches/features/all/rt/printk-rt-aware.patch
index 4ebb639..efaf07d 100644
--- a/debian/patches/features/all/rt/printk-rt-aware.patch
+++ b/debian/patches/features/all/rt/printk-rt-aware.patch
@@ -1,7 +1,7 @@
Subject: printk: Make rt aware
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 19 Sep 2012 14:50:37 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Drop the lock before calling the console driver and do not disable
interrupts while printing to a serial console.
@@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -1631,6 +1631,7 @@ static void call_console_drivers(int lev
+@@ -1628,6 +1628,7 @@ static void call_console_drivers(int lev
if (!console_drivers)
return;
@@ -21,7 +21,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
for_each_console(con) {
if (exclusive_console && con != exclusive_console)
continue;
-@@ -1646,6 +1647,7 @@ static void call_console_drivers(int lev
+@@ -1643,6 +1644,7 @@ static void call_console_drivers(int lev
else
con->write(con, text, len);
}
@@ -29,7 +29,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -1960,13 +1962,23 @@ asmlinkage int vprintk_emit(int facility
+@@ -1951,13 +1953,23 @@ asmlinkage int vprintk_emit(int facility
/* If called from the scheduler, we can not call up(). */
if (!in_sched) {
@@ -54,7 +54,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
console_unlock();
lockdep_on();
}
-@@ -2358,11 +2370,16 @@ static void console_cont_flush(char *tex
+@@ -2349,11 +2361,16 @@ static void console_cont_flush(char *tex
goto out;
len = cont_print_text(text, size);
@@ -71,7 +71,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return;
out:
raw_spin_unlock_irqrestore(&logbuf_lock, flags);
-@@ -2486,13 +2503,17 @@ void console_unlock(void)
+@@ -2477,13 +2494,17 @@ void console_unlock(void)
console_idx = log_next(console_idx);
console_seq++;
console_prev = msg->flags;
diff --git a/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch
index b9b3f62..7a6ae7d 100644
--- a/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch
+++ b/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
As explained by Alexander Fyodorov <halcy at yandex.ru>:
@@ -42,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#define task_contributes_to_load(task) \
((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
(task->flags & PF_FROZEN) == 0 && \
-@@ -3255,6 +3252,51 @@ static inline int signal_pending_state(l
+@@ -3359,6 +3356,51 @@ static inline int signal_pending_state(l
return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
}
@@ -96,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
* explicit rescheduling in places that are safe. The return
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
-@@ -128,7 +128,14 @@ static bool ptrace_freeze_traced(struct
+@@ -130,7 +130,14 @@ static bool ptrace_freeze_traced(struct
spin_lock_irq(&task->sighand->siglock);
if (task_is_traced(task) && !__fatal_signal_pending(task)) {
@@ -114,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
spin_unlock_irq(&task->sighand->siglock);
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -1373,6 +1373,18 @@ int migrate_swap(struct task_struct *cur
+@@ -1384,6 +1384,18 @@ int migrate_swap(struct task_struct *cur
return ret;
}
@@ -133,7 +133,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/*
* wait_task_inactive - wait for a thread to unschedule.
*
-@@ -1417,7 +1429,7 @@ unsigned long wait_task_inactive(struct
+@@ -1428,7 +1440,7 @@ unsigned long wait_task_inactive(struct
* is actually now running somewhere else!
*/
while (task_running(rq, p)) {
@@ -142,7 +142,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
return 0;
cpu_relax();
}
-@@ -1432,7 +1444,8 @@ unsigned long wait_task_inactive(struct
+@@ -1443,7 +1455,8 @@ unsigned long wait_task_inactive(struct
running = task_running(rq, p);
queued = task_on_rq_queued(p);
ncsw = 0;
diff --git a/debian/patches/features/all/rt/radix-tree-rt-aware.patch b/debian/patches/features/all/rt/radix-tree-rt-aware.patch
index 47638de..a59d05e 100644
--- a/debian/patches/features/all/rt/radix-tree-rt-aware.patch
+++ b/debian/patches/features/all/rt/radix-tree-rt-aware.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 17 Jul 2011 21:33:18 +0200
Subject: radix-tree: Make RT aware
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Disable radix_tree_preload() on -RT. This functions returns with
preemption disabled which may cause high latencies and breaks if the
diff --git a/debian/patches/features/all/rt/random-make-it-work-on-rt.patch b/debian/patches/features/all/rt/random-make-it-work-on-rt.patch
index 7ea5e53..94dec9e 100644
--- a/debian/patches/features/all/rt/random-make-it-work-on-rt.patch
+++ b/debian/patches/features/all/rt/random-make-it-work-on-rt.patch
@@ -1,7 +1,7 @@
Subject: random: Make it work on rt
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 21 Aug 2012 20:38:50 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Delegate the random insertion to the forced threaded interrupt
handler. Store the return IP of the hard interrupt handler in the irq
@@ -77,7 +77,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
-@@ -64,6 +64,7 @@ struct irq_desc {
+@@ -66,6 +66,7 @@ struct irq_desc {
unsigned int irqs_unhandled;
atomic_t threads_handled;
int threads_handled_last;
@@ -87,12 +87,12 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
const struct cpumask *percpu_affinity;
--- a/include/linux/random.h
+++ b/include/linux/random.h
-@@ -20,7 +20,7 @@ struct random_ready_callback {
- extern void add_device_randomness(const void *, unsigned int);
+@@ -31,7 +31,7 @@ static inline void add_latent_entropy(vo
+
extern void add_input_randomness(unsigned int type, unsigned int code,
- unsigned int value);
--extern void add_interrupt_randomness(int irq, int irq_flags);
-+extern void add_interrupt_randomness(int irq, int irq_flags, __u64 ip);
+ unsigned int value) __latent_entropy;
+-extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy;
++extern void add_interrupt_randomness(int irq, int irq_flags, __u64 ip) __latent_entropy;
extern void get_random_bytes(void *buf, int nbytes);
extern int add_random_ready_callback(struct random_ready_callback *rdy);
diff --git a/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch b/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch
index 8f5c9c3..89487ec 100644
--- a/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch
+++ b/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Wed, 14 Sep 2016 11:52:17 +0200
Subject: rbtree: include rcu.h because we use it
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Since commit c1adf20052d8 ("Introduce rb_replace_node_rcu()")
rbtree_augmented.h uses RCU related data structures but does not include
diff --git a/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch b/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch
index 1617e2a..fe8c1e1 100644
--- a/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch
+++ b/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch
@@ -1,7 +1,7 @@
From: "Paul E. McKenney" <paulmck at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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,
@@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
-@@ -56,6 +56,11 @@
+@@ -55,6 +55,11 @@
#include <linux/random.h>
#include <linux/trace_events.h>
#include <linux/suspend.h>
@@ -40,8 +40,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/*
* Do RCU core processing for the current CPU.
*/
--static void rcu_process_callbacks(struct softirq_action *unused)
-+static void rcu_process_callbacks(void)
+-static __latent_entropy void rcu_process_callbacks(struct softirq_action *unused)
++static __latent_entropy void rcu_process_callbacks(void)
{
struct rcu_state *rsp;
@@ -169,7 +169,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/*
* Handle any core-RCU processing required by a call_rcu() invocation.
-@@ -4237,7 +4328,6 @@ void __init rcu_init(void)
+@@ -4261,7 +4352,6 @@ void __init rcu_init(void)
if (dump_tree)
rcu_dump_rcu_node_tree(&rcu_sched_state);
__rcu_init_preempt();
@@ -179,7 +179,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
* We don't need protection against CPU-hotplug here because
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
-@@ -595,12 +595,10 @@ extern struct rcu_state rcu_bh_state;
+@@ -596,12 +596,10 @@ extern struct rcu_state rcu_bh_state;
extern struct rcu_state rcu_preempt_state;
#endif /* #ifdef CONFIG_PREEMPT_RCU */
@@ -192,7 +192,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#ifndef RCU_TREE_NONCORE
-@@ -620,10 +618,9 @@ void call_rcu(struct rcu_head *head, rcu
+@@ -621,10 +619,9 @@ void call_rcu(struct rcu_head *head, rcu
static void __init __rcu_init_preempt(void);
static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags);
static void rcu_preempt_boost_start_gp(struct rcu_node *rnp);
diff --git a/debian/patches/features/all/rt/rcu-disable-more-spots-of-rcu_bh.patch b/debian/patches/features/all/rt/rcu-disable-more-spots-of-rcu_bh.patch
deleted file mode 100644
index d55b9c1..0000000
--- a/debian/patches/features/all/rt/rcu-disable-more-spots-of-rcu_bh.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Wed, 10 Feb 2016 18:30:56 +0100
-Subject: rcu: disable more spots of rcu_bh
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-We don't use ru_bh on -RT but we still fork a thread for it and keep it
-as a flavour. No more.
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- kernel/rcu/tree.c | 6 ++++++
- kernel/rcu/tree.h | 2 ++
- 2 files changed, 8 insertions(+)
-
---- a/kernel/rcu/tree.c
-+++ b/kernel/rcu/tree.c
-@@ -440,11 +440,13 @@ EXPORT_SYMBOL_GPL(rcu_batches_started_sc
- /*
- * Return the number of RCU BH batches started thus far for debug & stats.
- */
-+#ifndef CONFIG_PREEMPT_RT_FULL
- unsigned long rcu_batches_started_bh(void)
- {
- return rcu_bh_state.gpnum;
- }
- EXPORT_SYMBOL_GPL(rcu_batches_started_bh);
-+#endif
-
- /*
- * Return the number of RCU batches completed thus far for debug & stats.
-@@ -549,9 +551,11 @@ void rcutorture_get_gp_data(enum rcutort
- case RCU_FLAVOR:
- rsp = rcu_state_p;
- break;
-+#ifndef CONFIG_PREEMPT_RT_FULL
- case RCU_BH_FLAVOR:
- rsp = &rcu_bh_state;
- break;
-+#endif
- case RCU_SCHED_FLAVOR:
- rsp = &rcu_sched_state;
- break;
-@@ -4637,7 +4641,9 @@ void __init rcu_init(void)
-
- rcu_bootup_announce();
- rcu_init_geometry();
-+#ifndef CONFIG_PREEMPT_RT_FULL
- rcu_init_one(&rcu_bh_state);
-+#endif
- rcu_init_one(&rcu_sched_state);
- if (dump_tree)
- rcu_dump_rcu_node_tree(&rcu_sched_state);
---- a/kernel/rcu/tree.h
-+++ b/kernel/rcu/tree.h
-@@ -572,7 +572,9 @@ extern struct list_head rcu_struct_flavo
- */
- extern struct rcu_state rcu_sched_state;
-
-+#ifndef CONFIG_PREEMPT_RT_FULL
- extern struct rcu_state rcu_bh_state;
-+#endif
-
- #ifdef CONFIG_PREEMPT_RCU
- extern struct rcu_state rcu_preempt_state;
diff --git a/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch b/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch
index f8bbf9a..338dce6 100644
--- a/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch
+++ b/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch
@@ -1,7 +1,7 @@
Subject: rcu: Disable RCU_FAST_NO_HZ on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 28 Oct 2012 13:26:09 +0000
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
This uses a timer_list timer from the irq disabled guts of the idle
code. Disable it for now to prevent wreckage.
@@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -613,7 +613,7 @@ config RCU_FANOUT_LEAF
+@@ -623,7 +623,7 @@ config RCU_FANOUT_LEAF
config RCU_FAST_NO_HZ
bool "Accelerate last non-dyntick-idle CPU's grace periods"
diff --git a/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch b/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch
index c7005ff..7bdf664 100644
--- a/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch
+++ b/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch
@@ -1,7 +1,7 @@
From: Julia Cartwright <julia at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The forcing of an expedited grace period is an expensive and very
RT-application unfriendly operation, as it forcibly preempts all running
@@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
-@@ -63,7 +63,7 @@ MODULE_ALIAS("rcupdate");
+@@ -62,7 +62,7 @@
#ifndef CONFIG_TINY_RCU
module_param(rcu_expedited, int, 0);
module_param(rcu_normal, int, 0);
diff --git a/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch b/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch
index a81bd7a..eb39256 100644
--- a/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch
+++ b/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -15,7 +15,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -496,7 +496,7 @@ config TINY_RCU
+@@ -506,7 +506,7 @@ config TINY_RCU
config RCU_EXPERT
bool "Make expert-level adjustments to RCU configuration"
@@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
help
This option needs to be enabled if you wish to make
expert-level adjustments to RCU configuration. By default,
-@@ -640,7 +640,7 @@ config TREE_RCU_TRACE
+@@ -650,7 +650,7 @@ config TREE_RCU_TRACE
config RCU_BOOST
bool "Enable RCU priority boosting"
depends on RT_MUTEXES && PREEMPT_RCU && RCU_EXPERT
diff --git a/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch b/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch
index 15fd70c..2aea56b 100644
--- a/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch
+++ b/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch
@@ -1,7 +1,7 @@
Subject: rcu: Merge RCU-bh into RCU-preempt
Date: Wed, 5 Oct 2011 11:59:38 -0700
From: Thomas Gleixner <tglx at linutronix.de>
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The Linux kernel has long RCU-bh read-side critical sections that
intolerably increase scheduling latency under mainline's RCU-bh rules,
@@ -64,8 +64,8 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
+#endif
void rcu_check_callbacks(int user);
void rcu_report_dead(unsigned int cpu);
-
-@@ -508,7 +516,14 @@ extern struct lockdep_map rcu_callback_m
+ void rcu_cpu_starting(unsigned int cpu);
+@@ -509,7 +517,14 @@ extern struct lockdep_map rcu_callback_m
int debug_lockdep_rcu_enabled(void);
int rcu_read_lock_held(void);
@@ -80,7 +80,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/**
* rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section?
-@@ -906,10 +921,14 @@ static inline void rcu_read_unlock(void)
+@@ -907,10 +922,14 @@ static inline void rcu_read_unlock(void)
static inline void rcu_read_lock_bh(void)
{
local_bh_disable();
@@ -95,7 +95,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -919,10 +938,14 @@ static inline void rcu_read_lock_bh(void
+@@ -920,10 +939,14 @@ static inline void rcu_read_lock_bh(void
*/
static inline void rcu_read_unlock_bh(void)
{
@@ -196,7 +196,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
* The names includes "busted", and they really means it!
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
-@@ -259,6 +259,7 @@ void rcu_sched_qs(void)
+@@ -257,6 +257,7 @@ void rcu_sched_qs(void)
this_cpu_ptr(&rcu_sched_data), true);
}
@@ -204,7 +204,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void rcu_bh_qs(void)
{
if (__this_cpu_read(rcu_bh_data.cpu_no_qs.s)) {
-@@ -268,6 +269,7 @@ void rcu_bh_qs(void)
+@@ -266,6 +267,7 @@ void rcu_bh_qs(void)
__this_cpu_write(rcu_bh_data.cpu_no_qs.b.norm, false);
}
}
@@ -212,7 +212,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
static DEFINE_PER_CPU(int, rcu_sched_qs_mask);
-@@ -448,11 +450,13 @@ EXPORT_SYMBOL_GPL(rcu_batches_started_sc
+@@ -446,11 +448,13 @@ EXPORT_SYMBOL_GPL(rcu_batches_started_sc
/*
* Return the number of RCU BH batches started thus far for debug & stats.
*/
@@ -226,7 +226,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Return the number of RCU batches completed thus far for debug & stats.
-@@ -472,6 +476,7 @@ unsigned long rcu_batches_completed_sche
+@@ -470,6 +474,7 @@ unsigned long rcu_batches_completed_sche
}
EXPORT_SYMBOL_GPL(rcu_batches_completed_sched);
@@ -234,7 +234,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Return the number of RCU BH batches completed thus far for debug & stats.
*/
-@@ -480,6 +485,7 @@ unsigned long rcu_batches_completed_bh(v
+@@ -478,6 +483,7 @@ unsigned long rcu_batches_completed_bh(v
return rcu_bh_state.completed;
}
EXPORT_SYMBOL_GPL(rcu_batches_completed_bh);
@@ -242,7 +242,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Return the number of RCU expedited batches completed thus far for
-@@ -503,6 +509,7 @@ unsigned long rcu_exp_batches_completed_
+@@ -501,6 +507,7 @@ unsigned long rcu_exp_batches_completed_
}
EXPORT_SYMBOL_GPL(rcu_exp_batches_completed_sched);
@@ -250,7 +250,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Force a quiescent state.
*/
-@@ -521,6 +528,13 @@ void rcu_bh_force_quiescent_state(void)
+@@ -519,6 +526,13 @@ void rcu_bh_force_quiescent_state(void)
}
EXPORT_SYMBOL_GPL(rcu_bh_force_quiescent_state);
@@ -264,7 +264,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Force a quiescent state for RCU-sched.
*/
-@@ -571,9 +585,11 @@ void rcutorture_get_gp_data(enum rcutort
+@@ -569,9 +583,11 @@ void rcutorture_get_gp_data(enum rcutort
case RCU_FLAVOR:
rsp = rcu_state_p;
break;
@@ -324,7 +324,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/**
* rcu_barrier_sched - Wait for in-flight call_rcu_sched() callbacks.
-@@ -4196,7 +4218,9 @@ void __init rcu_init(void)
+@@ -4220,7 +4242,9 @@ void __init rcu_init(void)
rcu_bootup_announce();
rcu_init_geometry();
@@ -336,7 +336,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
rcu_dump_rcu_node_tree(&rcu_sched_state);
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
-@@ -587,7 +587,9 @@ extern struct list_head rcu_struct_flavo
+@@ -588,7 +588,9 @@ extern struct list_head rcu_struct_flavo
*/
extern struct rcu_state rcu_sched_state;
@@ -348,7 +348,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
extern struct rcu_state rcu_preempt_state;
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
-@@ -293,6 +293,7 @@ int rcu_read_lock_held(void)
+@@ -292,6 +292,7 @@ int rcu_read_lock_held(void)
}
EXPORT_SYMBOL_GPL(rcu_read_lock_held);
@@ -356,7 +356,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/**
* rcu_read_lock_bh_held() - might we be in RCU-bh read-side critical section?
*
-@@ -319,6 +320,7 @@ int rcu_read_lock_bh_held(void)
+@@ -318,6 +319,7 @@ int rcu_read_lock_bh_held(void)
return in_softirq() || irqs_disabled();
}
EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held);
diff --git a/debian/patches/features/all/rt/rcu-update-make-RCU_EXPEDITE_BOOT-default.patch b/debian/patches/features/all/rt/rcu-update-make-RCU_EXPEDITE_BOOT-default.patch
index 55750f9..6af6490 100644
--- a/debian/patches/features/all/rt/rcu-update-make-RCU_EXPEDITE_BOOT-default.patch
+++ b/debian/patches/features/all/rt/rcu-update-make-RCU_EXPEDITE_BOOT-default.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Wed, 2 Nov 2016 16:45:58 +0100
Subject: [PATCH] rcu: update: make RCU_EXPEDITE_BOOT default
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
RCU_EXPEDITE_BOOT should speed up the boot process by enforcing
synchronize_rcu_expedited() instead of synchronize_rcu() during the boot
@@ -17,7 +17,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -771,19 +771,6 @@ config RCU_NOCB_CPU_ALL
+@@ -781,19 +781,6 @@ config RCU_NOCB_CPU_ALL
endchoice
@@ -39,7 +39,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
config BUILD_BIN2C
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
-@@ -130,8 +130,7 @@ bool rcu_gp_is_normal(void)
+@@ -129,8 +129,7 @@ bool rcu_gp_is_normal(void)
}
EXPORT_SYMBOL_GPL(rcu_gp_is_normal);
@@ -49,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/*
* Should normal grace-period primitives be expedited? Intended for
-@@ -179,8 +178,7 @@ EXPORT_SYMBOL_GPL(rcu_unexpedite_gp);
+@@ -178,8 +177,7 @@ EXPORT_SYMBOL_GPL(rcu_unexpedite_gp);
*/
void rcu_end_inkernel_boot(void)
{
diff --git a/debian/patches/features/all/rt/rcutorture-comment-out-rcu_bh-ops-on-PREEMPT_RT_FULL.patch b/debian/patches/features/all/rt/rcutorture-comment-out-rcu_bh-ops-on-PREEMPT_RT_FULL.patch
deleted file mode 100644
index ecdfb55..0000000
--- a/debian/patches/features/all/rt/rcutorture-comment-out-rcu_bh-ops-on-PREEMPT_RT_FULL.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From: Clark Williams <williams at redhat.com>
-Date: Fri, 26 Feb 2016 13:19:20 -0600
-Subject: rcu/torture: Comment out rcu_bh ops on PREEMPT_RT_FULL
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-RT has dropped support of rcu_bh, comment out in rcutorture.
-
-Signed-off-by: Clark Williams <williams at redhat.com>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
----
- kernel/rcu/rcutorture.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
---- a/kernel/rcu/rcutorture.c
-+++ b/kernel/rcu/rcutorture.c
-@@ -409,6 +409,7 @@ static struct rcu_torture_ops rcu_ops =
- .name = "rcu"
- };
-
-+#ifndef CONFIG_PREEMPT_RT_FULL
- /*
- * Definitions for rcu_bh torture testing.
- */
-@@ -448,6 +449,12 @@ static struct rcu_torture_ops rcu_bh_ops
- .name = "rcu_bh"
- };
-
-+#else
-+static struct rcu_torture_ops rcu_bh_ops = {
-+ .ttype = INVALID_RCU_FLAVOR,
-+};
-+#endif
-+
- /*
- * Don't even think about trying any of these in real life!!!
- * The names includes "busted", and they really means it!
diff --git a/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch b/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch
index eb788ec..7cd0d73 100644
--- a/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch
+++ b/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch
@@ -1,7 +1,7 @@
From: Tiejun Chen <tiejun.chen at windriver.com>
Date: Wed, 18 Dec 2013 17:51:49 +0800
Subject: rcutree/rcu_bh_qs: Disable irq while calling rcu_preempt_qs()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Any callers to the function rcu_preempt_qs() must disable irqs in
order to protect the assignment to ->rcu_read_unlock_special. In
@@ -34,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
-@@ -264,7 +264,12 @@ static void rcu_preempt_qs(void);
+@@ -262,7 +262,12 @@ static void rcu_preempt_qs(void);
void rcu_bh_qs(void)
{
diff --git a/debian/patches/features/all/rt/re-migrate_disable-race-with-cpu-hotplug-3f.patch b/debian/patches/features/all/rt/re-migrate_disable-race-with-cpu-hotplug-3f.patch
index 9d1d03d..23b4ae0 100644
--- a/debian/patches/features/all/rt/re-migrate_disable-race-with-cpu-hotplug-3f.patch
+++ b/debian/patches/features/all/rt/re-migrate_disable-race-with-cpu-hotplug-3f.patch
@@ -1,7 +1,7 @@
From: Yong Zhang <yong.zhang0 at gmail.com>
Date: Thu, 28 Jul 2011 11:16:00 +0800
Subject: hotplug: Reread hotplug_pcp on pin_current_cpu() retry
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
When retry happens, it's likely that the task has been migrated to
another cpu (except unplug failed), but it still derefernces the
@@ -20,7 +20,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
-@@ -184,9 +184,11 @@ static DEFINE_PER_CPU(struct hotplug_pcp
+@@ -257,9 +257,11 @@ static DEFINE_PER_CPU(struct hotplug_pcp
*/
void pin_current_cpu(void)
{
diff --git a/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch b/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch
index 820fdbf..e0e1f99 100644
--- a/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch
+++ b/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch
@@ -1,7 +1,7 @@
Subject: ARM: Initialize split page table locks for vector page
From: Frank Rowand <frank.rowand at am.sony.com>
Date: Sat, 1 Oct 2011 18:58:13 -0700
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Without this patch, ARM can not use SPLIT_PTLOCK_CPUS if
PREEMPT_RT_FULL=y because vectors_user_mapping() creates a
@@ -36,7 +36,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
-@@ -323,6 +323,30 @@ unsigned long arch_randomize_brk(struct
+@@ -322,6 +322,30 @@ unsigned long arch_randomize_brk(struct
}
#ifdef CONFIG_MMU
diff --git a/debian/patches/features/all/rt/relay-fix-timer-madness.patch b/debian/patches/features/all/rt/relay-fix-timer-madness.patch
deleted file mode 100644
index 1e150bd..0000000
--- a/debian/patches/features/all/rt/relay-fix-timer-madness.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From: Ingo Molnar <mingo at elte.hu>
-Date: Fri, 3 Jul 2009 08:44:07 -0500
-Subject: relay: Fix timer madness
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-remove timer calls (!!!) from deep within the tracing infrastructure.
-This was totally bogus code that can cause lockups and worse. Poll
-the buffer every 2 jiffies for now.
-
-Signed-off-by: Ingo Molnar <mingo at elte.hu>
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
-
----
- kernel/relay.c | 14 +++++---------
- 1 file changed, 5 insertions(+), 9 deletions(-)
-
---- a/kernel/relay.c
-+++ b/kernel/relay.c
-@@ -336,6 +336,10 @@ static void wakeup_readers(unsigned long
- {
- struct rchan_buf *buf = (struct rchan_buf *)data;
- wake_up_interruptible(&buf->read_wait);
-+ /*
-+ * Stupid polling for now:
-+ */
-+ mod_timer(&buf->timer, jiffies + 1);
- }
-
- /**
-@@ -353,6 +357,7 @@ static void __relay_reset(struct rchan_b
- init_waitqueue_head(&buf->read_wait);
- kref_init(&buf->kref);
- setup_timer(&buf->timer, wakeup_readers, (unsigned long)buf);
-+ mod_timer(&buf->timer, jiffies + 1);
- } else
- del_timer_sync(&buf->timer);
-
-@@ -767,15 +772,6 @@ size_t relay_switch_subbuf(struct rchan_
- else
- buf->early_bytes += buf->chan->subbuf_size -
- buf->padding[old_subbuf];
-- smp_mb();
-- if (waitqueue_active(&buf->read_wait))
-- /*
-- * Calling wake_up_interruptible() from here
-- * will deadlock if we happen to be logging
-- * from the scheduler (trying to re-grab
-- * rq->lock), so defer it.
-- */
-- mod_timer(&buf->timer, jiffies + 1);
- }
-
- old = buf->data;
diff --git a/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch b/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch
index 5151c8a..6aaa144 100644
--- a/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch
+++ b/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch
@@ -1,7 +1,7 @@
Subject: ARM: smp: Move clear_tasks_mm_cpumask() call to __cpu_die()
From: Grygorii Strashko <grygorii.strashko at ti.com>
Date: Fri, 11 Sep 2015 21:21:23 +0300
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
When running with the RT-kernel (4.1.5-rt5) on TI OMAP dra7-evm and trying
to do Suspend to RAM, the following backtrace occurs:
diff --git a/debian/patches/features/all/rt/rt-add-rt-locks.patch b/debian/patches/features/all/rt/rt-add-rt-locks.patch
index ee3eba6..4486347 100644
--- a/debian/patches/features/all/rt/rt-add-rt-locks.patch
+++ b/debian/patches/features/all/rt/rt-add-rt-locks.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 26 Jul 2009 19:39:56 +0200
Subject: rt: Add the preempt-rt lock replacement APIs
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Map spinlocks, rwlocks, rw_semaphores and semaphores to the rt_mutex
based locking functions for preempt-rt.
@@ -613,7 +613,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Task command name length */
#define TASK_COMM_LEN 16
-@@ -1009,8 +1014,18 @@ struct wake_q_head {
+@@ -1013,8 +1018,18 @@ struct wake_q_head {
struct wake_q_head name = { WAKE_Q_TAIL, &name.first }
extern void wake_q_add(struct wake_q_head *head,
@@ -916,7 +916,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
+#endif
--- a/kernel/futex.c
+++ b/kernel/futex.c
-@@ -1292,6 +1292,7 @@ static int wake_futex_pi(u32 __user *uad
+@@ -1301,6 +1301,7 @@ static int wake_futex_pi(u32 __user *uad
struct futex_pi_state *pi_state = this->pi_state;
u32 uninitialized_var(curval), newval;
WAKE_Q(wake_q);
@@ -924,7 +924,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
bool deboost;
int ret = 0;
-@@ -1358,7 +1359,8 @@ static int wake_futex_pi(u32 __user *uad
+@@ -1367,7 +1368,8 @@ static int wake_futex_pi(u32 __user *uad
raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock);
@@ -934,7 +934,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* First unlock HB so the waiter does not spin on it once he got woken
-@@ -1368,6 +1370,7 @@ static int wake_futex_pi(u32 __user *uad
+@@ -1377,6 +1379,7 @@ static int wake_futex_pi(u32 __user *uad
*/
spin_unlock(&hb->lock);
wake_up_q(&wake_q);
@@ -942,7 +942,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (deboost)
rt_mutex_adjust_prio(current);
-@@ -2842,10 +2845,7 @@ static int futex_wait_requeue_pi(u32 __u
+@@ -2851,10 +2854,7 @@ static int futex_wait_requeue_pi(u32 __u
* The waiter is allocated on our stack, manipulated by the requeue
* code while we sleep on uaddr.
*/
@@ -977,7 +977,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
obj-$(CONFIG_LOCKDEP) += lockdep.o
ifeq ($(CONFIG_PROC_FS),y)
obj-$(CONFIG_LOCKDEP) += lockdep_proc.o
-@@ -25,7 +29,10 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o
+@@ -24,7 +28,10 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o
obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
@@ -2121,7 +2121,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef CONFIG_DEBUG_RT_MUTEXES
unsigned long ip;
struct pid *deadlock_task_pid;
-@@ -113,7 +114,8 @@ extern int rt_mutex_finish_proxy_lock(st
+@@ -114,7 +115,8 @@ extern int rt_mutex_finish_proxy_lock(st
struct rt_mutex_waiter *waiter);
extern int rt_mutex_timed_futex_lock(struct rt_mutex *l, struct hrtimer_sleeper *to);
extern bool rt_mutex_futex_unlock(struct rt_mutex *lock,
@@ -2131,7 +2131,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
extern void rt_mutex_adjust_prio(struct task_struct *task);
#ifdef CONFIG_DEBUG_RT_MUTEXES
-@@ -122,4 +124,14 @@ extern void rt_mutex_adjust_prio(struct
+@@ -123,4 +125,14 @@ extern void rt_mutex_adjust_prio(struct
# include "rtmutex.h"
#endif
diff --git a/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch b/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch
index 1eee7a5..5cc0514 100644
--- a/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch
+++ b/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch
@@ -1,7 +1,7 @@
Subject: rt: Introduce cpu_chill()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 07 Mar 2012 20:51:03 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Retry loops on RT might loop forever when the modifying side was
preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill()
diff --git a/debian/patches/features/all/rt/rt-local-irq-lock.patch b/debian/patches/features/all/rt/rt-local-irq-lock.patch
index e8d5aef..d7c43bf 100644
--- a/debian/patches/features/all/rt/rt-local-irq-lock.patch
+++ b/debian/patches/features/all/rt/rt-local-irq-lock.patch
@@ -1,7 +1,7 @@
Subject: rt: Add local irq locks
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 20 Jun 2011 09:03:47 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/rt-locking-Reenable-migration-accross-schedule.patch b/debian/patches/features/all/rt/rt-locking-Reenable-migration-accross-schedule.patch
index 40c1621..b22752c 100644
--- a/debian/patches/features/all/rt/rt-locking-Reenable-migration-accross-schedule.patch
+++ b/debian/patches/features/all/rt/rt-locking-Reenable-migration-accross-schedule.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 8 Feb 2016 16:15:28 +0100
Subject: rt/locking: Reenable migration accross schedule
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
We currently disable migration across lock acquisition. That includes the part
where we block on the lock and schedule out. We cannot disable migration after
diff --git a/debian/patches/features/all/rt/rt-preempt-base-config.patch b/debian/patches/features/all/rt/rt-preempt-base-config.patch
index ccf5592..768d7ee 100644
--- a/debian/patches/features/all/rt/rt-preempt-base-config.patch
+++ b/debian/patches/features/all/rt/rt-preempt-base-config.patch
@@ -1,7 +1,7 @@
Subject: rt: Provide PREEMPT_RT_BASE config switch
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 17 Jun 2011 12:39:57 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Introduce PREEMPT_RT_BASE which enables parts of
PREEMPT_RT_FULL. Forces interrupt threading and enables some of the RT
diff --git a/debian/patches/features/all/rt/rt-serial-warn-fix.patch b/debian/patches/features/all/rt/rt-serial-warn-fix.patch
index 4cdc011..eed663a 100644
--- a/debian/patches/features/all/rt/rt-serial-warn-fix.patch
+++ b/debian/patches/features/all/rt/rt-serial-warn-fix.patch
@@ -1,7 +1,7 @@
Subject: rt: Improve the serial console PASS_LIMIT
From: Ingo Molnar <mingo at elte.hu>
Date: Wed Dec 14 13:05:54 CET 2011
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Beyond the warning:
diff --git a/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully b/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully
deleted file mode 100644
index 2b0b2ff..0000000
--- a/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully
+++ /dev/null
@@ -1,33 +0,0 @@
-Subject: rtmutex: Handle non enqueued waiters gracefully
-From: Thomas Gleixner <tglx at linutronix.de>
-Date: Fri, 06 Nov 2015 18:51:03 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz
-
-Yimin debugged that in case of a PI wakeup in progress when
-rt_mutex_start_proxy_lock() calls task_blocks_on_rt_mutex() the latter
-returns -EAGAIN and in consequence the remove_waiter() call runs into
-a BUG_ON() because there is nothing to remove.
-
-Guard it with rt_mutex_has_waiters(). This is a quick fix which is
-easy to backport. The proper fix is to have a central check in
-remove_waiter() so we can call it unconditionally.
-
-Reported-and-debugged-by: Yimin Deng <yimin11.deng at gmail.com>
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
-Cc: stable-rt at vger.kernel.org
-
----
- kernel/locking/rtmutex.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/kernel/locking/rtmutex.c
-+++ b/kernel/locking/rtmutex.c
-@@ -1617,7 +1617,7 @@ int rt_mutex_start_proxy_lock(struct rt_
- ret = 0;
- }
-
-- if (unlikely(ret))
-+ if (ret && rt_mutex_has_waiters(lock))
- remove_waiter(lock, waiter);
-
- raw_spin_unlock(&lock->wait_lock);
diff --git a/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch b/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch
index 65d5741..2a62e8a 100644
--- a/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch
+++ b/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch
@@ -1,7 +1,7 @@
Subject: rtmutex: Handle non enqueued waiters gracefully
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 06 Nov 2015 18:51:03 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Yimin debugged that in case of a PI wakeup in progress when
rt_mutex_start_proxy_lock() calls task_blocks_on_rt_mutex() the latter
@@ -22,7 +22,7 @@ Cc: stable-rt at vger.kernel.org
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
-@@ -1626,7 +1626,7 @@ int rt_mutex_start_proxy_lock(struct rt_
+@@ -1690,7 +1690,7 @@ int rt_mutex_start_proxy_lock(struct rt_
ret = 0;
}
diff --git a/debian/patches/features/all/rt/rtmutex-Use-chainwalking-control-enum.patch b/debian/patches/features/all/rt/rtmutex-Use-chainwalking-control-enum.patch
deleted file mode 100644
index 7ce43cf..0000000
--- a/debian/patches/features/all/rt/rtmutex-Use-chainwalking-control-enum.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: "bmouring at ni.com" <bmouring at ni.com>
-Date: Tue, 15 Dec 2015 17:07:30 -0600
-Subject: rtmutex: Use chainwalking control enum
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-In 8930ed80 (rtmutex: Cleanup deadlock detector debug logic),
-chainwalking control enums were introduced to limit the deadlock
-detection logic. One of the calls to task_blocks_on_rt_mutex was
-missed when converting to use the enums.
-
-Cc: Thomas Gleixner <tglx at linutronix.de>
-Signed-off-by: Brad Mouring <brad.mouring at ni.com>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- kernel/locking/rtmutex.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/kernel/locking/rtmutex.c
-+++ b/kernel/locking/rtmutex.c
-@@ -1017,7 +1017,7 @@ static void noinline __sched rt_spin_lo
- __set_current_state_no_track(TASK_UNINTERRUPTIBLE);
- raw_spin_unlock(&self->pi_lock);
-
-- ret = task_blocks_on_rt_mutex(lock, &waiter, self, 0);
-+ ret = task_blocks_on_rt_mutex(lock, &waiter, self, RT_MUTEX_MIN_CHAINWALK);
- BUG_ON(ret);
-
- for (;;) {
diff --git a/debian/patches/features/all/rt/rtmutex-add-a-first-shot-of-ww_mutex.patch b/debian/patches/features/all/rt/rtmutex-add-a-first-shot-of-ww_mutex.patch
index 9e6db42..a336422 100644
--- a/debian/patches/features/all/rt/rtmutex-add-a-first-shot-of-ww_mutex.patch
+++ b/debian/patches/features/all/rt/rtmutex-add-a-first-shot-of-ww_mutex.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <sebastian at breakpoint.cc>
Date: Mon, 28 Oct 2013 09:36:37 +0100
Subject: rtmutex: Add RT aware ww locks
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
lockdep says:
| --------------------------------------------------------------------------
diff --git a/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch b/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch
index 812cc69..4a8107d 100644
--- a/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch
+++ b/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch
@@ -1,7 +1,7 @@
Subject: rtmutex: Avoid include hell
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 29 Jun 2011 20:06:39 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
diff --git a/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch b/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch
index 3c14570..4bd0618 100644
--- a/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch
+++ b/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch
@@ -1,7 +1,7 @@
Subject: rtmutex: Handle the various new futex race conditions
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 10 Jun 2011 11:04:15 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/futex.c
+++ b/kernel/futex.c
-@@ -1915,6 +1915,16 @@ static int futex_requeue(u32 __user *uad
+@@ -1924,6 +1924,16 @@ static int futex_requeue(u32 __user *uad
requeue_pi_wake_futex(this, &key2, hb2);
drop_count++;
continue;
@@ -33,7 +33,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
} else if (ret) {
/*
* rt_mutex_start_proxy_lock() detected a
-@@ -2805,7 +2815,7 @@ static int futex_wait_requeue_pi(u32 __u
+@@ -2814,7 +2824,7 @@ static int futex_wait_requeue_pi(u32 __u
struct hrtimer_sleeper timeout, *to = NULL;
struct rt_mutex_waiter rt_waiter;
struct rt_mutex *pi_mutex = NULL;
@@ -42,7 +42,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
union futex_key key2 = FUTEX_KEY_INIT;
struct futex_q q = futex_q_init;
int res, ret;
-@@ -2864,20 +2874,55 @@ static int futex_wait_requeue_pi(u32 __u
+@@ -2873,20 +2883,55 @@ static int futex_wait_requeue_pi(u32 __u
/* Queue the futex_q, drop the hb lock, wait for wakeup. */
futex_wait_queue_me(hb, &q, to);
@@ -109,7 +109,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Check if the requeue code acquired the second futex for us. */
if (!q.rt_waiter) {
-@@ -2886,14 +2931,15 @@ static int futex_wait_requeue_pi(u32 __u
+@@ -2895,14 +2940,15 @@ static int futex_wait_requeue_pi(u32 __u
* did a lock-steal - fix up the PI-state in that case.
*/
if (q.pi_state && (q.pi_state->owner != current)) {
@@ -127,7 +127,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
} else {
/*
-@@ -2906,7 +2952,8 @@ static int futex_wait_requeue_pi(u32 __u
+@@ -2915,7 +2961,8 @@ static int futex_wait_requeue_pi(u32 __u
ret = rt_mutex_finish_proxy_lock(pi_mutex, to, &rt_waiter);
debug_rt_mutex_free_waiter(&rt_waiter);
@@ -233,7 +233,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return;
--- a/kernel/locking/rtmutex_common.h
+++ b/kernel/locking/rtmutex_common.h
-@@ -97,6 +97,8 @@ enum rtmutex_chainwalk {
+@@ -98,6 +98,8 @@ enum rtmutex_chainwalk {
/*
* PI-futex support (proxy locking functions, etc.):
*/
diff --git a/debian/patches/features/all/rt/rtmutex-lock-killable.patch b/debian/patches/features/all/rt/rtmutex-lock-killable.patch
index f7f42a7..344fe77 100644
--- a/debian/patches/features/all/rt/rtmutex-lock-killable.patch
+++ b/debian/patches/features/all/rt/rtmutex-lock-killable.patch
@@ -1,7 +1,7 @@
Subject: rtmutex: Add rtmutex_lock_killable()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 09 Jun 2011 11:43:52 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Add "killable" type to rtmutex. We need this since rtmutex are used as
"normal" mutexes which do use this type.
diff --git a/debian/patches/features/all/rt/rtmutex-push-down-migrate_disable-into-rt_spin_lock.patch b/debian/patches/features/all/rt/rtmutex-push-down-migrate_disable-into-rt_spin_lock.patch
deleted file mode 100644
index 8aa01f2..0000000
--- a/debian/patches/features/all/rt/rtmutex-push-down-migrate_disable-into-rt_spin_lock.patch
+++ /dev/null
@@ -1,272 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Fri, 5 Feb 2016 18:26:11 +0100
-Subject: rtmutex: push down migrate_disable() into rt_spin_lock()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-No point in having the migrate disable/enable invocations in all the
-macro/inlines. That's just more code for no win as we do a function
-call anyway. Move it to the core code and save quite some text size.
-
- text data bss dec filename
-11034127 3676912 14901248 29612287 vmlinux.before
-10990437 3676848 14901248 29568533 vmlinux.after
-
-~-40KiB
-
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- include/linux/locallock.h | 6 +++---
- include/linux/spinlock_rt.h | 25 +++++++------------------
- kernel/cpu.c | 4 ++--
- kernel/locking/lglock.c | 2 +-
- kernel/locking/rt.c | 2 --
- kernel/locking/rtmutex.c | 44 +++++++++++++++++++++++++++++++++++++++++---
- 6 files changed, 54 insertions(+), 29 deletions(-)
-
---- a/include/linux/locallock.h
-+++ b/include/linux/locallock.h
-@@ -43,9 +43,9 @@ struct local_irq_lock {
- * for CONFIG_PREEMPT_BASE map to the normal spin_* calls.
- */
- #ifdef CONFIG_PREEMPT_RT_FULL
--# define spin_lock_local(lock) rt_spin_lock(lock)
--# define spin_trylock_local(lock) rt_spin_trylock(lock)
--# define spin_unlock_local(lock) rt_spin_unlock(lock)
-+# define spin_lock_local(lock) rt_spin_lock__no_mg(lock)
-+# define spin_trylock_local(lock) rt_spin_trylock__no_mg(lock)
-+# define spin_unlock_local(lock) rt_spin_unlock__no_mg(lock)
- #else
- # define spin_lock_local(lock) spin_lock(lock)
- # define spin_trylock_local(lock) spin_trylock(lock)
---- a/include/linux/spinlock_rt.h
-+++ b/include/linux/spinlock_rt.h
-@@ -18,6 +18,10 @@ do { \
- __rt_spin_lock_init(slock, #slock, &__key); \
- } while (0)
-
-+void __lockfunc rt_spin_lock__no_mg(spinlock_t *lock);
-+void __lockfunc rt_spin_unlock__no_mg(spinlock_t *lock);
-+int __lockfunc rt_spin_trylock__no_mg(spinlock_t *lock);
-+
- extern void __lockfunc rt_spin_lock(spinlock_t *lock);
- extern unsigned long __lockfunc rt_spin_lock_trace_flags(spinlock_t *lock);
- extern void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass);
-@@ -32,20 +36,16 @@ extern int atomic_dec_and_spin_lock(atom
- * lockdep-less calls, for derived types like rwlock:
- * (for trylock they can use rt_mutex_trylock() directly.
- */
-+extern void __lockfunc __rt_spin_lock__no_mg(struct rt_mutex *lock);
- extern void __lockfunc __rt_spin_lock(struct rt_mutex *lock);
- extern void __lockfunc __rt_spin_unlock(struct rt_mutex *lock);
- extern int __lockfunc __rt_spin_trylock(struct rt_mutex *lock);
-
--#define spin_lock(lock) \
-- do { \
-- migrate_disable(); \
-- rt_spin_lock(lock); \
-- } while (0)
-+#define spin_lock(lock) rt_spin_lock(lock)
-
- #define spin_lock_bh(lock) \
- do { \
- local_bh_disable(); \
-- migrate_disable(); \
- rt_spin_lock(lock); \
- } while (0)
-
-@@ -56,24 +56,19 @@ extern int __lockfunc __rt_spin_trylock(
- #define spin_trylock(lock) \
- ({ \
- int __locked; \
-- migrate_disable(); \
- __locked = spin_do_trylock(lock); \
-- if (!__locked) \
-- migrate_enable(); \
- __locked; \
- })
-
- #ifdef CONFIG_LOCKDEP
- # define spin_lock_nested(lock, subclass) \
- do { \
-- migrate_disable(); \
- rt_spin_lock_nested(lock, subclass); \
- } while (0)
-
- #define spin_lock_bh_nested(lock, subclass) \
- do { \
- local_bh_disable(); \
-- migrate_disable(); \
- rt_spin_lock_nested(lock, subclass); \
- } while (0)
-
-@@ -81,7 +76,6 @@ extern int __lockfunc __rt_spin_trylock(
- do { \
- typecheck(unsigned long, flags); \
- flags = 0; \
-- migrate_disable(); \
- rt_spin_lock_nested(lock, subclass); \
- } while (0)
- #else
-@@ -117,16 +111,11 @@ static inline unsigned long spin_lock_tr
- /* FIXME: we need rt_spin_lock_nest_lock */
- #define spin_lock_nest_lock(lock, nest_lock) spin_lock_nested(lock, 0)
-
--#define spin_unlock(lock) \
-- do { \
-- rt_spin_unlock(lock); \
-- migrate_enable(); \
-- } while (0)
-+#define spin_unlock(lock) rt_spin_unlock(lock)
-
- #define spin_unlock_bh(lock) \
- do { \
- rt_spin_unlock(lock); \
-- migrate_enable(); \
- local_bh_enable(); \
- } while (0)
-
---- a/kernel/cpu.c
-+++ b/kernel/cpu.c
-@@ -204,8 +204,8 @@ struct hotplug_pcp {
- };
-
- #ifdef CONFIG_PREEMPT_RT_FULL
--# define hotplug_lock(hp) rt_spin_lock(&(hp)->lock)
--# define hotplug_unlock(hp) rt_spin_unlock(&(hp)->lock)
-+# define hotplug_lock(hp) rt_spin_lock__no_mg(&(hp)->lock)
-+# define hotplug_unlock(hp) rt_spin_unlock__no_mg(&(hp)->lock)
- #else
- # define hotplug_lock(hp) mutex_lock(&(hp)->mutex)
- # define hotplug_unlock(hp) mutex_unlock(&(hp)->mutex)
---- a/kernel/locking/lglock.c
-+++ b/kernel/locking/lglock.c
-@@ -10,7 +10,7 @@
- # define lg_do_unlock(l) arch_spin_unlock(l)
- #else
- # define lg_lock_ptr struct rt_mutex
--# define lg_do_lock(l) __rt_spin_lock(l)
-+# define lg_do_lock(l) __rt_spin_lock__no_mg(l)
- # define lg_do_unlock(l) __rt_spin_unlock(l)
- #endif
- /*
---- a/kernel/locking/rt.c
-+++ b/kernel/locking/rt.c
-@@ -235,7 +235,6 @@ EXPORT_SYMBOL(rt_read_trylock);
- void __lockfunc rt_write_lock(rwlock_t *rwlock)
- {
- rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_);
-- migrate_disable();
- __rt_spin_lock(&rwlock->lock);
- }
- EXPORT_SYMBOL(rt_write_lock);
-@@ -249,7 +248,6 @@ void __lockfunc rt_read_lock(rwlock_t *r
- * recursive read locks succeed when current owns the lock
- */
- if (rt_mutex_owner(lock) != current) {
-- migrate_disable();
- rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_);
- __rt_spin_lock(lock);
- }
---- a/kernel/locking/rtmutex.c
-+++ b/kernel/locking/rtmutex.c
-@@ -1103,8 +1103,16 @@ static void noinline __sched rt_spin_lo
- rt_mutex_adjust_prio(current);
- }
-
-+void __lockfunc rt_spin_lock__no_mg(spinlock_t *lock)
-+{
-+ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock);
-+ spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
-+}
-+EXPORT_SYMBOL(rt_spin_lock__no_mg);
-+
- void __lockfunc rt_spin_lock(spinlock_t *lock)
- {
-+ migrate_disable();
- rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock);
- spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
- }
-@@ -1112,24 +1120,41 @@ EXPORT_SYMBOL(rt_spin_lock);
-
- void __lockfunc __rt_spin_lock(struct rt_mutex *lock)
- {
-+ migrate_disable();
- rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock);
- }
- EXPORT_SYMBOL(__rt_spin_lock);
-
-+void __lockfunc __rt_spin_lock__no_mg(struct rt_mutex *lock)
-+{
-+ rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock);
-+}
-+EXPORT_SYMBOL(__rt_spin_lock__no_mg);
-+
- #ifdef CONFIG_DEBUG_LOCK_ALLOC
- void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass)
- {
-+ migrate_disable();
- rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock);
- spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
- }
- EXPORT_SYMBOL(rt_spin_lock_nested);
- #endif
-
-+void __lockfunc rt_spin_unlock__no_mg(spinlock_t *lock)
-+{
-+ /* NOTE: we always pass in '1' for nested, for simplicity */
-+ spin_release(&lock->dep_map, 1, _RET_IP_);
-+ rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock);
-+}
-+EXPORT_SYMBOL(rt_spin_unlock__no_mg);
-+
- void __lockfunc rt_spin_unlock(spinlock_t *lock)
- {
- /* NOTE: we always pass in '1' for nested, for simplicity */
- spin_release(&lock->dep_map, 1, _RET_IP_);
- rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock);
-+ migrate_enable();
- }
- EXPORT_SYMBOL(rt_spin_unlock);
-
-@@ -1156,12 +1181,27 @@ int __lockfunc __rt_spin_trylock(struct
- return rt_mutex_trylock(lock);
- }
-
-+int __lockfunc rt_spin_trylock__no_mg(spinlock_t *lock)
-+{
-+ int ret;
-+
-+ ret = rt_mutex_trylock(&lock->lock);
-+ if (ret)
-+ spin_acquire(&lock->dep_map, 0, 1, _RET_IP_);
-+ return ret;
-+}
-+EXPORT_SYMBOL(rt_spin_trylock__no_mg);
-+
- int __lockfunc rt_spin_trylock(spinlock_t *lock)
- {
-- int ret = rt_mutex_trylock(&lock->lock);
-+ int ret;
-
-+ migrate_disable();
-+ ret = rt_mutex_trylock(&lock->lock);
- if (ret)
- spin_acquire(&lock->dep_map, 0, 1, _RET_IP_);
-+ else
-+ migrate_enable();
- return ret;
- }
- EXPORT_SYMBOL(rt_spin_trylock);
-@@ -1200,12 +1240,10 @@ int atomic_dec_and_spin_lock(atomic_t *a
- /* Subtract 1 from counter unless that drops it to 0 (ie. it was 1) */
- if (atomic_add_unless(atomic, -1, 1))
- return 0;
-- migrate_disable();
- rt_spin_lock(lock);
- if (atomic_dec_and_test(atomic))
- return 1;
- rt_spin_unlock(lock);
-- migrate_enable();
- return 0;
- }
- EXPORT_SYMBOL(atomic_dec_and_spin_lock);
diff --git a/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch b/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch
index cb42b65..3a84bb0 100644
--- a/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch
+++ b/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch b/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch
index 0df5d8c..fe597cb 100644
--- a/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch
+++ b/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch
@@ -1,6 +1,6 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Subject: rbtree: don't include the rcu header
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The RCU header pulls in spinlock.h and fails due not yet defined types:
@@ -102,7 +102,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#include <asm/barrier.h>
-@@ -628,54 +629,6 @@ static inline void rcu_preempt_sleep_che
+@@ -629,54 +630,6 @@ static inline void rcu_preempt_sleep_che
})
/**
diff --git a/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch b/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch
index 85c641b..f0e04f3 100644
--- a/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch
+++ b/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch
@@ -2,7 +2,7 @@ From f9cf73e8bad7daa90318edfd933f8676cd1e5cd4 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Fri, 21 Oct 2016 10:54:50 +0200
Subject: [PATCH] rxrpc: remove unused static variables
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The rxrpc_security_methods and rxrpc_security_sem user has been removed
in 648af7fca159 ("rxrpc: Absorb the rxkad security module"). This was
diff --git a/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch b/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch
index 0ce58da..191ec5f 100644
--- a/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch
+++ b/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch
@@ -1,7 +1,7 @@
From: Paul Gortmaker <paul.gortmaker at windriver.com>
Date: Sat, 14 Feb 2015 11:01:16 -0500
Subject: sas-ata/isci: dont't disable interrupts in qc_issue handler
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
On 3.14-rt we see the following trace on Canoe Pass for
SCSI_ISCI "Intel(R) C600 Series Chipset SAS Controller"
diff --git a/debian/patches/features/all/rt/sc16is7xx_Drop_bogus_use_of_IRQF_ONESHOT.patch b/debian/patches/features/all/rt/sc16is7xx_Drop_bogus_use_of_IRQF_ONESHOT.patch
index fbc6376..97de985 100644
--- a/debian/patches/features/all/rt/sc16is7xx_Drop_bogus_use_of_IRQF_ONESHOT.patch
+++ b/debian/patches/features/all/rt/sc16is7xx_Drop_bogus_use_of_IRQF_ONESHOT.patch
@@ -1,7 +1,7 @@
Subject: sc16is7xx: Drop bogus use of IRQF_ONESHOT
From: Josh Cartwright <joshc at ni.com>
Date: Thu, 18 Feb 2016 11:26:12 -0600
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The use of IRQF_ONESHOT when registering an interrupt handler with
request_irq() is non-sensical.
@@ -44,7 +44,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
-@@ -1240,7 +1240,7 @@ static int sc16is7xx_probe(struct device
+@@ -1264,7 +1264,7 @@ static int sc16is7xx_probe(struct device
/* Setup interrupt */
ret = devm_request_irq(dev, irq, sc16is7xx_irq,
diff --git a/debian/patches/features/all/rt/sched-deadline-dl_task_timer-has-to-be-irqsafe.patch b/debian/patches/features/all/rt/sched-deadline-dl_task_timer-has-to-be-irqsafe.patch
index ff3d543..abcd3c9 100644
--- a/debian/patches/features/all/rt/sched-deadline-dl_task_timer-has-to-be-irqsafe.patch
+++ b/debian/patches/features/all/rt/sched-deadline-dl_task_timer-has-to-be-irqsafe.patch
@@ -1,7 +1,7 @@
From: Juri Lelli <juri.lelli at gmail.com>
Date: Tue, 13 May 2014 15:30:20 +0200
Subject: sched/deadline: dl_task_timer has to be irqsafe
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
As for rt_period_timer, dl_task_timer has to be irqsafe.
@@ -13,7 +13,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
-@@ -697,6 +697,7 @@ void init_dl_task_timer(struct sched_dl_
+@@ -687,6 +687,7 @@ void init_dl_task_timer(struct sched_dl_
hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
timer->function = dl_task_timer;
diff --git a/debian/patches/features/all/rt/sched-delay-put-task.patch b/debian/patches/features/all/rt/sched-delay-put-task.patch
index db2d5dc..0a64db3 100644
--- a/debian/patches/features/all/rt/sched-delay-put-task.patch
+++ b/debian/patches/features/all/rt/sched-delay-put-task.patch
@@ -1,7 +1,7 @@
Subject: sched: Move task_struct cleanup to RCU
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 31 May 2011 16:59:16 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
__put_task_struct() does quite some expensive work. We don't want to
burden random tasks with that.
@@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1936,6 +1936,9 @@ struct task_struct {
+@@ -1961,6 +1961,9 @@ struct task_struct {
unsigned int sequential_io;
unsigned int sequential_io_avg;
#endif
@@ -24,7 +24,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
unsigned long task_state_change;
#endif
-@@ -2174,6 +2177,15 @@ extern struct pid *cad_pid;
+@@ -2218,6 +2221,15 @@ extern struct pid *cad_pid;
extern void free_task(struct task_struct *tsk);
#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
@@ -40,7 +40,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
extern void __put_task_struct(struct task_struct *t);
static inline void put_task_struct(struct task_struct *t)
-@@ -2181,6 +2193,7 @@ static inline void put_task_struct(struc
+@@ -2225,6 +2237,7 @@ static inline void put_task_struct(struc
if (atomic_dec_and_test(&t->usage))
__put_task_struct(t);
}
@@ -50,7 +50,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
struct task_struct *try_get_task_struct(struct task_struct **ptask);
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -251,7 +251,9 @@ static inline void put_signal_struct(str
+@@ -376,7 +376,9 @@ static inline void put_signal_struct(str
if (atomic_dec_and_test(&sig->sigcnt))
free_signal_struct(sig);
}
@@ -61,7 +61,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void __put_task_struct(struct task_struct *tsk)
{
WARN_ON(!tsk->exit_state);
-@@ -268,7 +270,18 @@ void __put_task_struct(struct task_struc
+@@ -393,7 +395,18 @@ void __put_task_struct(struct task_struc
if (!profile_handoff_task(tsk))
free_task(tsk);
}
diff --git a/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch b/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch
index ea0d703..e916980 100644
--- a/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch
+++ b/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch
@@ -1,7 +1,7 @@
Subject: sched: Disable CONFIG_RT_GROUP_SCHED on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 18 Jul 2011 17:03:52 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Carsten reported problems when running:
@@ -19,7 +19,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1041,6 +1041,7 @@ config CFS_BANDWIDTH
+@@ -1051,6 +1051,7 @@ config CFS_BANDWIDTH
config RT_GROUP_SCHED
bool "Group scheduling for SCHED_RR/FIFO"
depends on CGROUP_SCHED
diff --git a/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch b/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch
index 00243b2..2f0930d 100644
--- a/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch
+++ b/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch
@@ -1,7 +1,7 @@
Subject: sched: Disable TTWU_QUEUE on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 13 Sep 2011 16:42:35 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The queued remote wakeup mechanism can introduce rather large
latencies if the number of migrated tasks is high. Disable it for RT.
diff --git a/debian/patches/features/all/rt/sched-limit-nr-migrate.patch b/debian/patches/features/all/rt/sched-limit-nr-migrate.patch
index db8dd76..58bc677 100644
--- a/debian/patches/features/all/rt/sched-limit-nr-migrate.patch
+++ b/debian/patches/features/all/rt/sched-limit-nr-migrate.patch
@@ -1,7 +1,7 @@
Subject: sched: Limit the number of task migrations per batch
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 06 Jun 2011 12:12:51 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Put an upper limit on the number of tasks which are migrated per batch
to avoid large latencies.
diff --git a/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch b/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch
index 999c068..031dc9b 100644
--- a/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch
+++ b/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch
@@ -1,7 +1,7 @@
Subject: sched: Do not account rcu_preempt_depth on RT in might_sleep()
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 07 Jun 2011 09:19:06 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
RT changes the rcu_preempt_depth semantics, so we cannot check for it
in might_sleep().
@@ -37,7 +37,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Internal to kernel */
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -7697,7 +7697,7 @@ void __init sched_init(void)
+@@ -7820,7 +7820,7 @@ void __init sched_init(void)
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
static inline int preempt_count_equals(int preempt_offset)
{
diff --git a/debian/patches/features/all/rt/sched-mmdrop-delayed.patch b/debian/patches/features/all/rt/sched-mmdrop-delayed.patch
index 70ed3bb..3ba394d 100644
--- a/debian/patches/features/all/rt/sched-mmdrop-delayed.patch
+++ b/debian/patches/features/all/rt/sched-mmdrop-delayed.patch
@@ -1,7 +1,7 @@
Subject: sched: Move mmdrop to RCU on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 06 Jun 2011 12:20:33 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Takes sleeping locks and calls into the memory allocator, so nothing
we want to do in task switch and oder atomic contexts.
@@ -36,7 +36,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void __user *bd_addr;
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -2857,6 +2857,17 @@ static inline void mmdrop(struct mm_stru
+@@ -2905,6 +2905,17 @@ static inline void mmdrop(struct mm_stru
__mmdrop(mm);
}
@@ -51,12 +51,12 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
+# define mmdrop_delayed(mm) mmdrop(mm)
+#endif
+
- static inline bool mmget_not_zero(struct mm_struct *mm)
+ static inline void mmdrop_async_fn(struct work_struct *work)
{
- return atomic_inc_not_zero(&mm->mm_users);
+ struct mm_struct *mm = container_of(work, struct mm_struct, async_put_work);
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -715,6 +715,19 @@ void __mmdrop(struct mm_struct *mm)
+@@ -862,6 +862,19 @@ void __mmdrop(struct mm_struct *mm)
}
EXPORT_SYMBOL_GPL(__mmdrop);
@@ -78,7 +78,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
VM_BUG_ON(atomic_read(&mm->mm_users));
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -2776,8 +2776,12 @@ static struct rq *finish_task_switch(str
+@@ -2785,8 +2785,12 @@ static struct rq *finish_task_switch(str
finish_arch_post_lock_switch();
fire_sched_in_preempt_notifiers(current);
@@ -92,7 +92,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (unlikely(prev_state == TASK_DEAD)) {
if (prev->sched_class->task_dead)
prev->sched_class->task_dead(prev);
-@@ -5513,6 +5517,8 @@ void sched_setnuma(struct task_struct *p
+@@ -5545,6 +5549,8 @@ void sched_setnuma(struct task_struct *p
#endif /* CONFIG_NUMA_BALANCING */
#ifdef CONFIG_HOTPLUG_CPU
@@ -101,7 +101,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Ensures that the idle task is using init_mm right before its cpu goes
* offline.
-@@ -5527,7 +5533,12 @@ void idle_task_exit(void)
+@@ -5559,7 +5565,12 @@ void idle_task_exit(void)
switch_mm_irqs_off(mm, &init_mm, current);
finish_arch_post_lock_switch();
}
@@ -115,7 +115,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -7402,6 +7413,10 @@ int sched_cpu_dying(unsigned int cpu)
+@@ -7505,6 +7516,10 @@ int sched_cpu_dying(unsigned int cpu)
update_max_interval();
nohz_balance_exit_idle(cpu);
hrtick_clear(rq);
diff --git a/debian/patches/features/all/rt/sched-preempt-Fix-preempt_count-manipulations.patch b/debian/patches/features/all/rt/sched-preempt-Fix-preempt_count-manipulations.patch
deleted file mode 100644
index 608c694..0000000
--- a/debian/patches/features/all/rt/sched-preempt-Fix-preempt_count-manipulations.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From: Peter Zijlstra <peterz at infradead.org>
-Date: Mon, 16 May 2016 15:01:11 +0200
-Subject: [PATCH] sched,preempt: Fix preempt_count manipulations
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-Vikram reported that his ARM64 compiler managed to 'optimize' away the
-preempt_count manipulations in code like:
-
- preempt_enable_no_resched();
- put_user();
- preempt_disable();
-
-Irrespective of that fact that that is horrible code that should be
-fixed for many reasons, it does highlight a deficiency in the generic
-preempt_count manipulators. As it is never right to combine/elide
-preempt_count manipulations like this.
-
-Therefore sprinkle some volatile in the two generic accessors to
-ensure the compiler is aware of the fact that the preempt_count is
-observed outside of the regular program-order view and thus cannot be
-optimized away like this.
-
-x86; the only arch not using the generic code is not affected as we
-do all this in asm in order to use the segment base per-cpu stuff.
-
-Cc: stable at vger.kernel.org
-Cc: stable-rt at vger.kernel.org
-Cc: Thomas Gleixner <tglx at linutronix.de>
-Fixes: a787870924db ("sched, arch: Create asm/preempt.h")
-Reported-by: Vikram Mulukutla <markivx at codeaurora.org>
-Tested-by: Vikram Mulukutla <markivx at codeaurora.org>
-Signed-off-by: Peter Zijlstra (Intel) <peterz at infradead.org>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- include/asm-generic/preempt.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/include/asm-generic/preempt.h
-+++ b/include/asm-generic/preempt.h
-@@ -7,10 +7,10 @@
-
- static __always_inline int preempt_count(void)
- {
-- return current_thread_info()->preempt_count;
-+ return READ_ONCE(current_thread_info()->preempt_count);
- }
-
--static __always_inline int *preempt_count_ptr(void)
-+static __always_inline volatile int *preempt_count_ptr(void)
- {
- return ¤t_thread_info()->preempt_count;
- }
diff --git a/debian/patches/features/all/rt/sched-provide-a-tsk_nr_cpus_allowed-helper.patch b/debian/patches/features/all/rt/sched-provide-a-tsk_nr_cpus_allowed-helper.patch
deleted file mode 100644
index c59bc15..0000000
--- a/debian/patches/features/all/rt/sched-provide-a-tsk_nr_cpus_allowed-helper.patch
+++ /dev/null
@@ -1,262 +0,0 @@
-From: Thomas Gleixner <tglx at linutronix.de>
-Date: Mon, 18 Jan 2016 17:21:59 +0100
-Subject: sched: provide a tsk_nr_cpus_allowed() helper
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-tsk_nr_cpus_allowed() is an accessor for task->nr_cpus_allowed which allows
-us to change the representation of ->nr_cpus_allowed if required.
-
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- include/linux/sched.h | 5 +++++
- kernel/sched/core.c | 2 +-
- kernel/sched/deadline.c | 28 ++++++++++++++--------------
- kernel/sched/rt.c | 24 ++++++++++++------------
- 4 files changed, 32 insertions(+), 27 deletions(-)
-
---- a/include/linux/sched.h
-+++ b/include/linux/sched.h
-@@ -1871,6 +1871,11 @@ extern int arch_task_struct_size __read_
- /* Future-safe accessor for struct task_struct's cpus_allowed. */
- #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
-
-+static inline int tsk_nr_cpus_allowed(struct task_struct *p)
-+{
-+ return p->nr_cpus_allowed;
-+}
-+
- #define TNF_MIGRATED 0x01
- #define TNF_NO_GROUP 0x02
- #define TNF_SHARED 0x04
---- a/kernel/sched/core.c
-+++ b/kernel/sched/core.c
-@@ -1515,7 +1515,7 @@ int select_task_rq(struct task_struct *p
- {
- lockdep_assert_held(&p->pi_lock);
-
-- if (p->nr_cpus_allowed > 1)
-+ if (tsk_nr_cpus_allowed(p) > 1)
- cpu = p->sched_class->select_task_rq(p, cpu, sd_flags, wake_flags);
-
- /*
---- a/kernel/sched/deadline.c
-+++ b/kernel/sched/deadline.c
-@@ -134,7 +134,7 @@ static void inc_dl_migration(struct sche
- {
- struct task_struct *p = dl_task_of(dl_se);
-
-- if (p->nr_cpus_allowed > 1)
-+ if (tsk_nr_cpus_allowed(p) > 1)
- dl_rq->dl_nr_migratory++;
-
- update_dl_migration(dl_rq);
-@@ -144,7 +144,7 @@ static void dec_dl_migration(struct sche
- {
- struct task_struct *p = dl_task_of(dl_se);
-
-- if (p->nr_cpus_allowed > 1)
-+ if (tsk_nr_cpus_allowed(p) > 1)
- dl_rq->dl_nr_migratory--;
-
- update_dl_migration(dl_rq);
-@@ -966,7 +966,7 @@ static void enqueue_task_dl(struct rq *r
-
- enqueue_dl_entity(&p->dl, pi_se, flags);
-
-- if (!task_current(rq, p) && p->nr_cpus_allowed > 1)
-+ if (!task_current(rq, p) && tsk_nr_cpus_allowed(p) > 1)
- enqueue_pushable_dl_task(rq, p);
- }
-
-@@ -1040,9 +1040,9 @@ select_task_rq_dl(struct task_struct *p,
- * try to make it stay here, it might be important.
- */
- if (unlikely(dl_task(curr)) &&
-- (curr->nr_cpus_allowed < 2 ||
-+ (tsk_nr_cpus_allowed(curr) < 2 ||
- !dl_entity_preempt(&p->dl, &curr->dl)) &&
-- (p->nr_cpus_allowed > 1)) {
-+ (tsk_nr_cpus_allowed(p) > 1)) {
- int target = find_later_rq(p);
-
- if (target != -1 &&
-@@ -1063,7 +1063,7 @@ static void check_preempt_equal_dl(struc
- * Current can't be migrated, useless to reschedule,
- * let's hope p can move out.
- */
-- if (rq->curr->nr_cpus_allowed == 1 ||
-+ if (tsk_nr_cpus_allowed(rq->curr) == 1 ||
- cpudl_find(&rq->rd->cpudl, rq->curr, NULL) == -1)
- return;
-
-@@ -1071,7 +1071,7 @@ static void check_preempt_equal_dl(struc
- * p is migratable, so let's not schedule it and
- * see if it is pushed or pulled somewhere else.
- */
-- if (p->nr_cpus_allowed != 1 &&
-+ if (tsk_nr_cpus_allowed(p) != 1 &&
- cpudl_find(&rq->rd->cpudl, p, NULL) != -1)
- return;
-
-@@ -1185,7 +1185,7 @@ static void put_prev_task_dl(struct rq *
- {
- update_curr_dl(rq);
-
-- if (on_dl_rq(&p->dl) && p->nr_cpus_allowed > 1)
-+ if (on_dl_rq(&p->dl) && tsk_nr_cpus_allowed(p) > 1)
- enqueue_pushable_dl_task(rq, p);
- }
-
-@@ -1286,7 +1286,7 @@ static int find_later_rq(struct task_str
- if (unlikely(!later_mask))
- return -1;
-
-- if (task->nr_cpus_allowed == 1)
-+ if (tsk_nr_cpus_allowed(task) == 1)
- return -1;
-
- /*
-@@ -1432,7 +1432,7 @@ static struct task_struct *pick_next_pus
-
- BUG_ON(rq->cpu != task_cpu(p));
- BUG_ON(task_current(rq, p));
-- BUG_ON(p->nr_cpus_allowed <= 1);
-+ BUG_ON(tsk_nr_cpus_allowed(p) <= 1);
-
- BUG_ON(!task_on_rq_queued(p));
- BUG_ON(!dl_task(p));
-@@ -1471,7 +1471,7 @@ static int push_dl_task(struct rq *rq)
- */
- if (dl_task(rq->curr) &&
- dl_time_before(next_task->dl.deadline, rq->curr->dl.deadline) &&
-- rq->curr->nr_cpus_allowed > 1) {
-+ tsk_nr_cpus_allowed(rq->curr) > 1) {
- resched_curr(rq);
- return 0;
- }
-@@ -1618,9 +1618,9 @@ static void task_woken_dl(struct rq *rq,
- {
- if (!task_running(rq, p) &&
- !test_tsk_need_resched(rq->curr) &&
-- p->nr_cpus_allowed > 1 &&
-+ tsk_nr_cpus_allowed(p) > 1 &&
- dl_task(rq->curr) &&
-- (rq->curr->nr_cpus_allowed < 2 ||
-+ (tsk_nr_cpus_allowed(rq->curr) < 2 ||
- !dl_entity_preempt(&p->dl, &rq->curr->dl))) {
- push_dl_tasks(rq);
- }
-@@ -1724,7 +1724,7 @@ static void switched_to_dl(struct rq *rq
-
- if (task_on_rq_queued(p) && rq->curr != p) {
- #ifdef CONFIG_SMP
-- if (p->nr_cpus_allowed > 1 && rq->dl.overloaded)
-+ if (tsk_nr_cpus_allowed(p) > 1 && rq->dl.overloaded)
- queue_push_tasks(rq);
- #else
- if (dl_task(rq->curr))
---- a/kernel/sched/rt.c
-+++ b/kernel/sched/rt.c
-@@ -334,7 +334,7 @@ static void inc_rt_migration(struct sche
- rt_rq = &rq_of_rt_rq(rt_rq)->rt;
-
- rt_rq->rt_nr_total++;
-- if (p->nr_cpus_allowed > 1)
-+ if (tsk_nr_cpus_allowed(p) > 1)
- rt_rq->rt_nr_migratory++;
-
- update_rt_migration(rt_rq);
-@@ -351,7 +351,7 @@ static void dec_rt_migration(struct sche
- rt_rq = &rq_of_rt_rq(rt_rq)->rt;
-
- rt_rq->rt_nr_total--;
-- if (p->nr_cpus_allowed > 1)
-+ if (tsk_nr_cpus_allowed(p) > 1)
- rt_rq->rt_nr_migratory--;
-
- update_rt_migration(rt_rq);
-@@ -1324,7 +1324,7 @@ enqueue_task_rt(struct rq *rq, struct ta
-
- enqueue_rt_entity(rt_se, flags);
-
-- if (!task_current(rq, p) && p->nr_cpus_allowed > 1)
-+ if (!task_current(rq, p) && tsk_nr_cpus_allowed(p) > 1)
- enqueue_pushable_task(rq, p);
- }
-
-@@ -1413,7 +1413,7 @@ select_task_rq_rt(struct task_struct *p,
- * will have to sort it out.
- */
- if (curr && unlikely(rt_task(curr)) &&
-- (curr->nr_cpus_allowed < 2 ||
-+ (tsk_nr_cpus_allowed(curr) < 2 ||
- curr->prio <= p->prio)) {
- int target = find_lowest_rq(p);
-
-@@ -1437,7 +1437,7 @@ static void check_preempt_equal_prio(str
- * Current can't be migrated, useless to reschedule,
- * let's hope p can move out.
- */
-- if (rq->curr->nr_cpus_allowed == 1 ||
-+ if (tsk_nr_cpus_allowed(rq->curr) == 1 ||
- !cpupri_find(&rq->rd->cpupri, rq->curr, NULL))
- return;
-
-@@ -1445,7 +1445,7 @@ static void check_preempt_equal_prio(str
- * p is migratable, so let's not schedule it and
- * see if it is pushed or pulled somewhere else.
- */
-- if (p->nr_cpus_allowed != 1
-+ if (tsk_nr_cpus_allowed(p) != 1
- && cpupri_find(&rq->rd->cpupri, p, NULL))
- return;
-
-@@ -1579,7 +1579,7 @@ static void put_prev_task_rt(struct rq *
- * The previous task needs to be made eligible for pushing
- * if it is still active
- */
-- if (on_rt_rq(&p->rt) && p->nr_cpus_allowed > 1)
-+ if (on_rt_rq(&p->rt) && tsk_nr_cpus_allowed(p) > 1)
- enqueue_pushable_task(rq, p);
- }
-
-@@ -1629,7 +1629,7 @@ static int find_lowest_rq(struct task_st
- if (unlikely(!lowest_mask))
- return -1;
-
-- if (task->nr_cpus_allowed == 1)
-+ if (tsk_nr_cpus_allowed(task) == 1)
- return -1; /* No other targets possible */
-
- if (!cpupri_find(&task_rq(task)->rd->cpupri, task, lowest_mask))
-@@ -1762,7 +1762,7 @@ static struct task_struct *pick_next_pus
-
- BUG_ON(rq->cpu != task_cpu(p));
- BUG_ON(task_current(rq, p));
-- BUG_ON(p->nr_cpus_allowed <= 1);
-+ BUG_ON(tsk_nr_cpus_allowed(p) <= 1);
-
- BUG_ON(!task_on_rq_queued(p));
- BUG_ON(!rt_task(p));
-@@ -2122,9 +2122,9 @@ static void task_woken_rt(struct rq *rq,
- {
- if (!task_running(rq, p) &&
- !test_tsk_need_resched(rq->curr) &&
-- p->nr_cpus_allowed > 1 &&
-+ tsk_nr_cpus_allowed(p) > 1 &&
- (dl_task(rq->curr) || rt_task(rq->curr)) &&
-- (rq->curr->nr_cpus_allowed < 2 ||
-+ (tsk_nr_cpus_allowed(rq->curr) < 2 ||
- rq->curr->prio <= p->prio))
- push_rt_tasks(rq);
- }
-@@ -2197,7 +2197,7 @@ static void switched_to_rt(struct rq *rq
- */
- if (task_on_rq_queued(p) && rq->curr != p) {
- #ifdef CONFIG_SMP
-- if (p->nr_cpus_allowed > 1 && rq->rt.overloaded)
-+ if (tsk_nr_cpus_allowed(p) > 1 && rq->rt.overloaded)
- queue_push_tasks(rq);
- #else
- if (p->prio < rq->curr->prio)
diff --git a/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch b/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch
index c0f7da8..1895e72 100644
--- a/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch
+++ b/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch
@@ -1,7 +1,7 @@
Subject: sched: Add saved_state for tasks blocked on sleeping locks
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sat, 25 Jun 2011 09:21:04 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -18,15 +18,15 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1459,6 +1459,7 @@ struct tlbflush_unmap_batch {
-
- struct task_struct {
+@@ -1481,6 +1481,7 @@ struct task_struct {
+ struct thread_info thread_info;
+ #endif
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
-+ volatile long saved_state; /* saved state for "spinlock sleepers" */
++ volatile long saved_state; /* saved state for "spinlock sleepers" */
void *stack;
atomic_t usage;
unsigned int flags; /* per process flags, defined below */
-@@ -2649,6 +2650,7 @@ extern void xtime_update(unsigned long t
+@@ -2697,6 +2698,7 @@ extern void xtime_update(unsigned long t
extern int wake_up_state(struct task_struct *tsk, unsigned int state);
extern int wake_up_process(struct task_struct *tsk);
@@ -36,7 +36,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
extern void kick_process(struct task_struct *tsk);
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -2023,8 +2023,25 @@ try_to_wake_up(struct task_struct *p, un
+@@ -2033,8 +2033,25 @@ try_to_wake_up(struct task_struct *p, un
*/
smp_mb__before_spinlock();
raw_spin_lock_irqsave(&p->pi_lock, flags);
@@ -63,7 +63,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
trace_sched_waking(p);
-@@ -2172,6 +2189,18 @@ int wake_up_process(struct task_struct *
+@@ -2181,6 +2198,18 @@ int wake_up_process(struct task_struct *
}
EXPORT_SYMBOL(wake_up_process);
@@ -84,7 +84,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return try_to_wake_up(p, state, 0);
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
-@@ -1138,6 +1138,7 @@ static inline void finish_lock_switch(st
+@@ -1163,6 +1163,7 @@ static inline void finish_lock_switch(st
#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 */
diff --git a/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch b/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch
index 1262a5a..8a92d20 100644
--- a/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch
+++ b/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch
@@ -1,7 +1,7 @@
Subject: sched: ttwu: Return success when only changing the saved_state value
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 13 Dec 2011 21:42:19 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
When a task blocks on a rt lock, it saves the current state in
p->saved_state, so a lock related wake up will not destroy the
@@ -21,7 +21,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -2030,8 +2030,10 @@ try_to_wake_up(struct task_struct *p, un
+@@ -2040,8 +2040,10 @@ try_to_wake_up(struct task_struct *p, un
* if the wakeup condition is true.
*/
if (!(wake_flags & WF_LOCK_SLEEPER)) {
diff --git a/debian/patches/features/all/rt/sched-use-tsk_cpus_allowed-instead-of-accessing-cpus.patch b/debian/patches/features/all/rt/sched-use-tsk_cpus_allowed-instead-of-accessing-cpus.patch
deleted file mode 100644
index cd65b92..0000000
--- a/debian/patches/features/all/rt/sched-use-tsk_cpus_allowed-instead-of-accessing-cpus.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From: Thomas Gleixner <tglx at linutronix.de>
-Date: Mon, 18 Jan 2016 17:10:39 +0100
-Subject: sched: use tsk_cpus_allowed() instead of accessing
- ->cpus_allowed
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-Use the future-safe accessor for struct task_struct's.
-
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- kernel/sched/cpudeadline.c | 4 ++--
- kernel/sched/cpupri.c | 4 ++--
- kernel/sched/deadline.c | 2 +-
- 3 files changed, 5 insertions(+), 5 deletions(-)
-
---- a/kernel/sched/cpudeadline.c
-+++ b/kernel/sched/cpudeadline.c
-@@ -103,10 +103,10 @@ int cpudl_find(struct cpudl *cp, struct
- const struct sched_dl_entity *dl_se = &p->dl;
-
- if (later_mask &&
-- cpumask_and(later_mask, cp->free_cpus, &p->cpus_allowed)) {
-+ cpumask_and(later_mask, cp->free_cpus, tsk_cpus_allowed(p))) {
- best_cpu = cpumask_any(later_mask);
- goto out;
-- } else if (cpumask_test_cpu(cpudl_maximum(cp), &p->cpus_allowed) &&
-+ } else if (cpumask_test_cpu(cpudl_maximum(cp), tsk_cpus_allowed(p)) &&
- dl_time_before(dl_se->deadline, cp->elements[0].dl)) {
- best_cpu = cpudl_maximum(cp);
- if (later_mask)
---- a/kernel/sched/cpupri.c
-+++ b/kernel/sched/cpupri.c
-@@ -103,11 +103,11 @@ int cpupri_find(struct cpupri *cp, struc
- if (skip)
- continue;
-
-- if (cpumask_any_and(&p->cpus_allowed, vec->mask) >= nr_cpu_ids)
-+ if (cpumask_any_and(tsk_cpus_allowed(p), vec->mask) >= nr_cpu_ids)
- continue;
-
- if (lowest_mask) {
-- cpumask_and(lowest_mask, &p->cpus_allowed, vec->mask);
-+ cpumask_and(lowest_mask, tsk_cpus_allowed(p), vec->mask);
-
- /*
- * We have to ensure that we have at least one bit
---- a/kernel/sched/deadline.c
-+++ b/kernel/sched/deadline.c
-@@ -1392,7 +1392,7 @@ static struct rq *find_lock_later_rq(str
- if (double_lock_balance(rq, later_rq)) {
- if (unlikely(task_rq(task) != rq ||
- !cpumask_test_cpu(later_rq->cpu,
-- &task->cpus_allowed) ||
-+ tsk_cpus_allowed(task)) ||
- task_running(rq, task) ||
- !dl_task(task) ||
- !task_on_rq_queued(task))) {
diff --git a/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch b/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch
index 305d138..70de762 100644
--- a/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch
+++ b/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch
@@ -1,7 +1,7 @@
From: Steven Rostedt <rostedt at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -3482,8 +3482,10 @@ static void __sched notrace __schedule(b
+@@ -3477,8 +3477,10 @@ static void __sched notrace __schedule(b
* If a worker went to sleep, notify and ask workqueue
* whether it wants to wake up a task to maintain
* concurrency.
diff --git a/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch b/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch
index de9b4b1..2da7e59 100644
--- a/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch
+++ b/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch
@@ -1,7 +1,7 @@
Subject: scsi/fcoe: Make RT aware.
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sat, 12 Nov 2011 14:00:48 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Do not disable preemption while taking sleeping locks. All user look safe
for migrate_diable() only.
diff --git a/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch b/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch
index b65f2f7..ca8570b 100644
--- a/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch
+++ b/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch
@@ -1,7 +1,7 @@
Subject: scsi: qla2xxx: Use local_irq_save_nort() in qla2x00_poll
From: John Kacur <jkacur at redhat.com>
Date: Fri, 27 Apr 2012 12:48:46 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
RT triggers the following:
diff --git a/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch b/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch
index 2b6c563..93d916f 100644
--- a/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch
+++ b/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch
@@ -1,7 +1,7 @@
Subject: seqlock: Prevent rt starvation
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 22 Feb 2012 12:03:30 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
If a low prio writer gets preempted while holding the seqlock write
locked, a high prio reader spins forever on RT.
diff --git a/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch b/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch
index b3c8ec4..6b3f065 100644
--- a/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch
+++ b/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch
@@ -1,7 +1,7 @@
Subject: signal: Make __lock_task_sighand() RT aware
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 22 Jul 2011 08:07:08 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
local_irq_save() + spin_lock(&sighand->siglock) does not work on
-RT. Use the nort variants.
diff --git a/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch b/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch
index 8592d2a..ff056e6 100644
--- a/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch
+++ b/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch
@@ -1,7 +1,7 @@
Subject: signal: Revert ptrace preempt magic
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 21 Sep 2011 19:57:12 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more
than a bandaid around the ptrace design trainwreck. It's not a
diff --git a/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch
index 5f5b99e..c62572e 100644
--- a/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch
+++ b/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
To avoid allocation allow rt tasks to cache one sigqueue struct in
task struct.
@@ -18,7 +18,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1659,6 +1659,7 @@ struct task_struct {
+@@ -1684,6 +1684,7 @@ struct task_struct {
/* signal handlers */
struct signal_struct *signal;
struct sighand_struct *sighand;
@@ -49,7 +49,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -1399,6 +1399,7 @@ static struct task_struct *copy_process(
+@@ -1549,6 +1549,7 @@ static __latent_entropy struct task_stru
spin_lock_init(&p->alloc_lock);
init_sigpending(&p->pending);
diff --git a/debian/patches/features/all/rt/skbufhead-raw-lock-free-skbs.patch b/debian/patches/features/all/rt/skbufhead-raw-lock-free-skbs.patch
deleted file mode 100644
index 7852fcb..0000000
--- a/debian/patches/features/all/rt/skbufhead-raw-lock-free-skbs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Mon, 05 Dec 2016 18:09:34 +0100
-Subject: net: free the sbs in skbufhead
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-In "skbufhead-raw-lock.patch" we moved the memory to a list and the hunk that
-cleared the list got misplaced.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- net/core/dev.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
---- a/net/core/dev.c
-+++ b/net/core/dev.c
-@@ -5201,13 +5201,21 @@ static void net_rx_action(struct softirq
- struct softnet_data *sd = this_cpu_ptr(&softnet_data);
- unsigned long time_limit = jiffies + 2;
- int budget = netdev_budget;
-+ struct sk_buff_head tofree_q;
-+ struct sk_buff *skb;
- LIST_HEAD(list);
- LIST_HEAD(repoll);
-
-+ __skb_queue_head_init(&tofree_q);
-+
- local_irq_disable();
-+ skb_queue_splice_init(&sd->tofree_queue, &tofree_q);
- list_splice_init(&sd->poll_list, &list);
- local_irq_enable();
-
-+ while ((skb = __skb_dequeue(&tofree_q)))
-+ kfree_skb(skb);
-+
- for (;;) {
- struct napi_struct *n;
-
diff --git a/debian/patches/features/all/rt/skbufhead-raw-lock.patch b/debian/patches/features/all/rt/skbufhead-raw-lock.patch
index 910da52..6b464e0 100644
--- a/debian/patches/features/all/rt/skbufhead-raw-lock.patch
+++ b/debian/patches/features/all/rt/skbufhead-raw-lock.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -11,12 +11,12 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
---
include/linux/netdevice.h | 1 +
include/linux/skbuff.h | 7 +++++++
- net/core/dev.c | 19 +++++++++++++------
- 3 files changed, 21 insertions(+), 6 deletions(-)
+ net/core/dev.c | 31 ++++++++++++++++++++++++-------
+ 3 files changed, 32 insertions(+), 7 deletions(-)
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -2831,6 +2831,7 @@ struct softnet_data {
+@@ -2846,6 +2846,7 @@ struct softnet_data {
unsigned int dropped;
struct sk_buff_head input_pkt_queue;
struct napi_struct backlog;
@@ -34,7 +34,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
};
struct sk_buff;
-@@ -1565,6 +1566,12 @@ static inline void skb_queue_head_init(s
+@@ -1573,6 +1574,12 @@ static inline void skb_queue_head_init(s
__skb_queue_head_init(list);
}
@@ -66,31 +66,75 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#endif
}
-@@ -4323,7 +4323,7 @@ static void flush_backlog(void *arg)
+@@ -4315,7 +4315,7 @@ static void flush_backlog(struct work_st
skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) {
- if (skb->dev == dev) {
+ if (skb->dev->reg_state == NETREG_UNREGISTERING) {
__skb_unlink(skb, &sd->input_pkt_queue);
- kfree_skb(skb);
+ __skb_queue_tail(&sd->tofree_queue, skb);
input_queue_head_incr(sd);
}
}
-@@ -4332,10 +4332,13 @@ static void flush_backlog(void *arg)
+@@ -4325,11 +4325,14 @@ static void flush_backlog(struct work_st
skb_queue_walk_safe(&sd->process_queue, skb, tmp) {
- if (skb->dev == dev) {
+ if (skb->dev->reg_state == NETREG_UNREGISTERING) {
__skb_unlink(skb, &sd->process_queue);
- kfree_skb(skb);
+ __skb_queue_tail(&sd->tofree_queue, skb);
input_queue_head_incr(sd);
}
}
-+
+ if (!skb_queue_empty(&sd->tofree_queue))
+ raise_softirq_irqoff(NET_RX_SOFTIRQ);
+ local_bh_enable();
++
}
- static int napi_gro_complete(struct sk_buff *skb)
-@@ -8004,6 +8007,9 @@ static int dev_cpu_callback(struct notif
+ static void flush_all_backlogs(void)
+@@ -4852,7 +4855,9 @@ static int process_backlog(struct napi_s
+ while (again) {
+ struct sk_buff *skb;
+
++ local_irq_disable();
+ while ((skb = __skb_dequeue(&sd->process_queue))) {
++ local_irq_enable();
+ rcu_read_lock();
+ __netif_receive_skb(skb);
+ rcu_read_unlock();
+@@ -4860,9 +4865,9 @@ static int process_backlog(struct napi_s
+ if (++work >= quota)
+ return work;
+
++ local_irq_disable();
+ }
+
+- local_irq_disable();
+ rps_lock(sd);
+ if (skb_queue_empty(&sd->input_pkt_queue)) {
+ /*
+@@ -5204,13 +5209,21 @@ static __latent_entropy void net_rx_acti
+ struct softnet_data *sd = this_cpu_ptr(&softnet_data);
+ unsigned long time_limit = jiffies + 2;
+ int budget = netdev_budget;
++ struct sk_buff_head tofree_q;
++ struct sk_buff *skb;
+ LIST_HEAD(list);
+ LIST_HEAD(repoll);
+
++ __skb_queue_head_init(&tofree_q);
++
+ local_irq_disable();
++ skb_queue_splice_init(&sd->tofree_queue, &tofree_q);
+ list_splice_init(&sd->poll_list, &list);
+ local_irq_enable();
+
++ while ((skb = __skb_dequeue(&tofree_q)))
++ kfree_skb(skb);
++
+ for (;;) {
+ struct napi_struct *n;
+
+@@ -8013,6 +8026,9 @@ static int dev_cpu_callback(struct notif
netif_rx_ni(skb);
input_queue_head_incr(oldsd);
}
@@ -100,9 +144,9 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return NOTIFY_OK;
}
-@@ -8305,8 +8311,9 @@ static int __init net_dev_init(void)
- for_each_possible_cpu(i) {
- struct softnet_data *sd = &per_cpu(softnet_data, i);
+@@ -8317,8 +8333,9 @@ static int __init net_dev_init(void)
+
+ INIT_WORK(flush, flush_backlog);
- skb_queue_head_init(&sd->input_pkt_queue);
- skb_queue_head_init(&sd->process_queue);
diff --git a/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch b/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch
index 1942263..5c615fe 100644
--- a/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch
+++ b/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -37,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1788,7 +1788,7 @@ config SLAB_FREELIST_RANDOM
+@@ -1799,7 +1799,7 @@ config SLAB_FREELIST_RANDOM
config SLUB_CPU_PARTIAL
default y
diff --git a/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch b/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch
index 251d506..da7e537 100644
--- a/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch
+++ b/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch
@@ -1,7 +1,7 @@
Subject: slub: Enable irqs for __GFP_WAIT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 09 Jan 2013 12:08:15 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
@@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/mm/slub.c
+++ b/mm/slub.c
-@@ -1533,14 +1533,17 @@ static struct page *allocate_slab(struct
+@@ -1529,14 +1529,17 @@ static struct page *allocate_slab(struct
void *start, *p;
int idx, order;
bool shuffle;
@@ -33,7 +33,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
local_irq_enable();
flags |= s->allocflags;
-@@ -1615,11 +1618,7 @@ static struct page *allocate_slab(struct
+@@ -1611,11 +1614,7 @@ static struct page *allocate_slab(struct
page->frozen = 1;
out:
diff --git a/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch b/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch
index d769511..9cfdc40 100644
--- a/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch
+++ b/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch
@@ -1,7 +1,7 @@
From: Mike Galbraith <umgwanakikbuti at gmail.com>
Date: Wed, 18 Feb 2015 15:09:23 +0100
Subject: snd/pcm: fix snd_pcm_stream_lock*() irqs_disabled() splats
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Locking functions previously using read_lock_irq()/read_lock_irqsave() were
changed to local_irq_disable/save(), leading to gripes. Use nort variants.
diff --git a/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch b/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch
index 05f734d..d54630a 100644
--- a/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch
+++ b/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch
@@ -1,7 +1,7 @@
Subject: softirq: Disable softirq stacks for RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 18 Jul 2011 13:59:17 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Disable extra stacks for softirqs. We want to preempt softirqs and
having them on special IRQ-stack does not make this easier.
@@ -20,7 +20,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
-@@ -633,6 +633,7 @@ void irq_ctx_init(void)
+@@ -638,6 +638,7 @@ void irq_ctx_init(void)
}
}
@@ -28,7 +28,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void do_softirq_own_stack(void)
{
struct thread_info *curtp, *irqtp;
-@@ -650,6 +651,7 @@ void do_softirq_own_stack(void)
+@@ -655,6 +656,7 @@ void do_softirq_own_stack(void)
if (irqtp->flags)
set_bits(irqtp->flags, &curtp->flags);
}
@@ -38,7 +38,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
{
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
-@@ -40,6 +40,7 @@
+@@ -41,6 +41,7 @@
* We store the saved ksp_limit in the unused part
* of the STACK_FRAME_OVERHEAD
*/
@@ -46,7 +46,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
_GLOBAL(call_do_softirq)
mflr r0
stw r0,4(r1)
-@@ -56,6 +57,7 @@
+@@ -57,6 +58,7 @@
stw r10,THREAD+KSP_LIMIT(r2)
mtlr r0
blr
@@ -56,7 +56,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
* void call_do_irq(struct pt_regs *regs, struct thread_info *irqtp);
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
-@@ -30,6 +30,7 @@
+@@ -31,6 +31,7 @@
.text
@@ -64,7 +64,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
_GLOBAL(call_do_softirq)
mflr r0
std r0,16(r1)
-@@ -40,6 +41,7 @@
+@@ -41,6 +42,7 @@
ld r0,16(r1)
mtlr r0
blr
@@ -110,7 +110,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void fixup_irqs(void)
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
-@@ -817,6 +817,7 @@ END(native_load_gs_index)
+@@ -894,6 +894,7 @@ EXPORT_SYMBOL(native_load_gs_index)
jmp 2b
.previous
@@ -118,7 +118,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Call softirq on interrupt stack. Interrupts are off. */
ENTRY(do_softirq_own_stack)
pushq %rbp
-@@ -829,6 +830,7 @@ ENTRY(do_softirq_own_stack)
+@@ -906,6 +907,7 @@ ENTRY(do_softirq_own_stack)
decl PER_CPU_VAR(irq_count)
ret
END(do_softirq_own_stack)
@@ -146,7 +146,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
{
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
-@@ -464,7 +464,7 @@ struct softirq_action
+@@ -472,7 +472,7 @@ struct softirq_action
asmlinkage void do_softirq(void);
asmlinkage void __do_softirq(void);
diff --git a/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch b/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch
index bb5a308..5048965 100644
--- a/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch
+++ b/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch
@@ -1,7 +1,7 @@
Subject: softirq: Check preemption after reenabling interrupts
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 13 Nov 2011 17:17:09 +0100 (CET)
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
raise_softirq_irqoff() disables interrupts and wakes the softirq
daemon, but after reenabling interrupts there is no preemption check,
@@ -31,15 +31,15 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -93,6 +94,7 @@ static int blk_cpu_notify(struct notifie
- this_cpu_ptr(&blk_cpu_done));
- raise_softirq_irqoff(BLOCK_SOFTIRQ);
- local_irq_enable();
-+ preempt_check_resched_rt();
- }
+@@ -89,6 +90,7 @@ static int blk_softirq_cpu_dead(unsigned
+ this_cpu_ptr(&blk_cpu_done));
+ raise_softirq_irqoff(BLOCK_SOFTIRQ);
+ local_irq_enable();
++ preempt_check_resched_rt();
- return NOTIFY_OK;
-@@ -150,6 +152,7 @@ void __blk_complete_request(struct reque
+ return 0;
+ }
+@@ -141,6 +143,7 @@ void __blk_complete_request(struct reque
goto do_local;
local_irq_restore(flags);
@@ -86,7 +86,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
EXPORT_SYMBOL(irq_poll_complete);
-@@ -95,6 +97,7 @@ static void irq_poll_softirq(struct soft
+@@ -95,6 +97,7 @@ static void __latent_entropy irq_poll_so
}
local_irq_enable();
@@ -94,7 +94,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Even though interrupts have been re-enabled, this
* access is safe because interrupts can only add new
-@@ -132,6 +135,7 @@ static void irq_poll_softirq(struct soft
+@@ -132,6 +135,7 @@ static void __latent_entropy irq_poll_so
__raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);
local_irq_enable();
@@ -102,17 +102,17 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/**
-@@ -199,6 +203,7 @@ static int irq_poll_cpu_notify(struct no
- this_cpu_ptr(&blk_cpu_iopoll));
- __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);
- local_irq_enable();
-+ preempt_check_resched_rt();
- }
+@@ -195,6 +199,7 @@ static int irq_poll_cpu_dead(unsigned in
+ this_cpu_ptr(&blk_cpu_iopoll));
+ __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ);
+ local_irq_enable();
++ preempt_check_resched_rt();
- return NOTIFY_OK;
+ return 0;
+ }
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -2268,6 +2268,7 @@ static void __netif_reschedule(struct Qd
+@@ -2263,6 +2263,7 @@ static void __netif_reschedule(struct Qd
sd->output_queue_tailp = &q->next_sched;
raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_restore(flags);
@@ -120,7 +120,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
void __netif_schedule(struct Qdisc *q)
-@@ -2349,6 +2350,7 @@ void __dev_kfree_skb_irq(struct sk_buff
+@@ -2344,6 +2345,7 @@ void __dev_kfree_skb_irq(struct sk_buff
__this_cpu_write(softnet_data.completion_queue, skb);
raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_restore(flags);
@@ -128,7 +128,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
EXPORT_SYMBOL(__dev_kfree_skb_irq);
-@@ -3778,6 +3780,7 @@ static int enqueue_to_backlog(struct sk_
+@@ -3763,6 +3765,7 @@ static int enqueue_to_backlog(struct sk_
rps_unlock(sd);
local_irq_restore(flags);
@@ -136,7 +136,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
atomic_long_inc(&skb->dev->rx_dropped);
kfree_skb(skb);
-@@ -4797,6 +4800,7 @@ static void net_rps_action_and_irq_enabl
+@@ -4807,6 +4810,7 @@ static void net_rps_action_and_irq_enabl
sd->rps_ipi_list = NULL;
local_irq_enable();
@@ -144,7 +144,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* Send pending IPI's to kick RPS processing on remote cpus. */
while (remsd) {
-@@ -4810,6 +4814,7 @@ static void net_rps_action_and_irq_enabl
+@@ -4820,6 +4824,7 @@ static void net_rps_action_and_irq_enabl
} else
#endif
local_irq_enable();
@@ -152,7 +152,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
static bool sd_has_rps_ipi_waiting(struct softnet_data *sd)
-@@ -4891,6 +4896,7 @@ void __napi_schedule(struct napi_struct
+@@ -4897,6 +4902,7 @@ void __napi_schedule(struct napi_struct
local_irq_save(flags);
____napi_schedule(this_cpu_ptr(&softnet_data), n);
local_irq_restore(flags);
@@ -160,7 +160,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
EXPORT_SYMBOL(__napi_schedule);
-@@ -7989,6 +7995,7 @@ static int dev_cpu_callback(struct notif
+@@ -7998,6 +8004,7 @@ static int dev_cpu_callback(struct notif
raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_enable();
diff --git a/debian/patches/features/all/rt/softirq-split-locks.patch b/debian/patches/features/all/rt/softirq-split-locks.patch
index 23f7f6e..a6ce826 100644
--- a/debian/patches/features/all/rt/softirq-split-locks.patch
+++ b/debian/patches/features/all/rt/softirq-split-locks.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -30,10 +30,10 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
include/linux/preempt.h | 15 +
include/linux/sched.h | 3
init/main.c | 1
- kernel/softirq.c | 488 +++++++++++++++++++++++++++++++++++++-------
+ kernel/softirq.c | 492 +++++++++++++++++++++++++++++++++++++-------
kernel/time/tick-sched.c | 9
net/core/dev.c | 6
- 8 files changed, 477 insertions(+), 94 deletions(-)
+ 8 files changed, 480 insertions(+), 95 deletions(-)
--- a/include/linux/bottom_half.h
+++ b/include/linux/bottom_half.h
@@ -86,7 +86,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#endif /* _LINUX_BH_H */
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
-@@ -461,10 +461,11 @@ struct softirq_action
+@@ -469,10 +469,11 @@ struct softirq_action
void (*action)(struct softirq_action *);
};
@@ -100,7 +100,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void do_softirq_own_stack(void);
#else
static inline void do_softirq_own_stack(void)
-@@ -472,6 +473,9 @@ static inline void do_softirq_own_stack(
+@@ -480,6 +481,9 @@ static inline void do_softirq_own_stack(
__do_softirq();
}
#endif
@@ -110,7 +110,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
extern void open_softirq(int nr, void (*action)(struct softirq_action *));
extern void softirq_init(void);
-@@ -479,6 +483,7 @@ extern void __raise_softirq_irqoff(unsig
+@@ -487,6 +491,7 @@ extern void __raise_softirq_irqoff(unsig
extern void raise_softirq_irqoff(unsigned int nr);
extern void raise_softirq(unsigned int nr);
@@ -118,7 +118,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
DECLARE_PER_CPU(struct task_struct *, ksoftirqd);
-@@ -636,6 +641,12 @@ void tasklet_hrtimer_cancel(struct taskl
+@@ -644,6 +649,12 @@ void tasklet_hrtimer_cancel(struct taskl
tasklet_kill(&ttimer->tasklet);
}
@@ -173,7 +173,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
* Are we in NMI context?
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1939,6 +1939,8 @@ struct task_struct {
+@@ -1964,6 +1964,8 @@ struct task_struct {
#endif
#ifdef CONFIG_PREEMPT_RT_BASE
struct rcu_head put_rcu;
@@ -182,7 +182,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#endif
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
unsigned long task_state_change;
-@@ -2236,6 +2238,7 @@ extern void thread_group_cputime_adjuste
+@@ -2280,6 +2282,7 @@ extern void thread_group_cputime_adjuste
/*
* Per process flags
*/
@@ -309,7 +309,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* we cannot loop indefinitely here to avoid userspace starvation,
* but we also don't want to introduce a worst case 1/HZ latency
-@@ -78,6 +171,68 @@ static void wakeup_softirqd(void)
+@@ -78,6 +171,26 @@ static void wakeup_softirqd(void)
wake_up_process(tsk);
}
@@ -333,6 +333,13 @@ Signed-off-by: Thomas Gleixner <tglx at 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.
+@@ -89,6 +202,48 @@ static bool ksoftirqd_running(void)
+ return tsk && (tsk->state == TASK_RUNNING);
+ }
+
+#ifndef CONFIG_PREEMPT_RT_FULL
+static inline int ksoftirqd_softirq_pending(void)
+{
@@ -378,7 +385,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* preempt_count and SOFTIRQ_OFFSET usage:
* - preempt_count is changed by SOFTIRQ_OFFSET on entering or leaving
-@@ -233,10 +388,8 @@ asmlinkage __visible void __softirq_entr
+@@ -244,10 +399,8 @@ asmlinkage __visible void __softirq_entr
unsigned long end = jiffies + MAX_SOFTIRQ_TIME;
unsigned long old_flags = current->flags;
int max_restart = MAX_SOFTIRQ_RESTART;
@@ -389,7 +396,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
* Mask out PF_MEMALLOC s current task context is borrowed for the
-@@ -255,36 +408,7 @@ asmlinkage __visible void __softirq_entr
+@@ -266,36 +419,7 @@ asmlinkage __visible void __softirq_entr
/* Reset the pending bitmask before enabling irqs */
set_softirq_pending(0);
@@ -427,7 +434,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
pending = local_softirq_pending();
if (pending) {
-@@ -321,6 +445,246 @@ asmlinkage __visible void do_softirq(voi
+@@ -332,6 +456,246 @@ asmlinkage __visible void do_softirq(voi
}
/*
@@ -674,7 +681,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
* Enter an interrupt context.
*/
void irq_enter(void)
-@@ -331,9 +695,9 @@ void irq_enter(void)
+@@ -342,9 +706,9 @@ void irq_enter(void)
* Prevent raise_softirq from needlessly waking up ksoftirqd
* here, as softirq will be serviced on return from interrupt.
*/
@@ -686,20 +693,26 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
__irq_enter();
-@@ -341,6 +705,7 @@ void irq_enter(void)
+@@ -352,9 +716,13 @@ void irq_enter(void)
static inline void invoke_softirq(void)
{
++#ifdef CONFIG_PREEMPT_RT_FULL
++ unsigned long flags;
++#endif
++
+ if (ksoftirqd_running())
+ return;
+-
+#ifndef CONFIG_PREEMPT_RT_FULL
if (!force_irqthreads) {
#ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK
/*
-@@ -360,6 +725,15 @@ static inline void invoke_softirq(void)
+@@ -374,6 +742,14 @@ static inline void invoke_softirq(void)
} else {
wakeup_softirqd();
}
+#else /* PREEMPT_RT_FULL */
-+ unsigned long flags;
+
+ local_irq_save(flags);
+ if (__this_cpu_read(ksoftirqd) &&
@@ -710,7 +723,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
static inline void tick_irq_exit(void)
-@@ -396,26 +770,6 @@ void irq_exit(void)
+@@ -410,26 +786,6 @@ void irq_exit(void)
trace_hardirq_exit(); /* must be last! */
}
@@ -737,7 +750,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void raise_softirq(unsigned int nr)
{
unsigned long flags;
-@@ -425,12 +779,6 @@ void raise_softirq(unsigned int nr)
+@@ -439,12 +795,6 @@ void raise_softirq(unsigned int nr)
local_irq_restore(flags);
}
@@ -750,7 +763,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
void open_softirq(int nr, void (*action)(struct softirq_action *))
{
softirq_vec[nr].action = action;
-@@ -733,23 +1081,7 @@ EXPORT_SYMBOL(tasklet_unlock_wait);
+@@ -747,23 +1097,7 @@ EXPORT_SYMBOL(tasklet_unlock_wait);
static int ksoftirqd_should_run(unsigned int cpu)
{
@@ -775,7 +788,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
#ifdef CONFIG_HOTPLUG_CPU
-@@ -831,6 +1163,8 @@ static struct notifier_block cpu_nfb = {
+@@ -830,6 +1164,8 @@ static int takeover_tasklets(unsigned in
static struct smp_hotplug_thread softirq_threads = {
.store = &ksoftirqd,
@@ -786,7 +799,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
.thread_comm = "ksoftirqd/%u",
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
-@@ -879,14 +879,7 @@ static bool can_stop_idle_tick(int cpu,
+@@ -882,14 +882,7 @@ static bool can_stop_idle_tick(int cpu,
return false;
if (unlikely(local_softirq_pending() && cpu_online(cpu))) {
@@ -804,7 +817,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -3849,11 +3849,9 @@ int netif_rx_ni(struct sk_buff *skb)
+@@ -3834,11 +3834,9 @@ int netif_rx_ni(struct sk_buff *skb)
trace_netif_rx_ni_entry(skb);
diff --git a/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch b/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch
index 11dca2a..6fb1ee5 100644
--- a/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch
+++ b/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -24,7 +24,7 @@ Cc: stable-rt at vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
kernel/softirq.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++--------
- 1 file changed, 74 insertions(+), 11 deletions(-)
+ 1 file changed, 73 insertions(+), 12 deletions(-)
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -33,12 +33,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
+#ifdef CONFIG_PREEMPT_RT_FULL
-+#define TIMER_SOFTIRQS ((1 << TIMER_SOFTIRQ) | (1 << HRTIMER_SOFTIRQ))
++#define TIMER_SOFTIRQS ((1 << TIMER_SOFTIRQ) | (1 << HRTIMER_SOFTIRQ))
+DEFINE_PER_CPU(struct task_struct *, ktimer_softirqd);
+#endif
const char * const softirq_to_name[NR_SOFTIRQS] = {
- "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "BLOCK_IOPOLL",
+ "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", "IRQ_POLL",
@@ -171,6 +175,17 @@ static void wakeup_softirqd(void)
wake_up_process(tsk);
}
@@ -57,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
static void handle_softirq(unsigned int vec_nr)
{
struct softirq_action *h = softirq_vec + vec_nr;
-@@ -473,7 +488,6 @@ void __raise_softirq_irqoff(unsigned int
+@@ -484,7 +499,6 @@ void __raise_softirq_irqoff(unsigned int
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) { }
@@ -65,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#else /* !PREEMPT_RT_FULL */
-@@ -620,8 +634,12 @@ void thread_do_softirq(void)
+@@ -631,8 +645,12 @@ void thread_do_softirq(void)
static void do_raise_softirq_irqoff(unsigned int nr)
{
@@ -79,7 +79,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/*
* If we are not in a hard interrupt and inside a bh disabled
-@@ -630,16 +648,30 @@ static void do_raise_softirq_irqoff(unsi
+@@ -641,16 +659,29 @@ static void do_raise_softirq_irqoff(unsi
* delegate it to ksoftirqd.
*/
if (!in_irq() && current->softirq_nestcnt)
@@ -104,7 +104,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+ wakeup_softirqd();
}
-+
void __raise_softirq_irqoff(unsigned int nr)
{
do_raise_softirq_irqoff(nr);
@@ -114,7 +113,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
/*
-@@ -665,7 +697,7 @@ void raise_softirq_irqoff(unsigned int n
+@@ -676,7 +707,7 @@ void raise_softirq_irqoff(unsigned int n
* raise a WARN() if the condition is met.
*/
if (!current->softirq_nestcnt)
@@ -123,7 +122,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
static inline int ksoftirqd_softirq_pending(void)
-@@ -678,22 +710,37 @@ static inline void _local_bh_enable_nort
+@@ -689,22 +720,37 @@ static inline void _local_bh_enable_nort
static inline void ksoftirqd_set_sched_params(unsigned int cpu)
{
@@ -164,7 +163,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#endif /* PREEMPT_RT_FULL */
/*
* Enter an interrupt context.
-@@ -743,6 +790,9 @@ static inline void invoke_softirq(void)
+@@ -759,6 +805,9 @@ static inline void invoke_softirq(void)
if (__this_cpu_read(ksoftirqd) &&
__this_cpu_read(ksoftirqd)->softirqs_raised)
wakeup_softirqd();
@@ -174,7 +173,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
local_irq_restore(flags);
#endif
}
-@@ -1175,17 +1225,30 @@ static struct notifier_block cpu_nfb = {
+@@ -1176,18 +1225,30 @@ static int takeover_tasklets(unsigned in
static struct smp_hotplug_thread softirq_threads = {
.store = &ksoftirqd,
.setup = ksoftirqd_set_sched_params,
@@ -197,12 +196,13 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
+
static __init int spawn_ksoftirqd(void)
{
- register_cpu_notifier(&cpu_nfb);
-
+ cpuhp_setup_state_nocalls(CPUHP_SOFTIRQ_DEAD, "softirq:dead", NULL,
+ takeover_tasklets);
BUG_ON(smpboot_register_percpu_thread(&softirq_threads));
+-
+#ifdef CONFIG_PREEMPT_RT_FULL
+ BUG_ON(smpboot_register_percpu_thread(&softirq_timer_threads));
+#endif
-
return 0;
}
+ early_initcall(spawn_ksoftirqd);
diff --git a/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch b/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch
index e6bcc99..aacfb4b 100644
--- a/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch
+++ b/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch
@@ -1,7 +1,7 @@
From: Allen Pais <allen.pais at oracle.com>
Date: Fri, 13 Dec 2013 09:44:41 +0530
Subject: sparc64: use generic rwsem spinlocks rt
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Signed-off-by: Allen Pais <allen.pais at oracle.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
@@ -11,7 +11,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
-@@ -187,12 +187,10 @@ config NR_CPUS
+@@ -194,12 +194,10 @@ config NR_CPUS
source kernel/Kconfig.hz
config RWSEM_GENERIC_SPINLOCK
diff --git a/debian/patches/features/all/rt/spinlock-types-separate-raw.patch b/debian/patches/features/all/rt/spinlock-types-separate-raw.patch
index f94f3bd..e4cd06f 100644
--- a/debian/patches/features/all/rt/spinlock-types-separate-raw.patch
+++ b/debian/patches/features/all/rt/spinlock-types-separate-raw.patch
@@ -1,7 +1,7 @@
Subject: spinlock: Split the lock types header
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 29 Jun 2011 19:34:01 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/stomp-machine-create-lg_global_trylock_relax-primiti.patch b/debian/patches/features/all/rt/stomp-machine-create-lg_global_trylock_relax-primiti.patch
deleted file mode 100644
index 19e5462..0000000
--- a/debian/patches/features/all/rt/stomp-machine-create-lg_global_trylock_relax-primiti.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From: Mike Galbraith <umgwanakikbuti at gmail.com>
-Date: Fri, 2 May 2014 13:13:22 +0200
-Subject: stomp-machine: create lg_global_trylock_relax() primitive
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-Create lg_global_trylock_relax() for use by stopper thread when it cannot
-schedule, to deal with stop_cpus_lock, which is now an lglock.
-
-Signed-off-by: Mike Galbraith <umgwanakikbuti at gmail.com>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- include/linux/lglock.h | 6 ++++++
- include/linux/spinlock_rt.h | 1 +
- kernel/locking/lglock.c | 25 +++++++++++++++++++++++++
- kernel/locking/rtmutex.c | 5 +++++
- 4 files changed, 37 insertions(+)
-
---- a/include/linux/lglock.h
-+++ b/include/linux/lglock.h
-@@ -82,6 +82,12 @@ void lg_double_unlock(struct lglock *lg,
- void lg_global_lock(struct lglock *lg);
- void lg_global_unlock(struct lglock *lg);
-
-+#ifndef CONFIG_PREEMPT_RT_FULL
-+#define lg_global_trylock_relax(name) lg_global_lock(name)
-+#else
-+void lg_global_trylock_relax(struct lglock *lg);
-+#endif
-+
- #else
- /* When !CONFIG_SMP, map lglock to spinlock */
- #define lglock spinlock
---- a/include/linux/spinlock_rt.h
-+++ b/include/linux/spinlock_rt.h
-@@ -40,6 +40,7 @@ extern int atomic_dec_and_spin_lock(atom
- extern void __lockfunc __rt_spin_lock__no_mg(struct rt_mutex *lock);
- extern void __lockfunc __rt_spin_lock(struct rt_mutex *lock);
- extern void __lockfunc __rt_spin_unlock(struct rt_mutex *lock);
-+extern int __lockfunc __rt_spin_trylock(struct rt_mutex *lock);
-
- #define spin_lock(lock) rt_spin_lock(lock)
-
---- a/kernel/locking/lglock.c
-+++ b/kernel/locking/lglock.c
-@@ -127,3 +127,28 @@ void lg_global_unlock(struct lglock *lg)
- preempt_enable_nort();
- }
- EXPORT_SYMBOL(lg_global_unlock);
-+
-+#ifdef CONFIG_PREEMPT_RT_FULL
-+/*
-+ * HACK: If you use this, you get to keep the pieces.
-+ * Used in queue_stop_cpus_work() when stop machinery
-+ * is called from inactive CPU, so we can't schedule.
-+ */
-+# define lg_do_trylock_relax(l) \
-+ do { \
-+ while (!__rt_spin_trylock(l)) \
-+ cpu_relax(); \
-+ } while (0)
-+
-+void lg_global_trylock_relax(struct lglock *lg)
-+{
-+ int i;
-+
-+ lock_acquire_exclusive(&lg->lock_dep_map, 0, 0, NULL, _RET_IP_);
-+ for_each_possible_cpu(i) {
-+ lg_lock_ptr *lock;
-+ lock = per_cpu_ptr(lg->lock, i);
-+ lg_do_trylock_relax(lock);
-+ }
-+}
-+#endif
---- a/kernel/locking/rtmutex.c
-+++ b/kernel/locking/rtmutex.c
-@@ -1279,6 +1279,11 @@ void __lockfunc rt_spin_unlock_wait(spin
- }
- EXPORT_SYMBOL(rt_spin_unlock_wait);
-
-+int __lockfunc __rt_spin_trylock(struct rt_mutex *lock)
-+{
-+ return rt_mutex_trylock(lock);
-+}
-+
- int __lockfunc rt_spin_trylock__no_mg(spinlock_t *lock)
- {
- int ret;
diff --git a/debian/patches/features/all/rt/stomp-machine-use-lg_global_trylock_relax-to-dead-wi.patch b/debian/patches/features/all/rt/stomp-machine-use-lg_global_trylock_relax-to-dead-wi.patch
deleted file mode 100644
index 47a0f7f..0000000
--- a/debian/patches/features/all/rt/stomp-machine-use-lg_global_trylock_relax-to-dead-wi.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From: Mike Galbraith <umgwanakikbuti at gmail.com>
-Date: Fri, 2 May 2014 13:13:34 +0200
-Subject: stomp-machine: use lg_global_trylock_relax() to dead with stop_cpus_lock lglock
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-If the stop machinery is called from inactive CPU we cannot use
-lg_global_lock(), because some other stomp machine invocation might be
-in progress and the lock can be contended. We cannot schedule from this
-context, so use the lovely new lg_global_trylock_relax() primitive to
-do what we used to do via one mutex_trylock()/cpu_relax() loop. We
-now do that trylock()/relax() across an entire herd of locks. Joy.
-
-Signed-off-by: Mike Galbraith <umgwanakikbuti at gmail.com>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- kernel/stop_machine.c | 19 ++++++++++++-------
- 1 file changed, 12 insertions(+), 7 deletions(-)
-
---- a/kernel/stop_machine.c
-+++ b/kernel/stop_machine.c
-@@ -321,18 +321,21 @@ static DEFINE_MUTEX(stop_cpus_mutex);
-
- static bool queue_stop_cpus_work(const struct cpumask *cpumask,
- cpu_stop_fn_t fn, void *arg,
-- struct cpu_stop_done *done)
-+ struct cpu_stop_done *done, bool inactive)
- {
- struct cpu_stop_work *work;
- unsigned int cpu;
- bool queued = false;
-
- /*
-- * Disable preemption while queueing to avoid getting
-- * preempted by a stopper which might wait for other stoppers
-- * to enter @fn which can lead to deadlock.
-+ * Make sure that all work is queued on all cpus before
-+ * any of the cpus can execute it.
- */
-- lg_global_lock(&stop_cpus_lock);
-+ if (!inactive)
-+ lg_global_lock(&stop_cpus_lock);
-+ else
-+ lg_global_trylock_relax(&stop_cpus_lock);
-+
- for_each_cpu(cpu, cpumask) {
- work = &per_cpu(cpu_stopper.stop_work, cpu);
- work->fn = fn;
-@@ -352,7 +355,7 @@ static int __stop_cpus(const struct cpum
- struct cpu_stop_done done;
-
- cpu_stop_init_done(&done, cpumask_weight(cpumask));
-- if (!queue_stop_cpus_work(cpumask, fn, arg, &done))
-+ if (!queue_stop_cpus_work(cpumask, fn, arg, &done, false))
- return -ENOENT;
- wait_for_completion(&done.completion);
- return done.ret;
-@@ -540,6 +543,8 @@ static int __init cpu_stop_init(void)
- INIT_LIST_HEAD(&stopper->works);
- }
-
-+ lg_lock_init(&stop_cpus_lock, "stop_cpus_lock");
-+
- BUG_ON(smpboot_register_percpu_thread(&cpu_stop_threads));
- stop_machine_unpark(raw_smp_processor_id());
- stop_machine_initialized = true;
-@@ -634,7 +639,7 @@ int stop_machine_from_inactive_cpu(cpu_s
- set_state(&msdata, MULTI_STOP_PREPARE);
- cpu_stop_init_done(&done, num_active_cpus());
- queue_stop_cpus_work(cpu_active_mask, multi_cpu_stop, &msdata,
-- &done);
-+ &done, true);
- ret = multi_cpu_stop(&msdata);
-
- /* Busy wait for completion. */
diff --git a/debian/patches/features/all/rt/stop-machine-raw-lock.patch b/debian/patches/features/all/rt/stop-machine-raw-lock.patch
index b5f56af..9944651 100644
--- a/debian/patches/features/all/rt/stop-machine-raw-lock.patch
+++ b/debian/patches/features/all/rt/stop-machine-raw-lock.patch
@@ -1,18 +1,18 @@
Subject: stop_machine: Use raw spinlocks
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 29 Jun 2011 11:01:51 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Use raw-locks in stomp_machine() to allow locking in irq-off regions.
Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
---
- kernel/stop_machine.c | 24 ++++++++++++------------
- 1 file changed, 12 insertions(+), 12 deletions(-)
+ kernel/stop_machine.c | 34 +++++++++++++---------------------
+ 1 file changed, 13 insertions(+), 21 deletions(-)
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
-@@ -37,7 +37,7 @@ struct cpu_stop_done {
+@@ -36,7 +36,7 @@ struct cpu_stop_done {
struct cpu_stopper {
struct task_struct *thread;
@@ -21,7 +21,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
bool enabled; /* is this stopper enabled? */
struct list_head works; /* list of pending works */
-@@ -83,14 +83,14 @@ static bool cpu_stop_queue_work(unsigned
+@@ -78,14 +78,14 @@ static bool cpu_stop_queue_work(unsigned
unsigned long flags;
bool enabled;
@@ -38,10 +38,10 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return enabled;
}
-@@ -232,8 +232,8 @@ static int cpu_stop_queue_two_works(int
+@@ -231,8 +231,8 @@ static int cpu_stop_queue_two_works(int
+ struct cpu_stopper *stopper2 = per_cpu_ptr(&cpu_stopper, cpu2);
int err;
-
- lg_double_lock(&stop_cpus_lock, cpu1, cpu2);
+ retry:
- spin_lock_irq(&stopper1->lock);
- spin_lock_nested(&stopper2->lock, SINGLE_DEPTH_NESTING);
+ raw_spin_lock_irq(&stopper1->lock);
@@ -49,7 +49,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
err = -ENOENT;
if (!stopper1->enabled || !stopper2->enabled)
-@@ -243,8 +243,8 @@ static int cpu_stop_queue_two_works(int
+@@ -255,8 +255,8 @@ static int cpu_stop_queue_two_works(int
__cpu_stop_queue_work(stopper1, work1);
__cpu_stop_queue_work(stopper2, work2);
unlock:
@@ -57,10 +57,10 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
- spin_unlock_irq(&stopper1->lock);
+ raw_spin_unlock(&stopper2->lock);
+ raw_spin_unlock_irq(&stopper1->lock);
- lg_double_unlock(&stop_cpus_lock, cpu1, cpu2);
- return err;
-@@ -433,9 +433,9 @@ static int cpu_stop_should_run(unsigned
+ if (unlikely(err == -EDEADLK)) {
+ while (stop_cpus_in_progress)
+@@ -448,9 +448,9 @@ static int cpu_stop_should_run(unsigned
unsigned long flags;
int run;
@@ -72,7 +72,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return run;
}
-@@ -446,13 +446,13 @@ static void cpu_stopper_thread(unsigned
+@@ -461,13 +461,13 @@ static void cpu_stopper_thread(unsigned
repeat:
work = NULL;
@@ -88,7 +88,24 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (work) {
cpu_stop_fn_t fn = work->fn;
-@@ -536,7 +536,7 @@ static int __init cpu_stop_init(void)
+@@ -475,15 +475,7 @@ static void cpu_stopper_thread(unsigned
+ struct cpu_stop_done *done = work->done;
+ int ret;
+
+- /*
+- * Wait until the stopper finished scheduling on all
+- * cpus
+- */
+- lg_global_lock(&stop_cpus_lock);
+- /*
+- * Let other cpu threads continue as well
+- */
+- lg_global_unlock(&stop_cpus_lock);
++ /* XXX */
+
+ /* cpu stop callbacks must not sleep, make in_atomic() == T */
+ preempt_count_inc();
+@@ -551,7 +543,7 @@ static int __init cpu_stop_init(void)
for_each_possible_cpu(cpu) {
struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu);
diff --git a/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch b/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch
index 341b4a0..8690bd8 100644
--- a/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch
+++ b/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at elte.hu>
Date: Fri, 3 Jul 2009 08:30:27 -0500
Subject: stop_machine: convert stop_machine_run() to PREEMPT_RT
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Instead of playing with non-preemption, introduce explicit
startup serialization. This is more robust and cleaner as
@@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
-@@ -460,6 +460,16 @@ static void cpu_stopper_thread(unsigned
+@@ -475,6 +475,16 @@ static void cpu_stopper_thread(unsigned
struct cpu_stop_done *done = work->done;
int ret;
diff --git a/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch
index 71a6fc6..c6d866a 100644
--- a/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch
+++ b/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch
@@ -1,7 +1,7 @@
From: Mike Galbraith <umgwanakikbuti at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch b/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch
index 39a50cb..193313f 100644
--- a/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch
+++ b/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 15 Jul 2010 10:29:00 +0200
Subject: suspend: Prevent might sleep splats
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
timekeeping suspend/resume calls read_persistant_clock() which takes
rtc_lock. That results in might sleep warnings because at that point
@@ -26,7 +26,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
-@@ -491,6 +491,7 @@ extern enum system_states {
+@@ -488,6 +488,7 @@ extern enum system_states {
SYSTEM_HALT,
SYSTEM_POWER_OFF,
SYSTEM_RESTART,
@@ -45,7 +45,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
error = syscore_suspend();
if (error) {
printk(KERN_ERR "PM: Some system devices failed to power down, "
-@@ -315,6 +317,7 @@ static int create_image(int platform_mod
+@@ -317,6 +319,7 @@ static int create_image(int platform_mod
syscore_resume();
Enable_irqs:
@@ -53,7 +53,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
local_irq_enable();
Enable_cpus:
-@@ -444,6 +447,7 @@ static int resume_target_kernel(bool pla
+@@ -446,6 +449,7 @@ static int resume_target_kernel(bool pla
goto Enable_cpus;
local_irq_disable();
@@ -61,7 +61,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
error = syscore_suspend();
if (error)
-@@ -477,6 +481,7 @@ static int resume_target_kernel(bool pla
+@@ -479,6 +483,7 @@ static int resume_target_kernel(bool pla
syscore_resume();
Enable_irqs:
@@ -69,7 +69,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
local_irq_enable();
Enable_cpus:
-@@ -562,6 +567,7 @@ int hibernation_platform_enter(void)
+@@ -564,6 +569,7 @@ int hibernation_platform_enter(void)
goto Enable_cpus;
local_irq_disable();
@@ -77,7 +77,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
syscore_suspend();
if (pm_wakeup_pending()) {
error = -EAGAIN;
-@@ -574,6 +580,7 @@ int hibernation_platform_enter(void)
+@@ -576,6 +582,7 @@ int hibernation_platform_enter(void)
Power_up:
syscore_resume();
@@ -87,7 +87,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
Enable_cpus:
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
-@@ -361,6 +361,8 @@ static int suspend_enter(suspend_state_t
+@@ -369,6 +369,8 @@ static int suspend_enter(suspend_state_t
arch_suspend_disable_irqs();
BUG_ON(!irqs_disabled());
@@ -96,7 +96,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
error = syscore_suspend();
if (!error) {
*wakeup = pm_wakeup_pending();
-@@ -377,6 +379,8 @@ static int suspend_enter(suspend_state_t
+@@ -385,6 +387,8 @@ static int suspend_enter(suspend_state_t
syscore_resume();
}
diff --git a/debian/patches/features/all/rt/sysfs-realtime-entry.patch b/debian/patches/features/all/rt/sysfs-realtime-entry.patch
index 7c16f2b..dd96a0e 100644
--- a/debian/patches/features/all/rt/sysfs-realtime-entry.patch
+++ b/debian/patches/features/all/rt/sysfs-realtime-entry.patch
@@ -1,7 +1,7 @@
Subject: sysfs: Add /sys/kernel/realtime entry
From: Clark Williams <williams at redhat.com>
Date: Sat Jul 30 21:55:53 2011 -0500
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Add a /sys/kernel entry to indicate that the kernel is a
realtime kernel.
diff --git a/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch b/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch
index ad3db2b..ac679f2 100644
--- a/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch
+++ b/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch
@@ -1,7 +1,7 @@
Subject: tasklet: Prevent tasklets from going into infinite spin in RT
From: Ingo Molnar <mingo at elte.hu>
Date: Tue Nov 29 20:18:22 2011 -0500
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads,
and spinlocks turn are mutexes. But this can cause issues with
@@ -44,7 +44,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
-@@ -500,8 +500,9 @@ static inline struct task_struct *this_c
+@@ -508,8 +508,9 @@ static inline struct task_struct *this_c
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 +56,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
* Tasklet is strictly serialized wrt itself, but not
wrt another tasklets. If client needs some intertask synchronization,
he makes it with spinlocks.
-@@ -526,27 +527,36 @@ struct tasklet_struct name = { NULL, 0,
+@@ -534,27 +535,36 @@ struct tasklet_struct name = { NULL, 0,
enum
{
TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */
@@ -99,7 +99,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#define tasklet_unlock_wait(t) do { } while (0)
#define tasklet_unlock(t) do { } while (0)
#endif
-@@ -595,12 +605,7 @@ static inline void tasklet_disable(struc
+@@ -603,12 +613,7 @@ static inline void tasklet_disable(struc
smp_mb();
}
@@ -123,7 +123,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#include <linux/ftrace.h>
#include <linux/smp.h>
#include <linux/smpboot.h>
-@@ -446,15 +447,45 @@ struct tasklet_head {
+@@ -460,15 +461,45 @@ struct tasklet_head {
static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec);
static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec);
@@ -173,7 +173,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
local_irq_restore(flags);
}
EXPORT_SYMBOL(__tasklet_schedule);
-@@ -464,10 +495,7 @@ void __tasklet_hi_schedule(struct taskle
+@@ -478,10 +509,7 @@ void __tasklet_hi_schedule(struct taskle
unsigned long flags;
local_irq_save(flags);
@@ -185,7 +185,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
local_irq_restore(flags);
}
EXPORT_SYMBOL(__tasklet_hi_schedule);
-@@ -476,82 +504,122 @@ void __tasklet_hi_schedule_first(struct
+@@ -490,82 +518,122 @@ void __tasklet_hi_schedule_first(struct
{
BUG_ON(!irqs_disabled());
@@ -196,7 +196,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
EXPORT_SYMBOL(__tasklet_hi_schedule_first);
--static void tasklet_action(struct softirq_action *a)
+-static __latent_entropy void tasklet_action(struct softirq_action *a)
+void tasklet_enable(struct tasklet_struct *t)
{
- struct tasklet_struct *list;
@@ -317,7 +317,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
+ __tasklet_action(a, list);
+}
+
- static void tasklet_hi_action(struct softirq_action *a)
+ static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
{
struct tasklet_struct *list;
@@ -357,7 +357,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
void tasklet_init(struct tasklet_struct *t,
-@@ -572,7 +640,7 @@ void tasklet_kill(struct tasklet_struct
+@@ -586,7 +654,7 @@ void tasklet_kill(struct tasklet_struct
while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
do {
@@ -366,7 +366,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
} while (test_bit(TASKLET_STATE_SCHED, &t->state));
}
tasklet_unlock_wait(t);
-@@ -646,6 +714,23 @@ void __init softirq_init(void)
+@@ -660,6 +728,23 @@ void __init softirq_init(void)
open_softirq(HI_SOFTIRQ, tasklet_hi_action);
}
diff --git a/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch b/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch
index 8e0ba99..548357f 100644
--- a/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch
+++ b/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch
@@ -1,7 +1,7 @@
From: Daniel Wagner <wagi at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
On RT the spin lock in pkg_temp_thermal_platfrom_thermal_notify will
call schedule while we run in irq context.
@@ -37,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
#include <asm/cpu_device_id.h>
#include <asm/mce.h>
-@@ -352,7 +353,7 @@ static void pkg_temp_thermal_threshold_w
+@@ -353,7 +354,7 @@ static void pkg_temp_thermal_threshold_w
}
}
@@ -46,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
{
unsigned long flags;
int cpu = smp_processor_id();
-@@ -369,7 +370,7 @@ static int pkg_temp_thermal_platform_the
+@@ -370,7 +371,7 @@ static int pkg_temp_thermal_platform_the
pkg_work_scheduled[phy_id]) {
disable_pkg_thres_interrupt();
spin_unlock_irqrestore(&pkg_work_lock, flags);
@@ -55,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
pkg_work_scheduled[phy_id] = 1;
spin_unlock_irqrestore(&pkg_work_lock, flags);
-@@ -378,9 +379,48 @@ static int pkg_temp_thermal_platform_the
+@@ -379,9 +380,48 @@ static int pkg_temp_thermal_platform_the
schedule_delayed_work_on(cpu,
&per_cpu(pkg_temp_thermal_threshold_work, cpu),
msecs_to_jiffies(notify_delay_ms));
@@ -104,7 +104,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
static int find_siblings_cpu(int cpu)
{
int i;
-@@ -584,6 +624,9 @@ static int __init pkg_temp_thermal_init(
+@@ -585,6 +625,9 @@ static int __init pkg_temp_thermal_init(
if (!x86_match_cpu(pkg_temp_thermal_ids))
return -ENODEV;
@@ -114,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
spin_lock_init(&pkg_work_lock);
platform_thermal_package_notify =
pkg_temp_thermal_platform_thermal_notify;
-@@ -608,7 +651,7 @@ static int __init pkg_temp_thermal_init(
+@@ -609,7 +652,7 @@ static int __init pkg_temp_thermal_init(
kfree(pkg_work_scheduled);
platform_thermal_package_notify = NULL;
platform_thermal_package_rate_control = NULL;
@@ -123,7 +123,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
return -ENODEV;
}
-@@ -633,6 +676,7 @@ static void __exit pkg_temp_thermal_exit
+@@ -634,6 +677,7 @@ static void __exit pkg_temp_thermal_exit
mutex_unlock(&phy_dev_list_mutex);
platform_thermal_package_notify = NULL;
platform_thermal_package_rate_control = NULL;
diff --git a/debian/patches/features/all/rt/tick-broadcast--Make-hrtimer-irqsafe.patch b/debian/patches/features/all/rt/tick-broadcast--Make-hrtimer-irqsafe.patch
index 9630719..3bc466e 100644
--- a/debian/patches/features/all/rt/tick-broadcast--Make-hrtimer-irqsafe.patch
+++ b/debian/patches/features/all/rt/tick-broadcast--Make-hrtimer-irqsafe.patch
@@ -1,7 +1,7 @@
Subject: tick/broadcast: Make broadcast hrtimer irqsafe
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sat, 27 Feb 2016 10:47:10 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Otherwise we end up with the following:
diff --git a/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch b/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch
index 5681ab5..02284cd 100644
--- a/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch
+++ b/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch
@@ -1,7 +1,7 @@
Subject: timekeeping: Split jiffies seqlock
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 14 Feb 2013 22:36:59 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Replace jiffies_lock seqlock with a simple seqcounter and a rawlock so
it can be taken in atomic context on RT.
@@ -115,7 +115,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return period;
}
-@@ -670,10 +675,10 @@ static ktime_t tick_nohz_stop_sched_tick
+@@ -673,10 +678,10 @@ static ktime_t tick_nohz_stop_sched_tick
/* Read jiffies and the time when jiffies were updated last */
do {
diff --git a/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch b/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch
index 2695985..a3a015b 100644
--- a/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch
+++ b/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch
@@ -1,7 +1,7 @@
From: Peter Zijlstra <peterz at infradead.org>
Date: Fri, 21 Aug 2009 11:56:45 +0200
Subject: timer: delay waking softirqs from the jiffy tick
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
People were complaining about broken balancing with the recent -rt
series.
diff --git a/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch b/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch
index cdb5f0d..9495195 100644
--- a/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch
+++ b/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch
@@ -1,7 +1,7 @@
Subject: timer-fd: Prevent live lock
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 25 Jan 2012 11:08:40 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
If hrtimer_try_to_cancel() requires a retry, then depending on the
priority setting te retry loop might prevent timer callback completion
diff --git a/debian/patches/features/all/rt/timer-make-the-base-lock-raw.patch b/debian/patches/features/all/rt/timer-make-the-base-lock-raw.patch
index e3a9717..a393a55 100644
--- a/debian/patches/features/all/rt/timer-make-the-base-lock-raw.patch
+++ b/debian/patches/features/all/rt/timer-make-the-base-lock-raw.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Wed, 13 Jul 2016 18:22:23 +0200
Subject: [PATCH] timer: make the base lock raw
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The part where the base lock is held got more predictable / shorter after the
timer rework. One reason is the lack of re-cascading.
diff --git a/debian/patches/features/all/rt/timers-avoid-the-base-null-otptimization-on-rt.patch b/debian/patches/features/all/rt/timers-avoid-the-base-null-otptimization-on-rt.patch
deleted file mode 100644
index 5c44fe5..0000000
--- a/debian/patches/features/all/rt/timers-avoid-the-base-null-otptimization-on-rt.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-Subject: timers: Avoid the switch timers base set to NULL trick on RT
-From: Thomas Gleixner <tglx at linutronix.de>
-Date: Thu, 21 Jul 2011 15:23:39 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-On RT that code is preemptible, so we cannot assign NULL to timers
-base as a preempter would spin forever in lock_timer_base().
-
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
----
- kernel/time/timer.c | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
---- a/kernel/time/timer.c
-+++ b/kernel/time/timer.c
-@@ -780,6 +780,39 @@ static struct tvec_base *lock_timer_base
- cpu_relax();
- }
- }
-+#ifdef CONFIG_PREEMPT_RT_FULL
-+static inline struct tvec_base *switch_timer_base(struct timer_list *timer,
-+ struct tvec_base *old,
-+ struct tvec_base *new)
-+{
-+ /*
-+ * We cannot do the below because we might be preempted and
-+ * then the preempter would see NULL and loop forever.
-+ */
-+ if (spin_trylock(&new->lock)) {
-+ WRITE_ONCE(timer->flags,
-+ (timer->flags & ~TIMER_BASEMASK) | new->cpu);
-+ spin_unlock(&old->lock);
-+ return new;
-+ }
-+ return old;
-+}
-+
-+#else
-+static inline struct tvec_base *switch_timer_base(struct timer_list *timer,
-+ struct tvec_base *old,
-+ struct tvec_base *new)
-+{
-+ /* See the comment in lock_timer_base() */
-+ timer->flags |= TIMER_MIGRATING;
-+
-+ spin_unlock(&old->lock);
-+ spin_lock(&new->lock);
-+ WRITE_ONCE(timer->flags,
-+ (timer->flags & ~TIMER_BASEMASK) | new->cpu);
-+ return new;
-+}
-+#endif
-
- static inline int
- __mod_timer(struct timer_list *timer, unsigned long expires,
-@@ -810,16 +843,8 @@ static inline int
- * handler yet has not finished. This also guarantees that
- * the timer is serialized wrt itself.
- */
-- if (likely(base->running_timer != timer)) {
-- /* See the comment in lock_timer_base() */
-- timer->flags |= TIMER_MIGRATING;
--
-- spin_unlock(&base->lock);
-- base = new_base;
-- spin_lock(&base->lock);
-- WRITE_ONCE(timer->flags,
-- (timer->flags & ~TIMER_BASEMASK) | base->cpu);
-- }
-+ if (likely(base->running_timer != timer))
-+ base = switch_timer_base(timer, base, new_base);
- }
-
- timer->expires = expires;
diff --git a/debian/patches/features/all/rt/timers-preempt-rt-support.patch b/debian/patches/features/all/rt/timers-preempt-rt-support.patch
deleted file mode 100644
index 863ca5e..0000000
--- a/debian/patches/features/all/rt/timers-preempt-rt-support.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From: Ingo Molnar <mingo at elte.hu>
-Date: Fri, 3 Jul 2009 08:30:20 -0500
-Subject: timers: Preempt-rt support
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-The base->lock is a sleeping lock. Try not to workaround with a
-spin_trylock(). The rt-mutex lock is not irq save even the try-lock
-due to way how the inner lock accessed. Even with this fixed have the
-problem that the owner is not the current process on the CPU but his
-pid is used while taking the lock. Therefore we go with ext jiffy for
-the wakeup. Also drop preempt_disable() usage since we need just to
-ensure not to switch CPUs (the data structures have own locks).
-
-[bigeasy: dropped that spin try lock]
-Signed-off-by: Ingo Molnar <mingo at elte.hu>
-Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
----
- kernel/time/timer.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
---- a/kernel/time/timer.c
-+++ b/kernel/time/timer.c
-@@ -1422,6 +1422,14 @@ u64 get_next_timer_interrupt(unsigned lo
- if (cpu_is_offline(smp_processor_id()))
- return expires;
-
-+#ifdef CONFIG_PREEMPT_RT_FULL
-+ /*
-+ * On PREEMPT_RT we cannot sleep here. As a result we can't take
-+ * the base lock to check when the next timer is pending and so
-+ * we assume the next jiffy.
-+ */
-+ return basem + TICK_NSEC;
-+#endif
- spin_lock(&base->lock);
- if (base->active_timers) {
- if (time_before_eq(base->next_timer, base->timer_jiffies))
-@@ -1632,7 +1640,7 @@ static void migrate_timers(int cpu)
-
- BUG_ON(cpu_online(cpu));
- old_base = per_cpu_ptr(&tvec_bases, cpu);
-- new_base = get_cpu_ptr(&tvec_bases);
-+ new_base = get_local_ptr(&tvec_bases);
- /*
- * The caller is globally serialized and nobody else
- * takes two locks at once, deadlock is not possible.
-@@ -1656,7 +1664,7 @@ static void migrate_timers(int cpu)
-
- spin_unlock(&old_base->lock);
- spin_unlock_irq(&new_base->lock);
-- put_cpu_ptr(&tvec_bases);
-+ put_local_ptr(&tvec_bases);
- }
-
- static int timer_cpu_notify(struct notifier_block *self,
diff --git a/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch b/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch
index db901c0..1994517 100644
--- a/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch
+++ b/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/trace-correct-off-by-one-while-recording-the-trace-e.patch b/debian/patches/features/all/rt/trace-correct-off-by-one-while-recording-the-trace-e.patch
deleted file mode 100644
index 64d7a5e..0000000
--- a/debian/patches/features/all/rt/trace-correct-off-by-one-while-recording-the-trace-e.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Wed, 25 May 2016 14:03:50 +0200
-Subject: [PATCH] trace: correct off by one while recording the trace-event
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.6/older/patches-4.6.2-rt5.tar.xz
-
-Trace events like raw_syscalls show always a preempt code of one. The
-reason is that on PREEMPT kernels rcu_read_lock_sched_notrace()
-increases the preemption counter and the function recording the counter
-is caller within the RCU section.
-
-Cc: stable-rt at vger.kernel.org
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- include/linux/tracepoint.h | 13 +++++++++++++
- kernel/trace/trace_events.c | 2 +-
- 2 files changed, 14 insertions(+), 1 deletion(-)
-
---- a/include/linux/tracepoint.h
-+++ b/include/linux/tracepoint.h
-@@ -33,6 +33,19 @@ struct trace_enum_map {
-
- #define TRACEPOINT_DEFAULT_PRIO 10
-
-+/*
-+ * The preempt count recorded in trace_event_raw_event_# are off by one due to
-+ * rcu_read_lock_sched_notrace() in __DO_TRACE. This is corrected here.
-+ */
-+static inline int event_preempt_count(void)
-+{
-+#ifdef CONFIG_PREEMPT
-+ return preempt_count() - 1;
-+#else
-+ return 0;
-+#endif
-+}
-+
- extern int
- tracepoint_probe_register(struct tracepoint *tp, void *probe, void *data);
- extern int
---- a/kernel/trace/trace_events.c
-+++ b/kernel/trace/trace_events.c
-@@ -243,7 +243,7 @@ void *trace_event_buffer_reserve(struct
- return NULL;
-
- local_save_flags(fbuffer->flags);
-- fbuffer->pc = preempt_count();
-+ fbuffer->pc = event_preempt_count();
- fbuffer->trace_file = trace_file;
-
- fbuffer->event =
diff --git a/debian/patches/features/all/rt/trace-latency-hist-Consider-new-argument-when-probin.patch b/debian/patches/features/all/rt/trace-latency-hist-Consider-new-argument-when-probin.patch
index 4ff1e0c..da411c7 100644
--- a/debian/patches/features/all/rt/trace-latency-hist-Consider-new-argument-when-probin.patch
+++ b/debian/patches/features/all/rt/trace-latency-hist-Consider-new-argument-when-probin.patch
@@ -2,7 +2,7 @@ From: Carsten Emde <C.Emde at osadl.org>
Date: Tue, 5 Jan 2016 10:21:59 +0100
Subject: trace/latency-hist: Consider new argument when probing the
sched_switch tracer
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The sched_switch tracer has got a new argument. Fix the latency tracer
accordingly.
diff --git a/debian/patches/features/all/rt/trace_Use_rcuidle_version_for_preemptoff_hist_trace_point.patch b/debian/patches/features/all/rt/trace_Use_rcuidle_version_for_preemptoff_hist_trace_point.patch
index 2ed8a84..b9cd15e 100644
--- a/debian/patches/features/all/rt/trace_Use_rcuidle_version_for_preemptoff_hist_trace_point.patch
+++ b/debian/patches/features/all/rt/trace_Use_rcuidle_version_for_preemptoff_hist_trace_point.patch
@@ -1,7 +1,7 @@
Subject: trace: Use rcuidle version for preemptoff_hist trace point
From: Yang Shi <yang.shi at windriver.com>
Date: Tue, 23 Feb 2016 13:23:23 -0800
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
When running -rt kernel with both PREEMPT_OFF_HIST and LOCKDEP enabled,
the below error is reported:
diff --git a/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch b/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch
index 23cfdc6..f8fbd19 100644
--- a/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch
+++ b/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch
@@ -1,7 +1,7 @@
From: Steven Rostedt <rostedt at goodmis.org>
Date: Thu, 29 Sep 2011 12:24:30 -0500
Subject: tracing: Account for preempt off in preempt_schedule()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
The preempt_schedule() uses the preempt_disable_notrace() version
because it can cause infinite recursion by the function tracer as
@@ -28,7 +28,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -3553,7 +3553,16 @@ asmlinkage __visible void __sched notrac
+@@ -3583,7 +3583,16 @@ asmlinkage __visible void __sched notrac
* an infinite recursion.
*/
prev_ctx = exception_enter();
diff --git a/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch b/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch
index ac3d2d8..5d43760 100644
--- a/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch
+++ b/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -15,7 +15,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
-@@ -3109,10 +3109,8 @@ void serial8250_console_write(struct uar
+@@ -3144,10 +3144,8 @@ void serial8250_console_write(struct uar
serial8250_rpm_get(up);
diff --git a/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch b/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch
index d7a6ecb..292e752 100644
--- a/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch
+++ b/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch
@@ -1,7 +1,7 @@
Subject: net: Remove preemption disabling in netif_rx()
From: Priyanka Jain <Priyanka.Jain at freescale.com>
Date: Thu, 17 May 2012 09:35:11 +0530
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
1)enqueue_to_backlog() (called from netif_rx) should be
bind to a particluar CPU. This can be achieved by
@@ -38,7 +38,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -3804,7 +3804,7 @@ static int netif_rx_internal(struct sk_b
+@@ -3789,7 +3789,7 @@ static int netif_rx_internal(struct sk_b
struct rps_dev_flow voidflow, *rflow = &voidflow;
int cpu;
@@ -47,7 +47,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
rcu_read_lock();
cpu = get_rps_cpu(skb->dev, skb, &rflow);
-@@ -3814,13 +3814,13 @@ static int netif_rx_internal(struct sk_b
+@@ -3799,13 +3799,13 @@ static int netif_rx_internal(struct sk_b
ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
rcu_read_unlock();
diff --git a/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch b/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch
index 5a704a7..a2ddcef 100644
--- a/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch
+++ b/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Fri, 8 Nov 2013 17:34:54 +0100
Subject: usb: Use _nort in giveback function
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Since commit 94dfd7ed ("USB: HCD: support giveback of URB in tasklet
context") I see
@@ -44,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
-@@ -1760,9 +1760,9 @@ static void __usb_hcd_giveback_urb(struc
+@@ -1761,9 +1761,9 @@ static void __usb_hcd_giveback_urb(struc
* and no one may trigger the above deadlock situation when
* running complete() in tasklet.
*/
diff --git a/debian/patches/features/all/rt/user-use-local-irq-nort.patch b/debian/patches/features/all/rt/user-use-local-irq-nort.patch
index 72d5285..b8e5840 100644
--- a/debian/patches/features/all/rt/user-use-local-irq-nort.patch
+++ b/debian/patches/features/all/rt/user-use-local-irq-nort.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Tue, 21 Jul 2009 23:06:05 +0200
Subject: core: Do not disable interrupts on RT in kernel/users.c
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Use the local_irq_*_nort variants to reduce latencies in RT. The code
is serialized by the locks. No need to disable interrupts.
diff --git a/debian/patches/features/all/rt/wait.h-include-atomic.h.patch b/debian/patches/features/all/rt/wait.h-include-atomic.h.patch
index 122043a..10fba15 100644
--- a/debian/patches/features/all/rt/wait.h-include-atomic.h.patch
+++ b/debian/patches/features/all/rt/wait.h-include-atomic.h.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
| CC init/main.o
|In file included from include/linux/mmzone.h:9:0,
diff --git a/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch b/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch
index 91c3d40..8da5718 100644
--- a/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch
+++ b/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch b/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch
index 59f8380..0b72cdc 100644
--- a/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch
+++ b/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch
@@ -1,7 +1,7 @@
From: Daniel Wagner <daniel.wagner at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Provides a framework for enqueuing callbacks from irq context
PREEMPT_RT_FULL safe. The callbacks are executed in kthread context.
diff --git a/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch b/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch
index 5bf0164..bf3af66 100644
--- a/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch
+++ b/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch
@@ -22,7 +22,7 @@ Cc: Jens Axboe <axboe at kernel.dk>
Cc: Linus Torvalds <torvalds at linux-foundation.org>
Link: http://lkml.kernel.org/r/20110622174919.135236139@linutronix.de
Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
---
kernel/sched/core.c | 81 ++++++++------------------------------------
@@ -32,7 +32,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -1701,10 +1701,6 @@ static inline void ttwu_activate(struct
+@@ -1711,10 +1711,6 @@ static inline void ttwu_activate(struct
{
activate_task(rq, p, en_flags);
p->on_rq = TASK_ON_RQ_QUEUED;
@@ -43,12 +43,13 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.
}
/*
-@@ -2143,53 +2139,6 @@ try_to_wake_up(struct task_struct *p, un
+@@ -2152,53 +2148,6 @@ try_to_wake_up(struct task_struct *p, un
}
/**
- * try_to_wake_up_local - try to wake up a local task with rq lock held
- * @p: the thread to be awakened
+- * @cookie: context's cookie for pinning
- *
- * Put @p on the run-queue if it's not already there. The caller must
- * ensure that this_rq() is locked, @p is bound to this_rq() and not
@@ -87,8 +88,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.
- ttwu_activate(rq, p, ENQUEUE_WAKEUP);
-
- ttwu_do_wakeup(rq, p, 0, cookie);
-- if (schedstat_enabled())
-- ttwu_stat(p, smp_processor_id(), 0);
+- ttwu_stat(p, smp_processor_id(), 0);
-out:
- raw_spin_unlock(&p->pi_lock);
-}
@@ -97,7 +97,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.
* wake_up_process - Wake up a specific process
* @p: The process to be woken up.
*
-@@ -3499,21 +3448,6 @@ static void __sched notrace __schedule(b
+@@ -3494,21 +3443,6 @@ static void __sched notrace __schedule(b
} else {
deactivate_task(rq, prev, DEQUEUE_SLEEP);
prev->on_rq = 0;
@@ -119,7 +119,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.
}
switch_count = &prev->nvcsw;
}
-@@ -3546,6 +3480,14 @@ static inline void sched_submit_work(str
+@@ -3567,6 +3501,14 @@ static inline void sched_submit_work(str
{
if (!tsk->state || tsk_is_pi_blocked(tsk))
return;
@@ -134,7 +134,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.
/*
* If we are going to sleep and we have plugged IO queued,
* make sure to submit it to avoid deadlocks.
-@@ -3554,6 +3496,12 @@ static inline void sched_submit_work(str
+@@ -3575,6 +3517,12 @@ static inline void sched_submit_work(str
blk_schedule_flush_plug(tsk);
}
@@ -147,7 +147,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.
asmlinkage __visible void __sched schedule(void)
{
struct task_struct *tsk = current;
-@@ -3564,6 +3512,7 @@ asmlinkage __visible void __sched schedu
+@@ -3585,6 +3533,7 @@ asmlinkage __visible void __sched schedu
__schedule(false);
sched_preempt_enable_no_resched();
} while (need_resched());
diff --git a/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch b/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch
index 7aa3146..3b6682f 100644
--- a/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch
+++ b/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch
@@ -1,7 +1,7 @@
Subject: workqueue: Prevent deadlock/stall on RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Fri, 27 Jun 2014 16:24:52 +0200 (CEST)
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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.
@@ -44,7 +44,7 @@ Cc: Steven Rostedt <rostedt at goodmis.org>
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -3594,9 +3594,8 @@ STACK_FRAME_NON_STANDARD(__schedule); /*
+@@ -3615,9 +3615,8 @@ void __noreturn do_task_dead(void)
static inline void sched_submit_work(struct task_struct *tsk)
{
@@ -55,7 +55,7 @@ Cc: Steven Rostedt <rostedt at goodmis.org>
/*
* If a worker went to sleep, notify and ask workqueue whether
* it wants to wake up a task to maintain concurrency.
-@@ -3604,6 +3603,10 @@ static inline void sched_submit_work(str
+@@ -3625,6 +3624,10 @@ static inline void sched_submit_work(str
if (tsk->flags & PF_WQ_WORKER)
wq_worker_sleeping(tsk);
diff --git a/debian/patches/features/all/rt/workqueue-use-locallock.patch b/debian/patches/features/all/rt/workqueue-use-locallock.patch
index e9676b7..c201464 100644
--- a/debian/patches/features/all/rt/workqueue-use-locallock.patch
+++ b/debian/patches/features/all/rt/workqueue-use-locallock.patch
@@ -1,15 +1,15 @@
Subject: workqueue: Use local irq lock instead of irq disable regions
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 17 Jul 2011 21:42:26 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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 at linutronix.de>
---
- kernel/workqueue.c | 31 +++++++++++++++++--------------
- 1 file changed, 17 insertions(+), 14 deletions(-)
+ kernel/workqueue.c | 33 +++++++++++++++++++--------------
+ 1 file changed, 19 insertions(+), 14 deletions(-)
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -30,19 +30,21 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
static int worker_thread(void *__worker);
static void workqueue_sysfs_unregister(struct workqueue_struct *wq);
-@@ -1101,9 +1104,9 @@ static void put_pwq_unlocked(struct pool
+@@ -1101,9 +1104,11 @@ static void put_pwq_unlocked(struct pool
* As both pwqs and pools are RCU protected, the
* following lock operations are safe.
*/
- spin_lock_irq(&pwq->pool->lock);
++ rcu_read_lock();
+ local_spin_lock_irq(pendingb_lock, &pwq->pool->lock);
put_pwq(pwq);
- spin_unlock_irq(&pwq->pool->lock);
+ local_spin_unlock_irq(pendingb_lock, &pwq->pool->lock);
++ rcu_read_unlock();
}
}
-@@ -1207,7 +1210,7 @@ static int try_to_grab_pending(struct wo
+@@ -1207,7 +1212,7 @@ static int try_to_grab_pending(struct wo
struct worker_pool *pool;
struct pool_workqueue *pwq;
@@ -51,7 +53,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/* try to steal the timer if it exists */
if (is_dwork) {
-@@ -1271,7 +1274,7 @@ static int try_to_grab_pending(struct wo
+@@ -1271,7 +1276,7 @@ static int try_to_grab_pending(struct wo
spin_unlock(&pool->lock);
fail:
rcu_read_unlock();
@@ -60,7 +62,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (work_is_canceling(work))
return -ENOENT;
cpu_relax();
-@@ -1376,7 +1379,7 @@ static void __queue_work(int cpu, struct
+@@ -1376,7 +1381,7 @@ static void __queue_work(int cpu, struct
* queued or lose PENDING. Grabbing PENDING and queueing should
* happen with IRQ disabled.
*/
@@ -69,7 +71,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
debug_work_activate(work);
-@@ -1482,14 +1485,14 @@ bool queue_work_on(int cpu, struct workq
+@@ -1482,14 +1487,14 @@ bool queue_work_on(int cpu, struct workq
bool ret = false;
unsigned long flags;
@@ -86,7 +88,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return ret;
}
EXPORT_SYMBOL(queue_work_on);
-@@ -1556,14 +1559,14 @@ bool queue_delayed_work_on(int cpu, stru
+@@ -1556,14 +1561,14 @@ bool queue_delayed_work_on(int cpu, stru
unsigned long flags;
/* read the comment in __queue_work() */
@@ -103,7 +105,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return ret;
}
EXPORT_SYMBOL(queue_delayed_work_on);
-@@ -1598,7 +1601,7 @@ bool mod_delayed_work_on(int cpu, struct
+@@ -1598,7 +1603,7 @@ bool mod_delayed_work_on(int cpu, struct
if (likely(ret >= 0)) {
__queue_delayed_work(cpu, wq, dwork, delay);
@@ -112,7 +114,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/* -ENOENT from try_to_grab_pending() becomes %true */
-@@ -2916,7 +2919,7 @@ static bool __cancel_work_timer(struct w
+@@ -2916,7 +2921,7 @@ static bool __cancel_work_timer(struct w
/* tell other tasks trying to grab @work to back off */
mark_work_canceling(work);
@@ -121,7 +123,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
flush_work(work);
clear_work_data(work);
-@@ -2971,10 +2974,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync);
+@@ -2971,10 +2976,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync);
*/
bool flush_delayed_work(struct delayed_work *dwork)
{
@@ -134,12 +136,12 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return flush_work(&dwork->work);
}
EXPORT_SYMBOL(flush_delayed_work);
-@@ -3009,7 +3012,7 @@ bool cancel_delayed_work(struct delayed_
+@@ -2992,7 +2997,7 @@ static bool __cancel_work(struct work_st
+ return false;
- set_work_pool_and_clear_pending(&dwork->work,
- get_work_pool_id(&dwork->work));
+ set_work_pool_and_clear_pending(work, get_work_pool_id(work));
- local_irq_restore(flags);
+ local_unlock_irqrestore(pendingb_lock, flags);
return ret;
}
- EXPORT_SYMBOL(cancel_delayed_work);
+
diff --git a/debian/patches/features/all/rt/workqueue-use-rcu.patch b/debian/patches/features/all/rt/workqueue-use-rcu.patch
index d21281a..5f27ef9 100644
--- a/debian/patches/features/all/rt/workqueue-use-rcu.patch
+++ b/debian/patches/features/all/rt/workqueue-use-rcu.patch
@@ -1,7 +1,7 @@
Subject: workqueue: Use normal rcu
From: Thomas Gleixner <tglx at linutronix.de>
Date: Wed, 24 Jul 2013 15:26:54 +0200
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
@@ -208,7 +208,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return false;
}
-@@ -3233,7 +3238,7 @@ static void rcu_free_pool(struct rcu_hea
+@@ -3245,7 +3250,7 @@ static void rcu_free_pool(struct rcu_hea
* put_unbound_pool - put a worker_pool
* @pool: worker_pool to put
*
@@ -217,7 +217,7 @@ Signed-off-by: Thomas Gleixner <tglx at 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().
-@@ -3287,8 +3292,8 @@ static void put_unbound_pool(struct work
+@@ -3299,8 +3304,8 @@ static void put_unbound_pool(struct work
del_timer_sync(&pool->idle_timer);
del_timer_sync(&pool->mayday_timer);
@@ -228,7 +228,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/**
-@@ -3395,14 +3400,14 @@ static void pwq_unbound_release_workfn(s
+@@ -3407,14 +3412,14 @@ static void pwq_unbound_release_workfn(s
put_unbound_pool(pool);
mutex_unlock(&wq_pool_mutex);
@@ -245,7 +245,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/**
-@@ -4052,7 +4057,7 @@ void destroy_workqueue(struct workqueue_
+@@ -4064,7 +4069,7 @@ void destroy_workqueue(struct workqueue_
* The base ref is never dropped on per-cpu pwqs. Directly
* schedule RCU free.
*/
@@ -254,7 +254,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
} else {
/*
* We're the sole accessor of @wq at this point. Directly
-@@ -4145,7 +4150,8 @@ bool workqueue_congested(int cpu, struct
+@@ -4157,7 +4162,8 @@ bool workqueue_congested(int cpu, struct
struct pool_workqueue *pwq;
bool ret;
@@ -264,7 +264,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
if (cpu == WORK_CPU_UNBOUND)
cpu = smp_processor_id();
-@@ -4156,7 +4162,8 @@ bool workqueue_congested(int cpu, struct
+@@ -4168,7 +4174,8 @@ bool workqueue_congested(int cpu, struct
pwq = unbound_pwq_by_node(wq, cpu_to_node(cpu));
ret = !list_empty(&pwq->delayed_works);
@@ -274,7 +274,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return ret;
}
-@@ -4182,15 +4189,15 @@ unsigned int work_busy(struct work_struc
+@@ -4194,15 +4201,15 @@ unsigned int work_busy(struct work_struc
if (work_pending(work))
ret |= WORK_BUSY_PENDING;
@@ -294,7 +294,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
return ret;
}
-@@ -4379,7 +4386,7 @@ void show_workqueue_state(void)
+@@ -4391,7 +4398,7 @@ void show_workqueue_state(void)
unsigned long flags;
int pi;
@@ -303,7 +303,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
pr_info("Showing busy workqueues and worker pools:\n");
-@@ -4432,7 +4439,7 @@ void show_workqueue_state(void)
+@@ -4444,7 +4451,7 @@ void show_workqueue_state(void)
spin_unlock_irqrestore(&pool->lock, flags);
}
@@ -312,7 +312,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
/*
-@@ -4770,16 +4777,16 @@ bool freeze_workqueues_busy(void)
+@@ -4782,16 +4789,16 @@ bool freeze_workqueues_busy(void)
* nr_active is monotonically decreasing. It's safe
* to peek without lock.
*/
@@ -332,7 +332,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
}
out_unlock:
mutex_unlock(&wq_pool_mutex);
-@@ -4969,7 +4976,8 @@ static ssize_t wq_pool_ids_show(struct d
+@@ -4981,7 +4988,8 @@ static ssize_t wq_pool_ids_show(struct d
const char *delim = "";
int node, written = 0;
@@ -342,7 +342,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
for_each_node(node) {
written += scnprintf(buf + written, PAGE_SIZE - written,
"%s%d:%d", delim, node,
-@@ -4977,7 +4985,8 @@ static ssize_t wq_pool_ids_show(struct d
+@@ -4989,7 +4997,8 @@ static ssize_t wq_pool_ids_show(struct d
delim = " ";
}
written += scnprintf(buf + written, PAGE_SIZE - written, "\n");
diff --git a/debian/patches/features/all/rt/workqueue-use-rcu_readlock-in-put_pwq_unlocked.patch b/debian/patches/features/all/rt/workqueue-use-rcu_readlock-in-put_pwq_unlocked.patch
deleted file mode 100644
index e83b489..0000000
--- a/debian/patches/features/all/rt/workqueue-use-rcu_readlock-in-put_pwq_unlocked.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
-Date: Mon, 12 Dec 2016 16:14:18 +0100
-Subject: [PATCH] workqueue: use rcu_readlock() in put_pwq_unlocked()
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
-
-The RCU sched protection was changed to RCU only and so all IRQ-off and
-preempt-off disabled region were changed to the relevant rcu-read-lock
-primitives. One was missed and triggered:
-|[ BUG: bad unlock balance detected! ]
-|4.4.30-rt41 #51 Tainted: G W
-|btattach/345 is trying to release lock (
-|Unable to handle kernel paging request at virtual address 6b6b6bbb
-|Backtrace:
-|[<c016b5a0>] (lock_release) from [<c0804844>] (rt_spin_unlock+0x20/0x30)
-|[<c0804824>] (rt_spin_unlock) from [<c0138954>] (put_pwq_unlocked+0xa4/0x118)
-|[<c01388b0>] (put_pwq_unlocked) from [<c0138b2c>] (destroy_workqueue+0x164/0x1b0)
-|[<c01389c8>] (destroy_workqueue) from [<c078e1ac>] (hci_unregister_dev+0x120/0x21c)
-|[<c078e08c>] (hci_unregister_dev) from [<c054f658>] (hci_uart_tty_close+0x90/0xbc)
-|[<c054f5c8>] (hci_uart_tty_close) from [<c03a2be8>] (tty_ldisc_close+0x50/0x58)
-|[<c03a2b98>] (tty_ldisc_close) from [<c03a2cb4>] (tty_ldisc_kill+0x18/0x78)
-|[<c03a2c9c>] (tty_ldisc_kill) from [<c03a3528>] (tty_ldisc_release+0x100/0x134)
-|[<c03a3428>] (tty_ldisc_release) from [<c039cd68>] (tty_release+0x3bc/0x460)
-|[<c039c9ac>] (tty_release) from [<c020cc08>] (__fput+0xe0/0x1b4)
-|[<c020cb28>] (__fput) from [<c020cd3c>] (____fput+0x10/0x14)
-|[<c020cd2c>] (____fput) from [<c013e0d4>] (task_work_run+0xa4/0xb8)
-|[<c013e030>] (task_work_run) from [<c0121754>] (do_exit+0x40c/0x8b0)
-|[<c0121348>] (do_exit) from [<c0122ff8>] (do_group_exit+0x54/0xc4)
-
-Cc: stable-rt at vger.kernel.org
-Reported-by: John Keeping <john at metanate.com>
-Tested-by: John Keeping <john at metanate.com>
-Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
----
- kernel/workqueue.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/kernel/workqueue.c
-+++ b/kernel/workqueue.c
-@@ -1104,9 +1104,11 @@ static void put_pwq_unlocked(struct pool
- * As both pwqs and pools are RCU protected, the
- * following lock operations are safe.
- */
-+ rcu_read_lock();
- local_spin_lock_irq(pendingb_lock, &pwq->pool->lock);
- put_pwq(pwq);
- local_spin_unlock_irq(pendingb_lock, &pwq->pool->lock);
-+ rcu_read_unlock();
- }
- }
-
diff --git a/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch b/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch
index c36c434..d47249e 100644
--- a/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch
+++ b/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch
@@ -1,7 +1,7 @@
From: Mike Galbraith <umgwanakikbuti at gmail.com>
Date: Sun, 2 Nov 2014 08:31:37 +0100
Subject: x86: UV: raw_spinlock conversion
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Shrug. Lots of hobbyists have a beast in their basement, right?
@@ -16,7 +16,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/arch/x86/include/asm/uv/uv_bau.h
+++ b/arch/x86/include/asm/uv/uv_bau.h
-@@ -615,9 +615,9 @@ struct bau_control {
+@@ -624,9 +624,9 @@ struct bau_control {
cycles_t send_message;
cycles_t period_end;
cycles_t period_time;
@@ -29,7 +29,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
/* tunables */
int max_concurr;
int max_concurr_const;
-@@ -776,15 +776,15 @@ static inline int atom_asr(short i, stru
+@@ -815,15 +815,15 @@ static inline int atom_asr(short i, stru
* to be lowered below the current 'v'. atomic_add_unless can only stop
* on equal.
*/
@@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
-@@ -729,9 +729,9 @@ static void destination_plugged(struct b
+@@ -748,9 +748,9 @@ static void destination_plugged(struct b
quiesce_local_uvhub(hmaster);
@@ -63,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
end_uvhub_quiesce(hmaster);
-@@ -751,9 +751,9 @@ static void destination_timeout(struct b
+@@ -770,9 +770,9 @@ static void destination_timeout(struct b
quiesce_local_uvhub(hmaster);
@@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
end_uvhub_quiesce(hmaster);
-@@ -774,7 +774,7 @@ static void disable_for_period(struct ba
+@@ -793,7 +793,7 @@ static void disable_for_period(struct ba
cycles_t tm1;
hmaster = bcp->uvhub_master;
@@ -84,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
if (!bcp->baudisabled) {
stat->s_bau_disabled++;
tm1 = get_cycles();
-@@ -787,7 +787,7 @@ static void disable_for_period(struct ba
+@@ -806,7 +806,7 @@ static void disable_for_period(struct ba
}
}
}
@@ -93,7 +93,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
}
static void count_max_concurr(int stat, struct bau_control *bcp,
-@@ -850,7 +850,7 @@ static void record_send_stats(cycles_t t
+@@ -869,7 +869,7 @@ static void record_send_stats(cycles_t t
*/
static void uv1_throttle(struct bau_control *hmaster, struct ptc_stats *stat)
{
@@ -102,7 +102,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
atomic_t *v;
v = &hmaster->active_descriptor_count;
-@@ -983,7 +983,7 @@ static int check_enable(struct bau_contr
+@@ -1002,7 +1002,7 @@ static int check_enable(struct bau_contr
struct bau_control *hmaster;
hmaster = bcp->uvhub_master;
@@ -111,7 +111,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
if (bcp->baudisabled && (get_cycles() >= bcp->set_bau_on_time)) {
stat->s_bau_reenabled++;
for_each_present_cpu(tcpu) {
-@@ -995,10 +995,10 @@ static int check_enable(struct bau_contr
+@@ -1014,10 +1014,10 @@ static int check_enable(struct bau_contr
tbcp->period_giveups = 0;
}
}
@@ -124,10 +124,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
return -1;
}
-@@ -1916,9 +1916,9 @@ static void __init init_per_cpu_tunables
+@@ -1940,9 +1940,9 @@ static void __init init_per_cpu_tunables
bcp->cong_reps = congested_reps;
- bcp->disabled_period = sec_2_cycles(disabled_period);
- bcp->giveup_limit = giveup_limit;
+ bcp->disabled_period = sec_2_cycles(disabled_period);
+ bcp->giveup_limit = giveup_limit;
- spin_lock_init(&bcp->queue_lock);
- spin_lock_init(&bcp->uvhub_lock);
- spin_lock_init(&bcp->disable_lock);
diff --git a/debian/patches/features/all/rt/x86-apic-get-rid-of-warning-acpi_ioapic_lock-defined.patch b/debian/patches/features/all/rt/x86-apic-get-rid-of-warning-acpi_ioapic_lock-defined.patch
index bfce050..f7864ee 100644
--- a/debian/patches/features/all/rt/x86-apic-get-rid-of-warning-acpi_ioapic_lock-defined.patch
+++ b/debian/patches/features/all/rt/x86-apic-get-rid-of-warning-acpi_ioapic_lock-defined.patch
@@ -3,7 +3,7 @@ From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Date: Fri, 21 Oct 2016 10:29:11 +0200
Subject: [PATCH] x86/apic: get rid of "warning: 'acpi_ioapic_lock' defined but
not used"
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
kbuild test robot reported this against the -RT tree:
diff --git a/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch b/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch
index 5c62e99..9451314 100644
--- a/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch
+++ b/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch
@@ -1,7 +1,7 @@
Subject: x86: crypto: Reduce preempt disabled regions
From: Peter Zijlstra <peterz at infradead.org>
Date: Mon, 14 Nov 2011 18:19:27 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Restrict the preempt disabled regions to the actual floating point
operations and enable preemption for the administrative actions.
diff --git a/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch b/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch
index 45492a7..c82668b 100644
--- a/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch
+++ b/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch
@@ -1,7 +1,7 @@
From: Sebastian Andrzej Siewior <bigeasy at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
This is a copy from kmap_atomic_prot().
diff --git a/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch b/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch
index 64b4700..95e06ca 100644
--- a/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch
+++ b/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch
@@ -1,7 +1,7 @@
From: Ingo Molnar <mingo at elte.hu>
Date: Fri, 3 Jul 2009 08:29:27 -0500
Subject: x86/ioapic: Do not unmask io_apic when interrupt is in progress
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
With threaded interrupts we might see an interrupt in progress on
migration. Do not unmask it when this is the case.
diff --git a/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch b/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch
index 44b3150..ae15797 100644
--- a/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch
+++ b/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch
@@ -1,7 +1,7 @@
Subject: x86: kvm Require const tsc for RT
From: Thomas Gleixner <tglx at linutronix.de>
Date: Sun, 06 Nov 2011 12:26:18 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Non constant TSC is a nightmare on bare metal already, but with
virtualization it becomes a complete disaster because the workarounds
@@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
-@@ -5877,6 +5877,13 @@ int kvm_arch_init(void *opaque)
+@@ -5925,6 +5925,13 @@ int kvm_arch_init(void *opaque)
goto out;
}
diff --git a/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch b/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch
index 5e40e88..11b820c 100644
--- a/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch
+++ b/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at linutronix.de>
Date: Mon, 13 Dec 2010 16:33:39 +0100
Subject: x86: Convert mce timer to hrtimer
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
mce_timer is started in atomic contexts of cpu bringup. This results
in might_sleep() warnings on RT. Convert mce_timer to a hrtimer to
@@ -32,10 +32,10 @@ fold in:
#include <linux/irq_work.h>
#include <linux/export.h>
+#include <linux/jiffies.h>
+ #include <linux/jump_label.h>
#include <asm/processor.h>
- #include <asm/traps.h>
-@@ -1291,7 +1292,7 @@ void mce_log_therm_throt_event(__u64 sta
+@@ -1317,7 +1318,7 @@ void mce_log_therm_throt_event(__u64 sta
static unsigned long check_interval = INITIAL_CHECK_INTERVAL;
static DEFINE_PER_CPU(unsigned long, mce_next_interval); /* in jiffies */
@@ -44,7 +44,7 @@ fold in:
static unsigned long mce_adjust_timer_default(unsigned long interval)
{
-@@ -1300,32 +1301,18 @@ static unsigned long mce_adjust_timer_de
+@@ -1326,32 +1327,18 @@ static unsigned long mce_adjust_timer_de
static unsigned long (*mce_adjust_timer)(unsigned long interval) = mce_adjust_timer_default;
@@ -83,7 +83,7 @@ fold in:
iv = __this_cpu_read(mce_next_interval);
if (mce_available(this_cpu_ptr(&cpu_info))) {
-@@ -1348,7 +1335,7 @@ static void mce_timer_fn(unsigned long d
+@@ -1374,7 +1361,7 @@ static void mce_timer_fn(unsigned long d
done:
__this_cpu_write(mce_next_interval, iv);
@@ -92,7 +92,7 @@ fold in:
}
/*
-@@ -1356,7 +1343,7 @@ static void mce_timer_fn(unsigned long d
+@@ -1382,7 +1369,7 @@ static void mce_timer_fn(unsigned long d
*/
void mce_timer_kick(unsigned long interval)
{
@@ -101,7 +101,7 @@ fold in:
unsigned long iv = __this_cpu_read(mce_next_interval);
__restart_timer(t, interval);
-@@ -1371,7 +1358,7 @@ static void mce_timer_delete_all(void)
+@@ -1397,7 +1384,7 @@ static void mce_timer_delete_all(void)
int cpu;
for_each_online_cpu(cpu)
@@ -110,7 +110,7 @@ fold in:
}
static void mce_do_trigger(struct work_struct *work)
-@@ -1717,7 +1704,7 @@ static void __mcheck_cpu_clear_vendor(st
+@@ -1732,7 +1719,7 @@ static void __mcheck_cpu_clear_vendor(st
}
}
@@ -119,7 +119,7 @@ fold in:
{
unsigned long iv = check_interval * HZ;
-@@ -1726,16 +1713,17 @@ static void mce_start_timer(unsigned int
+@@ -1741,16 +1728,17 @@ static void mce_start_timer(unsigned int
per_cpu(mce_next_interval, cpu) = iv;
@@ -141,7 +141,7 @@ fold in:
mce_start_timer(cpu, t);
}
-@@ -2459,6 +2447,8 @@ static void mce_disable_cpu(void *h)
+@@ -2475,6 +2463,8 @@ static void mce_disable_cpu(void *h)
if (!mce_available(raw_cpu_ptr(&cpu_info)))
return;
@@ -150,7 +150,7 @@ fold in:
if (!(action & CPU_TASKS_FROZEN))
cmci_clear();
-@@ -2481,6 +2471,7 @@ static void mce_reenable_cpu(void *h)
+@@ -2497,6 +2487,7 @@ static void mce_reenable_cpu(void *h)
if (b->init)
wrmsrl(msr_ops.ctl(i), b->ctl);
}
@@ -158,7 +158,7 @@ fold in:
}
/* Get notified when a cpu comes on/off. Be hotplug friendly. */
-@@ -2488,7 +2479,6 @@ static int
+@@ -2504,7 +2495,6 @@ static int
mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned long)hcpu;
@@ -166,7 +166,7 @@ fold in:
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_ONLINE:
-@@ -2508,11 +2498,9 @@ mce_cpu_callback(struct notifier_block *
+@@ -2524,11 +2514,9 @@ mce_cpu_callback(struct notifier_block *
break;
case CPU_DOWN_PREPARE:
smp_call_function_single(cpu, mce_disable_cpu, &action, 1);
diff --git a/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch b/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch
index a790c90..470c45f 100644
--- a/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch
+++ b/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch
@@ -1,7 +1,7 @@
Subject: x86/mce: use swait queue for mce wakeups
From: Steven Rostedt <rostedt at goodmis.org>
Date: Fri, 27 Feb 2015 15:20:37 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
We had a customer report a lockup on a 3.0-rt kernel that had the
following backtrace:
@@ -66,10 +66,10 @@ Signed-off-by: Daniel Wagner <daniel.wagner at bmw-carit.de>
#include <linux/export.h>
#include <linux/jiffies.h>
+#include <linux/swork.h>
+ #include <linux/jump_label.h>
#include <asm/processor.h>
- #include <asm/traps.h>
-@@ -1368,6 +1369,56 @@ static void mce_do_trigger(struct work_s
+@@ -1394,6 +1395,56 @@ static void mce_do_trigger(struct work_s
static DECLARE_WORK(mce_trigger_work, mce_do_trigger);
@@ -126,7 +126,7 @@ Signed-off-by: Daniel Wagner <daniel.wagner at bmw-carit.de>
/*
* Notify the user(s) about new machine check events.
* Can be called from interrupt context, but not from machine check/NMI
-@@ -1375,19 +1426,8 @@ static DECLARE_WORK(mce_trigger_work, mc
+@@ -1401,19 +1452,8 @@ static DECLARE_WORK(mce_trigger_work, mc
*/
int mce_notify_irq(void)
{
@@ -147,7 +147,7 @@ Signed-off-by: Daniel Wagner <daniel.wagner at bmw-carit.de>
return 1;
}
return 0;
-@@ -2539,6 +2579,10 @@ static __init int mcheck_init_device(voi
+@@ -2555,6 +2595,10 @@ static __init int mcheck_init_device(voi
goto err_out;
}
diff --git a/debian/patches/features/all/rt/x86-preempt-lazy.patch b/debian/patches/features/all/rt/x86-preempt-lazy.patch
index c8ca099..40d662a 100644
--- a/debian/patches/features/all/rt/x86-preempt-lazy.patch
+++ b/debian/patches/features/all/rt/x86-preempt-lazy.patch
@@ -1,7 +1,7 @@
Subject: x86: Support for lazy preemption
From: Thomas Gleixner <tglx at linutronix.de>
Date: Thu, 01 Nov 2012 11:03:47 +0100
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Implement the x86 pieces for lazy preempt.
@@ -12,9 +12,9 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
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 | 10 ++++++++++
+ arch/x86/include/asm/thread_info.h | 11 +++++++++++
arch/x86/kernel/asm-offsets.c | 2 ++
- 7 files changed, 78 insertions(+), 3 deletions(-)
+ 7 files changed, 79 insertions(+), 3 deletions(-)
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -28,7 +28,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
select ANON_INODES
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
-@@ -136,7 +136,7 @@ static long syscall_trace_enter(struct p
+@@ -129,7 +129,7 @@ static long syscall_trace_enter(struct p
#define EXIT_TO_USERMODE_LOOP_FLAGS \
(_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
@@ -37,7 +37,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags)
{
-@@ -152,7 +152,7 @@ static void exit_to_usermode_loop(struct
+@@ -145,7 +145,7 @@ static void exit_to_usermode_loop(struct
/* We have work to do. */
local_irq_enable();
@@ -48,7 +48,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef ARCH_RT_DELAYS_SIGNAL_SEND
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
-@@ -271,8 +271,25 @@ END(ret_from_exception)
+@@ -308,8 +308,25 @@ END(ret_from_exception)
ENTRY(resume_kernel)
DISABLE_INTERRUPTS(CLBR_ANY)
need_resched:
@@ -63,11 +63,11 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
+ cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count)
+ jne restore_all
+
-+ GET_THREAD_INFO(%ebp)
-+ cmpl $0,TI_preempt_lazy_count(%ebp) # non-zero preempt_lazy_count ?
++ movl PER_CPU_VAR(current_task), %ebp
++ cmpl $0,TASK_TI_preempt_lazy_count(%ebp) # non-zero preempt_lazy_count ?
+ jnz restore_all
+
-+ testl $_TIF_NEED_RESCHED_LAZY, TI_flags(%ebp)
++ testl $_TIF_NEED_RESCHED_LAZY, TASK_TI_flags(%ebp)
+ jz restore_all
+test_int_off:
+#endif
@@ -76,7 +76,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
call preempt_schedule_irq
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
-@@ -512,7 +512,23 @@ GLOBAL(retint_user)
+@@ -546,7 +546,23 @@ GLOBAL(retint_user)
bt $9, EFLAGS(%rsp) /* were interrupts off? */
jnc 1f
0: cmpl $0, PER_CPU_VAR(__preempt_count)
@@ -89,11 +89,11 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
+ cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count)
+ jnz 1f
+
-+ GET_THREAD_INFO(%rcx)
-+ cmpl $0, TI_preempt_lazy_count(%rcx)
++ movq PER_CPU_VAR(current_task), %rcx
++ cmpl $0, TASK_TI_preempt_lazy_count(%rcx)
+ jnz 1f
+
-+ bt $TIF_NEED_RESCHED_LAZY,TI_flags(%rcx)
++ bt $TIF_NEED_RESCHED_LAZY,TASK_TI_flags(%rcx)
+ jnc 1f
+do_preempt_schedule_irq:
+#endif
@@ -152,16 +152,22 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#ifdef CONFIG_PREEMPT
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
-@@ -57,6 +57,8 @@ struct thread_info {
- __u32 flags; /* low level flags */
- __u32 status; /* thread synchronous flags */
- __u32 cpu; /* current CPU */
-+ int preempt_lazy_count; /* 0 => lazy preemptable
+@@ -54,11 +54,14 @@ struct task_struct;
+
+ struct thread_info {
+ unsigned long flags; /* low level flags */
++ int preempt_lazy_count; /* 0 => lazy preemptable
+ <0 => BUG */
};
#define INIT_THREAD_INFO(tsk) \
-@@ -73,6 +75,10 @@ struct thread_info {
+ { \
+ .flags = 0, \
++ .preempt_lazy_count = 0, \
+ }
+
+ #define init_stack (init_thread_union.stack)
+@@ -67,6 +70,10 @@ struct thread_info {
#include <asm/asm-offsets.h>
@@ -172,7 +178,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#endif
/*
-@@ -91,6 +97,7 @@ struct thread_info {
+@@ -85,6 +92,7 @@ struct thread_info {
#define TIF_SYSCALL_EMU 6 /* syscall emulation active */
#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
#define TIF_SECCOMP 8 /* secure computing */
@@ -180,7 +186,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#define TIF_USER_RETURN_NOTIFY 11 /* notify kernel of userspace return */
#define TIF_UPROBE 12 /* breakpointed or singlestepping */
#define TIF_NOTSC 16 /* TSC is not accessible in userland */
-@@ -115,6 +122,7 @@ struct thread_info {
+@@ -108,6 +116,7 @@ struct thread_info {
#define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
#define _TIF_SECCOMP (1 << TIF_SECCOMP)
@@ -188,7 +194,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
#define _TIF_USER_RETURN_NOTIFY (1 << TIF_USER_RETURN_NOTIFY)
#define _TIF_UPROBE (1 << TIF_UPROBE)
#define _TIF_NOTSC (1 << TIF_NOTSC)
-@@ -151,6 +159,8 @@ struct thread_info {
+@@ -143,6 +152,8 @@ struct thread_info {
#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
@@ -199,15 +205,15 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
/*
--- a/arch/x86/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets.c
-@@ -31,6 +31,7 @@ void common(void) {
- BLANK();
- OFFSET(TI_flags, thread_info, flags);
- OFFSET(TI_status, thread_info, status);
-+ OFFSET(TI_preempt_lazy_count, thread_info, preempt_lazy_count);
+@@ -36,6 +36,7 @@ void common(void) {
BLANK();
+ OFFSET(TASK_TI_flags, task_struct, thread_info.flags);
++ OFFSET(TASK_TI_preempt_lazy_count, task_struct, thread_info.preempt_lazy_count);
OFFSET(TASK_addr_limit, task_struct, thread.addr_limit);
-@@ -88,4 +89,5 @@ void common(void) {
+
+ BLANK();
+@@ -91,4 +92,5 @@ void common(void) {
BLANK();
DEFINE(PTREGS_SIZE, sizeof(struct pt_regs));
diff --git a/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch b/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch
index 842696d..3b57c14 100644
--- a/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch
+++ b/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch
@@ -1,7 +1,7 @@
From: Yang Shi <yang.shi at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
When running some ptrace single step tests on x86-32 machine, the below problem
is triggered:
@@ -32,7 +32,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
--- a/arch/x86/include/asm/signal.h
+++ b/arch/x86/include/asm/signal.h
-@@ -32,7 +32,7 @@ typedef struct {
+@@ -36,7 +36,7 @@ typedef struct {
* TIF_NOTIFY_RESUME and set up the signal to be sent on exit of the
* trap.
*/
diff --git a/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch b/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch
index 5ec0ca8..deb2984 100644
--- a/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch
+++ b/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.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
diff --git a/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch b/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch
index 79b1ae3..1df736d 100644
--- a/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch
+++ b/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch
@@ -1,7 +1,7 @@
From: Thomas Gleixner <tglx at 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.8/older/patches-4.8.14-rt9.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patches-4.9-rt1.tar.xz
Simplifies the separation of anon_rw_semaphores and rw_semaphores for
-rt.
@@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -231,8 +231,11 @@ config ARCH_MAY_HAVE_PC_FDC
+@@ -232,8 +232,11 @@ config ARCH_MAY_HAVE_PC_FDC
def_bool y
depends on ISA_DMA_API
diff --git a/debian/patches/series-rt b/debian/patches/series-rt
index 6430649..fb3f92a 100644
--- a/debian/patches/series-rt
+++ b/debian/patches/series-rt
@@ -34,10 +34,12 @@ features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch
features/all/rt/fs-dcache-init-in_lookup_hashtable.patch
features/all/rt/iommu-iova-don-t-disable-preempt-around-this_cpu_ptr.patch
features/all/rt/iommu-vt-d-don-t-disable-preemption-while-accessing-.patch
-features/all/rt/lockdep-Quiet-gcc-about-dangerous-__builtin_return_a.patch
features/all/rt/x86-apic-get-rid-of-warning-acpi_ioapic_lock-defined.patch
features/all/rt/rxrpc-remove-unused-static-variables.patch
features/all/rt/rcu-update-make-RCU_EXPEDITE_BOOT-default.patch
+features/all/rt/locking-percpu-rwsem-use-swait-for-the-wating-writer.patch
+features/all/rt/btrfs-drop-trace_btrfs_all_work_done-from-normal_wor.patch
+features/all/rt/btrfs-swap-free-and-trace-point-in-run_ordered_work.patch
# Wants a different fix for upstream
features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch
@@ -154,13 +156,6 @@ features/all/rt/latency_hist-update-sched_wakeup-probe.patch
features/all/rt/trace-latency-hist-Consider-new-argument-when-probin.patch
features/all/rt/trace_Use_rcuidle_version_for_preemptoff_hist_trace_point.patch
-# HW LATENCY DETECTOR - this really wants a rewrite
-features/all/rt/hwlatdetect.patch
-features/all/rt/hwlat-detector-Update-hwlat_detector-to-add-outer-lo.patch
-features/all/rt/hwlat-detector-Use-trace_clock_local-if-available.patch
-features/all/rt/hwlat-detector-Use-thread-instead-of-stop-machine.patch
-features/all/rt/hwlat-detector-Don-t-ignore-threshold-module-paramet.patch
-
##################################################
# REAL RT STUFF starts here
##################################################
@@ -257,12 +252,6 @@ features/all/rt/radix-tree-rt-aware.patch
# PANIC
features/all/rt/panic-disable-random-on-rt.patch
-# IPC
-features/all/rt/ipc-msg-Implement-lockless-pipelined-wakeups.patch
-
-# RELAY
-features/all/rt/relay-fix-timer-madness.patch
-
# TIMERS
features/all/rt/timers-prepare-for-full-preemption.patch
features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch
@@ -282,6 +271,7 @@ features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch
features/all/rt/sched-delay-put-task.patch
features/all/rt/sched-limit-nr-migrate.patch
features/all/rt/sched-mmdrop-delayed.patch
+features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch
features/all/rt/sched-rt-mutex-wakeup.patch
features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch
features/all/rt/cond-resched-softirq-rt.patch
@@ -330,6 +320,7 @@ features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch
# RTMUTEX
features/all/rt/pid.h-include-atomic.h.patch
+features/all/rt/arm-include-definition-for-cpumask_t.patch
features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch
features/all/rt/rtmutex-lock-killable.patch
features/all/rt/spinlock-types-separate-raw.patch
@@ -346,14 +337,6 @@ features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch
features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch
features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch
-# LGLOCKS - lovely
-features/all/rt/lglocks-rt.patch
-features/all/rt/lockinglglocks_Use_preempt_enabledisable_nort.patch
-
-# STOP machine (depend on lglock & rtmutex)
-features/all/rt/stomp-machine-create-lg_global_trylock_relax-primiti.patch
-features/all/rt/stomp-machine-use-lg_global_trylock_relax-to-dead-wi.patch
-
# DRIVERS SERIAL
features/all/rt/drivers-tty-fix-omap-lock-crap.patch
features/all/rt/drivers-tty-pl011-irq-disable-madness.patch
@@ -369,6 +352,7 @@ features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch
features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch
# FS
+features/all/rt/peterz-percpu-rwsem-rt.patch
features/all/rt/fs-namespace-preemption-fix.patch
features/all/rt/mm-protect-activate-switch-mm.patch
features/all/rt/fs-block-rt-support.patch
@@ -389,7 +373,6 @@ features/all/rt/mm-vmalloc-use-get-cpu-light.patch
features/all/rt/block-mq-use-cpu_light.patch
features/all/rt/block-mq-drop-preempt-disable.patch
features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch
-features/all/rt/dump-stack-don-t-disable-preemption-during-trace.patch
features/all/rt/md-raid5-percpu-handling-rt-aware.patch
# CPU CHILL
@@ -397,7 +380,6 @@ features/all/rt/rt-introduce-cpu-chill.patch
features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch
# block
-features/all/rt/blk-mq-revert-raw-locks-post-pone-notifier-to-POST_D.patchto-POST_D.patch
features/all/rt/block-blk-mq-use-swait.patch
# BLOCK LIVELOCK PREVENTION
@@ -411,7 +393,6 @@ features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch
# WORKQUEUE more fixes
features/all/rt/workqueue-use-rcu.patch
features/all/rt/workqueue-use-locallock.patch
-features/all/rt/workqueue-use-rcu_readlock-in-put_pwq_unlocked.patch
features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch
features/all/rt/workqueue-distangle-from-rq-lock.patch
@@ -431,7 +412,6 @@ features/all/rt/seqlock-prevent-rt-starvation.patch
# NETWORKING
features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch
features/all/rt/skbufhead-raw-lock.patch
-features/all/rt/skbufhead-raw-lock-free-skbs.patch
features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch
features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch
features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git
More information about the Kernel-svn-changes
mailing list