From 4a0b4cb79e0195ede89af9c264e50259b70d62bf Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 25 Feb 2019 16:57:53 +0100 Subject: [PATCH 1/8] update to 4.19.21 --- debian/changelog | 309 +++++++++++++++++- ...g-fix-the-ring-buffer-implementation.patch | 259 --------------- ...l_create_device-reference-counting-C.patch | 57 ---- ...t-spin_lock_irq-to-spin_lock_irqsave.patch | 49 --- ...tionally-cancel-preemption-timer-in-.patch | 37 --- ...und-leak-of-uninitialized-stack-cont.patch | 48 --- debian/patches/series | 5 - 7 files changed, 308 insertions(+), 456 deletions(-) delete mode 100644 debian/patches/bugfix/all/HID-debug-fix-the-ring-buffer-implementation.patch delete mode 100644 debian/patches/bugfix/all/kvm-fix-kvm_ioctl_create_device-reference-counting-C.patch delete mode 100644 debian/patches/bugfix/all/percpu-convert-spin_lock_irq-to-spin_lock_irqsave.patch delete mode 100644 debian/patches/bugfix/x86/KVM-nVMX-unconditionally-cancel-preemption-timer-in-.patch delete mode 100644 debian/patches/bugfix/x86/KVM-x86-work-around-leak-of-uninitialized-stack-cont.patch diff --git a/debian/changelog b/debian/changelog index 2807301e2..b520823b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,311 @@ -linux (4.19.20-2) UNRELEASED; urgency=medium +linux (4.19.21-1) UNRELEASED; urgency=medium + + * New upstream stable update: + https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.21 + - devres: Align data[] to ARCH_KMALLOC_MINALIGN + - drm/bufs: Fix Spectre v1 vulnerability + - drm/vgem: Fix vgem_init to get drm device available. + - [arm*] pinctrl: bcm2835: Use raw spinlock for RT compatibility + - [x86] ASoC: Intel: mrfld: fix uninitialized variable access + - gpiolib: Fix possible use after free on label + - [armhf] drm/sun4i: Initialize registers in tcon-top driver + - genirq/affinity: Spread IRQs to all available NUMA nodes + - [armhf] gpu: ipu-v3: image-convert: Prevent race between run and + unprepare + - wil6210: fix reset flow for Talyn-mb + - wil6210: fix memory leak in wil_find_tx_bcast_2 + - ath10k: assign 'n_cipher_suites' for WCN3990 + - ath9k: dynack: use authentication messages for 'late' ack + - scsi: lpfc: Correct LCB RJT handling + - scsi: mpt3sas: Call sas_remove_host before removing the target devices + - scsi: lpfc: Fix LOGO/PLOGI handling when triggerd by ABTS Timeout event + - [armhf] 8808/1: kexec:offline panic_smp_self_stop CPU + - [mips] clk: boston: fix possible memory leak in clk_boston_setup() + - dlm: Don't swamp the CPU with callbacks queued during recovery + - [x86] PCI: Fix Broadcom CNB20LE unintended sign extension (redux) + - [powerpc] pseries: add of_node_put() in dlpar_detach_node() + - crypto: aes_ti - disable interrupts while accessing S-box + - [arm*] drm/vc4: ->x_scaling[1] should never be set to VC4_SCALING_NONE + - serial: fsl_lpuart: clear parity enable bit when disable parity + - ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl + - [mips] Boston: Disable EG20T prefetch + - dpaa2-ptp: defer probe when portal allocation failed + - iwlwifi: fw: do not set sgi bits for HE connection + - fpga: altera-cvp: Fix registration for CvP incapable devices + - [x86] fpga: altera-cvp: fix 'bad IO access' on x86_64 + - [x86] vbox: fix link error with 'gcc -Og' + - platform/chrome: don't report EC_MKBP_EVENT_SENSOR_FIFO as wakeup + - i40e: prevent overlapping tx_timeout recover + - scsi: hisi_sas: change the time of SAS SSP connection + - usbnet: smsc95xx: fix rx packet alignment + - [armhf,arm64] drm/rockchip: fix for mailbox read size + - [arm*] OMAP2+: hwmod: Fix some section annotations + - drm/amd/display: fix gamma not being applied correctly + - drm/amd/display: calculate stream->phy_pix_clk before clock mapping + - bpf: libbpf: retry map creation without the name + - net/mlx5: EQ, Use the right place to store/read IRQ affinity hint + - modpost: validate symbol names also in find_elf_symbol + - perf tools: Add Hygon Dhyana support + - [armhf] soc/tegra: Don't leak device tree node reference + - media: rc: ensure close() is called on rc_unregister_device + - media: video-i2c: avoid accessing released memory area when removing + driver + - [armhf] media: mtk-vcodec: Release device nodes in + mtk_vcodec_init_enc_pm() + - ptp: Fix pass zero to ERR_PTR() in ptp_clock_register + - dmaengine: xilinx_dma: Remove __aligned attribute on zynqmp_dma_desc_ll + - [powerpc] 32: Add .data..Lubsan_data*/.data..Lubsan_type* sections + explicitly + - media: adv*/tc358743/ths8200: fill in min width/height/pixelclock + - ACPI: SPCR: Consider baud rate 0 as preconfigured state + - f2fs: move dir data flush to write checkpoint process + - f2fs: fix race between write_checkpoint and write_begin + - f2fs: fix wrong return value of f2fs_acl_create + - i2c: sh_mobile: add support for r8a77990 (R-Car E3) + - [arm64] io: Ensure calls to delay routines are ordered against prior + readX() + - net: aquantia: return 'err' if set MPI_DEINIT state fails + - [sparc*] sunvdc: Do not spin in an infinite loop when vio_ldc_send() + returns EAGAIN + - soc: bcm: brcmstb: Don't leak device tree node reference + - nfsd4: fix crash on writing v4_end_grace before nfsd startup + - drm: Clear state->acquire_ctx before leaving + drm_atomic_helper_commit_duplicated_state() + - perf: arm_spe: handle devm_kasprintf() failure + - [arm64] io: Ensure value passed to __iormb() is held in a 64-bit register + - Thermal: do not clear passive state during system sleep + - thermal: Fix locking in cooling device sysfs update cur_state + - firmware/efi: Add NULL pointer checks in efivars API functions + - [s390] zcrypt: improve special ap message cmd handling + - mt76x0: dfs: fix IBI_R11 configuration on non-radar channels + - [arm64] ftrace: don't adjust the LR value + - ARM: dts: mmp2: fix TWSI2 + - ARM: dts: aspeed: add missing memory unit-address + - [x86] fpu: Add might_fault() to user_insn() + - media: i2c: TDA1997x: select CONFIG_HDMI + - media: DaVinci-VPBE: fix error handling in vpbe_initialize() + - smack: fix access permissions for keyring + - usb: dwc3: Correct the logic for checking TRB full in + __dwc3_prepare_one_trb() + - usb: dwc2: Disable power down feature on Samsung SoCs + - usb: hub: delay hub autosuspend if USB3 port is still link training + - timekeeping: Use proper seqcount initializer + - usb: mtu3: fix the issue about SetFeature(U1/U2_Enable) + - [armhf] clk: sunxi-ng: a33: Set CLK_SET_RATE_PARENT for all audio module + clocks + - media: imx274: select REGMAP_I2C + - drm/amdgpu/powerplay: fix clock stretcher limits on polaris (v2) + - tipc: fix node keep alive interval calculation + - driver core: Move async_synchronize_full call + - kobject: return error code if writing /sys/.../uevent fails + - IB/hfi1: Unreserve a reserved request when it is completed + - usb: dwc3: trace: add missing break statement to make compiler happy + - [mips] gpio: mt7621: report failure of devm_kasprintf() + - [mips] gpio: mt7621: pass mediatek_gpio_bank_probe() failure up the stack + - [x86] iommu/amd: Fix amd_iommu=force_isolation + - [armhf] dts: Fix OMAP4430 SDP Ethernet startup + - [mips] bpf: fix encoding bug for mm_srlv32_op + - media: coda: fix H.264 deblocking filter controls + - [armel] dts: Fix up the D-Link DIR-685 MTD partition info + - watchdog: renesas_wdt: don't set divider while watchdog is running + - [armhf] dts: imx51-zii-rdu1: Do not specify "power-gpio" for hpa1 + - usb: dwc3: gadget: Disable CSP for stream OUT ep + - [arm64] iommu/arm-smmu-v3: Avoid memory corruption from Hisilicon MSI + payloads + - [arm64] iommu/arm-smmu: Add support for qcom,smmu-v2 variant + - [arm64] iommu/arm-smmu-v3: Use explicit mb() when moving cons pointer + - [armhf] clk: imx6sl: ensure MMDC CH0 handshake is bypassed + - [x86] platform: mlx-platform: Fix tachometer registers + - cpuidle: big.LITTLE: fix refcount leak + - OPP: Use opp_table->regulators to verify no regulator case + - tee: optee: avoid possible double list_del() + - drm/msm/dsi: fix dsi clock names in DSI 10nm PLL driver + - drm/msm: dpu: Only check flush register against pending flushes + - lightnvm: pblk: fix resubmission of overwritten write err lbas + - lightnvm: pblk: add lock protection to list operations + - i2c-axxia: check for error conditions first + - [armhf] phy: sun4i-usb: add support for missing USB PHY index + - udf: Fix BUG on corrupted inode + - selftests/bpf: use __bpf_constant_htons in test_prog.c + - [armel] pxa: avoid section mismatch warning + - [armhf] ASoC: fsl: Fix SND_SOC_EUKREA_TLV320 build error on i.MX8M + - [powerpc] KVM: Book3S: Only report KVM_CAP_SPAPR_TCE_VFIO on powernv + machines + - [arm*] mmc: bcm2835: Recover from MMC_SEND_EXT_CSD + - [arm*] mmc: bcm2835: reset host on timeout + - memstick: Prevent memstick host from getting runtime suspended during + card detection + - mmc: sdhci-of-esdhc: Fix timeout checks + - mmc: sdhci-omap: Fix timeout checks + - mmc: sdhci-xenon: Fix timeout checks + - [mips] mmc: jz4740: Get CD/WP GPIOs from descriptors + - usb: renesas_usbhs: add support for RZ/G2E + - btrfs: harden agaist duplicate fsid on scanned devices + - serial: sh-sci: Fix locking in sci_submit_rx() + - serial: sh-sci: Resume PIO in sci_rx_interrupt() on DMA failure + - tty: serial: samsung: Properly set flags in autoCTS mode + - perf test: Fix perf_event_attr test failure + - perf dso: Fix unchecked usage of strncpy() + - perf header: Fix unchecked usage of strncpy() + - btrfs: use tagged writepage to mitigate livelock of snapshot + - perf probe: Fix unchecked usage of strncpy() + - i2c: sh_mobile: Add support for r8a774c0 (RZ/G2E) + - bnxt_en: Disable MSIX before re-reserving NQs/CMPL rings. + - [x86] tools/power/x86/intel_pstate_tracer: Fix non root execution for + post processing a trace file + - livepatch: check kzalloc return values + - [arm64] KVM: Skip MMIO insn after emulation + - usb: musb: dsps: fix otg state machine + - usb: musb: dsps: fix runtime pm for peripheral mode + - perf header: Fix up argument to ctime() + - perf tools: Cast off_t to s64 to avoid warning on bionic libc + - percpu: convert spin_lock_irq to spin_lock_irqsave. + - [arm64] net: hns3: fix incomplete uninitialization of IRQ in the + hns3_nic_uninit_vector_data() + - drm/amd/display: Add retry to read ddc_clock pin + - Bluetooth: hci_bcm: Handle deferred probing for the clock supply + - drm/amd/display: fix YCbCr420 blank color + - [powerpc] uaccess: fix warning/error with access_ok() + - mac80211: fix radiotap vendor presence bitmap handling + - xfrm6_tunnel: Fix spi check in __xfrm6_tunnel_alloc_spi + - mlxsw: spectrum: Properly cleanup LAG uppers when removing port from LAG + - scsi: smartpqi: correct host serial num for ssa + - scsi: smartpqi: correct volume status + - scsi: smartpqi: increase fw status register read timeout + - cw1200: Fix concurrency use-after-free bugs in cw1200_hw_scan() + - [arm64] net: hns3: add max vector number check for pf + - [powerpc] perf: Fix thresholding counter data for unknown type + - iwlwifi: mvm: fix setting HE ppe FW config + - [powerpc] powernv/ioda: Allocate indirect TCE levels of cached userspace + addresses on demand + - mlx5: update timecounter at least twice per counter overflow + - drbd: narrow rcu_read_lock in drbd_sync_handshake + - drbd: disconnect, if the wrong UUIDs are attached on a connected peer + - drbd: skip spurious timeout (ping-timeo) when failing promote + - drbd: Avoid Clang warning about pointless switch statment + - drm/amd/display: validate extended dongle caps + - video: clps711x-fb: release disp device node in probe() + - md: fix raid10 hang issue caused by barrier + - fbdev: fbmem: behave better with small rotated displays and many CPUs + - i40e: define proper net_device::neigh_priv_len + - ice: Do not enable NAPI on q_vectors that have no rings + - igb: Fix an issue that PME is not enabled during runtime suspend + - ACPI/APEI: Clear GHES block_status before panic() + - fbdev: fbcon: Fix unregister crash when more than one framebuffer + - [powerpc] mm: Fix reporting of kernel execute faults on the 8xx + - [x86] KVM: svm: report MSR_IA32_MCG_EXT_CTL as unsupported + - [powerpc] fadump: Do not allow hot-remove memory from fadump reserved + area. + - kvm: Change offset in kvm_write_guest_offset_cached to unsigned + - NFS: nfs_compare_mount_options always compare auth flavors. + - perf build: Don't unconditionally link the libbfd feature test to + -liberty and -lz + - hwmon: (lm80) fix a missing check of the status of SMBus read + - hwmon: (lm80) fix a missing check of bus read in lm80 probe + - seq_buf: Make seq_buf_puts() null-terminate the buffer + - crypto: ux500 - Use proper enum in cryp_set_dma_transfer + - crypto: ux500 - Use proper enum in hash_set_dma_transfer + - [mips] ralink: Select CONFIG_CPU_MIPSR2_IRQ_VI on MT7620/8 + - cifs: check ntwrk_buf_start for NULL before dereferencing it + - f2fs: fix use-after-free issue when accessing sbi->stat_info + - um: Avoid marking pages with "changed protection" + - niu: fix missing checks of niu_pci_eeprom_read + - f2fs: fix sbi->extent_list corruption issue + - cgroup: fix parsing empty mount option string + - perf python: Do not force closing original perf descriptor in + evlist.get_pollfd() + - scripts/decode_stacktrace: only strip base path when a prefix of the path + - arch/sh/boards/mach-kfr2r09/setup.c: fix struct mtd_oob_ops build warning + - ocfs2: don't clear bh uptodate for block read + - ocfs2: improve ocfs2 Makefile + - mm/page_alloc.c: don't call kasan_free_pages() at deferred mem init + - zram: fix lockdep warning of free block handling + - isdn: hisax: hfc_pci: Fix a possible concurrency use-after-free bug in + HFCPCI_l1hw() + - gdrom: fix a memory leak bug + - fsl/fman: Use GFP_ATOMIC in {memac,tgec}_add_hash_mac_address() + - block/swim3: Fix -EBUSY error when re-opening device after unmount + - [arm*] thermal: bcm2835: enable hwmon explicitly + - kdb: Don't back trace on a cpu that didn't round up + - [armhf] PCI: imx: Enable MSI from downstream components + - thermal: generic-adc: Fix adc to temp interpolation + - [arm64] sve: ptrace: Fix SVE_PT_REGS_OFFSET definition + - kernel/hung_task.c: break RCU locks based on jiffies + - proc/sysctl: fix return error for proc_doulongvec_minmax() + - kernel/hung_task.c: force console verbose before panic + - fs/epoll: drop ovflist branch prediction + - exec: load_script: don't blindly truncate shebang string + - kernel/kcov.c: mark write_comp_data() as notrace + - scripts/gdb: fix lx-version string output + - xfs: Fix xqmstats offsets in /proc/fs/xfs/xqmstat + - xfs: cancel COW blocks before swapext + - xfs: Fix error code in 'xfs_ioc_getbmap()' + - xfs: fix overflow in xfs_attr3_leaf_verify + - xfs: fix shared extent data corruption due to missing cow reservation + - xfs: fix transient reference count error in + xfs_buf_resubmit_failed_buffers + - xfs: delalloc -> unwritten COW fork allocation can go wrong + - fs/xfs: fix f_ffree value for statfs when project quota is set + - xfs: fix PAGE_MASK usage in xfs_free_file_space + - xfs: fix inverted return from xfs_btree_sblock_verify_crc + - thermal: hwmon: inline helpers when CONFIG_THERMAL_HWMON is not set + - dccp: fool proof ccid_hc_[rt]x_parse_options() + - enic: fix checksum validation for IPv6 + - lib/test_rhashtable: Make test_insert_dup() allocate its hash table + dynamically + - net: dp83640: expire old TX-skb + - net: dsa: Fix lockdep false positive splat + - net: dsa: Fix NULL checking in dsa_slave_set_eee() + - net: dsa: mv88e6xxx: Fix counting of ATU violations + - net: dsa: slave: Don't propagate flag changes on down slave interfaces + - net/mlx5e: Force CHECKSUM_UNNECESSARY for short ethernet frames + - net: systemport: Fix WoL with password after deep sleep + - rds: fix refcount bug in rds_sock_addref + - Revert "net: phy: marvell: avoid pause mode on SGMII-to-Copper for + 88e151x" + - rxrpc: bad unlock balance in rxrpc_recvmsg + - sctp: check and update stream->out_curr when allocating stream_out + - sctp: walk the list of asoc safely (CVE-2019-8956) + - skge: potential memory corruption in skge_get_regs() + - virtio_net: Account for tx bytes and packets on sending xdp_frames + - net/mlx5e: FPGA, fix Innova IPsec TX offload data path performance + - xfs: eof trim writeback mapping as soon as it is cached + - ALSA: compress: Fix stop handling on compressed capture streams + - ALSA: usb-audio: Add support for new T+A USB DAC + - ALSA: hda - Serialize codec registrations + - ALSA: hda/realtek - Fix lose hp_pins for disable auto mute + - ALSA: hda/realtek - Use a common helper for hp pin reference + - ALSA: hda/realtek - Headset microphone support for System76 darp5 + - fuse: call pipe_buf_release() under pipe lock + - fuse: decrement NR_WRITEBACK_TEMP on the right page + - fuse: handle zero sized retrieve correctly + - [arm*] dmaengine: bcm2835: Fix interrupt race on RT + - [arm*] dmaengine: bcm2835: Fix abort of transactions + - [armhf] dmaengine: imx-dma: fix wrong callback invoke + - futex: Handle early deadlock return correctly + - [arm64] irqchip/gic-v3-its: Plug allocation race for devices sharing a + DevID + - [armhf] usb: phy: am335x: fix race condition in _probe + - usb: dwc3: gadget: Handle 0 xfer length for OUT EP + - usb: gadget: udc: net2272: Fix bitwise and boolean operations + - usb: gadget: musb: fix short isoc packets with inventra dma + - staging: speakup: fix tty-operation NULL derefs + - scsi: cxlflash: Prevent deadlock when adapter probe fails + - scsi: aic94xx: fix module loading + - cpu/hotplug: Fix "SMT disabled by BIOS" detection for KVM + - [x86] perf/x86/intel/uncore: Add Node ID mask + - [x86] MCE: Initialize mce.bank in the case of a fatal error in + mce_no_way_out() + - perf/core: Don't WARN() for impossible ring-buffer sizes + - perf tests evsel-tp-sched: Fix bitwise operator + - serial: fix race between flush_to_ldisc and tty_open + - serial: 8250_pci: Make PCI class test non fatal + - serial: sh-sci: Do not free irqs that have already been freed + - cacheinfo: Keep the old value if of_property_read_u32 fails + - IB/hfi1: Add limit test for RC/UC send via loopback + - [x86] perf/x86/intel: Delay memory deallocation until x86_pmu_dead_cpu() + - ath9k: dynack: make ewma estimation faster + - ath9k: dynack: check da->enabled first in sampling routines [ Ben Hutchings ] * [sparc64] udeb: Use standard module list in nic-modules; add i2c-modules diff --git a/debian/patches/bugfix/all/HID-debug-fix-the-ring-buffer-implementation.patch b/debian/patches/bugfix/all/HID-debug-fix-the-ring-buffer-implementation.patch deleted file mode 100644 index 5c7a0b408..000000000 --- a/debian/patches/bugfix/all/HID-debug-fix-the-ring-buffer-implementation.patch +++ /dev/null @@ -1,259 +0,0 @@ -From: Vladis Dronov -Date: Tue, 29 Jan 2019 11:58:35 +0100 -Subject: HID: debug: fix the ring buffer implementation -Origin: https://git.kernel.org/linus/13054abbaa4f1fd4e6f3b4b63439ec033b4c8035 -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2019-3819 - -Ring buffer implementation in hid_debug_event() and hid_debug_events_read() -is strange allowing lost or corrupted data. After commit 717adfdaf147 -("HID: debug: check length before copy_to_user()") it is possible to enter -an infinite loop in hid_debug_events_read() by providing 0 as count, this -locks up a system. Fix this by rewriting the ring buffer implementation -with kfifo and simplify the code. - -This fixes CVE-2019-3819. - -v2: fix an execution logic and add a comment -v3: use __set_current_state() instead of set_current_state() - -Link: https://bugzilla.redhat.com/show_bug.cgi?id=1669187 -Cc: stable@vger.kernel.org # v4.18+ -Fixes: cd667ce24796 ("HID: use debugfs for events/reports dumping") -Fixes: 717adfdaf147 ("HID: debug: check length before copy_to_user()") -Signed-off-by: Vladis Dronov -Reviewed-by: Oleg Nesterov -Signed-off-by: Benjamin Tissoires ---- - drivers/hid/hid-debug.c | 120 ++++++++++++++++++---------------------------- - include/linux/hid-debug.h | 9 ++-- - 2 files changed, 51 insertions(+), 78 deletions(-) - -diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c -index c530476edba6..ac9fda1b5a72 100644 ---- a/drivers/hid/hid-debug.c -+++ b/drivers/hid/hid-debug.c -@@ -30,6 +30,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -661,17 +662,12 @@ EXPORT_SYMBOL_GPL(hid_dump_device); - /* enqueue string to 'events' ring buffer */ - void hid_debug_event(struct hid_device *hdev, char *buf) - { -- unsigned i; - struct hid_debug_list *list; - unsigned long flags; - - spin_lock_irqsave(&hdev->debug_list_lock, flags); -- list_for_each_entry(list, &hdev->debug_list, node) { -- for (i = 0; buf[i]; i++) -- list->hid_debug_buf[(list->tail + i) % HID_DEBUG_BUFSIZE] = -- buf[i]; -- list->tail = (list->tail + i) % HID_DEBUG_BUFSIZE; -- } -+ list_for_each_entry(list, &hdev->debug_list, node) -+ kfifo_in(&list->hid_debug_fifo, buf, strlen(buf)); - spin_unlock_irqrestore(&hdev->debug_list_lock, flags); - - wake_up_interruptible(&hdev->debug_wait); -@@ -722,8 +718,7 @@ void hid_dump_input(struct hid_device *hdev, struct hid_usage *usage, __s32 valu - hid_debug_event(hdev, buf); - - kfree(buf); -- wake_up_interruptible(&hdev->debug_wait); -- -+ wake_up_interruptible(&hdev->debug_wait); - } - EXPORT_SYMBOL_GPL(hid_dump_input); - -@@ -1083,8 +1078,8 @@ static int hid_debug_events_open(struct inode *inode, struct file *file) - goto out; - } - -- if (!(list->hid_debug_buf = kzalloc(HID_DEBUG_BUFSIZE, GFP_KERNEL))) { -- err = -ENOMEM; -+ err = kfifo_alloc(&list->hid_debug_fifo, HID_DEBUG_FIFOSIZE, GFP_KERNEL); -+ if (err) { - kfree(list); - goto out; - } -@@ -1104,77 +1099,57 @@ static ssize_t hid_debug_events_read(struct file *file, char __user *buffer, - size_t count, loff_t *ppos) - { - struct hid_debug_list *list = file->private_data; -- int ret = 0, len; -+ int ret = 0, copied; - DECLARE_WAITQUEUE(wait, current); - - mutex_lock(&list->read_mutex); -- while (ret == 0) { -- if (list->head == list->tail) { -- add_wait_queue(&list->hdev->debug_wait, &wait); -- set_current_state(TASK_INTERRUPTIBLE); -- -- while (list->head == list->tail) { -- if (file->f_flags & O_NONBLOCK) { -- ret = -EAGAIN; -- break; -- } -- if (signal_pending(current)) { -- ret = -ERESTARTSYS; -- break; -- } -+ if (kfifo_is_empty(&list->hid_debug_fifo)) { -+ add_wait_queue(&list->hdev->debug_wait, &wait); -+ set_current_state(TASK_INTERRUPTIBLE); -+ -+ while (kfifo_is_empty(&list->hid_debug_fifo)) { -+ if (file->f_flags & O_NONBLOCK) { -+ ret = -EAGAIN; -+ break; -+ } - -- if (!list->hdev || !list->hdev->debug) { -- ret = -EIO; -- set_current_state(TASK_RUNNING); -- goto out; -- } -+ if (signal_pending(current)) { -+ ret = -ERESTARTSYS; -+ break; -+ } - -- /* allow O_NONBLOCK from other threads */ -- mutex_unlock(&list->read_mutex); -- schedule(); -- mutex_lock(&list->read_mutex); -- set_current_state(TASK_INTERRUPTIBLE); -+ /* if list->hdev is NULL we cannot remove_wait_queue(). -+ * if list->hdev->debug is 0 then hid_debug_unregister() -+ * was already called and list->hdev is being destroyed. -+ * if we add remove_wait_queue() here we can hit a race. -+ */ -+ if (!list->hdev || !list->hdev->debug) { -+ ret = -EIO; -+ set_current_state(TASK_RUNNING); -+ goto out; - } - -- set_current_state(TASK_RUNNING); -- remove_wait_queue(&list->hdev->debug_wait, &wait); -+ /* allow O_NONBLOCK from other threads */ -+ mutex_unlock(&list->read_mutex); -+ schedule(); -+ mutex_lock(&list->read_mutex); -+ set_current_state(TASK_INTERRUPTIBLE); - } - -- if (ret) -- goto out; -+ __set_current_state(TASK_RUNNING); -+ remove_wait_queue(&list->hdev->debug_wait, &wait); - -- /* pass the ringbuffer contents to userspace */ --copy_rest: -- if (list->tail == list->head) -+ if (ret) - goto out; -- if (list->tail > list->head) { -- len = list->tail - list->head; -- if (len > count) -- len = count; -- -- if (copy_to_user(buffer + ret, &list->hid_debug_buf[list->head], len)) { -- ret = -EFAULT; -- goto out; -- } -- ret += len; -- list->head += len; -- } else { -- len = HID_DEBUG_BUFSIZE - list->head; -- if (len > count) -- len = count; -- -- if (copy_to_user(buffer, &list->hid_debug_buf[list->head], len)) { -- ret = -EFAULT; -- goto out; -- } -- list->head = 0; -- ret += len; -- count -= len; -- if (count > 0) -- goto copy_rest; -- } -- - } -+ -+ /* pass the fifo content to userspace, locking is not needed with only -+ * one concurrent reader and one concurrent writer -+ */ -+ ret = kfifo_to_user(&list->hid_debug_fifo, buffer, count, &copied); -+ if (ret) -+ goto out; -+ ret = copied; - out: - mutex_unlock(&list->read_mutex); - return ret; -@@ -1185,7 +1160,7 @@ static __poll_t hid_debug_events_poll(struct file *file, poll_table *wait) - struct hid_debug_list *list = file->private_data; - - poll_wait(file, &list->hdev->debug_wait, wait); -- if (list->head != list->tail) -+ if (!kfifo_is_empty(&list->hid_debug_fifo)) - return EPOLLIN | EPOLLRDNORM; - if (!list->hdev->debug) - return EPOLLERR | EPOLLHUP; -@@ -1200,7 +1175,7 @@ static int hid_debug_events_release(struct inode *inode, struct file *file) - spin_lock_irqsave(&list->hdev->debug_list_lock, flags); - list_del(&list->node); - spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags); -- kfree(list->hid_debug_buf); -+ kfifo_free(&list->hid_debug_fifo); - kfree(list); - - return 0; -@@ -1246,4 +1221,3 @@ void hid_debug_exit(void) - { - debugfs_remove_recursive(hid_debug_root); - } -- -diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h -index 8663f216c563..2d6100edf204 100644 ---- a/include/linux/hid-debug.h -+++ b/include/linux/hid-debug.h -@@ -24,7 +24,10 @@ - - #ifdef CONFIG_DEBUG_FS - -+#include -+ - #define HID_DEBUG_BUFSIZE 512 -+#define HID_DEBUG_FIFOSIZE 512 - - void hid_dump_input(struct hid_device *, struct hid_usage *, __s32); - void hid_dump_report(struct hid_device *, int , u8 *, int); -@@ -37,11 +40,8 @@ void hid_debug_init(void); - void hid_debug_exit(void); - void hid_debug_event(struct hid_device *, char *); - -- - struct hid_debug_list { -- char *hid_debug_buf; -- int head; -- int tail; -+ DECLARE_KFIFO_PTR(hid_debug_fifo, char); - struct fasync_struct *fasync; - struct hid_device *hdev; - struct list_head node; -@@ -64,4 +64,3 @@ struct hid_debug_list { - #endif - - #endif -- --- -2.11.0 - diff --git a/debian/patches/bugfix/all/kvm-fix-kvm_ioctl_create_device-reference-counting-C.patch b/debian/patches/bugfix/all/kvm-fix-kvm_ioctl_create_device-reference-counting-C.patch deleted file mode 100644 index 0ac911484..000000000 --- a/debian/patches/bugfix/all/kvm-fix-kvm_ioctl_create_device-reference-counting-C.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: Jann Horn -Date: Sat, 26 Jan 2019 01:54:33 +0100 -Subject: kvm: fix kvm_ioctl_create_device() reference counting (CVE-2019-6974) -Origin: https://git.kernel.org/linus/cfa39381173d5f969daf43582c95ad679189cbc9 -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2019-6974 - -kvm_ioctl_create_device() does the following: - -1. creates a device that holds a reference to the VM object (with a borrowed - reference, the VM's refcount has not been bumped yet) -2. initializes the device -3. transfers the reference to the device to the caller's file descriptor table -4. calls kvm_get_kvm() to turn the borrowed reference to the VM into a real - reference - -The ownership transfer in step 3 must not happen before the reference to the VM -becomes a proper, non-borrowed reference, which only happens in step 4. -After step 3, an attacker can close the file descriptor and drop the borrowed -reference, which can cause the refcount of the kvm object to drop to zero. - -This means that we need to grab a reference for the device before -anon_inode_getfd(), otherwise the VM can disappear from under us. - -Fixes: 852b6d57dc7f ("kvm: add device control API") -Cc: stable@kernel.org -Signed-off-by: Jann Horn -Signed-off-by: Paolo Bonzini ---- - virt/kvm/kvm_main.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c -index 5ecea812cb6a..585845203db8 100644 ---- a/virt/kvm/kvm_main.c -+++ b/virt/kvm/kvm_main.c -@@ -3000,8 +3000,10 @@ static int kvm_ioctl_create_device(struct kvm *kvm, - if (ops->init) - ops->init(dev); - -+ kvm_get_kvm(kvm); - ret = anon_inode_getfd(ops->name, &kvm_device_fops, dev, O_RDWR | O_CLOEXEC); - if (ret < 0) { -+ kvm_put_kvm(kvm); - mutex_lock(&kvm->lock); - list_del(&dev->vm_node); - mutex_unlock(&kvm->lock); -@@ -3009,7 +3011,6 @@ static int kvm_ioctl_create_device(struct kvm *kvm, - return ret; - } - -- kvm_get_kvm(kvm); - cd->fd = ret; - return 0; - } --- -2.11.0 - diff --git a/debian/patches/bugfix/all/percpu-convert-spin_lock_irq-to-spin_lock_irqsave.patch b/debian/patches/bugfix/all/percpu-convert-spin_lock_irq-to-spin_lock_irqsave.patch deleted file mode 100644 index bffa68484..000000000 --- a/debian/patches/bugfix/all/percpu-convert-spin_lock_irq-to-spin_lock_irqsave.patch +++ /dev/null @@ -1,49 +0,0 @@ -From: Dennis Zhou -Date: Tue, 18 Dec 2018 08:42:27 -0800 -Subject: percpu: convert spin_lock_irq to spin_lock_irqsave. -Origin: https://git.kernel.org/linus/6ab7d47bcbf0144a8cb81536c2cead4cde18acfe - -From Michael Cree: - "Bisection lead to commit b38d08f3181c ("percpu: restructure - locking") as being the cause of lockups at initial boot on - the kernel built for generic Alpha. - - On a suggestion by Tejun Heo that: - - So, the only thing I can think of is that it's calling - spin_unlock_irq() while irq handling isn't set up yet. - Can you please try the followings? - - 1. Convert all spin_[un]lock_irq() to - spin_lock_irqsave/unlock_irqrestore()." - -Fixes: b38d08f3181c ("percpu: restructure locking") -Reported-and-tested-by: Michael Cree -Acked-by: Tejun Heo -Signed-off-by: Dennis Zhou ---- - mm/percpu-km.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/mm/percpu-km.c -+++ b/mm/percpu-km.c -@@ -50,6 +50,7 @@ static struct pcpu_chunk *pcpu_create_ch - const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT; - struct pcpu_chunk *chunk; - struct page *pages; -+ unsigned long flags; - int i; - - chunk = pcpu_alloc_chunk(gfp); -@@ -68,9 +69,9 @@ static struct pcpu_chunk *pcpu_create_ch - chunk->data = pages; - chunk->base_addr = page_address(pages) - pcpu_group_offsets[0]; - -- spin_lock_irq(&pcpu_lock); -+ spin_lock_irqsave(&pcpu_lock, flags); - pcpu_chunk_populated(chunk, 0, nr_pages, false); -- spin_unlock_irq(&pcpu_lock); -+ spin_unlock_irqrestore(&pcpu_lock, flags); - - pcpu_stats_chunk_alloc(); - trace_percpu_create_chunk(chunk->base_addr); diff --git a/debian/patches/bugfix/x86/KVM-nVMX-unconditionally-cancel-preemption-timer-in-.patch b/debian/patches/bugfix/x86/KVM-nVMX-unconditionally-cancel-preemption-timer-in-.patch deleted file mode 100644 index 9e55a4928..000000000 --- a/debian/patches/bugfix/x86/KVM-nVMX-unconditionally-cancel-preemption-timer-in-.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Peter Shier -Date: Thu, 11 Oct 2018 11:46:46 -0700 -Subject: KVM: nVMX: unconditionally cancel preemption timer in free_nested - (CVE-2019-7221) -Origin: https://git.kernel.org/linus/ecec76885bcfe3294685dc363fd1273df0d5d65f -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2019-7221 - -Bugzilla: 1671904 - -There are multiple code paths where an hrtimer may have been started to -emulate an L1 VMX preemption timer that can result in a call to free_nested -without an intervening L2 exit where the hrtimer is normally -cancelled. Unconditionally cancel in free_nested to cover all cases. - -Embargoed until Feb 7th 2019. - -Signed-off-by: Peter Shier -Reported-by: Jim Mattson -Reviewed-by: Jim Mattson -Reported-by: Felix Wilhelm -Cc: stable@kernel.org -Message-Id: <20181011184646.154065-1-pshier@google.com> -Signed-off-by: Paolo Bonzini -[carnil: Backport to 4.19. Adjust filename to arch/x86/kvm/vmx/vmx.c -as later refactoring moved nested code to dedicated files] ---- - ---- a/arch/x86/kvm/vmx.c -+++ b/arch/x86/kvm/vmx.c -@@ -8469,6 +8469,7 @@ static void free_nested(struct vcpu_vmx - if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon) - return; - -+ hrtimer_cancel(&vmx->nested.preemption_timer); - vmx->nested.vmxon = false; - vmx->nested.smm.vmxon = false; - free_vpid(vmx->nested.vpid02); diff --git a/debian/patches/bugfix/x86/KVM-x86-work-around-leak-of-uninitialized-stack-cont.patch b/debian/patches/bugfix/x86/KVM-x86-work-around-leak-of-uninitialized-stack-cont.patch deleted file mode 100644 index 5f753bd78..000000000 --- a/debian/patches/bugfix/x86/KVM-x86-work-around-leak-of-uninitialized-stack-cont.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Paolo Bonzini -Date: Tue, 29 Jan 2019 18:41:16 +0100 -Subject: KVM: x86: work around leak of uninitialized stack contents - (CVE-2019-7222) -Origin: https://git.kernel.org/linus/353c0956a618a07ba4bbe7ad00ff29fe70e8412a -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2019-7222 - -Bugzilla: 1671930 - -Emulation of certain instructions (VMXON, VMCLEAR, VMPTRLD, VMWRITE with -memory operand, INVEPT, INVVPID) can incorrectly inject a page fault -when passed an operand that points to an MMIO address. The page fault -will use uninitialized kernel stack memory as the CR2 and error code. - -The right behavior would be to abort the VM with a KVM_EXIT_INTERNAL_ERROR -exit to userspace; however, it is not an easy fix, so for now just -ensure that the error code and CR2 are zero. - -Embargoed until Feb 7th 2019. - -Reported-by: Felix Wilhelm -Cc: stable@kernel.org -Signed-off-by: Paolo Bonzini ---- - arch/x86/kvm/x86.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 3d27206f6c01..e67ecf25e690 100644 ---- a/arch/x86/kvm/x86.c -+++ b/arch/x86/kvm/x86.c -@@ -5116,6 +5116,13 @@ int kvm_read_guest_virt(struct kvm_vcpu *vcpu, - { - u32 access = (kvm_x86_ops->get_cpl(vcpu) == 3) ? PFERR_USER_MASK : 0; - -+ /* -+ * FIXME: this should call handle_emulation_failure if X86EMUL_IO_NEEDED -+ * is returned, but our callers are not ready for that and they blindly -+ * call kvm_inject_page_fault. Ensure that they at least do not leak -+ * uninitialized kernel stack memory into cr2 and error code. -+ */ -+ memset(exception, 0, sizeof(*exception)); - return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, access, - exception); - } --- -2.11.0 - diff --git a/debian/patches/series b/debian/patches/series index efdee6915..1834c6f09 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -102,7 +102,6 @@ bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch bugfix/all/partially-revert-usb-kconfig-using-select-for-usb_co.patch bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch debian/revert-objtool-fix-config_stack_validation-y-warning.patch -bugfix/all/percpu-convert-spin_lock_irq-to-spin_lock_irqsave.patch bugfix/all/mt76-use-the-correct-hweight8-function.patch bugfix/all/btrfs-fix-corruption-reading-shared-and-compressed-e.patch @@ -144,10 +143,6 @@ features/all/lockdown/arm64-add-kernel-config-option-to-lock-down-when.patch # Security fixes debian/i386-686-pae-pci-set-pci-nobios-by-default.patch -bugfix/all/kvm-fix-kvm_ioctl_create_device-reference-counting-C.patch -bugfix/x86/KVM-x86-work-around-leak-of-uninitialized-stack-cont.patch -bugfix/x86/KVM-nVMX-unconditionally-cancel-preemption-timer-in-.patch -bugfix/all/HID-debug-fix-the-ring-buffer-implementation.patch # Fix exported symbol versions bugfix/all/module-disable-matching-missing-version-crc.patch From e60f3ee90aec7a1be712e819d2add51d3b017e5e Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 25 Feb 2019 16:58:41 +0100 Subject: [PATCH 2/8] perf: disable libfd-liberty libbfd-liberty-z Due to "perf build: Don't unconditionally link the libbfd feature test to -liberty and -lz" commit in 4.19 stable tree. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.19.y&id=303d29d8f0cfccfc283322648a617033cd69a70f --- debian/rules.d/tools/perf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules.d/tools/perf/Makefile b/debian/rules.d/tools/perf/Makefile index c5d0c9342..3c397c75e 100644 --- a/debian/rules.d/tools/perf/Makefile +++ b/debian/rules.d/tools/perf/Makefile @@ -15,7 +15,7 @@ MAKE_PERF += perfexecdir=lib/perf_$(VERSION)-core plugindir=/usr/lib/traceevent_ # undistributable as they are licenced under GPL v2 and v3+ # respectively. Override detection of libbfd and insist that # cplus_demangle() can be found in libiberty (LGPL v2.1+). -MAKE_PERF += feature-libbfd=0 HAVE_CPLUS_DEMANGLE_SUPPORT=1 +MAKE_PERF += feature-libbfd=0 feature-libbfd-liberty=0 feature-libbfd-liberty-z=0 HAVE_CPLUS_DEMANGLE_SUPPORT=1 # perf can link against libcrypto if available, but the result is # undistributable as GPL v2 and OpenSSL are not compatible without From ee5b6f81c695cf9d2d5702f62cf6a10fb0acc078 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 25 Feb 2019 16:59:29 +0100 Subject: [PATCH 3/8] update to 4.19.22 --- debian/changelog | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b520823b5..3ef5413ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (4.19.21-1) UNRELEASED; urgency=medium +linux (4.19.22-1) UNRELEASED; urgency=medium * New upstream stable update: https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.21 @@ -306,6 +306,43 @@ linux (4.19.21-1) UNRELEASED; urgency=medium - [x86] perf/x86/intel: Delay memory deallocation until x86_pmu_dead_cpu() - ath9k: dynack: make ewma estimation faster - ath9k: dynack: check da->enabled first in sampling routines + https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.22 + - mtd: Make sure mtd->erasesize is valid even if the partition is of size 0 + - mtd: rawnand: gpmi: fix MX28 bus master lockup problem + - libata: Add NOLPM quirk for SAMSUNG MZ7TE512HMHP-000L1 SSD + - [armhf, arm64] iio: adc: axp288: Fix TS-pin handling + - signal: Always notice exiting tasks + - signal: Better detection of synchronous signals + - [armhf, arm64] misc: vexpress: Off by one in vexpress_syscfg_exec() + - [x86] mei: me: add ice lake point device id. + - debugfs: fix debugfs_rename parameter checking + - [arm64] pinctrl: sunxi: Correct number of IRQ banks on H6 main pin + controller + - [x86] pinctrl: cherryview: fix Strago DMI workaround + - tracing: uprobes: Fix typo in pr_fmt string + - [mips*] cm: reprime error cause + - [mips*] OCTEON: don't set octeon_dma_bar_type if PCI is disabled + - [mips*] VDSO: Use same -m%-float cflag as the kernel proper + - [mips*] loongson64: remove unreachable(), fix loongson_poweroff(). + - [mips*] VDSO: Include $(ccflags-vdso) in o32,n32 .lds builds + - [arm64] firmware: arm_scmi: provide the mandatory device release callback + - [powerpc*] radix: Fix kernel crash with mremap() + - mic: vop: Fix use-after-free on remove + - mac80211: ensure that mgmt tx skbs have tailroom for encryption + - drm/modes: Prevent division by zero htotal + - drm/amd/powerplay: Fix missing break in switch + - [x86] drm/i915: always return something on DDI clock selection + - [x86] drm/vmwgfx: Fix setting of dma masks + - [x86] drm/vmwgfx: Return error code from vmw_execbuf_copy_fence_user + - SUNRPC: Always drop the XPRT_LOCK on XPRT_CLOSE_WAIT + - xfrm: Make set-mark default behavior backward compatible + - Revert "ext4: use ext4_write_inode() when fsyncing w/o a journal" + - libceph: avoid KEEPALIVE_PENDING races in ceph_con_keepalive() + - xfrm: refine validation of template and selector families + - batman-adv: Avoid WARN on net_device without parent in netns + - batman-adv: Force mac header to start of data on xmit + - svcrdma: Reduce max_send_sges + - svcrdma: Remove max_sge check at connect time [ Ben Hutchings ] * [sparc64] udeb: Use standard module list in nic-modules; add i2c-modules From 493801a88a606827b028e145b8edfe2d2817846b Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 25 Feb 2019 16:59:58 +0100 Subject: [PATCH 4/8] update to 4.19.23 --- debian/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3ef5413ee..2074166ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (4.19.22-1) UNRELEASED; urgency=medium +linux (4.19.23-1) UNRELEASED; urgency=medium * New upstream stable update: https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.21 @@ -343,6 +343,8 @@ linux (4.19.22-1) UNRELEASED; urgency=medium - batman-adv: Force mac header to start of data on xmit - svcrdma: Reduce max_send_sges - svcrdma: Remove max_sge check at connect time + https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.23 + - Revert "exec: load_script: don't blindly truncate shebang string" [ Ben Hutchings ] * [sparc64] udeb: Use standard module list in nic-modules; add i2c-modules From 37e6c11924a19a13a3bf05727e058c2cd8feb69e Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 25 Feb 2019 17:00:37 +0100 Subject: [PATCH 5/8] update to 4.19.24 --- debian/changelog | 92 ++++++++++++++++++- ...tools-uapi-fix-risc-v-64-bit-support.patch | 70 -------------- debian/patches/series | 1 - 3 files changed, 91 insertions(+), 72 deletions(-) delete mode 100644 debian/patches/bugfix/riscv/tools-uapi-fix-risc-v-64-bit-support.patch diff --git a/debian/changelog b/debian/changelog index 2074166ac..13f557753 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (4.19.23-1) UNRELEASED; urgency=medium +linux (4.19.24-1) UNRELEASED; urgency=medium * New upstream stable update: https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.21 @@ -345,6 +345,96 @@ linux (4.19.23-1) UNRELEASED; urgency=medium - svcrdma: Remove max_sge check at connect time https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.23 - Revert "exec: load_script: don't blindly truncate shebang string" + https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.24 + - dt-bindings: eeprom: at24: add "atmel,24c2048" compatible string + - eeprom: at24: add support for 24c2048 + - blk-mq: fix a hung issue when fsync + - [armel, armhf] 8789/1: signal: copy registers using __copy_to_user() + - [armel, armhf] 8790/1: signal: always use __copy_to_user to save iwmmxt + context + - [armel, armhf] 8791/1: vfp: use __copy_to_user() when saving VFP state + - [armel, armhf] 8792/1: oabi-compat: copy oabi events using + __copy_to_user() + - [armel, armhf] 8793/1: signal: replace __put_user_error with __put_user + - [armel, armhf] 8794/1: uaccess: Prevent speculative use of the current + addr_limit + - [armel, armhf] 8795/1: spectre-v1.1: use put_user() for __put_user() + - [armel, armhf] 8796/1: spectre-v1,v1.1: provide helpers for address + sanitization + - [armel, armhf] 8797/1: spectre-v1.1: harden __copy_to_user + - [armel, armhf] 8810/1: vfp: Fix wrong assignement to ufp_exc + - [armel, armhfl armhf] make lookup_processor_type() non-__init + - [armel, armhf] split out processor lookup + - [armel, armhf] clean up per-processor check_bugs method call + - [armel, armhf] add PROC_VTABLE and PROC_TABLE macros + - [armel, armhf] spectre-v2: per-CPU vtables to work around big.Little + systems + - [armel, armhf] ensure that processor vtables is not lost after boot + - [armel, armhf] fix the cockup in the previous patch + - drm/amdgpu/sriov:Correct pfvf exchange logic + - [i386] ACPI: NUMA: Use correct type for printing addresses on i386-PAE + - perf report: Fix wrong iteration count in --branch-history + - perf test shell: Use a fallback to get the pathname in vfs_getname + - [riscv64] riscv: fix trace_sys_exit hook + - cpufreq: check if policy is inactive early in __cpufreq_get() + - drm/bridge: tc358767: add bus flags + - drm/bridge: tc358767: add defines for DP1_SRCCTRL & PHY_2LANE + - drm/bridge: tc358767: fix single lane configuration + - drm/bridge: tc358767: fix initial DP0/1_SRCCTRL value + - drm/bridge: tc358767: reject modes which require too much BW + - drm/bridge: tc358767: fix output H/V syncs + - nvme-pci: use the same attributes when freeing host_mem_desc_bufs. + - nvme-pci: fix out of bounds access in nvme_cqe_pending + - nvme-multipath: zero out ANA log buffer + - nvme: pad fake subsys NQN vid and ssvid with zeros + - drm/amdgpu: set WRITE_BURST_LENGTH to 64B to workaround SDMA1 hang + - [armel] dts: kirkwood: Fix polarity of GPIO fan lines + - [armel, armhf] gpio: pl061: handle failed allocations + - drm/nouveau: Don't disable polling in fallback mode + - drm/nouveau/falcon: avoid touching registers if engine is off + - cifs: Limit memory used by lock request calls to a page + - [x86] kvm: sev: Fail KVM_SEV_INIT if already initialized + - CIFS: Do not assume one credit for async responses + - [arm*] gpio: mxc: move gpio noirq suspend/resume to syscore phase + - [x86] Revert "Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire + F5-573G" + - [x86] Input: elan_i2c - add ACPI ID for touchpad in Lenovo V330-15ISK + - [armhf] OMAP5+: Fix inverted nirq pin interrupts with irq_set_type + - perf/core: Fix impossible ring-buffer sizes warning + - [x86] perf: Add check_period PMU callback + - [x86] ALSA: hda - Add quirk for HP EliteBook 840 G5 + - ALSA: usb-audio: Fix implicit fb endpoint setup by quirk + - ASoC: hdmi-codec: fix oops on re-probe + - tools uapi: fix Alpha support + - [riscv64] Add pte bit to distinguish swap from invalid + - [x86] kvm/nVMX: read from MSR_IA32_VMX_PROCBASED_CTLS2 only when it is + available + - [x86] kvm: vmx: Fix entry number check for add_atomic_switch_msr() + - [arm*] mmc: sunxi: Filter out unsupported modes declared in the device + tree + - mmc: block: handle complete_work on separate workqueue + - Input: bma150 - register input device after setting private data + - [x86] Input: elantech - enable 3rd button support on Fujitsu CELSIUS H780 + - Revert "nfsd4: return default lease period" + - Revert "mm: don't reclaim inodes with many attached pages" + - Revert "mm: slowly shrink slabs with a relatively small number of + objects" + - alpha: fix page fault handling for r16-r18 targets + - alpha: Fix Eiger NR_IRQS to 128 + - [s390*] zcrypt: fix specification exception on z196 during ap probe + - tracing/uprobes: Fix output for multiple string arguments + - [x86] platform/UV: Use efi_runtime_lock to serialise BIOS calls + - scsi: sd: fix entropy gathering for most rotational disks + - signal: Restore the stop PTRACE_EVENT_EXIT + - md/raid1: don't clear bitmap bits on interrupted recovery. + - [x86] a.out: Clear the dump structure initially + - dm crypt: don't overallocate the integrity tag space + - dm thin: fix bug where bio that overwrites thin block ignores FUA + - drm: Use array_size() when creating lease + - [x86] drm/vkms: Fix license inconsistent + - [x86] drm/i915: Block fbdev HPD processing during suspend + - [x86] drm/i915: Prevent a race during I915_GEM_MMAP ioctl with WC set + - mm: proc: smaps_rollup: fix pss_locked calculation [ Ben Hutchings ] * [sparc64] udeb: Use standard module list in nic-modules; add i2c-modules diff --git a/debian/patches/bugfix/riscv/tools-uapi-fix-risc-v-64-bit-support.patch b/debian/patches/bugfix/riscv/tools-uapi-fix-risc-v-64-bit-support.patch deleted file mode 100644 index ab35e9a38..000000000 --- a/debian/patches/bugfix/riscv/tools-uapi-fix-risc-v-64-bit-support.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Aurelien Jarno -Date: Tue, 25 Dec 2018 06:46:24 -0800 -Subject: tools uapi: fix RISC-V 64-bit support -Forwarded: http://lists.infradead.org/pipermail/linux-riscv/2018-December/002622.html - -The BPF library is not built on 64-bit RISC-V, as the BPF feature is -not detected. Looking more in details, feature/test-bpf.c fails to build -with the following error: - -| In file included from /tmp/linux-4.19.12/tools/include/uapi/asm/bitsperlong.h:17, -| from /tmp/linux-4.19.12/tools/include/uapi/asm-generic/unistd.h:2, -| from /usr/include/riscv64-linux-gnu/asm/unistd.h:1, -| from test-bpf.c:2: -| /tmp/linux-4.19.12/tools/include/asm-generic/bitsperlong.h:14:2: error: #error Inconsistent word size. Check asm/bitsperlong.h -| #error Inconsistent word size. Check asm/bitsperlong.h -| ^~~~~ - -The UAPI from the tools directory is missing RISC-V support, therefore -bitsperlong.h from asm-generic is used, defaulting to 32 bits. - -Fix that by adding tools/arch/riscv/include/uapi/asm/bitsperlong.h as -a copy of arch/riscv/include/uapi/asm/bitsperlong.h and by updating -tools/include/uapi/asm/bitsperlong.h. - -Signed-off-by: Aurelien Jarno ---- - .../arch/riscv/include/uapi/asm/bitsperlong.h | 25 +++++++++++++++++++ - tools/include/uapi/asm/bitsperlong.h | 2 ++ - 2 files changed, 27 insertions(+) - create mode 100644 tools/arch/riscv/include/uapi/asm/bitsperlong.h - ---- /dev/null -+++ b/tools/arch/riscv/include/uapi/asm/bitsperlong.h -@@ -0,0 +1,25 @@ -+/* -+ * Copyright (C) 2012 ARM Ltd. -+ * Copyright (C) 2015 Regents of the University of California -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . -+ */ -+ -+#ifndef _UAPI_ASM_RISCV_BITSPERLONG_H -+#define _UAPI_ASM_RISCV_BITSPERLONG_H -+ -+#define __BITS_PER_LONG (__SIZEOF_POINTER__ * 8) -+ -+#include -+ -+#endif /* _UAPI_ASM_RISCV_BITSPERLONG_H */ ---- a/tools/include/uapi/asm/bitsperlong.h -+++ b/tools/include/uapi/asm/bitsperlong.h -@@ -13,6 +13,8 @@ - #include "../../arch/mips/include/uapi/asm/bitsperlong.h" - #elif defined(__ia64__) - #include "../../arch/ia64/include/uapi/asm/bitsperlong.h" -+#elif defined(__riscv) -+#include "../../arch/riscv/include/uapi/asm/bitsperlong.h" - #else - #include - #endif diff --git a/debian/patches/series b/debian/patches/series index 1834c6f09..c166088eb 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -164,7 +164,6 @@ bugfix/x86/tools-x86_energy_perf_policy-fix-uninitialized-varia.patch bugfix/x86/tools-turbostat-Add-checks-for-failure-of-fgets-and-.patch bugfix/all/libbpf-add-soname-to-shared-object.patch bugfix/all/libbpf-link-shared-object-with-libelf.patch -bugfix/riscv/tools-uapi-fix-risc-v-64-bit-support.patch # wireless: Disable regulatory.db direct loading (until we sort out signing) debian/wireless-disable-regulatory.db-direct-loading.patch From 1b33d3e00b2abda0e0cf0152341a105910837509 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Wed, 27 Feb 2019 19:38:51 +0100 Subject: [PATCH 6/8] update to 4.19.25 --- debian/changelog | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 13f557753..49ddd79cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (4.19.24-1) UNRELEASED; urgency=medium +linux (4.19.25-1) UNRELEASED; urgency=medium * New upstream stable update: https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.21 @@ -435,6 +435,36 @@ linux (4.19.24-1) UNRELEASED; urgency=medium - [x86] drm/i915: Block fbdev HPD processing during suspend - [x86] drm/i915: Prevent a race during I915_GEM_MMAP ioctl with WC set - mm: proc: smaps_rollup: fix pss_locked calculation + https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.25 + - af_packet: fix raw sockets over 6in4 tunnel + - [arm64, armhf] dsa: mv88e6xxx: Ensure all pending interrupts are handled + prior to exit + - mlxsw: __mlxsw_sp_port_headroom_set(): Fix a use of local variable + - net: crypto set sk to NULL when af_alg_release. (CVE-2019-8912) + - net: Fix for_each_netdev_feature on Big endian + - net: fix IPv6 prefix route residue + - net: ip6_gre: initialize erspan_ver just for erspan tunnels + - net: ipv4: use a dedicated counter for icmp_v4 redirect packets + - net: phy: xgmiitorgmii: Support generic PHY status read + - net: stmmac: Fix a race in EEE enable callback + - net: stmmac: handle endianness in dwmac4_get_timestamp + - sky2: Increase D3 delay again + - vhost: correctly check the return value of translate_desc() in log_used() + - vsock: cope with memory allocation failure at socket creation time + - vxlan: test dev->flags & IFF_UP before calling netif_rx() + - net: Add header for usage of fls64() + - tcp: clear icsk_backoff in tcp_write_queue_purge() + - tcp: tcp_v4_err() should be more careful + - net: Do not allocate page fragments that are not skb aligned + - hwmon: (lm80) Fix missing unlock on error in set_fan_div() + - scsi: target/core: Use kmem_cache_free() instead of kfree() + - PCI: Fix __initdata issue with "pci=disable_acs_redir" parameter + - sunrpc: fix 4 more call sites that were using stack memory with a + scatterlist + - netfilter: nf_nat_snmp_basic: add missing length checks in ASN.1 cbs + (CVE-2019-9162) + - net/x25: do not hold the cpu too long in x25_new_lci() + - ax25: fix possible use-after-free [ Ben Hutchings ] * [sparc64] udeb: Use standard module list in nic-modules; add i2c-modules From 8e3ab60ac630dd5fc9372a64c13964261121a9f7 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Wed, 27 Feb 2019 19:39:23 +0100 Subject: [PATCH 7/8] update to 4.19.26 --- debian/changelog | 138 +++++++++++++++++- ...tions-for-handling-Low-Latency-Queue.patch | 2 +- 2 files changed, 138 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 49ddd79cb..aaf5ea72a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (4.19.25-1) UNRELEASED; urgency=medium +linux (4.19.26-1) UNRELEASED; urgency=medium * New upstream stable update: https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.21 @@ -465,6 +465,142 @@ linux (4.19.25-1) UNRELEASED; urgency=medium (CVE-2019-9162) - net/x25: do not hold the cpu too long in x25_new_lci() - ax25: fix possible use-after-free + https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.26 + - [armel armhf] 8834/1: Fix: kprobes: optimized kprobes illegal instruction + - tracing: Fix number of entries in trace header + - [mips*] eBPF: Always return sign extended 32b values + - [armel] gpio: pxa: avoid attempting to set pin direction via pinctrl on + MMP2 + - mac80211: Restore vif beacon interval if start ap fails + - mac80211: Use linked list instead of rhashtable walk for mesh tables + - mac80211: Free mpath object when rhashtable insertion fails + - libceph: handle an empty authorize reply + - ceph: avoid repeatedly adding inode to mdsc->snap_flush_list + - numa: change get_mempolicy() to use nr_node_ids instead of MAX_NUMNODES + - proc, oom: do not report alien mms when setting oom_score_adj + - [x86] ALSA: hda/realtek - Headset microphone and internal speaker + support for System76 oryp5 + - [x86] ALSA: hda/realtek: Disable PC beep in passthrough on alc285 + - KEYS: allow reaching the keys quotas exactly + - backlight: pwm_bl: Fix devicetree parsing with auto-generated brightness + tables + - [armhf] mfd: ti_am335x_tscadc: Use PLATFORM_DEVID_AUTO while registering + mfd cells + - pvcalls-front: read all data before closing the connection + - pvcalls-front: don't try to free unallocated rings + - pvcalls-front: properly allocate sk + - pvcalls-back: set -ENOTCONN in pvcalls_conn_back_read + - mfd: twl-core: Fix section annotations on {,un}protect_pm_master + - mfd: db8500-prcmu: Fix some section annotations + - mfd: ab8500-core: Return zero in get_register_interruptible() + - mfd: qcom_rpm: write fw_version to CTRL_REG + - mfd: wm5110: Add missing ASRC rate register + - mfd: axp20x: Add AC power supply cell for AXP813 + - mfd: axp20x: Re-align MFD cell entries + - mfd: axp20x: Add supported cells for AXP803 + - mfd: cros_ec_dev: Add missing mfd_remove_devices() call in remove + - mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in + probe() + - mfd: mc13xxx: Fix a missing check of a register-read failure + - qed: Fix qed_chain_set_prod() for PBL chains with non power of 2 page + count + - qed: Fix qed_ll2_post_rx_buffer_notify_fw() by adding a write memory + barrier + - net: hns: Fix use after free identified by SLUB debug + - bpf: Fix [::] -> [::1] rewrite in sys_sendmsg + - selftests/bpf: Test [::] -> [::1] rewrite in sys_sendmsg in + test_sock_addr + - watchdog: mt7621_wdt/rt2880_wdt: Fix compilation problem + - net/mlx4: Get rid of page operation after dma_alloc_coherent + - xprtrdma: Double free in rpcrdma_sendctxs_create() + - mlxsw: spectrum_acl: Add cleanup after C-TCAM update error condition + - selftests: forwarding: Add a test for VLAN deletion + - netfilter: nf_tables: fix leaking object reference count + - scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param + - scsi: isci: initialize shost fully before calling scsi_add_host() + - include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR + - netfilter: nft_flow_offload: Fix reverse route lookup + - bpf: correctly set initial window on active Fast Open sender + - bpf: fix panic in stack_map_get_build_id() on i386 and arm32 + - netfilter: nft_flow_offload: fix interaction with vrf slave device + - RDMA/mthca: Clear QP objects during their allocation + - powerpc/8xx: fix setting of pagetable for Abatron BDI debug tool. + - acpi/nfit: Fix race accessing memdev in nfit_get_smbios_id() + - net: stmmac: Fix PCI module removal leak + - net: stmmac: dwxgmac2: Only clear interrupts that are active + - net: stmmac: Check if CBS is supported before configuring + - net: stmmac: Fix the logic of checking if RX Watchdog must be enabled + - net: stmmac: Prevent RX starvation in stmmac_napi_poll() + - isdn: i4l: isdn_tty: Fix some concurrency double-free bugs + - scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes + - scsi: ufs: Fix system suspend status + - scsi: qedi: Add ep_state for login completion on un-reachable targets + - scsi: ufs: Fix geometry descriptor size + - scsi: cxgb4i: add wait_for_completion() + - netfilter: nft_flow_offload: fix checking method of conntrack helper + - always clear the X2APIC_ENABLE bit for PV guest + - [armhf, arm64] drm/meson: add missing of_node_put + - drm/amdkfd: Don't assign dGPUs to APU topology devices + - drm/amd/display: fix PME notification not working in RV desktop + - vhost: return EINVAL if iovecs size does not match the message size + - [armhf, arm64] drm/sun4i: backend: add missing of_node_puts + - bpf: don't assume build-id length is always 20 bytes + - bpf: zero out build_id for BPF_STACK_BUILD_ID_IP + - atm: he: fix sign-extension overflow on large shift + - hwmon: (tmp421) Correct the misspelling of the tmp442 compatible + attribute in OF device ID table + - [armhf] leds: lp5523: fix a missing check of return value of lp55xx_read + - bpf: bpf_setsockopt: reset sock dst on SO_MARK changes + - dpaa_eth: NETIF_F_LLTX requires to do our own update of trans_start + - mlxsw: pci: Return error on PCI reset timeout + - net: bridge: Mark FDB entries that were added by user as such + - mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky + - net/mlx5e: Fix wrong (zero) TX drop counter indication for representor + - isdn: avm: Fix string plus integer warning from Clang + - batman-adv: fix uninit-value in batadv_interface_tx() + - inet_diag: fix reporting cgroup classid and fallback to priority + - ipv6: propagate genlmsg_reply return code + - net: ena: fix race between link up and device initalization + - net/mlx4_en: Force CHECKSUM_NONE for short ethernet frames + - net/mlx5e: Don't overwrite pedit action when multiple pedit used + - net/packet: fix 4gb buffer limit due to overflow check + - net: sfp: do not probe SFP module before we're attached + - sctp: call gso_reset_checksum when computing checksum in sctp_gso_segment + - sctp: set stream ext to NULL after freeing it in sctp_stream_outq_migrate + - team: avoid complex list operations in team_nl_cmd_options_set() + - Revert "socket: fix struct ifreq size in compat ioctl" + - Revert "kill dev_ifsioc()" + - net: socket: fix SIOCGIFNAME in compat + - net: socket: make bond ioctls go through compat_ifreq_ioctl() + - geneve: should not call rt6_lookup() when ipv6 was disabled + - sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach() + - net_sched: fix a race condition in tcindex_destroy() + - net_sched: fix a memory leak in cls_tcindex + - net_sched: fix two more memory leaks in cls_tcindex + - net/mlx5e: XDP, fix redirect resources availability check + - RDMA/srp: Rework SCSI device reset handling + - KEYS: user: Align the payload buffer + - KEYS: always initialize keyring_index_key::desc_len + - drm/amdgpu: Set DPM_FLAG_NEVER_SKIP when enabling PM-runtime + - gpu: drm: radeon: Set DPM_FLAG_NEVER_SKIP when enabling PM-runtime + - [x86] drm/i915/fbdev: Actually configure untiled displays + - drm/amd/display: Fix MST reboot/poweroff sequence + - mac80211: allocate tailroom for forwarded mesh packets + - [x86] kvm: Return LA57 feature based on hardware capability + - net: validate untrusted gso packets without csum offload + - net: avoid false positives in untrusted gso validation + - Revert "bridge: do not add port to router list when receives query with + source 0.0.0.0" + - netfilter: nf_tables: fix flush after rule deletion in the same batch + - netfilter: nft_compat: use-after-free when deleting targets + - netfilter: ipv6: Don't preserve original oif for loopback address + - netfilter: nfnetlink_osf: add missing fmatch check + - netfilter: ipt_CLUSTERIP: fix sleep-in-atomic bug in + clusterip_config_entry_put() + - udlfb: handle unplug properly + - [armhf arm64] pinctrl: max77620: Use define directive for + max77620_pinconf_param values + - net: phylink: avoid resolving link state too early [ Ben Hutchings ] * [sparc64] udeb: Use standard module list in nic-modules; add i2c-modules diff --git a/debian/patches/features/all/ena/0006-net-ena-add-functions-for-handling-Low-Latency-Queue.patch b/debian/patches/features/all/ena/0006-net-ena-add-functions-for-handling-Low-Latency-Queue.patch index 6c5c57672..365f46bfb 100644 --- a/debian/patches/features/all/ena/0006-net-ena-add-functions-for-handling-Low-Latency-Queue.patch +++ b/debian/patches/features/all/ena/0006-net-ena-add-functions-for-handling-Low-Latency-Queue.patch @@ -473,8 +473,8 @@ index e732bd2ddd32..fcdfaf0ab8a7 100644 return NETDEV_TX_OK; } @@ -2621,7 +2670,9 @@ static int ena_restore_device(struct ena_adapter *adapter) + netif_carrier_on(adapter->netdev); - set_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags); mod_timer(&adapter->timer_service, round_jiffies(jiffies + HZ)); - dev_err(&pdev->dev, "Device reset completed successfully\n"); + dev_err(&pdev->dev, From 2ef57b8ec939f92c401561780e9de5daf3a1033e Mon Sep 17 00:00:00 2001 From: Romain Perier Date: Wed, 27 Feb 2019 19:51:46 +0100 Subject: [PATCH 8/8] [rt] Update to 4.19.25-rt16 --- debian/changelog | 3 + ...M-at91-add-TCB-registers-definitions.patch | 2 +- ...d-zone-lock-while-freeing-pages-from.patch | 16 +-- ...d-zone-lock-while-freeing-pages-from.patch | 22 ++-- ...ers-Add-a-new-driver-for-the-Atmel-A.patch | 2 +- ...ers-timer-atmel-tcb-add-clockevent-d.patch | 2 +- ...B-change-list_lock-to-raw_spinlock_t.patch | 68 +++++------ ...drivers-atmel-pit-make-option-silent.patch | 2 +- ...ving-back-empty-slubs-to-IRQ-enabled.patch | 2 +- ...at91-Implement-clocksource-selection.patch | 2 +- ...onfigs-at91-use-new-TCB-timer-driver.patch | 2 +- .../0007-ARM-configs-at91-unselect-PIT.patch | 2 +- ...n-translation-section-permission-fau.patch | 2 +- ...mbus-include-header-for-get_irq_regs.patch | 2 +- ...xpedited-GP-parallelization-cleverne.patch | 2 +- ...intk-drop-the-logbuf_lock-more-often.patch | 2 +- ...wngrade-preempt_disable-d-region-to-.patch | 8 +- ...-replace-seqcount_t-with-a-seqlock_t.patch | 2 +- debian/patches-rt/add_migrate_disable.patch | 2 +- ...-a-locallock-instead-preempt_disable.patch | 2 +- .../arch-arm64-Add-lazy-preempt-support.patch | 2 +- .../arm-convert-boot-lock-to-raw.patch | 2 +- .../arm-disable-NEON-in-kernel-mode.patch | 2 +- .../arm-enable-highmem-for-rt.patch | 2 +- .../arm-highmem-flush-tlb-on-unmap.patch | 2 +- ...arm-include-definition-for-cpumask_t.patch | 2 +- ...probe-replace-patch_lock-to-raw-lock.patch | 2 +- .../patches-rt/arm-preempt-lazy-support.patch | 4 +- .../patches-rt/arm-unwind-use_raw_lock.patch | 2 +- ...e_layout-before-altenates-are-applie.patch | 2 +- ...-preemp_disable-in-addition-to-local.patch | 2 +- .../at91_dont_enable_disable_clock.patch | 2 +- ...e-blk_queue_usage_counter_release-in.patch | 2 +- ...k-mq-don-t-complete-requests-via-IPI.patch | 2 +- .../block-mq-drop-preempt-disable.patch | 2 +- .../patches-rt/block-mq-use-cpu_light.patch | 2 +- debian/patches-rt/block-use-cpu-chill.patch | 2 +- ...irqsave-in-cgroup_rstat_flush_locked.patch | 2 +- ...roups-use-simple-wait-in-css_release.patch | 2 +- ...source-tclib-allow-higher-clockrates.patch | 2 +- .../completion-use-simple-wait-queues.patch | 2 +- .../cond-resched-lock-rt-tweak.patch | 2 +- ...c-Protect-send_msg-with-a-local-lock.patch | 2 +- .../cpu-hotplug--Implement-CPU-pinning.patch | 8 +- ...rop-K8-s-driver-from-beeing-selected.patch | 2 +- .../cpumask-disable-offstack-on-rt.patch | 2 +- ...vert-callback_lock-to-raw_spinlock_t.patch | 2 +- ...-preempt-disabled-regions-more-algos.patch | 2 +- ...m-qi-simplify-CGR-allocation-freeing.patch | 2 +- ...d-a-lock-instead-preempt_disable-loc.patch | 2 +- ...ypto-limit-more-FPU-enabled-sections.patch | 2 +- ...-serialize-RT-percpu-scratch-buffer-.patch | 2 +- debian/patches-rt/debugobjects-rt.patch | 2 +- ...rq-remove-BUG_ON-irqs_disabled-check.patch | 2 +- ...am-Replace-bit-spinlocks-with-rtmute.patch | 28 +++-- .../drivers-tty-fix-omap-lock-crap.patch | 2 +- ...rivers-tty-pl011-irq-disable-madness.patch | 2 +- ...-t-disable-preemption-in-zcomp_strea.patch | 8 +- ...-zcomp_stream_get-smp_processor_id-u.patch | 2 +- .../drm-i915-disable-tracing-on-RT.patch | 2 +- ...M_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch | 2 +- ...rq()_in_intel_pipe_update_startend().patch | 2 +- ...disableenable_rt()_where_recommended.patch | 2 +- debian/patches-rt/efi-Allow-efi-runtime.patch | 2 +- .../efi-Disable-runtime-services-on-RT.patch | 2 +- .../patches-rt/epoll-use-get-cpu-light.patch | 2 +- .../fs-aio-simple-simple-work.patch | 2 +- ...-back-explicit-INIT_HLIST_BL_HEAD-in.patch | 8 +- ...e-preemption-on-i_dir_seq-s-write-si.patch | 10 +- ...cache-use-cpu-chill-in-trylock-loops.patch | 2 +- ...use-swait_queue-instead-of-waitqueue.patch | 6 +- .../fs-jbd-replace-bh_state-lock.patch | 2 +- ...-nfs-turn-rmdir_sem-into-a-semaphore.patch | 2 +- .../fs-replace-bh_uptodate_lock-for-rt.patch | 2 +- ...lize-cookie-hash-table-raw-spinlocks.patch | 2 +- .../ftrace-Fix-trace-header-alignment.patch | 2 +- .../ftrace-migrate-disable-tracing.patch | 2 +- ...k-unlock-symetry-versus-pi_lock-and-.patch | 2 +- debian/patches-rt/futex-requeue-pi-fix.patch | 4 +- ...-migrate_disable-enable-in-different.patch | 14 ++- .../genirq-disable-irqpoll-on-rt.patch | 2 +- ...voke-the-affinity-callback-via-a-wor.patch | 2 +- .../patches-rt/genirq-force-threading.patch | 2 +- ...-irq_set_irqchip_state-documentation.patch | 2 +- ...duct-tape-RT-rwlock-usage-for-non-RT.patch | 8 +- .../hotplug-light-get-online-cpus.patch | 2 +- ...rtimer-Don-t-lose-state-in-cpu_chill.patch | 42 +++++++ ...-schedule_work-call-to-helper-thread.patch | 2 +- ...-by-default-into-the-softirq-context.patch | 4 +- ...ate-hrtimer_init-hrtimer_init_sleepe.patch | 4 +- ...chill-save-task-state-in-saved_state.patch | 56 +++++++++ ...te-change-before-hrtimer_cancel-in-d.patch | 2 +- .../hrtimers-prepare-full-preemption.patch | 2 +- ...irq-processing-in-irq-thread-context.patch | 2 +- ...ts-Move-pending-table-allocation-to-.patch | 16 +-- ...-push_most_work_into_softirq_context.patch | 2 +- debian/patches-rt/jump-label-rt.patch | 2 +- .../kconfig-disable-a-few-options-rt.patch | 2 +- .../patches-rt/kconfig-preempt-rt-full.patch | 2 +- ...n-t-try-to-print-from-IRQ-NMI-region.patch | 2 +- ...vide-a-pointer-to-the-valid-CPU-mask.patch | 22 ++-- ...e-stack-kprobe-clean-up-to-__put_tas.patch | 2 +- debian/patches-rt/kgb-serial-hackaround.patch | 2 +- ...-kmemleak_lock-to-raw-spinlock-on-RT.patch | 2 +- ...-convert-worker-lock-to-raw-spinlock.patch | 2 +- ...ds-trigger-disable-CPU-trigger-on-RT.patch | 2 +- .../list_bl-fixup-bogus-lockdep-warning.patch | 2 +- ..._bl.h-make-list-head-locking-RT-safe.patch | 2 +- ...provide-get-put-_locked_ptr-variants.patch | 2 +- debian/patches-rt/localversion.patch | 4 +- .../lockdep-disable-self-test.patch | 2 +- .../lockdep-no-softirq-accounting-on-rt.patch | 2 +- ...-fix-warnings-due-to-missing-PREEMPT.patch | 2 +- ...ardirq-context-test-for-raw-spinlock.patch | 2 +- ...eck-for-__LINUX_SPINLOCK_TYPES_H-on-.patch | 2 +- ...ure-Do-NOT-include-rwlock.h-directly.patch | 2 +- ...utex-Flush-block-plug-on-__down_read.patch | 2 +- ...-fix-deadlock-in-device-mapper-block.patch | 2 +- ...re-init-the-wait_lock-in-rt_mutex_in.patch | 2 +- debian/patches-rt/md-disable-bcache.patch | 2 +- .../md-raid5-percpu-handling-rt-aware.patch | 6 +- .../mips-disable-highmem-on-rt.patch | 4 +- .../mm-convert-swap-to-percpu-locked.patch | 6 +- debian/patches-rt/mm-disable-sloub-rt.patch | 6 +- debian/patches-rt/mm-enable-slub.patch | 2 +- ...ake-quarantine_lock-a-raw_spinlock_t.patch | 2 +- .../patches-rt/mm-make-vmstat-rt-aware.patch | 2 +- ...n-t-call-schedule_work_on-in-preempt.patch | 2 +- .../mm-memcontrol-do_not_disable_irq.patch | 2 +- ...page_alloc-rt-friendly-per-cpu-pages.patch | 36 +++--- ...m-perform-lru_add_drain_all-remotely.patch | 2 +- .../mm-protect-activate-switch-mm.patch | 2 +- .../mm-rt-kmap-atomic-scheduling.patch | 2 +- ...-scatterlist-dont-disable-irqs-on-RT.patch | 2 +- .../mm-vmalloc-use-get-cpu-light.patch | 2 +- ...oc_copy_with_get_cpu_var_and_locking.patch | 2 +- debian/patches-rt/mutex-no-spin-on-rt.patch | 2 +- ...schedule_irqoff-disable-interrupts-o.patch | 2 +- ...Qdisc-use-a-seqlock-instead-seqcount.patch | 2 +- .../net-add-a-lock-around-icmp_sk.patch | 2 +- ...-missing-serialization-in-ip_send_un.patch | 12 +- ...al-irq-disable-alloc-atomic-headache.patch | 4 +- ...-users-of-napi_alloc_cache-against-r.patch | 14 +-- ...-use-local_bh_disable-in-netif_rx_ni.patch | 2 +- ...ake-qdisc-s-busylock-in-__dev_xmit_s.patch | 2 +- ...ble-xt-write-recseq-begin-rt-fallout.patch | 2 +- .../net-make-devnet_rename_seq-a-mutex.patch | 2 +- ...recursion-to-per-task-variable-on-RT.patch | 8 +- ...y-to-delegate-processing-a-softirq-t.patch | 4 +- ...activate_many-use-msleep-1-instead-o.patch | 2 +- debian/patches-rt/net-use-cpu-chill.patch | 2 +- .../net_disable_NET_RX_BUSY_POLL.patch | 2 +- ...-phandle-cache-outside-of-the-devtre.patch | 2 +- debian/patches-rt/oleg-signal-rt-fix.patch | 6 +- .../panic-disable-random-on-rt.patch | 2 +- ...ce-rcu-bh-qs-where-safe-from-softirq.patch | 2 +- ...ec-Don-t-use-completion-s-wait-queue.patch | 4 +- ...de-irqflags.h-for-raw_local_irq_save.patch | 2 +- ...elay-memory-deallocation-until-cpu_d.patch | 74 ------------ .../patches-rt/peter_zijlstra-frob-rcu.patch | 2 +- .../patches-rt/peterz-percpu-rwsem-rt.patch | 2 +- .../patches-rt/pid.h-include-atomic.h.patch | 2 +- ...Use-raw-spinlock-for-RT-compatibilit.patch | 97 ---------------- ...timers-thread-posix-cpu-timers-on-rt.patch | 6 +- .../power-disable-highmem-on-rt.patch | 2 +- .../power-use-generic-rwsem-on-rt.patch | 2 +- ...ble-in-kernel-MPIC-emulation-for-PRE.patch | 2 +- .../powerpc-preempt-lazy-support.patch | 2 +- debian/patches-rt/preempt-lazy-support.patch | 8 +- .../patches-rt/preempt-nort-rt-variants.patch | 2 +- ...27-boot-param-to-help-with-debugging.patch | 2 +- debian/patches-rt/printk-kill.patch | 2 +- debian/patches-rt/printk-rt-aware.patch | 2 +- ...ace-fix-ptrace-vs-tasklist_lock-race.patch | 2 +- .../radix-tree-use-local-locks.patch | 2 +- ...dom-avoid-preempt_disable-ed-section.patch | 2 +- .../random-make-it-work-on-rt.patch | 6 +- ...nate-softirq-processing-from-rcutree.patch | 2 +- .../rcu-disable-rcu-fast-no-hz-on-rt.patch | 2 +- ..._normal_after_boot-by-default-for-RT.patch | 2 +- .../rcu-make-RCU_BOOST-default-on-RT.patch | 2 +- ...merge-rcu-bh-into-rcu-preempt-for-rt.patch | 2 +- ...l-arm-coredump-fails-for-cpu-3e-3d-4.patch | 2 +- ...ease-the-nr-of-migratory-tasks-when-.patch | 2 +- .../patches-rt/rt-introduce-cpu-chill.patch | 2 +- debian/patches-rt/rt-local-irq-lock.patch | 2 +- .../patches-rt/rt-preempt-base-config.patch | 2 +- debian/patches-rt/rt-serial-warn-fix.patch | 2 +- .../rtmutex-Make-lock_killable-work.patch | 2 +- ...tex-Provide-rt_mutex_slowlock_locked.patch | 2 +- ...utex-implementation-based-on-rtmutex.patch | 2 +- ...lock-implementation-based-on-rtmutex.patch | 2 +- ...wsem-implementation-based-on-rtmutex.patch | 2 +- ...tex-add-sleeping-lock-implementation.patch | 8 +- ...utex-add-ww_mutex-addon-for-mutex-rt.patch | 6 +- ...mutex-annotate-sleeping-lock-context.patch | 2 +- .../rtmutex-avoid-include-hell.patch | 2 +- ...ockdep-less-version-of-rt_mutex-s-lo.patch | 2 +- .../patches-rt/rtmutex-futex-prepare-rt.patch | 12 +- debian/patches-rt/rtmutex-lock-killable.patch | 2 +- ...-preserve-state-like-a-sleeping-lock.patch | 2 +- .../rtmutex-trylock-is-okay-on-RT.patch | 2 +- .../rtmutex-wire-up-RT-s-locking.patch | 2 +- .../patches-rt/rtmutex_dont_include_rcu.patch | 2 +- ...ed-user-tasks-to-be-awakened-to-the-.patch | 2 +- debian/patches-rt/sched-delay-put-task.patch | 2 +- .../sched-disable-rt-group-sched-on-rt.patch | 2 +- .../patches-rt/sched-disable-ttwu-queue.patch | 2 +- ...air-Make-the-hrtimers-non-hard-again.patch | 2 +- ...obustify-CFS-bandwidth-timer-locking.patch | 2 +- .../patches-rt/sched-limit-nr-migrate.patch | 2 +- ...might-sleep-do-not-account-rcu-depth.patch | 2 +- ...sable-Add-export_symbol_gpl-for-__mi.patch | 2 +- ...sable-fallback-to-preempt_disable-in.patch | 2 +- debian/patches-rt/sched-mmdrop-delayed.patch | 2 +- debian/patches-rt/sched-rt-mutex-wakeup.patch | 2 +- ...Only-wake-up-idle-workers-if-not-blo.patch | 2 +- debian/patches-rt/scsi-fcoe-rt-aware.patch | 2 +- .../seqlock-prevent-rt-starvation.patch | 2 +- debian/patches-rt/series | 8 +- .../signal-revert-ptrace-preempt-magic.patch | 4 +- ...t-tasks-to-cache-one-sigqueue-struct.patch | 4 +- debian/patches-rt/skbufhead-raw-lock.patch | 8 +- .../slub-disable-SLUB_CPU_PARTIAL.patch | 4 +- .../slub-enable-irqs-for-no-wait.patch | 2 +- ...cal_softirq_pending-messages-if-ksof.patch | 106 ++++++++++++++++++ ...cal_softirq_pending-messages-if-task.patch | 35 ++++++ ...oftirq-disable-softirq-stacks-for-rt.patch | 2 +- .../patches-rt/softirq-preempt-fix-3-re.patch | 4 +- debian/patches-rt/softirq-split-locks.patch | 2 +- ...plit-timer-softirqs-out-of-ksoftirqd.patch | 2 +- .../spinlock-types-separate-raw.patch | 2 +- ...e-of-local-lock-in-multi_cpu-decompr.patch | 2 +- ...place-local_irqsave-with-a-locallock.patch | 2 +- ...-use-cpu_online-instead-custom-check.patch | 2 +- ...vc_xprt_do_enqueue-use-get_cpu_light.patch | 2 +- debian/patches-rt/sysfs-realtime-entry.patch | 2 +- ...-from-going-into-infinite-spin-in-rt.patch | 2 +- ...rmal-Defer-thermal-wakups-to-threads.patch | 2 +- ...id-schedule_work-with-interrupts-dis.patch | 2 +- .../timekeeping-split-jiffies-lock.patch | 4 +- .../timers-prepare-for-full-preemption.patch | 2 +- .../tpm_tis-fix-stall-after-iowrite-s.patch | 2 +- ...0-don-t-take-the-trylock-during-oops.patch | 2 +- ...al-pl011-warning-about-uninitialized.patch | 2 +- ...ove-preemption-disabling-in-netif_rx.patch | 2 +- ...o-not-disable-interrupts-in-giveback.patch | 2 +- .../patches-rt/wait.h-include-atomic.h.patch | 2 +- ...t-deferral-of-watchdogd-wakeup-on-RT.patch | 2 +- ...rk-around-irqsafe-timer-optimization.patch | 2 +- ...mple-Simple-work-queue-implemenation.patch | 2 +- ...-a-shit-statement-in-SWORK_EVENT_PEN.patch | 2 +- .../workqueue-distangle-from-rq-lock.patch | 2 +- .../workqueue-prevent-deadlock-stall.patch | 2 +- .../patches-rt/workqueue-use-locallock.patch | 2 +- debian/patches-rt/workqueue-use-rcu.patch | 2 +- ...ypto-reduce-preempt-disabled-regions.patch | 2 +- ...fi-drop-task_lock-from-efi_switch_mm.patch | 2 +- ...e-preemption-around-local_bh_disable.patch | 2 +- ...highmem-add-a-already-used-pte-check.patch | 2 +- ...-let-setaffinity-unmask-threaded-EOI.patch | 2 +- .../x86-kvm-require-const-tsc-for-rt.patch | 4 +- ...-properly-check-against-preempt-mask.patch | 26 +++++ ...-use-proper-return-label-on-32bit-x8.patch | 38 +++++++ ...le-preemption-__split_large_page-aft.patch | 2 +- debian/patches-rt/x86-preempt-lazy.patch | 2 +- ...ignal-delay-calling-signals-on-32bit.patch | 2 +- .../x86-stackprot-no-random-on-rt.patch | 2 +- .../x86-use-gen-rwsem-spinlocks-rt.patch | 2 +- 269 files changed, 759 insertions(+), 606 deletions(-) create mode 100644 debian/patches-rt/hrtimer-Don-t-lose-state-in-cpu_chill.patch create mode 100644 debian/patches-rt/hrtimer-cpu_chill-save-task-state-in-saved_state.patch delete mode 100644 debian/patches-rt/perf-x86-intel-Delay-memory-deallocation-until-cpu_d.patch delete mode 100644 debian/patches-rt/pinctrl-bcm2835-Use-raw-spinlock-for-RT-compatibilit.patch create mode 100644 debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-ksof.patch create mode 100644 debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-task.patch create mode 100644 debian/patches-rt/x86-lazy-preempt-properly-check-against-preempt-mask.patch create mode 100644 debian/patches-rt/x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch diff --git a/debian/changelog b/debian/changelog index aaf5ea72a..03c026488 100644 --- a/debian/changelog +++ b/debian/changelog @@ -637,6 +637,9 @@ linux (4.19.26-1) UNRELEASED; urgency=medium [ Vagrant Cascadian ] * [arm64] Add patch from v4.20 to enable device-tree for Pine64-LTS. + [ Romain Perier ] + * [rt] Update to 4.19.25-rt16 + -- Ben Hutchings Tue, 12 Feb 2019 12:49:10 +0000 linux (4.19.20-1) unstable; urgency=medium diff --git a/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch b/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch index 822a441e2..b52979fa4 100644 --- a/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch +++ b/debian/patches-rt/0001-ARM-at91-add-TCB-registers-definitions.patch @@ -1,7 +1,7 @@ From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:18 +0200 Subject: [PATCH 1/7] ARM: at91: add TCB registers definitions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Add registers and bits definitions for the timer counter blocks found on Atmel ARM SoCs. diff --git a/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index 1df9712af..98be06765 100644 --- a/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -2,7 +2,7 @@ From: Peter Zijlstra Date: Mon, 28 May 2018 15:24:20 +0200 Subject: [PATCH 1/4] Split IRQ-off and zone->lock while freeing pages from PCP list #1 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. @@ -18,7 +18,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1067,7 +1067,7 @@ static inline void prefetch_buddy(struct +@@ -1095,7 +1095,7 @@ static inline void prefetch_buddy(struct } /* @@ -27,7 +27,7 @@ Signed-off-by: Sebastian Andrzej Siewior * Assumes all pages on list are in same zone, and of same order. * count is the number of pages to free. * -@@ -1078,14 +1078,41 @@ static inline void prefetch_buddy(struct +@@ -1106,14 +1106,41 @@ static inline void prefetch_buddy(struct * pinned" detection logic. */ static void free_pcppages_bulk(struct zone *zone, int count, @@ -73,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior while (count) { struct list_head *list; -@@ -1117,7 +1144,7 @@ static void free_pcppages_bulk(struct zo +@@ -1145,7 +1172,7 @@ static void free_pcppages_bulk(struct zo if (bulkfree_pcp_prepare(page)) continue; @@ -82,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * We are going to put the page back to the global -@@ -1132,26 +1159,6 @@ static void free_pcppages_bulk(struct zo +@@ -1160,26 +1187,6 @@ static void free_pcppages_bulk(struct zo prefetch_buddy(page); } while (--count && --batch_free && !list_empty(list)); } @@ -109,7 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void free_one_page(struct zone *zone, -@@ -2515,13 +2522,18 @@ void drain_zone_pages(struct zone *zone, +@@ -2536,13 +2543,18 @@ void drain_zone_pages(struct zone *zone, { unsigned long flags; int to_drain, batch; @@ -129,7 +129,7 @@ Signed-off-by: Sebastian Andrzej Siewior } #endif -@@ -2537,14 +2549,21 @@ static void drain_pages_zone(unsigned in +@@ -2558,14 +2570,21 @@ static void drain_pages_zone(unsigned in unsigned long flags; struct per_cpu_pageset *pset; struct per_cpu_pages *pcp; @@ -153,7 +153,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -2766,7 +2785,10 @@ static void free_unref_page_commit(struc +@@ -2787,7 +2806,10 @@ static void free_unref_page_commit(struc pcp->count++; if (pcp->count >= pcp->high) { unsigned long batch = READ_ONCE(pcp->batch); diff --git a/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index d88877d84..ab7c6f4fe 100644 --- a/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -2,7 +2,7 @@ From: Peter Zijlstra Date: Mon, 28 May 2018 15:24:21 +0200 Subject: [PATCH 2/4] Split IRQ-off and zone->lock while freeing pages from PCP list #2 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. @@ -18,7 +18,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1077,8 +1077,8 @@ static inline void prefetch_buddy(struct +@@ -1105,8 +1105,8 @@ static inline void prefetch_buddy(struct * And clear the zone's pages_scanned counter, to hold off the "all pages are * pinned" detection logic. */ @@ -29,7 +29,7 @@ Signed-off-by: Sebastian Andrzej Siewior { bool isolated_pageblocks; struct page *page, *tmp; -@@ -1093,12 +1093,27 @@ static void free_pcppages_bulk(struct zo +@@ -1121,12 +1121,27 @@ static void free_pcppages_bulk(struct zo */ list_for_each_entry_safe(page, tmp, head, lru) { int mt = get_pcppage_migratetype(page); @@ -57,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior __free_one_page(page, page_to_pfn(page), zone, 0, mt); trace_mm_page_pcpu_drain(page, 0, mt); } -@@ -2533,7 +2548,7 @@ void drain_zone_pages(struct zone *zone, +@@ -2554,7 +2569,7 @@ void drain_zone_pages(struct zone *zone, local_irq_restore(flags); if (to_drain > 0) @@ -66,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior } #endif -@@ -2563,7 +2578,7 @@ static void drain_pages_zone(unsigned in +@@ -2584,7 +2599,7 @@ static void drain_pages_zone(unsigned in local_irq_restore(flags); if (count) @@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -2756,7 +2771,8 @@ static bool free_unref_page_prepare(stru +@@ -2777,7 +2792,8 @@ static bool free_unref_page_prepare(stru return true; } @@ -85,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct zone *zone = page_zone(page); struct per_cpu_pages *pcp; -@@ -2785,10 +2801,8 @@ static void free_unref_page_commit(struc +@@ -2806,10 +2822,8 @@ static void free_unref_page_commit(struc pcp->count++; if (pcp->count >= pcp->high) { unsigned long batch = READ_ONCE(pcp->batch); @@ -97,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -2799,13 +2813,17 @@ void free_unref_page(struct page *page) +@@ -2820,13 +2834,17 @@ void free_unref_page(struct page *page) { unsigned long flags; unsigned long pfn = page_to_pfn(page); @@ -116,7 +116,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -2816,6 +2834,11 @@ void free_unref_page_list(struct list_he +@@ -2837,6 +2855,11 @@ void free_unref_page_list(struct list_he struct page *page, *next; unsigned long flags, pfn; int batch_count = 0; @@ -128,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Prepare pages for freeing */ list_for_each_entry_safe(page, next, list, lru) { -@@ -2828,10 +2851,12 @@ void free_unref_page_list(struct list_he +@@ -2849,10 +2872,12 @@ void free_unref_page_list(struct list_he local_irq_save(flags); list_for_each_entry_safe(page, next, list, lru) { unsigned long pfn = page_private(page); @@ -142,7 +142,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Guard against excessive IRQ disabled times when we get -@@ -2844,6 +2869,21 @@ void free_unref_page_list(struct list_he +@@ -2865,6 +2890,21 @@ void free_unref_page_list(struct list_he } } local_irq_restore(flags); diff --git a/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch b/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch index aa7b12c65..1165a2663 100644 --- a/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch +++ b/debian/patches-rt/0002-clocksource-drivers-Add-a-new-driver-for-the-Atmel-A.patch @@ -2,7 +2,7 @@ From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:19 +0200 Subject: [PATCH 2/7] clocksource/drivers: Add a new driver for the Atmel ARM TC blocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Add a driver for the Atmel Timer Counter Blocks. This driver provides a clocksource and two clockevent devices. diff --git a/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch b/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch index 80fa614b3..4f6314b5d 100644 --- a/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch +++ b/debian/patches-rt/0003-clocksource-drivers-timer-atmel-tcb-add-clockevent-d.patch @@ -2,7 +2,7 @@ From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:20 +0200 Subject: [PATCH 3/7] clocksource/drivers: timer-atmel-tcb: add clockevent device on separate channel -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Add an other clockevent device that uses a separate TCB channel when available. diff --git a/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch b/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch index a37e84717..4b4d7c015 100644 --- a/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Mon, 28 May 2018 15:24:22 +0200 Subject: [PATCH 3/4] mm/SLxB: change list_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The list_lock is used with used with IRQs off on RT. Make it a raw_spinlock_t otherwise the interrupts won't be disabled on -RT. The locking rules remain @@ -40,7 +40,7 @@ Signed-off-by: Sebastian Andrzej Siewior slabs_destroy(cachep, &list); } -@@ -728,7 +728,7 @@ static void __drain_alien_cache(struct k +@@ -730,7 +730,7 @@ static void __drain_alien_cache(struct k struct kmem_cache_node *n = get_node(cachep, node); if (ac->avail) { @@ -49,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Stuff objects into the remote nodes shared array first. * That way we could avoid the overhead of putting the objects -@@ -739,7 +739,7 @@ static void __drain_alien_cache(struct k +@@ -741,7 +741,7 @@ static void __drain_alien_cache(struct k free_block(cachep, ac->entry, ac->avail, node, list); ac->avail = 0; @@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -812,9 +812,9 @@ static int __cache_free_alien(struct kme +@@ -814,9 +814,9 @@ static int __cache_free_alien(struct kme slabs_destroy(cachep, &list); } else { n = get_node(cachep, page_node); @@ -70,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior slabs_destroy(cachep, &list); } return 1; -@@ -855,10 +855,10 @@ static int init_cache_node(struct kmem_c +@@ -857,10 +857,10 @@ static int init_cache_node(struct kmem_c */ n = get_node(cachep, node); if (n) { @@ -83,7 +83,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -937,7 +937,7 @@ static int setup_kmem_cache_node(struct +@@ -939,7 +939,7 @@ static int setup_kmem_cache_node(struct goto fail; n = get_node(cachep, node); @@ -92,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (n->shared && force_change) { free_block(cachep, n->shared->entry, n->shared->avail, node, &list); -@@ -955,7 +955,7 @@ static int setup_kmem_cache_node(struct +@@ -957,7 +957,7 @@ static int setup_kmem_cache_node(struct new_alien = NULL; } @@ -101,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior slabs_destroy(cachep, &list); /* -@@ -994,7 +994,7 @@ static void cpuup_canceled(long cpu) +@@ -996,7 +996,7 @@ static void cpuup_canceled(long cpu) if (!n) continue; @@ -110,7 +110,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Free limit for this kmem_cache_node */ n->free_limit -= cachep->batchcount; -@@ -1007,7 +1007,7 @@ static void cpuup_canceled(long cpu) +@@ -1009,7 +1009,7 @@ static void cpuup_canceled(long cpu) } if (!cpumask_empty(mask)) { @@ -119,7 +119,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto free_slab; } -@@ -1021,7 +1021,7 @@ static void cpuup_canceled(long cpu) +@@ -1023,7 +1023,7 @@ static void cpuup_canceled(long cpu) alien = n->alien; n->alien = NULL; @@ -128,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(shared); if (alien) { -@@ -1205,7 +1205,7 @@ static void __init init_list(struct kmem +@@ -1207,7 +1207,7 @@ static void __init init_list(struct kmem /* * Do not assume that spinlocks can be initialized via memcpy: */ @@ -137,7 +137,7 @@ Signed-off-by: Sebastian Andrzej Siewior MAKE_ALL_LISTS(cachep, ptr, nodeid); cachep->node[nodeid] = ptr; -@@ -1376,11 +1376,11 @@ slab_out_of_memory(struct kmem_cache *ca +@@ -1378,11 +1378,11 @@ slab_out_of_memory(struct kmem_cache *ca for_each_kmem_cache_node(cachep, node, n) { unsigned long total_slabs, free_slabs, free_objs; @@ -151,7 +151,7 @@ Signed-off-by: Sebastian Andrzej Siewior pr_warn(" node %d: slabs: %ld/%ld, objs: %ld/%ld\n", node, total_slabs - free_slabs, total_slabs, -@@ -2173,7 +2173,7 @@ static void check_spinlock_acquired(stru +@@ -2175,7 +2175,7 @@ static void check_spinlock_acquired(stru { #ifdef CONFIG_SMP check_irq_off(); @@ -160,7 +160,7 @@ Signed-off-by: Sebastian Andrzej Siewior #endif } -@@ -2181,7 +2181,7 @@ static void check_spinlock_acquired_node +@@ -2183,7 +2183,7 @@ static void check_spinlock_acquired_node { #ifdef CONFIG_SMP check_irq_off(); @@ -169,7 +169,7 @@ Signed-off-by: Sebastian Andrzej Siewior #endif } -@@ -2221,9 +2221,9 @@ static void do_drain(void *arg) +@@ -2223,9 +2223,9 @@ static void do_drain(void *arg) check_irq_off(); ac = cpu_cache_get(cachep); n = get_node(cachep, node); @@ -181,7 +181,7 @@ Signed-off-by: Sebastian Andrzej Siewior slabs_destroy(cachep, &list); ac->avail = 0; } -@@ -2241,9 +2241,9 @@ static void drain_cpu_caches(struct kmem +@@ -2243,9 +2243,9 @@ static void drain_cpu_caches(struct kmem drain_alien_cache(cachep, n->alien); for_each_kmem_cache_node(cachep, node, n) { @@ -193,7 +193,7 @@ Signed-off-by: Sebastian Andrzej Siewior slabs_destroy(cachep, &list); } -@@ -2265,10 +2265,10 @@ static int drain_freelist(struct kmem_ca +@@ -2267,10 +2267,10 @@ static int drain_freelist(struct kmem_ca nr_freed = 0; while (nr_freed < tofree && !list_empty(&n->slabs_free)) { @@ -206,7 +206,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; } -@@ -2281,7 +2281,7 @@ static int drain_freelist(struct kmem_ca +@@ -2283,7 +2283,7 @@ static int drain_freelist(struct kmem_ca * to the cache. */ n->free_objects -= cache->num; @@ -215,7 +215,7 @@ Signed-off-by: Sebastian Andrzej Siewior slab_destroy(cache, page); nr_freed++; } -@@ -2729,7 +2729,7 @@ static void cache_grow_end(struct kmem_c +@@ -2731,7 +2731,7 @@ static void cache_grow_end(struct kmem_c INIT_LIST_HEAD(&page->lru); n = get_node(cachep, page_to_nid(page)); @@ -224,7 +224,7 @@ Signed-off-by: Sebastian Andrzej Siewior n->total_slabs++; if (!page->active) { list_add_tail(&page->lru, &(n->slabs_free)); -@@ -2739,7 +2739,7 @@ static void cache_grow_end(struct kmem_c +@@ -2741,7 +2741,7 @@ static void cache_grow_end(struct kmem_c STATS_INC_GROWN(cachep); n->free_objects += cachep->num - page->active; @@ -233,7 +233,7 @@ Signed-off-by: Sebastian Andrzej Siewior fixup_objfreelist_debug(cachep, &list); } -@@ -2907,7 +2907,7 @@ static struct page *get_first_slab(struc +@@ -2909,7 +2909,7 @@ static struct page *get_first_slab(struc { struct page *page; @@ -242,7 +242,7 @@ Signed-off-by: Sebastian Andrzej Siewior page = list_first_entry_or_null(&n->slabs_partial, struct page, lru); if (!page) { n->free_touched = 1; -@@ -2933,10 +2933,10 @@ static noinline void *cache_alloc_pfmema +@@ -2935,10 +2935,10 @@ static noinline void *cache_alloc_pfmema if (!gfp_pfmemalloc_allowed(flags)) return NULL; @@ -255,7 +255,7 @@ Signed-off-by: Sebastian Andrzej Siewior return NULL; } -@@ -2945,7 +2945,7 @@ static noinline void *cache_alloc_pfmema +@@ -2947,7 +2947,7 @@ static noinline void *cache_alloc_pfmema fixup_slab_list(cachep, n, page, &list); @@ -264,7 +264,7 @@ Signed-off-by: Sebastian Andrzej Siewior fixup_objfreelist_debug(cachep, &list); return obj; -@@ -3004,7 +3004,7 @@ static void *cache_alloc_refill(struct k +@@ -3006,7 +3006,7 @@ static void *cache_alloc_refill(struct k if (!n->free_objects && (!shared || !shared->avail)) goto direct_grow; @@ -273,7 +273,7 @@ Signed-off-by: Sebastian Andrzej Siewior shared = READ_ONCE(n->shared); /* See if we can refill from the shared array */ -@@ -3028,7 +3028,7 @@ static void *cache_alloc_refill(struct k +@@ -3030,7 +3030,7 @@ static void *cache_alloc_refill(struct k must_grow: n->free_objects -= ac->avail; alloc_done: @@ -282,7 +282,7 @@ Signed-off-by: Sebastian Andrzej Siewior fixup_objfreelist_debug(cachep, &list); direct_grow: -@@ -3253,7 +3253,7 @@ static void *____cache_alloc_node(struct +@@ -3255,7 +3255,7 @@ static void *____cache_alloc_node(struct BUG_ON(!n); check_irq_off(); @@ -291,7 +291,7 @@ Signed-off-by: Sebastian Andrzej Siewior page = get_first_slab(n, false); if (!page) goto must_grow; -@@ -3271,12 +3271,12 @@ static void *____cache_alloc_node(struct +@@ -3273,12 +3273,12 @@ static void *____cache_alloc_node(struct fixup_slab_list(cachep, n, page, &list); @@ -306,7 +306,7 @@ Signed-off-by: Sebastian Andrzej Siewior page = cache_grow_begin(cachep, gfp_exact_node(flags), nodeid); if (page) { /* This slab isn't counted yet so don't update free_objects */ -@@ -3452,7 +3452,7 @@ static void cache_flusharray(struct kmem +@@ -3454,7 +3454,7 @@ static void cache_flusharray(struct kmem check_irq_off(); n = get_node(cachep, node); @@ -315,7 +315,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (n->shared) { struct array_cache *shared_array = n->shared; int max = shared_array->limit - shared_array->avail; -@@ -3481,7 +3481,7 @@ static void cache_flusharray(struct kmem +@@ -3483,7 +3483,7 @@ static void cache_flusharray(struct kmem STATS_SET_FREEABLE(cachep, i); } #endif @@ -324,7 +324,7 @@ Signed-off-by: Sebastian Andrzej Siewior slabs_destroy(cachep, &list); ac->avail -= batchcount; memmove(ac->entry, &(ac->entry[batchcount]), sizeof(void *)*ac->avail); -@@ -3891,9 +3891,9 @@ static int __do_tune_cpucache(struct kme +@@ -3893,9 +3893,9 @@ static int __do_tune_cpucache(struct kme node = cpu_to_mem(cpu); n = get_node(cachep, node); @@ -336,7 +336,7 @@ Signed-off-by: Sebastian Andrzej Siewior slabs_destroy(cachep, &list); } free_percpu(prev); -@@ -4018,9 +4018,9 @@ static void drain_array(struct kmem_cach +@@ -4020,9 +4020,9 @@ static void drain_array(struct kmem_cach return; } @@ -348,7 +348,7 @@ Signed-off-by: Sebastian Andrzej Siewior slabs_destroy(cachep, &list); } -@@ -4104,7 +4104,7 @@ void get_slabinfo(struct kmem_cache *cac +@@ -4106,7 +4106,7 @@ void get_slabinfo(struct kmem_cache *cac for_each_kmem_cache_node(cachep, node, n) { check_irq_on(); @@ -357,7 +357,7 @@ Signed-off-by: Sebastian Andrzej Siewior total_slabs += n->total_slabs; free_slabs += n->free_slabs; -@@ -4113,7 +4113,7 @@ void get_slabinfo(struct kmem_cache *cac +@@ -4115,7 +4115,7 @@ void get_slabinfo(struct kmem_cache *cac if (n->shared) shared_avail += n->shared->avail; @@ -366,7 +366,7 @@ Signed-off-by: Sebastian Andrzej Siewior } num_objs = total_slabs * cachep->num; active_slabs = total_slabs - free_slabs; -@@ -4328,13 +4328,13 @@ static int leaks_show(struct seq_file *m +@@ -4330,13 +4330,13 @@ static int leaks_show(struct seq_file *m for_each_kmem_cache_node(cachep, node, n) { check_irq_on(); diff --git a/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch b/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch index 170752835..68b04f759 100644 --- a/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch +++ b/debian/patches-rt/0004-clocksource-drivers-atmel-pit-make-option-silent.patch @@ -1,7 +1,7 @@ From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:21 +0200 Subject: [PATCH 4/7] clocksource/drivers: atmel-pit: make option silent -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz To conform with the other option, make the ATMEL_PIT option silent so it can be selected from the platform diff --git a/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch b/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch index 0fcaf5fb5..eee74fcf6 100644 --- a/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch +++ b/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 21 Jun 2018 17:29:19 +0200 Subject: [PATCH 4/4] mm/SLUB: delay giving back empty slubs to IRQ enabled regions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz __free_slab() is invoked with disabled interrupts which increases the irq-off time while __free_pages() is doing the work. diff --git a/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch b/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch index 9b2218d38..c0b3a2f3d 100644 --- a/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch +++ b/debian/patches-rt/0005-ARM-at91-Implement-clocksource-selection.patch @@ -1,7 +1,7 @@ From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:22 +0200 Subject: [PATCH 5/7] ARM: at91: Implement clocksource selection -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Allow selecting and unselecting the PIT clocksource driver so it doesn't have to be compile when unused. diff --git a/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch b/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch index 6e205b03a..ddb783c51 100644 --- a/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch +++ b/debian/patches-rt/0006-ARM-configs-at91-use-new-TCB-timer-driver.patch @@ -1,7 +1,7 @@ From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:23 +0200 Subject: [PATCH 6/7] ARM: configs: at91: use new TCB timer driver -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Unselecting ATMEL_TCLIB switches the TCB timer driver from tcb_clksrc to timer-atmel-tcb. diff --git a/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch b/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch index 83ed10780..e9d16c60d 100644 --- a/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch +++ b/debian/patches-rt/0007-ARM-configs-at91-unselect-PIT.patch @@ -1,7 +1,7 @@ From: Alexandre Belloni Date: Thu, 13 Sep 2018 13:30:24 +0200 Subject: [PATCH 7/7] ARM: configs: at91: unselect PIT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The PIT is not required anymore to successfully boot and may actually harm in case preempt-rt is used because the PIT interrupt is shared. diff --git a/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch b/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch index 3798591f6..6305da359 100644 --- a/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch +++ b/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch @@ -1,7 +1,7 @@ From: "Yadi.hu" Date: Wed, 10 Dec 2014 10:32:09 +0800 Subject: ARM: enable irq in translation/section permission fault handlers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Probably happens on all ARM, with CONFIG_PREEMPT_RT_FULL diff --git a/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch b/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch index e486de5d0..e00e88022 100644 --- a/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch +++ b/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch @@ -4,7 +4,7 @@ Subject: [PATCH] Drivers: hv: vmbus: include header for get_irq_regs() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz On !RT the header file get_irq_regs() gets pulled in via other header files. On RT it does not and the build fails: diff --git a/debian/patches-rt/EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch b/debian/patches-rt/EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch index 278f08023..4992b753b 100644 --- a/debian/patches-rt/EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch +++ b/debian/patches-rt/EXP-rcu-Revert-expedited-GP-parallelization-cleverne.patch @@ -1,7 +1,7 @@ From: Paul E. McKenney Date: Mon, 29 Oct 2018 11:53:01 +0100 Subject: [PATCH] EXP rcu: Revert expedited GP parallelization cleverness -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz (Commit 258ba8e089db23f760139266c232f01bad73f85c from linux-rcu) diff --git a/debian/patches-rt/HACK-printk-drop-the-logbuf_lock-more-often.patch b/debian/patches-rt/HACK-printk-drop-the-logbuf_lock-more-often.patch index 34e98ff84..13bb994ce 100644 --- a/debian/patches-rt/HACK-printk-drop-the-logbuf_lock-more-often.patch +++ b/debian/patches-rt/HACK-printk-drop-the-logbuf_lock-more-often.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Mar 2013 19:01:05 +0100 Subject: printk: Drop the logbuf_lock more often -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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. diff --git a/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch index 861443bc7..848176de1 100644 --- a/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ b/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:01 -0600 Subject: KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c -@@ -700,7 +700,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -699,7 +699,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 kvm_pmu_flush_hwstate(vcpu); -@@ -749,7 +749,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -748,7 +748,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v kvm_timer_sync_hwstate(vcpu); kvm_vgic_sync_hwstate(vcpu); local_irq_enable(); @@ -41,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; } -@@ -827,7 +827,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -826,7 +826,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v /* Exit types that need handling before we can be preempted */ handle_exit_early(vcpu, run, ret); diff --git a/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch index db95bd32e..2e3798c21 100644 --- a/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +++ b/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -5,7 +5,7 @@ Cc: Anna Schumaker , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de Subject: NFSv4: replace seqcount_t with a seqlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/add_migrate_disable.patch b/debian/patches-rt/add_migrate_disable.patch index 10056eeba..c958abe27 100644 --- a/debian/patches-rt/add_migrate_disable.patch +++ b/debian/patches-rt/add_migrate_disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 Subject: kernel/sched/core: add migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz --- include/linux/preempt.h | 23 ++++++++ diff --git a/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch b/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch index e2f354d79..b6619c168 100644 --- a/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch +++ b/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 11 Oct 2017 17:43:49 +0200 Subject: apparmor: use a locallock instead preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz get_buffers() disables preemption which acts as a lock for the per-CPU variable. Since we can't disable preemption here on RT, a local_lock is diff --git a/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch b/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch index 80652ff2d..37282db20 100644 --- a/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch +++ b/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch @@ -1,7 +1,7 @@ From: Anders Roxell Date: Thu, 14 May 2015 17:52:17 +0200 Subject: arch/arm64: Add lazy preempt support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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, diff --git a/debian/patches-rt/arm-convert-boot-lock-to-raw.patch b/debian/patches-rt/arm-convert-boot-lock-to-raw.patch index e39ce6e18..e090291d6 100644 --- a/debian/patches-rt/arm-convert-boot-lock-to-raw.patch +++ b/debian/patches-rt/arm-convert-boot-lock-to-raw.patch @@ -1,7 +1,7 @@ From: Frank Rowand Date: Mon, 19 Sep 2011 14:51:14 -0700 Subject: arm: Convert arm boot_lock to raw -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/arm-disable-NEON-in-kernel-mode.patch b/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch index 1b7df7308..f906f3bdd 100644 --- a/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch +++ b/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 1 Dec 2017 10:42:03 +0100 Subject: [PATCH] arm*: disable NEON in kernel mode -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz NEON in kernel mode is used by the crypto algorithms and raid6 code. While the raid6 code looks okay, the crypto algorithms do not: NEON diff --git a/debian/patches-rt/arm-enable-highmem-for-rt.patch b/debian/patches-rt/arm-enable-highmem-for-rt.patch index bd95b17c9..796487215 100644 --- a/debian/patches-rt/arm-enable-highmem-for-rt.patch +++ b/debian/patches-rt/arm-enable-highmem-for-rt.patch @@ -1,7 +1,7 @@ Subject: arm: Enable highmem for rt From: Thomas Gleixner Date: Wed, 13 Feb 2013 11:03:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz fixup highmem for ARM. diff --git a/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch b/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch index 396629b43..297272c98 100644 --- a/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch +++ b/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 21:37:27 +0100 Subject: arm/highmem: Flush tlb on unmap -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/arm-include-definition-for-cpumask_t.patch b/debian/patches-rt/arm-include-definition-for-cpumask_t.patch index 42dfb0c62..125134d8d 100644 --- a/debian/patches-rt/arm-include-definition-for-cpumask_t.patch +++ b/debian/patches-rt/arm-include-definition-for-cpumask_t.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 22 Dec 2016 17:28:33 +0100 Subject: [PATCH] arm: include definition for cpumask_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz This definition gets pulled in by other files. With the (later) split of RCU and spinlock.h it won't compile anymore. diff --git a/debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch b/debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch index 47e4069a1..e514e3718 100644 --- a/debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch +++ b/debian/patches-rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch @@ -1,7 +1,7 @@ From: Yang Shi Date: Thu, 10 Nov 2016 16:17:55 -0800 Subject: [PATCH] arm: kprobe: replace patch_lock to raw lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz When running kprobe on -rt kernel, the below bug is caught: diff --git a/debian/patches-rt/arm-preempt-lazy-support.patch b/debian/patches-rt/arm-preempt-lazy-support.patch index f13bce5db..12915da3b 100644 --- a/debian/patches-rt/arm-preempt-lazy-support.patch +++ b/debian/patches-rt/arm-preempt-lazy-support.patch @@ -1,7 +1,7 @@ Subject: arm: Add support for lazy preemption From: Thomas Gleixner Date: Wed, 31 Oct 2012 12:04:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Implement the arm pieces for lazy preempt. @@ -140,7 +140,7 @@ Signed-off-by: Thomas Gleixner --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c -@@ -644,7 +644,8 @@ do_work_pending(struct pt_regs *regs, un +@@ -652,7 +652,8 @@ do_work_pending(struct pt_regs *regs, un */ trace_hardirqs_off(); do { diff --git a/debian/patches-rt/arm-unwind-use_raw_lock.patch b/debian/patches-rt/arm-unwind-use_raw_lock.patch index 5f4147fe4..12b6d6153 100644 --- a/debian/patches-rt/arm-unwind-use_raw_lock.patch +++ b/debian/patches-rt/arm-unwind-use_raw_lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 20 Sep 2013 14:31:54 +0200 Subject: arm/unwind: use a raw_spin_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Mostly unwind is done with irqs enabled however SLUB may call it with irqs disabled while creating a new SLUB cache. diff --git a/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch b/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch index 0b13d2d23..61db4820f 100644 --- a/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch +++ b/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 09:13:42 +0200 Subject: [PATCH] arm64: KVM: compute_layout before altenates are applied -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz compute_layout() is invoked as part of an alternative fixup under stop_machine() and needs a sleeping lock as part of get_random_long(). diff --git a/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch b/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch index e6bf0f062..d978a8ae0 100644 --- a/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch +++ b/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 25 Jul 2018 14:02:38 +0200 Subject: [PATCH] arm64: fpsimd: use preemp_disable in addition to local_bh_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz In v4.16-RT I noticed a number of warnings from task_fpsimd_load(). The code disables BH and expects that it is not preemptible. On -RT the diff --git a/debian/patches-rt/at91_dont_enable_disable_clock.patch b/debian/patches-rt/at91_dont_enable_disable_clock.patch index f1bd90bc0..d215c2f9e 100644 --- a/debian/patches-rt/at91_dont_enable_disable_clock.patch +++ b/debian/patches-rt/at91_dont_enable_disable_clock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 09 Mar 2016 10:51:06 +0100 Subject: arm: at91: do not disable/enable clocks in a row -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch b/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch index a14542065..a0bccbbb8 100644 --- a/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch +++ b/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 13 Mar 2018 13:49:16 +0100 Subject: [PATCH] block: blk-mq: move blk_queue_usage_counter_release() into process context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch b/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch index 080893991..cab933645 100644 --- a/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch +++ b/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Jan 2015 15:10:08 +0100 Subject: block/mq: don't complete requests via IPI -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The IPI runs in hardirq context and there are sleeping locks. This patch moves the completion into a workqueue. diff --git a/debian/patches-rt/block-mq-drop-preempt-disable.patch b/debian/patches-rt/block-mq-drop-preempt-disable.patch index 5115e8a5f..520a7e221 100644 --- a/debian/patches-rt/block-mq-drop-preempt-disable.patch +++ b/debian/patches-rt/block-mq-drop-preempt-disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: block/mq: do not invoke preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz preempt_disable() and get_cpu() don't play well together with the sleeping locks it tries to allocate later. diff --git a/debian/patches-rt/block-mq-use-cpu_light.patch b/debian/patches-rt/block-mq-use-cpu_light.patch index fd01e3dc9..1ad6a2df8 100644 --- a/debian/patches-rt/block-mq-use-cpu_light.patch +++ b/debian/patches-rt/block-mq-use-cpu_light.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 9 Apr 2014 10:37:23 +0200 Subject: block: mq: use cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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(). diff --git a/debian/patches-rt/block-use-cpu-chill.patch b/debian/patches-rt/block-use-cpu-chill.patch index 3c3c75e50..b8087aabd 100644 --- a/debian/patches-rt/block-use-cpu-chill.patch +++ b/debian/patches-rt/block-use-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: block: Use cpu_chill() for retry loops From: Thomas Gleixner Date: Thu, 20 Dec 2012 18:28:26 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch b/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch index 1d5c51a46..a53b33e5d 100644 --- a/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch +++ b/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 3 Jul 2018 18:19:48 +0200 Subject: [PATCH] cgroup: use irqsave in cgroup_rstat_flush_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz All callers of cgroup_rstat_flush_locked() acquire cgroup_rstat_lock either with spin_lock_irq() or spin_lock_irqsave(). diff --git a/debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch b/debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch index b9156ff8a..ad23a5163 100644 --- a/debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch +++ b/debian/patches-rt/cgroups-use-simple-wait-in-css_release.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 13 Feb 2015 15:52:24 +0100 Subject: cgroups: use simple wait in css_release() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz To avoid: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 diff --git a/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch b/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch index 28e51d1a0..3754f04c6 100644 --- a/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch +++ b/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch @@ -1,7 +1,7 @@ From: Benedikt Spranger Date: Mon, 8 Mar 2010 18:57:04 +0100 Subject: clocksource: TCLIB: Allow higher clock rates for clock events -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/completion-use-simple-wait-queues.patch b/debian/patches-rt/completion-use-simple-wait-queues.patch index a77b3dc31..23ea30c58 100644 --- a/debian/patches-rt/completion-use-simple-wait-queues.patch +++ b/debian/patches-rt/completion-use-simple-wait-queues.patch @@ -1,7 +1,7 @@ Subject: completion: Use simple wait queues From: Thomas Gleixner Date: Fri, 11 Jan 2013 11:23:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Completions have no long lasting callbacks and therefor do not need the complex waitqueue variant. Use simple waitqueues which reduces the diff --git a/debian/patches-rt/cond-resched-lock-rt-tweak.patch b/debian/patches-rt/cond-resched-lock-rt-tweak.patch index 08b19e76b..92a62f187 100644 --- a/debian/patches-rt/cond-resched-lock-rt-tweak.patch +++ b/debian/patches-rt/cond-resched-lock-rt-tweak.patch @@ -1,7 +1,7 @@ Subject: sched: Use the proper LOCK_OFFSET for cond_resched() From: Thomas Gleixner Date: Sun, 17 Jul 2011 22:51:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch b/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch index 098ec4d34..027a15368 100644 --- a/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +++ b/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Sun, 16 Oct 2016 05:11:54 +0200 Subject: [PATCH] connector/cn_proc: Protect send_msg() with a local lock on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/cpu-hotplug--Implement-CPU-pinning.patch b/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch index 27780a195..92b35810c 100644 --- a/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch +++ b/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch @@ -1,7 +1,7 @@ Subject: cpu/hotplug: Implement CPU pinning From: Thomas Gleixner Date: Wed, 19 Jul 2017 17:31:20 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Signed-off-by: Thomas Gleixner --- @@ -76,7 +76,7 @@ Signed-off-by: Thomas Gleixner } DEFINE_STATIC_PERCPU_RWSEM(cpu_hotplug_lock); -@@ -853,6 +886,7 @@ static int take_cpu_down(void *_param) +@@ -828,6 +861,7 @@ static int take_cpu_down(void *_param) static int takedown_cpu(unsigned int cpu) { @@ -84,7 +84,7 @@ Signed-off-by: Thomas Gleixner struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); int err; -@@ -865,11 +899,14 @@ static int takedown_cpu(unsigned int cpu +@@ -840,11 +874,14 @@ static int takedown_cpu(unsigned int cpu */ irq_lock_sparse(); @@ -99,7 +99,7 @@ Signed-off-by: Thomas Gleixner /* CPU refused to die */ irq_unlock_sparse(); /* Unpark the hotplug thread so we can rollback there */ -@@ -888,6 +925,7 @@ static int takedown_cpu(unsigned int cpu +@@ -863,6 +900,7 @@ static int takedown_cpu(unsigned int cpu wait_for_ap_thread(st, false); BUG_ON(st->state != CPUHP_AP_IDLE_DEAD); diff --git a/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch b/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch index 54d127528..871e92e93 100644 --- a/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch +++ b/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 9 Apr 2015 15:23:01 +0200 Subject: cpufreq: drop K8's driver from beeing selected -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Ralf posted a picture of a backtrace from diff --git a/debian/patches-rt/cpumask-disable-offstack-on-rt.patch b/debian/patches-rt/cpumask-disable-offstack-on-rt.patch index 95ae2b503..10cff97d3 100644 --- a/debian/patches-rt/cpumask-disable-offstack-on-rt.patch +++ b/debian/patches-rt/cpumask-disable-offstack-on-rt.patch @@ -1,7 +1,7 @@ Subject: cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT From: Thomas Gleixner Date: Wed, 14 Dec 2011 01:03:49 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz There are "valid" GFP_ATOMIC allocations such as diff --git a/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch index 9eec702f6..2d36cf3b6 100644 --- a/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sun, 8 Jan 2017 09:32:25 +0100 Subject: [PATCH] cpuset: Convert callback_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The two commits below add up to a cpuset might_sleep() splat for RT: diff --git a/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch b/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch index 4f5d67fd6..476f7d666 100644 --- a/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch +++ b/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 21 Feb 2014 17:24:04 +0100 Subject: crypto: Reduce preempt disabled regions, more algos -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/crypto-caam-qi-simplify-CGR-allocation-freeing.patch b/debian/patches-rt/crypto-caam-qi-simplify-CGR-allocation-freeing.patch index 0ad090688..d1c41dcfc 100644 --- a/debian/patches-rt/crypto-caam-qi-simplify-CGR-allocation-freeing.patch +++ b/debian/patches-rt/crypto-caam-qi-simplify-CGR-allocation-freeing.patch @@ -4,7 +4,7 @@ Subject: [PATCH] crypto: caam/qi - simplify CGR allocation, freeing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz [Upstream commit 29e83c757006fd751966bdc53392bb22d74179c6] diff --git a/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch b/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch index 1f0b918f9..733e5c485 100644 --- a/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch +++ b/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 18:52:00 +0200 Subject: [PATCH] crypto: cryptd - add a lock instead preempt_disable/local_bh_disable -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz cryptd has a per-CPU lock which protected with local_bh_disable() and preempt_disable(). diff --git a/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch b/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch index 3bcff2ba4..4dac722d3 100644 --- a/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch +++ b/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch @@ -4,7 +4,7 @@ Subject: [PATCH] crypto: limit more FPU-enabled sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Those crypto drivers use SSE/AVX/… for their crypto work and in order to do so in kernel they need to enable the "FPU" in kernel mode which diff --git a/debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch b/debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch index 8dc9f7d3f..b3d221d11 100644 --- a/debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch +++ b/debian/patches-rt/crypto-scompress-serialize-RT-percpu-scratch-buffer-.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Wed, 11 Jul 2018 17:14:47 +0200 Subject: [PATCH] crypto: scompress - serialize RT percpu scratch buffer access with a local lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:974 | in_atomic(): 1, irqs_disabled(): 0, pid: 1401, name: cryptomgr_test diff --git a/debian/patches-rt/debugobjects-rt.patch b/debian/patches-rt/debugobjects-rt.patch index c8b19a2a9..45e303b77 100644 --- a/debian/patches-rt/debugobjects-rt.patch +++ b/debian/patches-rt/debugobjects-rt.patch @@ -1,7 +1,7 @@ Subject: debugobjects: Make RT aware From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:41:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Avoid filling the pool / allocating memory with irqs off(). diff --git a/debian/patches-rt/dm-rq-remove-BUG_ON-irqs_disabled-check.patch b/debian/patches-rt/dm-rq-remove-BUG_ON-irqs_disabled-check.patch index d11773fb8..35e3a5fe5 100644 --- a/debian/patches-rt/dm-rq-remove-BUG_ON-irqs_disabled-check.patch +++ b/debian/patches-rt/dm-rq-remove-BUG_ON-irqs_disabled-check.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 27 Mar 2018 16:24:15 +0200 Subject: [PATCH] dm rq: remove BUG_ON(!irqs_disabled) check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz In commit 052189a2ec95 ("dm: remove superfluous irq disablement in dm_request_fn") the spin_lock_irq() was replaced with spin_lock() + a diff --git a/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch index a285aadd2..d98d1d7ef 100644 --- a/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ b/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Thu, 31 Mar 2016 04:08:28 +0200 Subject: [PATCH] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz They're nondeterministic, and lead to ___might_sleep() splats in -rt. OTOH, they're a lot less wasteful than an rtmutex per page. @@ -10,13 +10,13 @@ OTOH, they're a lot less wasteful than an rtmutex per page. Signed-off-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- - drivers/block/zram/zram_drv.c | 28 ++++++++++++++++++++++++++++ + drivers/block/zram/zram_drv.c | 38 ++++++++++++++++++++++++++++++++++++++ drivers/block/zram/zram_drv.h | 3 +++ - 2 files changed, 31 insertions(+) + 2 files changed, 41 insertions(+) --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c -@@ -53,6 +53,30 @@ static size_t huge_class_size; +@@ -53,6 +53,40 @@ static size_t huge_class_size; static void zram_free_page(struct zram *zram, size_t index); @@ -29,6 +29,16 @@ Signed-off-by: Sebastian Andrzej Siewior + spin_lock_init(&zram->table[index].lock); +} + ++static int zram_slot_trylock(struct zram *zram, u32 index) ++{ ++ int ret; ++ ++ ret = spin_trylock(&zram->table[index].lock); ++ if (ret) ++ __set_bit(ZRAM_LOCK, &zram->table[index].value); ++ return ret; ++} ++ +static void zram_slot_lock(struct zram *zram, u32 index) +{ + spin_lock(&zram->table[index].lock); @@ -44,10 +54,10 @@ Signed-off-by: Sebastian Andrzej Siewior +#else +static void zram_meta_init_table_locks(struct zram *zram, size_t num_pages) { } + - static void zram_slot_lock(struct zram *zram, u32 index) + static int zram_slot_trylock(struct zram *zram, u32 index) { - bit_spin_lock(ZRAM_LOCK, &zram->table[index].value); -@@ -62,6 +86,7 @@ static void zram_slot_unlock(struct zram + return bit_spin_trylock(ZRAM_LOCK, &zram->table[index].value); +@@ -67,6 +101,7 @@ static void zram_slot_unlock(struct zram { bit_spin_unlock(ZRAM_LOCK, &zram->table[index].value); } @@ -55,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline bool init_done(struct zram *zram) { -@@ -900,6 +925,8 @@ static DEVICE_ATTR_RO(io_stat); +@@ -900,6 +935,8 @@ static DEVICE_ATTR_RO(io_stat); static DEVICE_ATTR_RO(mm_stat); static DEVICE_ATTR_RO(debug_stat); @@ -64,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void zram_meta_free(struct zram *zram, u64 disksize) { size_t num_pages = disksize >> PAGE_SHIFT; -@@ -930,6 +957,7 @@ static bool zram_meta_alloc(struct zram +@@ -930,6 +967,7 @@ static bool zram_meta_alloc(struct zram if (!huge_class_size) huge_class_size = zs_huge_class_size(zram->mem_pool); diff --git a/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch b/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch index 417e652a5..888fc0fbe 100644 --- a/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch +++ b/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch @@ -1,7 +1,7 @@ Subject: tty/serial/omap: Make the locking RT aware From: Thomas Gleixner Date: Thu, 28 Jul 2011 13:32:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/drivers-tty-pl011-irq-disable-madness.patch b/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch index f39426bed..560303b16 100644 --- a/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch +++ b/debian/patches-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 Date: Tue, 08 Jan 2013 21:36:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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. diff --git a/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch b/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch index 516a55db0..4d96fca94 100644 --- a/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +++ b/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch @@ -2,7 +2,7 @@ From: Mike Galbraith 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.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 @@ -63,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* dynamic per-device compression frontend */ --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c -@@ -1016,6 +1016,7 @@ static int __zram_bvec_read(struct zram +@@ -1026,6 +1026,7 @@ static int __zram_bvec_read(struct zram unsigned long handle; unsigned int size; void *src, *dst; @@ -71,7 +71,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (zram_wb_enabled(zram)) { zram_slot_lock(zram, index); -@@ -1050,6 +1051,7 @@ static int __zram_bvec_read(struct zram +@@ -1060,6 +1061,7 @@ static int __zram_bvec_read(struct zram size = zram_get_obj_size(zram, index); @@ -79,7 +79,7 @@ Signed-off-by: Sebastian Andrzej Siewior src = zs_map_object(zram->mem_pool, handle, ZS_MM_RO); if (size == PAGE_SIZE) { dst = kmap_atomic(page); -@@ -1057,14 +1059,13 @@ static int __zram_bvec_read(struct zram +@@ -1067,14 +1069,13 @@ static int __zram_bvec_read(struct zram kunmap_atomic(dst); ret = 0; } else { diff --git a/debian/patches-rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch b/debian/patches-rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch index 4cd7e43c6..8a527f27f 100644 --- a/debian/patches-rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch +++ b/debian/patches-rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Wed, 23 Aug 2017 11:57:29 +0200 Subject: [PATCH] drivers/zram: fix zcomp_stream_get() smp_processor_id() use in preemptible code -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Use get_local_ptr() instead this_cpu_ptr() to avoid a warning regarding smp_processor_id() in preemptible code. diff --git a/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch b/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch index 683fd3509..57a6a50c0 100644 --- a/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch +++ b/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 6 Dec 2018 09:52:20 +0100 Subject: [PATCH] drm/i915: disable tracing on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Luca Abeni reported this: | BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 diff --git a/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch b/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch index d654d96f5..f4a9b62b6 100644 --- a/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch +++ b/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 19 Dec 2018 10:47:02 +0100 Subject: [PATCH] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with NOTRACE -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The order of the header files is important. If this header file is included after tracepoint.h was included then the NOTRACE here becomes a diff --git a/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch b/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch index 644764b3a..d6b4a8e0f 100644 --- a/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch +++ b/debian/patches-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 Date: Sat, 27 Feb 2016 09:01:42 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz [ 8.014039] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:918 diff --git a/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch b/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch index cb5b935f9..8187ade05 100644 --- a/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch +++ b/debian/patches-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 Date: Sat, 27 Feb 2016 08:09:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz DRM folks identified the spots, so use them. diff --git a/debian/patches-rt/efi-Allow-efi-runtime.patch b/debian/patches-rt/efi-Allow-efi-runtime.patch index d2735cfb0..9681f9f81 100644 --- a/debian/patches-rt/efi-Allow-efi-runtime.patch +++ b/debian/patches-rt/efi-Allow-efi-runtime.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 15:06:10 +0200 Subject: [PATCH] efi: Allow efi=runtime -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz In case the option "efi=noruntime" is default at built-time, the user could overwrite its sate by `efi=runtime' and allow it again. diff --git a/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch b/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch index 42fe1f8fd..e402bd457 100644 --- a/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch +++ b/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 15:03:16 +0200 Subject: [PATCH] efi: Disable runtime services on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Based on meassurements the EFI functions get_variable / get_next_variable take up to 2us which looks okay. diff --git a/debian/patches-rt/epoll-use-get-cpu-light.patch b/debian/patches-rt/epoll-use-get-cpu-light.patch index 0852a58a8..2230da3c2 100644 --- a/debian/patches-rt/epoll-use-get-cpu-light.patch +++ b/debian/patches-rt/epoll-use-get-cpu-light.patch @@ -1,7 +1,7 @@ Subject: fs/epoll: Do not disable preemption on RT From: Thomas Gleixner Date: Fri, 08 Jul 2011 16:35:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/fs-aio-simple-simple-work.patch b/debian/patches-rt/fs-aio-simple-simple-work.patch index 3d5c481c3..a9e45d091 100644 --- a/debian/patches-rt/fs-aio-simple-simple-work.patch +++ b/debian/patches-rt/fs-aio-simple-simple-work.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 16 Feb 2015 18:49:10 +0100 Subject: fs/aio: simple simple work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch b/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch index c311dff77..7cb7878c1 100644 --- a/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch +++ b/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 12:32:34 +0200 Subject: [PATCH] fs/dcache: bring back explicit INIT_HLIST_BL_HEAD init -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Commit 3d375d78593c ("mm: update callers to use HASH_ZERO flag") removed INIT_HLIST_BL_HEAD and uses the ZERO flag instead for the init. However @@ -15,7 +15,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -3062,6 +3062,8 @@ static int __init set_dhash_entries(char +@@ -3058,6 +3058,8 @@ static int __init set_dhash_entries(char static void __init dcache_init_early(void) { @@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* If hashes are distributed across NUMA nodes, defer * hash allocation until vmalloc space is available. */ -@@ -3078,11 +3080,16 @@ static void __init dcache_init_early(voi +@@ -3074,11 +3076,16 @@ static void __init dcache_init_early(voi NULL, 0, 0); @@ -41,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * A constructor could be added for stable state like the lists, * but it is probably not worth it because of the cache nature -@@ -3106,6 +3113,10 @@ static void __init dcache_init(void) +@@ -3102,6 +3109,10 @@ static void __init dcache_init(void) NULL, 0, 0); diff --git a/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch index fe1b4d5cc..f33779619 100644 --- a/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ b/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 20 Oct 2017 11:29:53 +0200 Subject: [PATCH] fs/dcache: disable preemption on i_dir_seq's write side -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz i_dir_seq is an opencoded seqcounter. Based on the code it looks like we could have two writers in parallel despite the fact that the d_lock is @@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -2404,9 +2404,10 @@ EXPORT_SYMBOL(d_rehash); +@@ -2400,9 +2400,10 @@ EXPORT_SYMBOL(d_rehash); static inline unsigned start_dir_add(struct inode *dir) { @@ -37,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior return n; cpu_relax(); } -@@ -2414,7 +2415,8 @@ static inline unsigned start_dir_add(str +@@ -2410,7 +2411,8 @@ static inline unsigned start_dir_add(str static inline void end_dir_add(struct inode *dir, unsigned n) { @@ -47,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void d_wait_lookup(struct dentry *dentry) -@@ -2447,7 +2449,7 @@ struct dentry *d_alloc_parallel(struct d +@@ -2443,7 +2445,7 @@ struct dentry *d_alloc_parallel(struct d retry: rcu_read_lock(); @@ -56,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior r_seq = read_seqbegin(&rename_lock); dentry = __d_lookup_rcu(parent, name, &d_seq); if (unlikely(dentry)) { -@@ -2475,7 +2477,7 @@ struct dentry *d_alloc_parallel(struct d +@@ -2471,7 +2473,7 @@ struct dentry *d_alloc_parallel(struct d } hlist_bl_lock(b); diff --git a/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch b/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch index f29c296b8..d9c23bc84 100644 --- a/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch +++ b/debian/patches-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 Date: Wed, 07 Mar 2012 21:00:34 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch index 989ee8d18..9a7c97859 100644 --- a/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ b/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 14:35:49 +0200 Subject: [PATCH] fs/dcache: use swait_queue instead of waitqueue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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. @@ -34,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -2421,21 +2421,24 @@ static inline void end_dir_add(struct in +@@ -2417,21 +2417,24 @@ static inline void end_dir_add(struct in static void d_wait_lookup(struct dentry *dentry) { @@ -70,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior { unsigned int hash = name->hash; struct hlist_bl_head *b = in_lookup_hash(parent, hash); -@@ -2550,7 +2553,7 @@ void __d_lookup_done(struct dentry *dent +@@ -2546,7 +2549,7 @@ void __d_lookup_done(struct dentry *dent hlist_bl_lock(b); dentry->d_flags &= ~DCACHE_PAR_LOOKUP; __hlist_bl_del(&dentry->d_u.d_in_lookup_hash); diff --git a/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch b/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch index 5cfe32170..0647db39f 100644 --- a/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch +++ b/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 18 Mar 2011 10:11:25 +0100 Subject: fs: jbd/jbd2: Make state lock and journal head lock rt safe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz bit_spin_locks break under RT. diff --git a/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch b/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch index 04a9f4b57..64909e2ae 100644 --- a/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch +++ b/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 15 Sep 2016 10:51:27 +0200 Subject: [PATCH] fs/nfs: turn rmdir_sem into a semaphore -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch b/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch index 72e692b20..cf8a9add8 100644 --- a/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch +++ b/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 18 Mar 2011 09:18:52 +0100 Subject: buffer_head: Replace bh_uptodate_lock for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Wrap the bit_spin_lock calls into a separate inline and add the RT replacements with a real spinlock. diff --git a/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch b/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch index fa569e06a..d0bc8209b 100644 --- a/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch +++ b/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch @@ -1,7 +1,7 @@ From: Clark Williams Date: Tue, 3 Jul 2018 13:34:30 -0500 Subject: [PATCH] fscache: initialize cookie hash table raw spinlocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The fscache cookie mechanism uses a hash table of hlist_bl_head structures. The PREEMPT_RT patcheset adds a raw spinlock to this structure and so on PREEMPT_RT diff --git a/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch b/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch index 1549f0f6c..bd763f8f1 100644 --- a/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch +++ b/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sun, 16 Oct 2016 05:08:30 +0200 Subject: [PATCH] ftrace: Fix trace header alignment -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Line up helper arrows to the right column. diff --git a/debian/patches-rt/ftrace-migrate-disable-tracing.patch b/debian/patches-rt/ftrace-migrate-disable-tracing.patch index cdd499665..9ad94877d 100644 --- a/debian/patches-rt/ftrace-migrate-disable-tracing.patch +++ b/debian/patches-rt/ftrace-migrate-disable-tracing.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:56:42 +0200 Subject: trace: Add migrate-disabled counter to tracing output -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Signed-off-by: Thomas Gleixner --- diff --git a/debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch index cb96eac29..ae7a823dd 100644 --- a/debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch +++ b/debian/patches-rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 1 Mar 2013 11:17:42 +0100 Subject: futex: Ensure lock/unlock symetry versus pi_lock and hash bucket lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz In exit_pi_state_list() we have the following locking construct: diff --git a/debian/patches-rt/futex-requeue-pi-fix.patch b/debian/patches-rt/futex-requeue-pi-fix.patch index 131e9e995..cfcdf41ab 100644 --- a/debian/patches-rt/futex-requeue-pi-fix.patch +++ b/debian/patches-rt/futex-requeue-pi-fix.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: futex: Fix bug on when a requeued RT task times out -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Requeue with timeout causes a bug with PREEMPT_RT_FULL. @@ -66,7 +66,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -1763,6 +1764,34 @@ int __rt_mutex_start_proxy_lock(struct r +@@ -1784,6 +1785,34 @@ int __rt_mutex_start_proxy_lock(struct r if (try_to_take_rt_mutex(lock, task, NULL)) return 1; diff --git a/debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch b/debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch index 26174009e..b7033104b 100644 --- a/debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch +++ b/debian/patches-rt/futex-workaround-migrate_disable-enable-in-different.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Wed, 8 Mar 2017 14:23:35 +0100 Subject: [PATCH] futex: workaround migrate_disable/enable in different context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz migrate_disable()/migrate_enable() takes a different path in atomic() vs !atomic() context. These little hacks ensure that we don't underflow / overflow @@ -16,8 +16,8 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2855,9 +2855,18 @@ static int futex_lock_pi(u32 __user *uad - * lock handoff sequence. +@@ -2856,6 +2856,14 @@ static int futex_lock_pi(u32 __user *uad + * before __rt_mutex_start_proxy_lock() is done. */ raw_spin_lock_irq(&q.pi_state->pi_mutex.wait_lock); + /* @@ -29,14 +29,18 @@ Signed-off-by: Sebastian Andrzej Siewior + migrate_disable(); + spin_unlock(q.lock_ptr); + /* + * __rt_mutex_start_proxy_lock() unconditionally enqueues the @rt_waiter +@@ -2864,6 +2872,7 @@ static int futex_lock_pi(u32 __user *uad + */ ret = __rt_mutex_start_proxy_lock(&q.pi_state->pi_mutex, &rt_waiter, current); raw_spin_unlock_irq(&q.pi_state->pi_mutex.wait_lock); + migrate_enable(); if (ret) { if (ret == 1) -@@ -3004,11 +3013,21 @@ static int futex_unlock_pi(u32 __user *u - * observed. +@@ -3012,11 +3021,21 @@ static int futex_unlock_pi(u32 __user *u + * rt_waiter. Also see the WARN in wake_futex_pi(). */ raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); + /* diff --git a/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch b/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch index 02b761cbc..0f5484f29 100644 --- a/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch +++ b/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:57 -0500 Subject: genirq: Disable irqpoll on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Creates long latencies for no value diff --git a/debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch b/debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch index b2ade7b04..4abd3ed16 100644 --- a/debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch +++ b/debian/patches-rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 21 Aug 2013 17:48:46 +0200 Subject: genirq: Do not invoke the affinity callback via a workqueue on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/genirq-force-threading.patch b/debian/patches-rt/genirq-force-threading.patch index 0d5d0f709..c25fb81a4 100644 --- a/debian/patches-rt/genirq-force-threading.patch +++ b/debian/patches-rt/genirq-force-threading.patch @@ -1,7 +1,7 @@ Subject: genirq: Force interrupt thread on RT From: Thomas Gleixner Date: Sun, 03 Apr 2011 11:57:29 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Force threaded_irqs and optimize the code (force_irqthreads) in regard to this. diff --git a/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch b/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch index 7d21a49b2..1f734c30d 100644 --- a/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch +++ b/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:00 -0600 Subject: genirq: update irq_set_irqchip_state documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch b/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch index bc76beff4..476dbdbd8 100644 --- a/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +++ b/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 18:31:00 +0200 Subject: [PATCH] hotplug: duct-tape RT-rwlock usage for non-RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz This type is only available on -RT. We need to craft something for non-RT. Since the only migrate_disable() user is -RT only, there is no @@ -55,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior } DEFINE_STATIC_PERCPU_RWSEM(cpu_hotplug_lock); -@@ -886,7 +890,9 @@ static int take_cpu_down(void *_param) +@@ -861,7 +865,9 @@ static int take_cpu_down(void *_param) static int takedown_cpu(unsigned int cpu) { @@ -65,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu); int err; -@@ -899,14 +905,18 @@ static int takedown_cpu(unsigned int cpu +@@ -874,14 +880,18 @@ static int takedown_cpu(unsigned int cpu */ irq_lock_sparse(); @@ -84,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* CPU refused to die */ irq_unlock_sparse(); /* Unpark the hotplug thread so we can rollback there */ -@@ -925,7 +935,9 @@ static int takedown_cpu(unsigned int cpu +@@ -900,7 +910,9 @@ static int takedown_cpu(unsigned int cpu wait_for_ap_thread(st, false); BUG_ON(st->state != CPUHP_AP_IDLE_DEAD); diff --git a/debian/patches-rt/hotplug-light-get-online-cpus.patch b/debian/patches-rt/hotplug-light-get-online-cpus.patch index fd355ad76..984f3ba51 100644 --- a/debian/patches-rt/hotplug-light-get-online-cpus.patch +++ b/debian/patches-rt/hotplug-light-get-online-cpus.patch @@ -1,7 +1,7 @@ Subject: hotplug: Lightweight get online cpus From: Thomas Gleixner Date: Wed, 15 Jun 2011 12:36:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz get_online_cpus() is a heavy weight function which involves a global mutex. migrate_disable() wants a simpler construct which prevents only diff --git a/debian/patches-rt/hrtimer-Don-t-lose-state-in-cpu_chill.patch b/debian/patches-rt/hrtimer-Don-t-lose-state-in-cpu_chill.patch new file mode 100644 index 000000000..e6cdcf071 --- /dev/null +++ b/debian/patches-rt/hrtimer-Don-t-lose-state-in-cpu_chill.patch @@ -0,0 +1,42 @@ +From: Sebastian Andrzej Siewior +Date: Tue, 19 Feb 2019 16:59:15 +0100 +Subject: [PATCH] hrtimer: Don't lose state in cpu_chill() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz + +In cpu_chill() the state is set to TASK_UNINTERRUPTIBLE and a timer is +programmed. On return the state is always TASK_RUNNING which means we +lose the state if it was something other than RUNNING. Also +set_current_state() sets ->task_state_change to within cpu_chill() which +is not expected. + +Save the task state on entry and restore it on return. Simply set the +state in order to avoid updating ->task_state_change. + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/time/hrtimer.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -1902,15 +1902,18 @@ void cpu_chill(void) + { + ktime_t chill_time; + unsigned int freeze_flag = current->flags & PF_NOFREEZE; ++ long saved_state; + ++ saved_state = current->state; + chill_time = ktime_set(0, NSEC_PER_MSEC); +- set_current_state(TASK_UNINTERRUPTIBLE); ++ __set_current_state_no_track(TASK_UNINTERRUPTIBLE); + current->flags |= PF_NOFREEZE; + sleeping_lock_inc(); + schedule_hrtimeout(&chill_time, HRTIMER_MODE_REL_HARD); + sleeping_lock_dec(); + if (!freeze_flag) + current->flags &= ~PF_NOFREEZE; ++ __set_current_state_no_track(saved_state); + } + EXPORT_SYMBOL(cpu_chill); + #endif diff --git a/debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch b/debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch index 026c57bf1..76498c447 100644 --- a/debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch +++ b/debian/patches-rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch @@ -1,7 +1,7 @@ From: Yang Shi Date: Mon, 16 Sep 2013 14:09:19 -0700 Subject: hrtimer: Move schedule_work call to helper thread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz When run ltp leapsec_timer test, the following call trace is caught: diff --git a/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch b/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch index 17fd5dcd6..15d6df221 100644 --- a/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch +++ b/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 3 Jul 2009 08:44:31 -0500 Subject: hrtimer: by timers by default into the softirq context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz We can't have hrtimers callbacks running in hardirq context on RT. Therefore the timers are deferred to the softirq context by default. @@ -70,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior timer->function = perf_mux_hrtimer_handler; } -@@ -9173,7 +9173,7 @@ static void perf_swevent_init_hrtimer(st +@@ -9181,7 +9181,7 @@ static void perf_swevent_init_hrtimer(st if (!is_sampling_event(event)) return; diff --git a/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch b/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch index de3b01251..b10ae5280 100644 --- a/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch +++ b/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 3 Jul 2018 11:25:41 +0200 Subject: [PATCH v2] hrtimer: consolidate hrtimer_init() + hrtimer_init_sleeper() calls -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz hrtimer_init_sleeper() calls require a prior initialisation of the hrtimer object with hrtimer_init(). Lets make the initialisation of @@ -143,7 +143,7 @@ Signed-off-by: Anna-Maria Gleixner hrtimer_set_expires(&to->timer, *time); } -@@ -3201,10 +3199,9 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3209,10 +3207,9 @@ static int futex_wait_requeue_pi(u32 __u if (abs_time) { to = &timeout; diff --git a/debian/patches-rt/hrtimer-cpu_chill-save-task-state-in-saved_state.patch b/debian/patches-rt/hrtimer-cpu_chill-save-task-state-in-saved_state.patch new file mode 100644 index 000000000..2eadcd7f9 --- /dev/null +++ b/debian/patches-rt/hrtimer-cpu_chill-save-task-state-in-saved_state.patch @@ -0,0 +1,56 @@ +From: Sebastian Andrzej Siewior +Date: Tue, 26 Feb 2019 12:31:10 +0100 +Subject: [PATCH] hrtimer: cpu_chill(): save task state in ->saved_state() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz + +In the previous change I saved the current task state on stack. This was +bad because while the task is scheduled-out it might receive a wake-up. +The wake up changes the task state and we must not destroy it. + +Save the task-state in ->saved_state under a PI-lock to unsure that +state changes during are not missed while the task temporary scheduled +out. + +Reported-by: Mike Galbraith +Tested-by: Mike Galbraith +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/time/hrtimer.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -1900,20 +1900,28 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct + */ + void cpu_chill(void) + { +- ktime_t chill_time; + unsigned int freeze_flag = current->flags & PF_NOFREEZE; +- long saved_state; ++ struct task_struct *self = current; ++ ktime_t chill_time; + +- saved_state = current->state; +- chill_time = ktime_set(0, NSEC_PER_MSEC); ++ raw_spin_lock_irq(&self->pi_lock); ++ self->saved_state = self->state; + __set_current_state_no_track(TASK_UNINTERRUPTIBLE); ++ raw_spin_unlock_irq(&self->pi_lock); ++ ++ chill_time = ktime_set(0, NSEC_PER_MSEC); ++ + current->flags |= PF_NOFREEZE; + sleeping_lock_inc(); + schedule_hrtimeout(&chill_time, HRTIMER_MODE_REL_HARD); + sleeping_lock_dec(); + if (!freeze_flag) + current->flags &= ~PF_NOFREEZE; +- __set_current_state_no_track(saved_state); ++ ++ raw_spin_lock_irq(&self->pi_lock); ++ __set_current_state_no_track(self->saved_state); ++ self->saved_state = TASK_RUNNING; ++ raw_spin_unlock_irq(&self->pi_lock); + } + EXPORT_SYMBOL(cpu_chill); + #endif diff --git a/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch b/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch index f7e15d2c7..5aeec3560 100644 --- a/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch +++ b/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 6 Dec 2018 10:15:13 +0100 Subject: [PATCH] hrtimer: move state change before hrtimer_cancel in do_nanosleep() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz There is a small window between setting t->task to NULL and waking the task up (which would set TASK_RUNNING). So the timer would fire, run and diff --git a/debian/patches-rt/hrtimers-prepare-full-preemption.patch b/debian/patches-rt/hrtimers-prepare-full-preemption.patch index 1b55e2fa4..001327dbd 100644 --- a/debian/patches-rt/hrtimers-prepare-full-preemption.patch +++ b/debian/patches-rt/hrtimers-prepare-full-preemption.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 Subject: hrtimers: Prepare full preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Make cancellation of a running callback in softirq context safe against preemption. diff --git a/debian/patches-rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch b/debian/patches-rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch index a146d9da8..93e4f5b8b 100644 --- a/debian/patches-rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch +++ b/debian/patches-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 Date: Tue, 31 Jan 2012 13:01:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch b/debian/patches-rt/irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch index 23b1ae7a3..a1cfdb8e6 100644 --- a/debian/patches-rt/irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch +++ b/debian/patches-rt/irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch @@ -2,7 +2,7 @@ From: Marc Zyngier Date: Fri, 27 Jul 2018 13:38:54 +0100 Subject: [PATCH] irqchip/gic-v3-its: Move pending table allocation to init time -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Signed-off-by: Marc Zyngier Signed-off-by: Sebastian Andrzej Siewior @@ -13,7 +13,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c -@@ -173,6 +173,7 @@ static DEFINE_RAW_SPINLOCK(vmovp_lock); +@@ -179,6 +179,7 @@ static DEFINE_RAW_SPINLOCK(vmovp_lock); static DEFINE_IDA(its_vpeid_ida); #define gic_data_rdist() (raw_cpu_ptr(gic_rdists->rdist)) @@ -21,7 +21,7 @@ Signed-off-by: Sebastian Andrzej Siewior #define gic_data_rdist_rd_base() (gic_data_rdist()->rd_base) #define gic_data_rdist_vlpi_base() (gic_data_rdist_rd_base() + SZ_128K) -@@ -1622,7 +1623,7 @@ static void its_free_prop_table(struct p +@@ -1628,7 +1629,7 @@ static void its_free_prop_table(struct p get_order(LPI_PROPBASE_SZ)); } @@ -30,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior { phys_addr_t paddr; -@@ -1945,30 +1946,47 @@ static void its_free_pending_table(struc +@@ -1951,30 +1952,47 @@ static void its_free_pending_table(struc get_order(max_t(u32, LPI_PENDBASE_SZ, SZ_64K))); } @@ -93,7 +93,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* set PROPBASE */ val = (page_to_phys(gic_rdists->prop_page) | GICR_PROPBASER_InnerShareable | -@@ -2020,6 +2038,10 @@ static void its_cpu_init_lpis(void) +@@ -2026,6 +2044,10 @@ static void its_cpu_init_lpis(void) /* Make sure the GIC has seen the above */ dsb(sy); @@ -104,7 +104,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void its_cpu_init_collection(struct its_node *its) -@@ -3498,16 +3520,6 @@ static int redist_disable_lpis(void) +@@ -3521,16 +3543,6 @@ static int redist_disable_lpis(void) u64 timeout = USEC_PER_SEC; u64 val; @@ -121,7 +121,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!gic_rdists_supports_plpis()) { pr_info("CPU%d: LPIs not supported\n", smp_processor_id()); return -ENXIO; -@@ -3517,7 +3529,18 @@ static int redist_disable_lpis(void) +@@ -3540,7 +3552,18 @@ static int redist_disable_lpis(void) if (!(val & GICR_CTLR_ENABLE_LPIS)) return 0; @@ -141,7 +141,7 @@ Signed-off-by: Sebastian Andrzej Siewior smp_processor_id()); add_taint(TAINT_CRAP, LOCKDEP_STILL_OK); -@@ -3773,7 +3796,8 @@ int __init its_init(struct fwnode_handle +@@ -3796,7 +3819,8 @@ int __init its_init(struct fwnode_handle } gic_rdists = rdists; diff --git a/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch b/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch index 41bbb01e6..726255b18 100644 --- a/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch +++ b/debian/patches-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 Date: Tue, 23 Jun 2015 15:32:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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. diff --git a/debian/patches-rt/jump-label-rt.patch b/debian/patches-rt/jump-label-rt.patch index eacdc9bbc..09862188b 100644 --- a/debian/patches-rt/jump-label-rt.patch +++ b/debian/patches-rt/jump-label-rt.patch @@ -1,7 +1,7 @@ Subject: jump-label: disable if stop_machine() is used From: Thomas Gleixner Date: Wed, 08 Jul 2015 17:14:48 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Some architectures are using stop_machine() while switching the opcode which leads to latency spikes. diff --git a/debian/patches-rt/kconfig-disable-a-few-options-rt.patch b/debian/patches-rt/kconfig-disable-a-few-options-rt.patch index db68b39ba..8373ebdc7 100644 --- a/debian/patches-rt/kconfig-disable-a-few-options-rt.patch +++ b/debian/patches-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 Date: Sun, 24 Jul 2011 12:11:43 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Disable stuff which is known to have issues on RT diff --git a/debian/patches-rt/kconfig-preempt-rt-full.patch b/debian/patches-rt/kconfig-preempt-rt-full.patch index bacbc3d4c..b0b5ff986 100644 --- a/debian/patches-rt/kconfig-preempt-rt-full.patch +++ b/debian/patches-rt/kconfig-preempt-rt-full.patch @@ -1,7 +1,7 @@ Subject: kconfig: Add PREEMPT_RT_FULL From: Thomas Gleixner Date: Wed, 29 Jun 2011 14:58:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Introduce the final symbol for PREEMPT_RT_FULL. diff --git a/debian/patches-rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch b/debian/patches-rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch index 433ecae39..a5ea39ce7 100644 --- a/debian/patches-rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch +++ b/debian/patches-rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 19 May 2016 17:45:27 +0200 Subject: [PATCH] kernel/printk: Don't try to print from IRQ/NMI region -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch b/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch index 8931a10b2..d12c8ff8f 100644 --- a/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +++ b/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch @@ -4,7 +4,7 @@ Subject: [PATCH] kernel: sched: Provide a pointer to the valid CPU mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz In commit 4b53a3412d66 ("sched/core: Remove the tsk_nr_cpus_allowed() wrapper") the tsk_nr_cpus_allowed() wrapper was removed. There was not @@ -581,7 +581,7 @@ Signed-off-by: Sebastian Andrzej Siewior return prev_cpu; /* -@@ -6000,7 +6000,7 @@ static int select_idle_core(struct task_ +@@ -6001,7 +6001,7 @@ static int select_idle_core(struct task_ if (!test_idle_cores(target, false)) return -1; @@ -590,7 +590,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_cpu_wrap(core, cpus, target) { bool idle = true; -@@ -6034,7 +6034,7 @@ static int select_idle_smt(struct task_s +@@ -6035,7 +6035,7 @@ static int select_idle_smt(struct task_s return -1; for_each_cpu(cpu, cpu_smt_mask(target)) { @@ -599,7 +599,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; if (available_idle_cpu(cpu)) return cpu; -@@ -6097,7 +6097,7 @@ static int select_idle_cpu(struct task_s +@@ -6098,7 +6098,7 @@ static int select_idle_cpu(struct task_s for_each_cpu_wrap(cpu, sched_domain_span(sd), target) { if (!--nr) return -1; @@ -608,7 +608,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; if (available_idle_cpu(cpu)) break; -@@ -6134,7 +6134,7 @@ static int select_idle_sibling(struct ta +@@ -6135,7 +6135,7 @@ static int select_idle_sibling(struct ta recent_used_cpu != target && cpus_share_cache(recent_used_cpu, target) && available_idle_cpu(recent_used_cpu) && @@ -617,7 +617,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Replace recent_used_cpu with prev as it is a potential * candidate for the next wake: -@@ -6352,7 +6352,7 @@ select_task_rq_fair(struct task_struct * +@@ -6353,7 +6353,7 @@ select_task_rq_fair(struct task_struct * if (sd_flag & SD_BALANCE_WAKE) { record_wakee(p); want_affine = !wake_wide(p) && !wake_cap(p, cpu, prev_cpu) @@ -626,7 +626,7 @@ Signed-off-by: Sebastian Andrzej Siewior } rcu_read_lock(); -@@ -7091,14 +7091,14 @@ int can_migrate_task(struct task_struct +@@ -7092,14 +7092,14 @@ int can_migrate_task(struct task_struct /* * We do not migrate tasks that are: * 1) throttled_lb_pair, or @@ -643,7 +643,7 @@ Signed-off-by: Sebastian Andrzej Siewior int cpu; schedstat_inc(p->se.statistics.nr_failed_migrations_affine); -@@ -7118,7 +7118,7 @@ int can_migrate_task(struct task_struct +@@ -7119,7 +7119,7 @@ int can_migrate_task(struct task_struct /* Prevent to re-select dst_cpu via env's CPUs: */ for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) { @@ -652,7 +652,7 @@ Signed-off-by: Sebastian Andrzej Siewior env->flags |= LBF_DST_PINNED; env->new_dst_cpu = cpu; break; -@@ -7715,7 +7715,7 @@ check_cpu_capacity(struct rq *rq, struct +@@ -7716,7 +7716,7 @@ check_cpu_capacity(struct rq *rq, struct /* * Group imbalance indicates (and tries to solve) the problem where balancing @@ -661,7 +661,7 @@ Signed-off-by: Sebastian Andrzej Siewior * * Imagine a situation of two groups of 4 CPUs each and 4 tasks each with a * cpumask covering 1 CPU of the first group and 3 CPUs of the second group. -@@ -8330,7 +8330,7 @@ static struct sched_group *find_busiest_ +@@ -8331,7 +8331,7 @@ static struct sched_group *find_busiest_ /* * If the busiest group is imbalanced the below checks don't * work because they assume all things are equal, which typically @@ -670,7 +670,7 @@ Signed-off-by: Sebastian Andrzej Siewior */ if (busiest->group_type == group_imbalanced) goto force_balance; -@@ -8726,7 +8726,7 @@ static int load_balance(int this_cpu, st +@@ -8727,7 +8727,7 @@ static int load_balance(int this_cpu, st * if the curr task on busiest CPU can't be * moved to this_cpu: */ diff --git a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index f14c86a72..29b1bc04d 100644 --- a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior 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.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz There is no need to free the stack before the task struct (except for reasons mentioned in commit 68f24b08ee89 ("sched/core: Free the stack early if diff --git a/debian/patches-rt/kgb-serial-hackaround.patch b/debian/patches-rt/kgb-serial-hackaround.patch index 9e1804376..f05640b42 100644 --- a/debian/patches-rt/kgb-serial-hackaround.patch +++ b/debian/patches-rt/kgb-serial-hackaround.patch @@ -1,7 +1,7 @@ From: Jason Wessel Date: Thu, 28 Jul 2011 12:42:23 -0500 Subject: kgdb/serial: Short term workaround -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz On 07/27/2011 04:37 PM, Thomas Gleixner wrote: > - KGDB (not yet disabled) is reportedly unusable on -rt right now due diff --git a/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch b/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch index c149e1458..bead1d0dc 100644 --- a/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch +++ b/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch @@ -1,7 +1,7 @@ From: He Zhe Date: Wed, 19 Dec 2018 16:30:57 +0100 Subject: [PATCH] kmemleak: Turn kmemleak_lock to raw spinlock on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz kmemleak_lock, as a rwlock on RT, can possibly be held in atomic context and causes the follow BUG. diff --git a/debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch b/debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch index a3fdd8682..718a07415 100644 --- a/debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch +++ b/debian/patches-rt/kthread-convert-worker-lock-to-raw-spinlock.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Fri, 28 Sep 2018 21:03:51 +0000 Subject: [PATCH] kthread: convert worker lock to raw spinlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz In order to enable the queuing of kthread work items from hardirq context even when PREEMPT_RT_FULL is enabled, convert the worker diff --git a/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch b/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch index 28353f83f..a99ea777c 100644 --- a/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch +++ b/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 23 Jan 2014 14:45:59 +0100 Subject: leds: trigger: disable CPU trigger on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz as it triggers: |CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 diff --git a/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch b/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch index b28a0bc36..62a936d1a 100644 --- a/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch +++ b/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 31 Mar 2016 00:04:25 -0500 Subject: [PATCH] list_bl: fixup bogus lockdep warning -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz At first glance, the use of 'static inline' seems appropriate for INIT_HLIST_BL_HEAD(). diff --git a/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch b/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch index 7cd7d1a53..535550b95 100644 --- a/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch +++ b/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch @@ -1,7 +1,7 @@ From: Paul Gortmaker Date: Fri, 21 Jun 2013 15:07:25 -0400 Subject: list_bl: Make list head locking RT safe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/locallock-provide-get-put-_locked_ptr-variants.patch b/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch index ffd6ace1b..ed71abd2f 100644 --- a/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch +++ b/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Mon, 7 May 2018 08:58:56 -0500 Subject: [PATCH] locallock: provide {get,put}_locked_ptr() variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Provide a set of locallocked accessors for pointers to per-CPU data; this is useful for dynamically-allocated per-CPU regions, for example. diff --git a/debian/patches-rt/localversion.patch b/debian/patches-rt/localversion.patch index 90d68690c..5cb93385d 100644 --- a/debian/patches-rt/localversion.patch +++ b/debian/patches-rt/localversion.patch @@ -1,7 +1,7 @@ Subject: Add localversion for -RT release From: Thomas Gleixner Date: Fri, 08 Jul 2011 20:25:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Signed-off-by: Thomas Gleixner --- @@ -11,4 +11,4 @@ Signed-off-by: Thomas Gleixner --- /dev/null +++ b/localversion-rt @@ -0,0 +1 @@ -+-rt12 ++-rt16 diff --git a/debian/patches-rt/lockdep-disable-self-test.patch b/debian/patches-rt/lockdep-disable-self-test.patch index 5b38a6562..2fd0534f9 100644 --- a/debian/patches-rt/lockdep-disable-self-test.patch +++ b/debian/patches-rt/lockdep-disable-self-test.patch @@ -4,7 +4,7 @@ Subject: [PATCH] lockdep: disable self-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The self-test wasn't always 100% accurate for RT. We disabled a few tests which failed because they had a different semantic for RT. Some diff --git a/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch b/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch index 708467c66..c56e43b55 100644 --- a/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch +++ b/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch @@ -1,7 +1,7 @@ Subject: lockdep: Make it RT aware From: Thomas Gleixner Date: Sun, 17 Jul 2011 18:51:23 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz teach lockdep that we don't really do softirqs on -RT. diff --git a/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch index 301442858..74f0b6367 100644 --- a/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ b/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Wed, 28 Jan 2015 13:08:45 -0600 Subject: lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch b/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch index 3e8b98fb7..ff01f8acb 100644 --- a/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch +++ b/debian/patches-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 Date: Mon, 16 Apr 2012 15:01:56 +0800 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz From: Yong Zhang diff --git a/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch index fe439f1b0..15b595f98 100644 --- a/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ b/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 17:40:42 +0200 Subject: [PATCH 1/2] locking: don't check for __LINUX_SPINLOCK_TYPES_H on -RT archs -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Upstream uses arch_spinlock_t within spinlock_t and requests that spinlock_types.h header file is included first. diff --git a/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch b/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch index 7d227c43f..2a3d5874b 100644 --- a/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch +++ b/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch @@ -1,7 +1,7 @@ From: "Wolfgang M. Reimer" Date: Tue, 21 Jul 2015 16:20:07 +0200 Subject: locking: locktorture: Do NOT include rwlock.h directly -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch b/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch index b7f44b044..6966fd07a 100644 --- a/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch +++ b/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch @@ -1,7 +1,7 @@ From: Scott Wood Date: Fri, 4 Jan 2019 15:33:21 -0500 Subject: [PATCH] locking/rt-mutex: Flush block plug on __down_read() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz __down_read() bypasses the rtmutex frontend to call rt_mutex_slowlock_locked() directly, and thus it needs to call diff --git a/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch b/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch index 99c56fce6..a1f577b71 100644 --- a/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch +++ b/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch @@ -1,7 +1,7 @@ From: Mikulas Patocka Date: Mon, 13 Nov 2017 12:56:53 -0500 Subject: [PATCH] locking/rt-mutex: fix deadlock in device mapper / block-IO -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz When some block device driver creates a bio and submits it to another block device driver, the bio is added to current->bio_list (in order to diff --git a/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch b/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch index 0fb54b8cd..52b3b0348 100644 --- a/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch +++ b/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 16 Nov 2017 16:48:48 +0100 Subject: [PATCH] locking/rtmutex: re-init the wait_lock in rt_mutex_init_proxy_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz We could provide a key-class for the lockdep (and fixup all callers) or move the init to all callers (like it was) in order to avoid lockdep diff --git a/debian/patches-rt/md-disable-bcache.patch b/debian/patches-rt/md-disable-bcache.patch index aaa4a90cb..5fa1d2fa9 100644 --- a/debian/patches-rt/md-disable-bcache.patch +++ b/debian/patches-rt/md-disable-bcache.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 11:48:57 +0200 Subject: md: disable bcache -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz It uses anon semaphores |drivers/md/bcache/request.c: In function ‘cached_dev_write_complete’: diff --git a/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch b/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch index 61c16d145..10941b8e6 100644 --- a/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch +++ b/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 6 Apr 2010 16:51:31 +0200 Subject: md: raid5: Make raid5_percpu handling RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz __raid_run_ops() disables preemption with get_cpu() around the access to the raid5_percpu variables. That causes scheduling while atomic @@ -42,7 +42,7 @@ Tested-by: Udo van den Heuvel } static void free_stripe(struct kmem_cache *sc, struct stripe_head *sh) -@@ -6799,6 +6801,7 @@ static int raid456_cpu_up_prepare(unsign +@@ -6803,6 +6805,7 @@ static int raid456_cpu_up_prepare(unsign __func__, cpu); return -ENOMEM; } @@ -50,7 +50,7 @@ Tested-by: Udo van den Heuvel return 0; } -@@ -6809,7 +6812,6 @@ static int raid5_alloc_percpu(struct r5c +@@ -6813,7 +6816,6 @@ static int raid5_alloc_percpu(struct r5c conf->percpu = alloc_percpu(struct raid5_percpu); if (!conf->percpu) return -ENOMEM; diff --git a/debian/patches-rt/mips-disable-highmem-on-rt.patch b/debian/patches-rt/mips-disable-highmem-on-rt.patch index e27a24077..6cc3bc089 100644 --- a/debian/patches-rt/mips-disable-highmem-on-rt.patch +++ b/debian/patches-rt/mips-disable-highmem-on-rt.patch @@ -1,7 +1,7 @@ Subject: mips: Disable highmem on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:10:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The current highmem handling on -RT is not compatible and needs fixups. @@ -12,7 +12,7 @@ Signed-off-by: Thomas Gleixner --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2514,7 +2514,7 @@ config MIPS_CRC_SUPPORT +@@ -2517,7 +2517,7 @@ config MIPS_CRC_SUPPORT # config HIGHMEM bool "High Memory Support" diff --git a/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch b/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch index 3202de666..1340af54e 100644 --- a/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch +++ b/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:51 -0500 Subject: mm/swap: Convert to percpu locked -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Replace global locks (get_cpu + local_irq_save) with "local_locks()". Currently there is one of for "rotate" and one for "swap". @@ -26,7 +26,7 @@ Signed-off-by: Thomas Gleixner #include struct notifier_block; -@@ -322,6 +323,7 @@ extern unsigned long nr_free_pagecache_p +@@ -331,6 +332,7 @@ extern unsigned long nr_free_pagecache_p /* linux/mm/swap.c */ @@ -53,7 +53,7 @@ Signed-off-by: Thomas Gleixner } --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7196,8 +7196,9 @@ void __init free_area_init(unsigned long +@@ -7205,8 +7205,9 @@ void __init free_area_init(unsigned long static int page_alloc_cpu_dead(unsigned int cpu) { diff --git a/debian/patches-rt/mm-disable-sloub-rt.patch b/debian/patches-rt/mm-disable-sloub-rt.patch index 095d3a92a..897e69245 100644 --- a/debian/patches-rt/mm-disable-sloub-rt.patch +++ b/debian/patches-rt/mm-disable-sloub-rt.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:44:03 -0500 Subject: mm: Allow only slub on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs. @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner --- a/init/Kconfig +++ b/init/Kconfig -@@ -1633,6 +1633,7 @@ choice +@@ -1634,6 +1634,7 @@ choice config SLAB bool "SLAB" @@ -22,7 +22,7 @@ Signed-off-by: Thomas Gleixner select HAVE_HARDENED_USERCOPY_ALLOCATOR help The regular slab allocator that is established and known to work -@@ -1653,6 +1654,7 @@ config SLUB +@@ -1654,6 +1655,7 @@ config SLUB config SLOB depends on EXPERT bool "SLOB (Simple Allocator)" diff --git a/debian/patches-rt/mm-enable-slub.patch b/debian/patches-rt/mm-enable-slub.patch index 8e9b2ab46..061d68965 100644 --- a/debian/patches-rt/mm-enable-slub.patch +++ b/debian/patches-rt/mm-enable-slub.patch @@ -1,7 +1,7 @@ Subject: mm: Enable SLUB for RT From: Thomas Gleixner Date: Thu, 25 Oct 2012 10:32:35 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Avoid the memory allocation in IRQ section diff --git a/debian/patches-rt/mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch b/debian/patches-rt/mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch index d4b6fc03c..5d14de34e 100644 --- a/debian/patches-rt/mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch +++ b/debian/patches-rt/mm-kasan-make-quarantine_lock-a-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Clark Williams Date: Tue, 18 Sep 2018 10:29:31 -0500 Subject: [PATCH] mm/kasan: make quarantine_lock a raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The static lock quarantine_lock is used in quarantine.c to protect the quarantine queue datastructures. It is taken inside quarantine queue diff --git a/debian/patches-rt/mm-make-vmstat-rt-aware.patch b/debian/patches-rt/mm-make-vmstat-rt-aware.patch index 86848a282..b0f50e165 100644 --- a/debian/patches-rt/mm-make-vmstat-rt-aware.patch +++ b/debian/patches-rt/mm-make-vmstat-rt-aware.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:13 -0500 Subject: mm/vmstat: Protect per cpu variables with preempt disable on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch index 638b6cb4b..834760f41 100644 --- a/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ b/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch @@ -1,7 +1,7 @@ From: Yang Shi Subject: mm/memcontrol: Don't call schedule_work_on in preemption disabled context Date: Wed, 30 Oct 2013 11:48:33 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The following trace is triggered when running ltp oom test cases: diff --git a/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch b/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch index 636f02f74..dcf795408 100644 --- a/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch +++ b/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Subject: mm/memcontrol: Replace local_irq_disable with local locks Date: Wed, 28 Jan 2015 17:14:16 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. diff --git a/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch b/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch index 938f605dd..c22df2eb8 100644 --- a/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:37 -0500 Subject: mm: page_alloc: rt-friendly per-cpu pages -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz rt-friendly per-cpu pages: convert the irqs-off per-cpu locking method into a preemptible, explicit-per-cpu-locks method. @@ -45,7 +45,7 @@ Signed-off-by: Thomas Gleixner int page_group_by_mobility_disabled __read_mostly; #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT -@@ -1268,10 +1281,10 @@ static void __free_pages_ok(struct page +@@ -1296,10 +1309,10 @@ static void __free_pages_ok(struct page return; migratetype = get_pfnblock_migratetype(page, pfn); @@ -58,7 +58,7 @@ Signed-off-by: Thomas Gleixner } static void __init __free_pages_boot_core(struct page *page, unsigned int order) -@@ -2539,13 +2552,13 @@ void drain_zone_pages(struct zone *zone, +@@ -2560,13 +2573,13 @@ void drain_zone_pages(struct zone *zone, int to_drain, batch; LIST_HEAD(dst); @@ -74,7 +74,7 @@ Signed-off-by: Thomas Gleixner if (to_drain > 0) free_pcppages_bulk(zone, &dst, false); -@@ -2567,7 +2580,7 @@ static void drain_pages_zone(unsigned in +@@ -2588,7 +2601,7 @@ static void drain_pages_zone(unsigned in LIST_HEAD(dst); int count; @@ -83,7 +83,7 @@ Signed-off-by: Thomas Gleixner pset = per_cpu_ptr(zone->pageset, cpu); pcp = &pset->pcp; -@@ -2575,7 +2588,7 @@ static void drain_pages_zone(unsigned in +@@ -2596,7 +2609,7 @@ static void drain_pages_zone(unsigned in if (count) isolate_pcp_pages(count, pcp, &dst); @@ -92,7 +92,7 @@ Signed-off-by: Thomas Gleixner if (count) free_pcppages_bulk(zone, &dst, false); -@@ -2613,6 +2626,7 @@ void drain_local_pages(struct zone *zone +@@ -2634,6 +2647,7 @@ void drain_local_pages(struct zone *zone drain_pages(cpu); } @@ -100,7 +100,7 @@ Signed-off-by: Thomas Gleixner static void drain_local_pages_wq(struct work_struct *work) { /* -@@ -2626,6 +2640,7 @@ static void drain_local_pages_wq(struct +@@ -2647,6 +2661,7 @@ static void drain_local_pages_wq(struct drain_local_pages(NULL); preempt_enable(); } @@ -108,7 +108,7 @@ Signed-off-by: Thomas Gleixner /* * Spill all the per-cpu pages from all CPUs back into the buddy allocator. -@@ -2692,7 +2707,14 @@ void drain_all_pages(struct zone *zone) +@@ -2713,7 +2728,14 @@ void drain_all_pages(struct zone *zone) else cpumask_clear_cpu(cpu, &cpus_with_pcps); } @@ -124,7 +124,7 @@ Signed-off-by: Thomas Gleixner for_each_cpu(cpu, &cpus_with_pcps) { struct work_struct *work = per_cpu_ptr(&pcpu_drain, cpu); INIT_WORK(work, drain_local_pages_wq); -@@ -2700,6 +2722,7 @@ void drain_all_pages(struct zone *zone) +@@ -2721,6 +2743,7 @@ void drain_all_pages(struct zone *zone) } for_each_cpu(cpu, &cpus_with_pcps) flush_work(per_cpu_ptr(&pcpu_drain, cpu)); @@ -132,7 +132,7 @@ Signed-off-by: Thomas Gleixner mutex_unlock(&pcpu_drain_mutex); } -@@ -2819,9 +2842,9 @@ void free_unref_page(struct page *page) +@@ -2840,9 +2863,9 @@ void free_unref_page(struct page *page) if (!free_unref_page_prepare(page, pfn)) return; @@ -144,7 +144,7 @@ Signed-off-by: Thomas Gleixner if (!list_empty(&dst)) free_pcppages_bulk(zone, &dst, false); } -@@ -2848,7 +2871,7 @@ void free_unref_page_list(struct list_he +@@ -2869,7 +2892,7 @@ void free_unref_page_list(struct list_he set_page_private(page, pfn); } @@ -153,7 +153,7 @@ Signed-off-by: Thomas Gleixner list_for_each_entry_safe(page, next, list, lru) { unsigned long pfn = page_private(page); enum zone_type type; -@@ -2863,12 +2886,12 @@ void free_unref_page_list(struct list_he +@@ -2884,12 +2907,12 @@ void free_unref_page_list(struct list_he * a large list of pages to free. */ if (++batch_count == SWAP_CLUSTER_MAX) { @@ -169,7 +169,7 @@ Signed-off-by: Thomas Gleixner for (i = 0; i < __MAX_NR_ZONES; ) { struct page *page; -@@ -3017,7 +3040,7 @@ static struct page *rmqueue_pcplist(stru +@@ -3038,7 +3061,7 @@ static struct page *rmqueue_pcplist(stru struct page *page; unsigned long flags; @@ -178,7 +178,7 @@ Signed-off-by: Thomas Gleixner pcp = &this_cpu_ptr(zone->pageset)->pcp; list = &pcp->lists[migratetype]; page = __rmqueue_pcplist(zone, migratetype, pcp, list); -@@ -3025,7 +3048,7 @@ static struct page *rmqueue_pcplist(stru +@@ -3046,7 +3069,7 @@ static struct page *rmqueue_pcplist(stru __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); zone_statistics(preferred_zone, zone); } @@ -187,7 +187,7 @@ Signed-off-by: Thomas Gleixner return page; } -@@ -3052,7 +3075,7 @@ struct page *rmqueue(struct zone *prefer +@@ -3073,7 +3096,7 @@ struct page *rmqueue(struct zone *prefer * allocate greater than order-1 page units with __GFP_NOFAIL. */ WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1)); @@ -196,7 +196,7 @@ Signed-off-by: Thomas Gleixner do { page = NULL; -@@ -3072,14 +3095,14 @@ struct page *rmqueue(struct zone *prefer +@@ -3093,14 +3116,14 @@ struct page *rmqueue(struct zone *prefer __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); zone_statistics(preferred_zone, zone); @@ -213,7 +213,7 @@ Signed-off-by: Thomas Gleixner return NULL; } -@@ -8085,7 +8108,7 @@ void zone_pcp_reset(struct zone *zone) +@@ -8094,7 +8117,7 @@ void zone_pcp_reset(struct zone *zone) struct per_cpu_pageset *pset; /* avoid races with drain_pages() */ @@ -222,7 +222,7 @@ Signed-off-by: Thomas Gleixner if (zone->pageset != &boot_pageset) { for_each_online_cpu(cpu) { pset = per_cpu_ptr(zone->pageset, cpu); -@@ -8094,7 +8117,7 @@ void zone_pcp_reset(struct zone *zone) +@@ -8103,7 +8126,7 @@ void zone_pcp_reset(struct zone *zone) free_percpu(zone->pageset); zone->pageset = &boot_pageset; } diff --git a/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch b/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch index 23f9e5b51..977f79e92 100644 --- a/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch +++ b/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch @@ -1,7 +1,7 @@ From: Luiz Capitulino Date: Fri, 27 May 2016 15:03:28 +0200 Subject: [PATCH] mm: perform lru_add_drain_all() remotely -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/mm-protect-activate-switch-mm.patch b/debian/patches-rt/mm-protect-activate-switch-mm.patch index df0bbfa6b..9fd7b9813 100644 --- a/debian/patches-rt/mm-protect-activate-switch-mm.patch +++ b/debian/patches-rt/mm-protect-activate-switch-mm.patch @@ -1,7 +1,7 @@ From: Yong Zhang Date: Tue, 15 May 2012 13:53:56 +0800 Subject: mm: Protect activate_mm() by preempt_[disable&enable]_rt() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz User preempt_*_rt instead of local_irq_*_rt or otherwise there will be warning on ARM like below: diff --git a/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch b/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch index f0ebb528b..11c1530a2 100644 --- a/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch +++ b/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch @@ -1,7 +1,7 @@ Subject: mm, rt: kmap_atomic scheduling From: Peter Zijlstra Date: Thu, 28 Jul 2011 10:43:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch b/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch index ec3ebbaf4..25d62b0d5 100644 --- a/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch +++ b/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:34 -0500 Subject: mm/scatterlist: Do not disable irqs on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz For -RT it is enough to keep pagefault disabled (which is currently handled by kmap_atomic()). diff --git a/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch b/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch index 1d78c7ff5..4d57a6a20 100644 --- a/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch +++ b/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch @@ -1,7 +1,7 @@ Subject: mm/vmalloc: Another preempt disable region which sucks From: Thomas Gleixner Date: Tue, 12 Jul 2011 11:39:36 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Avoid the preempt disable version of get_cpu_var(). The inner-lock should provide enough serialisation. diff --git a/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch b/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch index 0a3b40960..6de9a56d1 100644 --- a/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch +++ b/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Tue, 22 Mar 2016 11:16:09 +0100 Subject: [PATCH] mm/zsmalloc: copy with get_cpu_var() and locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/mutex-no-spin-on-rt.patch b/debian/patches-rt/mutex-no-spin-on-rt.patch index bcc13b6fe..539766a92 100644 --- a/debian/patches-rt/mutex-no-spin-on-rt.patch +++ b/debian/patches-rt/mutex-no-spin-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:51:45 +0200 Subject: locking: Disable spin on owner for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Drop spin on owner for mutex / rwsem. We are most likely not using it but… diff --git a/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch b/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch index 4c45b277a..cd7b04878 100644 --- a/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch +++ b/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch @@ -2,7 +2,7 @@ From: Steven Rostedt Date: Tue, 6 Dec 2016 17:50:30 -0500 Subject: [PATCH] net: Have __napi_schedule_irqoff() disable interrupts on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz A customer hit a crash where the napi sd->poll_list became corrupted. The customer had the bnx2x driver, which does a diff --git a/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch b/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch index 766c397b4..4c54ce148 100644 --- a/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ b/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 17:36:35 +0200 Subject: [PATCH] net/Qdisc: use a seqlock instead seqcount -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/net-add-a-lock-around-icmp_sk.patch b/debian/patches-rt/net-add-a-lock-around-icmp_sk.patch index e1ee6372f..041801a35 100644 --- a/debian/patches-rt/net-add-a-lock-around-icmp_sk.patch +++ b/debian/patches-rt/net-add-a-lock-around-icmp_sk.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 31 Aug 2016 17:54:09 +0200 Subject: [PATCH] net: add a lock around icmp_sk() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/net-add-back-the-missing-serialization-in-ip_send_un.patch b/debian/patches-rt/net-add-back-the-missing-serialization-in-ip_send_un.patch index 85ccb50ed..cbe6595ea 100644 --- a/debian/patches-rt/net-add-back-the-missing-serialization-in-ip_send_un.patch +++ b/debian/patches-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.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 #include #include -@@ -633,6 +634,7 @@ void tcp_v4_send_check(struct sock *sk, +@@ -634,6 +635,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 /* * This routine will send an RST to the other tcp. * -@@ -767,6 +769,7 @@ static void tcp_v4_send_reset(const stru +@@ -768,6 +770,7 @@ static void tcp_v4_send_reset(const stru arg.tos = ip_hdr(skb)->tos; arg.uid = sock_net_uid(net, sk && sk_fullsock(sk) ? sk : NULL); local_bh_disable(); @@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior ctl_sk = *this_cpu_ptr(net->ipv4.tcp_sk); if (sk) ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ? -@@ -779,6 +782,7 @@ static void tcp_v4_send_reset(const stru +@@ -780,6 +783,7 @@ static void tcp_v4_send_reset(const stru ctl_sk->sk_mark = 0; __TCP_INC_STATS(net, TCP_MIB_OUTSEGS); __TCP_INC_STATS(net, TCP_MIB_OUTRSTS); @@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior local_bh_enable(); #ifdef CONFIG_TCP_MD5SIG -@@ -859,6 +863,7 @@ static void tcp_v4_send_ack(const struct +@@ -860,6 +864,7 @@ static void tcp_v4_send_ack(const struct arg.tos = tos; arg.uid = sock_net_uid(net, sk_fullsock(sk) ? sk : NULL); local_bh_disable(); @@ -83,7 +83,7 @@ Signed-off-by: Sebastian Andrzej Siewior ctl_sk = *this_cpu_ptr(net->ipv4.tcp_sk); if (sk) ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ? -@@ -870,6 +875,7 @@ static void tcp_v4_send_ack(const struct +@@ -871,6 +876,7 @@ static void tcp_v4_send_ack(const struct ctl_sk->sk_mark = 0; __TCP_INC_STATS(net, TCP_MIB_OUTSEGS); diff --git a/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch b/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch index e6f99b5f9..3491a8350 100644 --- a/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch +++ b/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Wed, 26 Sep 2012 16:21:08 +0200 Subject: net: Another local_irq_disable/kmalloc headache -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Replace it by a local lock. Though that's pretty inefficient :( @@ -41,7 +41,7 @@ Signed-off-by: Thomas Gleixner return data; } -@@ -408,13 +410,13 @@ struct sk_buff *__netdev_alloc_skb(struc +@@ -412,13 +414,13 @@ struct sk_buff *__netdev_alloc_skb(struc if (sk_memalloc_socks()) gfp_mask |= __GFP_MEMALLOC; diff --git a/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch b/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch index 617d660f6..58e78523b 100644 --- a/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch +++ b/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior 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.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 @@ -26,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask) { -@@ -361,9 +362,13 @@ EXPORT_SYMBOL(netdev_alloc_frag); +@@ -363,9 +364,13 @@ EXPORT_SYMBOL(netdev_alloc_frag); static void *__napi_alloc_frag(unsigned int fragsz, gfp_t gfp_mask) { @@ -42,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior } void *napi_alloc_frag(unsigned int fragsz) -@@ -457,9 +462,10 @@ EXPORT_SYMBOL(__netdev_alloc_skb); +@@ -461,9 +466,10 @@ EXPORT_SYMBOL(__netdev_alloc_skb); struct sk_buff *__napi_alloc_skb(struct napi_struct *napi, unsigned int len, gfp_t gfp_mask) { @@ -54,7 +54,7 @@ Signed-off-by: Sebastian Andrzej Siewior len += NET_SKB_PAD + NET_IP_ALIGN; -@@ -477,7 +483,10 @@ struct sk_buff *__napi_alloc_skb(struct +@@ -481,7 +487,10 @@ struct sk_buff *__napi_alloc_skb(struct if (sk_memalloc_socks()) gfp_mask |= __GFP_MEMALLOC; @@ -65,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (unlikely(!data)) return NULL; -@@ -488,7 +497,7 @@ struct sk_buff *__napi_alloc_skb(struct +@@ -492,7 +501,7 @@ struct sk_buff *__napi_alloc_skb(struct } /* use OR instead of assignment to avoid clearing of bits in mask */ @@ -74,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior skb->pfmemalloc = 1; skb->head_frag = 1; -@@ -720,23 +729,26 @@ void __consume_stateless_skb(struct sk_b +@@ -724,23 +733,26 @@ void __consume_stateless_skb(struct sk_b void __kfree_skb_flush(void) { @@ -103,7 +103,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* record skb to CPU local list */ nc->skb_cache[nc->skb_count++] = skb; -@@ -751,6 +763,7 @@ static inline void _kfree_skb_defer(stru +@@ -755,6 +767,7 @@ static inline void _kfree_skb_defer(stru nc->skb_cache); nc->skb_count = 0; } diff --git a/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch b/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch index cda0ecc23..fc8524c0d 100644 --- a/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch +++ b/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 16 Jun 2017 19:03:16 +0200 Subject: [PATCH] net/core: use local_bh_disable() in netif_rx_ni() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz In 2004 netif_rx_ni() gained a preempt_disable() section around netif_rx() and its do_softirq() + testing for it. The do_softirq() part diff --git a/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch index bec74fb3a..c74718eae 100644 --- a/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ b/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 30 Mar 2016 13:36:29 +0200 Subject: [PATCH] net: dev: always take qdisc's busylock in __dev_xmit_skb() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch b/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch index 581b0b3c8..04874c48a 100644 --- a/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch +++ b/debian/patches-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 Date: Sun, 28 Oct 2012 11:18:08 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The netfilter code relies only on the implicit semantics of local_bh_disable() for serializing wt_write_recseq sections. RT breaks diff --git a/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch b/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch index 364fdc290..a2d3c609f 100644 --- a/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch +++ b/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Mar 2013 18:06:20 +0100 Subject: net: Add a mutex around devnet_rename_seq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch b/debian/patches-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch index ad15bbb6a..45307d010 100644 --- a/debian/patches-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch +++ b/debian/patches-rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Jan 2016 15:55:02 +0100 Subject: net: move xmit_recursion to per-task variable on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 @@ -37,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Time (in jiffies) of last Tx */ -@@ -2605,14 +2609,53 @@ void netdev_freemem(struct net_device *d +@@ -2608,14 +2612,53 @@ void netdev_freemem(struct net_device *d void synchronize_net(void); int init_dummy_netdev(struct net_device *dev); @@ -92,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct net_device *dev_get_by_index(struct net *net, int ifindex); struct net_device *__dev_get_by_index(struct net *net, int ifindex); struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); -@@ -3788,10 +3831,48 @@ static inline u32 netif_msg_init(int deb +@@ -3791,10 +3834,48 @@ static inline u32 netif_msg_init(int deb return (1 << debug_value) - 1; } @@ -142,7 +142,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline bool __netif_tx_acquire(struct netdev_queue *txq) -@@ -3808,32 +3889,32 @@ static inline void __netif_tx_release(st +@@ -3811,32 +3892,32 @@ static inline void __netif_tx_release(st static inline void __netif_tx_lock_bh(struct netdev_queue *txq) { spin_lock_bh(&txq->_xmit_lock); diff --git a/debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch b/debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch index a042b7642..7078e282f 100644 --- a/debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch +++ b/debian/patches-rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 15:39:05 +0100 Subject: net: provide a way to delegate processing a softirq to ksoftirqd -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 @@ -38,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern void raise_softirq(unsigned int nr); --- a/kernel/softirq.c +++ b/kernel/softirq.c -@@ -694,6 +694,27 @@ void __raise_softirq_irqoff(unsigned int +@@ -722,6 +722,27 @@ void __raise_softirq_irqoff(unsigned int } /* diff --git a/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch b/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch index a43541482..02af24684 100644 --- a/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch +++ b/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch @@ -1,7 +1,7 @@ From: Marc Kleine-Budde Date: Wed, 5 Mar 2014 00:49:47 +0100 Subject: net: sched: Use msleep() instead of yield() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/net-use-cpu-chill.patch b/debian/patches-rt/net-use-cpu-chill.patch index 476a37623..e5f2eacc8 100644 --- a/debian/patches-rt/net-use-cpu-chill.patch +++ b/debian/patches-rt/net-use-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: net: Use cpu_chill() instead of cpu_relax() From: Thomas Gleixner Date: Wed, 07 Mar 2012 21:10:04 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/net_disable_NET_RX_BUSY_POLL.patch b/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch index a38097608..2eb67878d 100644 --- a/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch +++ b/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 Subject: net/core: disable NET_RX_BUSY_POLL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz sk_busy_loop() does preempt_disable() followed by a few operations which can take sleeping locks and may get long. diff --git a/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch b/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch index 6b59f8367..7e0076429 100644 --- a/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch +++ b/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 31 Aug 2018 14:16:30 +0200 Subject: [PATCH] of: allocate / free phandle cache outside of the devtree_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The phandle cache code allocates memory while holding devtree_lock which is a raw_spinlock_t. Memory allocation (and free()) is not possible on diff --git a/debian/patches-rt/oleg-signal-rt-fix.patch b/debian/patches-rt/oleg-signal-rt-fix.patch index ceeae0d1f..980395045 100644 --- a/debian/patches-rt/oleg-signal-rt-fix.patch +++ b/debian/patches-rt/oleg-signal-rt-fix.patch @@ -1,7 +1,7 @@ From: Oleg Nesterov Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: signal/x86: Delay calling signals in atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 @@ -90,7 +90,7 @@ Signed-off-by: Thomas Gleixner unsigned int sas_ss_flags; --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -1226,8 +1226,8 @@ int do_send_sig_info(int sig, struct sig +@@ -1268,8 +1268,8 @@ int do_send_sig_info(int sig, struct sig * We don't want to have recursive SIGSEGV's etc, for example, * that is why we also clear SIGNAL_UNKILLABLE. */ @@ -101,7 +101,7 @@ Signed-off-by: Thomas Gleixner { unsigned long int flags; int ret, blocked, ignored; -@@ -1256,6 +1256,39 @@ force_sig_info(int sig, struct siginfo * +@@ -1298,6 +1298,39 @@ force_sig_info(int sig, struct siginfo * return ret; } diff --git a/debian/patches-rt/panic-disable-random-on-rt.patch b/debian/patches-rt/panic-disable-random-on-rt.patch index b9a0a2bea..012711a80 100644 --- a/debian/patches-rt/panic-disable-random-on-rt.patch +++ b/debian/patches-rt/panic-disable-random-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: panic: skip get_random_bytes for RT_FULL in init_oops_id -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Disable on -RT. If this is invoked from irq-context we will have problems to acquire the sleeping lock. diff --git a/debian/patches-rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch b/debian/patches-rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch index b71a34897..76a2326ee 100644 --- a/debian/patches-rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch +++ b/debian/patches-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" Date: Wed, 5 Oct 2011 11:45:18 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Implementing RCU-bh in terms of RCU-preempt makes the system vulnerable to network-based denial-of-service attacks. This patch therefore diff --git a/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch b/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch index e875f196e..f89d68b33 100644 --- a/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch +++ b/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 4 Oct 2017 10:24:23 +0200 Subject: [PATCH] pci/switchtec: Don't use completion's wait queue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The poll callback is using completion's wait_queue_head_t member and puts it in poll_wait() so the poll() caller gets a wakeup after command @@ -97,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret |= EPOLLIN | EPOLLRDNORM; if (stuser->event_cnt != atomic_read(&stdev->event_cnt)) -@@ -1038,7 +1041,8 @@ static void stdev_kill(struct switchtec_ +@@ -1041,7 +1044,8 @@ static void stdev_kill(struct switchtec_ /* Wake up and kill any users waiting on an MRPC request */ list_for_each_entry_safe(stuser, tmpuser, &stdev->mrpc_queue, list) { diff --git a/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch b/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch index f335a16ec..482418272 100644 --- a/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch +++ b/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 11 Oct 2018 16:39:59 +0200 Subject: [PATCH] percpu: include irqflags.h for raw_local_irq_save() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The header percpu.h header file is using raw_local_irq_save() but does not include irqflags.h for its definition. It compiles because the diff --git a/debian/patches-rt/perf-x86-intel-Delay-memory-deallocation-until-cpu_d.patch b/debian/patches-rt/perf-x86-intel-Delay-memory-deallocation-until-cpu_d.patch deleted file mode 100644 index 766cad587..000000000 --- a/debian/patches-rt/perf-x86-intel-Delay-memory-deallocation-until-cpu_d.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: Peter Zijlstra -Date: Wed, 19 Dec 2018 16:46:44 +0100 -Subject: [PATCH] perf/x86/intel: Delay memory deallocation until cpu_dead -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz - -intel_pmu_cpu_prepare() allocated memory for ->shared_regs among other -members of struct cpu_hw_events. This memory is released in -intel_pmu_cpu_dying() which is wrong. The counterpart of the -intel_pmu_cpu_prepare() callback is x86_pmu_dead_cpu(). - -Otherwise if the CPU fails on the UP path between CPUHP_PERF_X86_PREPARE -and CPUHP_AP_PERF_X86_STARTING then it won't release the memory but -allocate new memory on the next attempt to online the CPU (leaking the -old memory). -Also, if the CPU down path fails between CPUHP_AP_PERF_X86_STARTING and -CPUHP_PERF_X86_PREPARE then the CPU will go back online but never -allocate the memory that was released in x86_pmu_dying_cpu(). - -Make the memory allocation/free symmetrical in regard to the CPU hotplug -notifier by moving the deallocation to intel_pmu_cpu_dead(). - -This started in commit - a7e3ed1e47011 ("perf: Add support for supplementary event registers"). - -Cc: stable@vger.kernel.org -Reported-by: He Zhe -Fixes: a7e3ed1e47011 ("perf: Add support for supplementary event registers"). -Signed-off-by: Peter Zijlstra (Intel) -[bigeasy: patch description] -Signed-off-by: Sebastian Andrzej Siewior ---- - arch/x86/events/intel/core.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - ---- a/arch/x86/events/intel/core.c -+++ b/arch/x86/events/intel/core.c -@@ -3440,6 +3440,11 @@ static void free_excl_cntrs(int cpu) - - static void intel_pmu_cpu_dying(int cpu) - { -+ fini_debug_store_on_cpu(cpu); -+} -+ -+static void intel_pmu_cpu_dead(int cpu) -+{ - struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu); - struct intel_shared_regs *pc; - -@@ -3451,8 +3456,6 @@ static void intel_pmu_cpu_dying(int cpu) - } - - free_excl_cntrs(cpu); -- -- fini_debug_store_on_cpu(cpu); - } - - static void intel_pmu_sched_task(struct perf_event_context *ctx, -@@ -3541,6 +3544,7 @@ static __initconst const struct x86_pmu - .cpu_prepare = intel_pmu_cpu_prepare, - .cpu_starting = intel_pmu_cpu_starting, - .cpu_dying = intel_pmu_cpu_dying, -+ .cpu_dead = intel_pmu_cpu_dead, - }; - - static struct attribute *intel_pmu_attrs[]; -@@ -3581,6 +3585,8 @@ static __initconst const struct x86_pmu - .cpu_prepare = intel_pmu_cpu_prepare, - .cpu_starting = intel_pmu_cpu_starting, - .cpu_dying = intel_pmu_cpu_dying, -+ .cpu_dead = intel_pmu_cpu_dead, -+ - .guest_get_msrs = intel_guest_get_msrs, - .sched_task = intel_pmu_sched_task, - }; diff --git a/debian/patches-rt/peter_zijlstra-frob-rcu.patch b/debian/patches-rt/peter_zijlstra-frob-rcu.patch index f6627ba8d..06a3c9ece 100644 --- a/debian/patches-rt/peter_zijlstra-frob-rcu.patch +++ b/debian/patches-rt/peter_zijlstra-frob-rcu.patch @@ -1,7 +1,7 @@ Subject: rcu: Frob softirq test From: Peter Zijlstra Date: Sat Aug 13 00:23:17 CEST 2011 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz With RT_FULL we get the below wreckage: diff --git a/debian/patches-rt/peterz-percpu-rwsem-rt.patch b/debian/patches-rt/peterz-percpu-rwsem-rt.patch index 592c504fc..98d53655d 100644 --- a/debian/patches-rt/peterz-percpu-rwsem-rt.patch +++ b/debian/patches-rt/peterz-percpu-rwsem-rt.patch @@ -1,7 +1,7 @@ Subject: locking/percpu-rwsem: Remove preempt_disable variants From: Peter Zijlstra Date: Wed Nov 23 16:29:32 CET 2016 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Effective revert commit: diff --git a/debian/patches-rt/pid.h-include-atomic.h.patch b/debian/patches-rt/pid.h-include-atomic.h.patch index 946636af2..87ea9fd89 100644 --- a/debian/patches-rt/pid.h-include-atomic.h.patch +++ b/debian/patches-rt/pid.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Grygorii Strashko Date: Tue, 21 Jul 2015 19:43:56 +0300 Subject: pid.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz This patch fixes build error: CC kernel/pid_namespace.o diff --git a/debian/patches-rt/pinctrl-bcm2835-Use-raw-spinlock-for-RT-compatibilit.patch b/debian/patches-rt/pinctrl-bcm2835-Use-raw-spinlock-for-RT-compatibilit.patch deleted file mode 100644 index a09184479..000000000 --- a/debian/patches-rt/pinctrl-bcm2835-Use-raw-spinlock-for-RT-compatibilit.patch +++ /dev/null @@ -1,97 +0,0 @@ -From: Lukas Wunner -Date: Sat, 27 Oct 2018 10:15:33 +0200 -Subject: [PATCH] pinctrl: bcm2835: Use raw spinlock for RT compatibility -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz - -[Upstream commit 71dfaa749f2f7c1722ebf6716d3f797a04528cba] - -The BCM2835 pinctrl driver acquires a spinlock in its ->irq_enable, -->irq_disable and ->irq_set_type callbacks. Spinlocks become sleeping -locks with CONFIG_PREEMPT_RT_FULL=y, therefore invocation of one of the -callbacks in atomic context may cause a hard lockup if at least two GPIO -pins in the same bank are used as interrupts. The issue doesn't occur -with just a single interrupt pin per bank because the lock is never -contended. I'm experiencing such lockups with GPIO 8 and 28 used as -level-triggered interrupts, i.e. with ->irq_disable being invoked on -reception of every IRQ. - -The critical section protected by the spinlock is very small (one bitop -and one RMW of an MMIO register), hence converting to a raw spinlock -seems a better trade-off than converting the driver to threaded IRQ -handling (which would increase latency to handle an interrupt). - -Cc: Mathias Duckeck -Signed-off-by: Lukas Wunner -Acked-by: Julia Cartwright -Signed-off-by: Linus Walleij -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/pinctrl/bcm/pinctrl-bcm2835.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - ---- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c -+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -@@ -90,7 +90,7 @@ struct bcm2835_pinctrl { - struct gpio_chip gpio_chip; - struct pinctrl_gpio_range gpio_range; - -- spinlock_t irq_lock[BCM2835_NUM_BANKS]; -+ raw_spinlock_t irq_lock[BCM2835_NUM_BANKS]; - }; - - /* pins are just named GPIO0..GPIO53 */ -@@ -461,10 +461,10 @@ static void bcm2835_gpio_irq_enable(stru - unsigned bank = GPIO_REG_OFFSET(gpio); - unsigned long flags; - -- spin_lock_irqsave(&pc->irq_lock[bank], flags); -+ raw_spin_lock_irqsave(&pc->irq_lock[bank], flags); - set_bit(offset, &pc->enabled_irq_map[bank]); - bcm2835_gpio_irq_config(pc, gpio, true); -- spin_unlock_irqrestore(&pc->irq_lock[bank], flags); -+ raw_spin_unlock_irqrestore(&pc->irq_lock[bank], flags); - } - - static void bcm2835_gpio_irq_disable(struct irq_data *data) -@@ -476,12 +476,12 @@ static void bcm2835_gpio_irq_disable(str - unsigned bank = GPIO_REG_OFFSET(gpio); - unsigned long flags; - -- spin_lock_irqsave(&pc->irq_lock[bank], flags); -+ raw_spin_lock_irqsave(&pc->irq_lock[bank], flags); - bcm2835_gpio_irq_config(pc, gpio, false); - /* Clear events that were latched prior to clearing event sources */ - bcm2835_gpio_set_bit(pc, GPEDS0, gpio); - clear_bit(offset, &pc->enabled_irq_map[bank]); -- spin_unlock_irqrestore(&pc->irq_lock[bank], flags); -+ raw_spin_unlock_irqrestore(&pc->irq_lock[bank], flags); - } - - static int __bcm2835_gpio_irq_set_type_disabled(struct bcm2835_pinctrl *pc, -@@ -584,7 +584,7 @@ static int bcm2835_gpio_irq_set_type(str - unsigned long flags; - int ret; - -- spin_lock_irqsave(&pc->irq_lock[bank], flags); -+ raw_spin_lock_irqsave(&pc->irq_lock[bank], flags); - - if (test_bit(offset, &pc->enabled_irq_map[bank])) - ret = __bcm2835_gpio_irq_set_type_enabled(pc, gpio, type); -@@ -596,7 +596,7 @@ static int bcm2835_gpio_irq_set_type(str - else - irq_set_handler_locked(data, handle_level_irq); - -- spin_unlock_irqrestore(&pc->irq_lock[bank], flags); -+ raw_spin_unlock_irqrestore(&pc->irq_lock[bank], flags); - - return ret; - } -@@ -1047,7 +1047,7 @@ static int bcm2835_pinctrl_probe(struct - for_each_set_bit(offset, &events, 32) - bcm2835_gpio_wr(pc, GPEDS0 + i * 4, BIT(offset)); - -- spin_lock_init(&pc->irq_lock[i]); -+ raw_spin_lock_init(&pc->irq_lock[i]); - } - - err = gpiochip_add_data(&pc->gpio_chip, pc); diff --git a/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch b/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch index ad0cc93fb..4991f1413 100644 --- a/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch +++ b/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch @@ -1,7 +1,7 @@ From: John Stultz Date: Fri, 3 Jul 2009 08:29:58 -0500 Subject: posix-timers: Thread posix-cpu-timers on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz posix-cpu-timer code takes non -rt safe locks in hard irq context. Move it to a thread. @@ -86,7 +86,7 @@ Signed-off-by: Thomas Gleixner #include "posix-timers.h" -@@ -1135,14 +1138,12 @@ static inline int fastpath_timer_check(s +@@ -1136,14 +1139,12 @@ static inline int fastpath_timer_check(s * already updated our counts. We need to check if any timers fire now. * Interrupts are disabled. */ @@ -102,7 +102,7 @@ Signed-off-by: Thomas Gleixner /* * The fast path checks that there are no expired thread or thread * group timers. If that's so, just return. -@@ -1195,6 +1196,153 @@ void run_posix_cpu_timers(struct task_st +@@ -1196,6 +1197,153 @@ void run_posix_cpu_timers(struct task_st } } diff --git a/debian/patches-rt/power-disable-highmem-on-rt.patch b/debian/patches-rt/power-disable-highmem-on-rt.patch index a69a464b8..4050e77e7 100644 --- a/debian/patches-rt/power-disable-highmem-on-rt.patch +++ b/debian/patches-rt/power-disable-highmem-on-rt.patch @@ -1,7 +1,7 @@ Subject: powerpc: Disable highmem on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:08:34 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The current highmem handling on -RT is not compatible and needs fixups. diff --git a/debian/patches-rt/power-use-generic-rwsem-on-rt.patch b/debian/patches-rt/power-use-generic-rwsem-on-rt.patch index a65b0db61..16f18ce60 100644 --- a/debian/patches-rt/power-use-generic-rwsem-on-rt.patch +++ b/debian/patches-rt/power-use-generic-rwsem-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: powerpc: Use generic rwsem on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Use generic code which uses rtmutex diff --git a/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch index aea8a5e4f..499aa51a8 100644 --- a/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ b/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch @@ -1,7 +1,7 @@ From: Bogdan Purcareata Date: Fri, 24 Apr 2015 15:53:13 +0000 Subject: powerpc/kvm: Disable in-kernel MPIC emulation for PREEMPT_RT_FULL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/powerpc-preempt-lazy-support.patch b/debian/patches-rt/powerpc-preempt-lazy-support.patch index 7e4b16d28..7dfd98492 100644 --- a/debian/patches-rt/powerpc-preempt-lazy-support.patch +++ b/debian/patches-rt/powerpc-preempt-lazy-support.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 1 Nov 2012 10:14:11 +0100 Subject: powerpc: Add support for lazy preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Implement the powerpc pieces for lazy preempt. diff --git a/debian/patches-rt/preempt-lazy-support.patch b/debian/patches-rt/preempt-lazy-support.patch index 9eaf1a488..a7544cec4 100644 --- a/debian/patches-rt/preempt-lazy-support.patch +++ b/debian/patches-rt/preempt-lazy-support.patch @@ -1,7 +1,7 @@ Subject: sched: Add support for lazy preemption From: Thomas Gleixner Date: Fri, 26 Oct 2012 18:50:54 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz It has become an obsession to mitigate the determinism vs. throughput loss of RT. Looking at the mainline semantics of preemption points @@ -451,7 +451,7 @@ Signed-off-by: Thomas Gleixner return; } hrtick_start(rq, delta); -@@ -6613,7 +6613,7 @@ static void check_preempt_wakeup(struct +@@ -6614,7 +6614,7 @@ static void check_preempt_wakeup(struct return; preempt: @@ -460,7 +460,7 @@ Signed-off-by: Thomas Gleixner /* * Only set the backward buddy when the current task is still * on the rq. This can happen when a wakeup gets interleaved -@@ -9700,7 +9700,7 @@ static void task_fork_fair(struct task_s +@@ -9701,7 +9701,7 @@ static void task_fork_fair(struct task_s * 'current' within the tree based on its new key value. */ swap(curr->vruntime, se->vruntime); @@ -469,7 +469,7 @@ Signed-off-by: Thomas Gleixner } se->vruntime -= cfs_rq->min_vruntime; -@@ -9724,7 +9724,7 @@ prio_changed_fair(struct rq *rq, struct +@@ -9725,7 +9725,7 @@ prio_changed_fair(struct rq *rq, struct */ if (rq->curr == p) { if (p->prio > oldprio) diff --git a/debian/patches-rt/preempt-nort-rt-variants.patch b/debian/patches-rt/preempt-nort-rt-variants.patch index 6a2c33dbc..481f22c3e 100644 --- a/debian/patches-rt/preempt-nort-rt-variants.patch +++ b/debian/patches-rt/preempt-nort-rt-variants.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 24 Jul 2009 12:38:56 +0200 Subject: preempt: Provide preempt_*_(no)rt variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch b/debian/patches-rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch index 3a9149827..7eb7d7e0c 100644 --- a/debian/patches-rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch +++ b/debian/patches-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 Date: Fri, 02 Sep 2011 14:41:29 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Gives me an option to screw printk and actually see what the machine says. diff --git a/debian/patches-rt/printk-kill.patch b/debian/patches-rt/printk-kill.patch index 72d854600..f31c685c9 100644 --- a/debian/patches-rt/printk-kill.patch +++ b/debian/patches-rt/printk-kill.patch @@ -1,7 +1,7 @@ Subject: printk: Add a printk kill switch From: Ingo Molnar Date: Fri, 22 Jul 2011 17:58:40 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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. diff --git a/debian/patches-rt/printk-rt-aware.patch b/debian/patches-rt/printk-rt-aware.patch index 4d27abb5d..6490088e3 100644 --- a/debian/patches-rt/printk-rt-aware.patch +++ b/debian/patches-rt/printk-rt-aware.patch @@ -1,7 +1,7 @@ Subject: printk: Make rt aware From: Thomas Gleixner Date: Wed, 19 Sep 2012 14:50:37 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Drop the lock before calling the console driver and do not disable interrupts while printing to a serial console. diff --git a/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch index 16472e62e..ca4d2b18e 100644 --- a/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ b/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 18:21:04 +0200 Subject: ptrace: fix ptrace vs tasklist_lock race -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz As explained by Alexander Fyodorov : diff --git a/debian/patches-rt/radix-tree-use-local-locks.patch b/debian/patches-rt/radix-tree-use-local-locks.patch index 973ef66f9..d1fd5e1a8 100644 --- a/debian/patches-rt/radix-tree-use-local-locks.patch +++ b/debian/patches-rt/radix-tree-use-local-locks.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 25 Jan 2017 16:34:27 +0100 Subject: [PATCH] radix-tree: use local locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The preload functionality uses per-CPU variables and preempt-disable to ensure that it does not switch CPUs during its usage. This patch adds diff --git a/debian/patches-rt/random-avoid-preempt_disable-ed-section.patch b/debian/patches-rt/random-avoid-preempt_disable-ed-section.patch index b7a53db14..097adcd63 100644 --- a/debian/patches-rt/random-avoid-preempt_disable-ed-section.patch +++ b/debian/patches-rt/random-avoid-preempt_disable-ed-section.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 12 May 2017 15:46:17 +0200 Subject: [PATCH] random: avoid preempt_disable()ed section -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz extract_crng() will use sleeping locks while in a preempt_disable() section due to get_cpu_var(). diff --git a/debian/patches-rt/random-make-it-work-on-rt.patch b/debian/patches-rt/random-make-it-work-on-rt.patch index 8e47f4956..054510d62 100644 --- a/debian/patches-rt/random-make-it-work-on-rt.patch +++ b/debian/patches-rt/random-make-it-work-on-rt.patch @@ -1,7 +1,7 @@ Subject: random: Make it work on rt From: Thomas Gleixner Date: Tue, 21 Aug 2012 20:38:50 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq @@ -74,7 +74,7 @@ Signed-off-by: Thomas Gleixner static int hv_ce_set_next_event(unsigned long delta, --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c -@@ -1011,6 +1011,8 @@ static void vmbus_isr(void) +@@ -1042,6 +1042,8 @@ static void vmbus_isr(void) void *page_addr = hv_cpu->synic_event_page; struct hv_message *msg; union hv_synic_event_flags *event; @@ -83,7 +83,7 @@ Signed-off-by: Thomas Gleixner bool handled = false; if (unlikely(page_addr == NULL)) -@@ -1054,7 +1056,7 @@ static void vmbus_isr(void) +@@ -1085,7 +1087,7 @@ static void vmbus_isr(void) tasklet_schedule(&hv_cpu->msg_dpc); } diff --git a/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch b/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch index 9197d6a36..2381b28e4 100644 --- a/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch +++ b/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch @@ -1,7 +1,7 @@ From: "Paul E. McKenney" Date: Mon, 4 Nov 2013 13:21:10 -0800 Subject: rcu: Eliminate softirq processing from rcutree -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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, diff --git a/debian/patches-rt/rcu-disable-rcu-fast-no-hz-on-rt.patch b/debian/patches-rt/rcu-disable-rcu-fast-no-hz-on-rt.patch index 83e495b88..81ebd696f 100644 --- a/debian/patches-rt/rcu-disable-rcu-fast-no-hz-on-rt.patch +++ b/debian/patches-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 Date: Sun, 28 Oct 2012 13:26:09 +0000 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz This uses a timer_list timer from the irq disabled guts of the idle code. Disable it for now to prevent wreckage. diff --git a/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch b/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch index 3adabb5a9..e528eb568 100644 --- a/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch +++ b/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Wed, 12 Oct 2016 11:21:14 -0500 Subject: [PATCH] rcu: enable rcu_normal_after_boot by default for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The forcing of an expedited grace period is an expensive and very RT-application unfriendly operation, as it forcibly preempts all running diff --git a/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch b/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch index 80a05bc81..3934c4892 100644 --- a/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch +++ b/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 21 Mar 2014 20:19:05 +0100 Subject: rcu: make RCU_BOOST default on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch b/debian/patches-rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch index 4f8f30ef8..d257c6a51 100644 --- a/debian/patches-rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch +++ b/debian/patches-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 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The Linux kernel has long RCU-bh read-side critical sections that intolerably increase scheduling latency under mainline's RCU-bh rules, diff --git a/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch b/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch index f3b7e7e1e..db988e03d 100644 --- a/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch +++ b/debian/patches-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 Date: Sat, 1 Oct 2011 18:58:13 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Without this patch, ARM can not use SPLIT_PTLOCK_CPUS if PREEMPT_RT_FULL=y because vectors_user_mapping() creates a diff --git a/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch b/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch index 607858b45..071e7940d 100644 --- a/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch +++ b/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch @@ -1,7 +1,7 @@ From: Daniel Bristot de Oliveira Date: Mon, 26 Jun 2017 17:07:15 +0200 Subject: rt: Increase/decrease the nr of migratory tasks when enabling/disabling migration -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz There is a problem in the migrate_disable()/enable() implementation regarding the number of migratory tasks in the rt/dl RQs. The problem diff --git a/debian/patches-rt/rt-introduce-cpu-chill.patch b/debian/patches-rt/rt-introduce-cpu-chill.patch index 7f7ec7531..222b6ff51 100644 --- a/debian/patches-rt/rt-introduce-cpu-chill.patch +++ b/debian/patches-rt/rt-introduce-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: rt: Introduce cpu_chill() From: Thomas Gleixner Date: Wed, 07 Mar 2012 20:51:03 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/rt-local-irq-lock.patch b/debian/patches-rt/rt-local-irq-lock.patch index 66d41ebe6..fe3ecdc33 100644 --- a/debian/patches-rt/rt-local-irq-lock.patch +++ b/debian/patches-rt/rt-local-irq-lock.patch @@ -1,7 +1,7 @@ Subject: rt: Add local irq locks From: Thomas Gleixner Date: Mon, 20 Jun 2011 09:03:47 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/rt-preempt-base-config.patch b/debian/patches-rt/rt-preempt-base-config.patch index fea34ed1b..ef0bd33a8 100644 --- a/debian/patches-rt/rt-preempt-base-config.patch +++ b/debian/patches-rt/rt-preempt-base-config.patch @@ -1,7 +1,7 @@ Subject: rt: Provide PREEMPT_RT_BASE config switch From: Thomas Gleixner Date: Fri, 17 Jun 2011 12:39:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/rt-serial-warn-fix.patch b/debian/patches-rt/rt-serial-warn-fix.patch index 1a426243e..b5153a6ce 100644 --- a/debian/patches-rt/rt-serial-warn-fix.patch +++ b/debian/patches-rt/rt-serial-warn-fix.patch @@ -1,7 +1,7 @@ Subject: rt: Improve the serial console PASS_LIMIT From: Ingo Molnar Date: Wed Dec 14 13:05:54 CET 2011 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Beyond the warning: diff --git a/debian/patches-rt/rtmutex-Make-lock_killable-work.patch b/debian/patches-rt/rtmutex-Make-lock_killable-work.patch index d5ffe8a5f..88ab19581 100644 --- a/debian/patches-rt/rtmutex-Make-lock_killable-work.patch +++ b/debian/patches-rt/rtmutex-Make-lock_killable-work.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sat, 1 Apr 2017 12:50:59 +0200 Subject: [PATCH] rtmutex: Make lock_killable work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. diff --git a/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch b/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch index 921e414da..97db9479a 100644 --- a/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ b/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:14:22 +0200 Subject: rtmutex: Provide rt_mutex_slowlock_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. diff --git a/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch b/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch index b065e6670..50f39f0a1 100644 --- a/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:17:03 +0200 Subject: rtmutex: add mutex implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch b/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch index 569c2f4e7..253bf7be4 100644 --- a/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:18:06 +0200 Subject: rtmutex: add rwlock implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The implementation is bias-based, similar to the rwsem implementation. diff --git a/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch b/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch index 1b0def40d..92dfe7722 100644 --- a/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:28:34 +0200 Subject: rtmutex: add rwsem implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The RT specific R/W semaphore implementation restricts the number of readers to one because a writer cannot block on multiple readers and inherit its diff --git a/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch b/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch index d9f578b94..8f72cc874 100644 --- a/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch +++ b/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:11:19 +0200 Subject: rtmutex: add sleeping lock implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior @@ -426,7 +426,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * On PREEMPT_RT_FULL, when hb->lock becomes an rt_mutex, we must not -@@ -3222,7 +3223,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3230,7 +3231,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. */ @@ -1042,7 +1042,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * rt_mutex_init_proxy_locked - initialize and lock a rt_mutex on behalf of a -@@ -1923,6 +2268,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -1949,6 +2294,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m struct hrtimer_sleeper *to, struct rt_mutex_waiter *waiter) { @@ -1050,7 +1050,7 @@ Signed-off-by: Sebastian Andrzej Siewior int ret; raw_spin_lock_irq(&lock->wait_lock); -@@ -1934,6 +2280,24 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -1960,6 +2306,24 @@ int rt_mutex_wait_proxy_lock(struct rt_m * have to fix that up. */ fixup_rt_mutex_waiters(lock); diff --git a/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch index df05f09fa..f1b8f90d4 100644 --- a/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ b/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 17:34:38 +0200 Subject: rtmutex: add ww_mutex addon for mutex-rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Signed-off-by: Sebastian Andrzej Siewior --- @@ -295,7 +295,7 @@ Signed-off-by: Sebastian Andrzej Siewior rt_mutex_slowlock); if (ret) mutex_release(&lock->dep_map, 1, _RET_IP_); -@@ -2274,7 +2423,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -2300,7 +2449,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m raw_spin_lock_irq(&lock->wait_lock); /* sleep on the mutex */ set_current_state(TASK_INTERRUPTIBLE); @@ -304,7 +304,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * try_to_take_rt_mutex() sets the waiter bit unconditionally. We might * have to fix that up. -@@ -2358,3 +2507,99 @@ bool rt_mutex_cleanup_proxy_lock(struct +@@ -2385,3 +2534,99 @@ bool rt_mutex_cleanup_proxy_lock(struct return cleanup; } diff --git a/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch b/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch index 46784417c..e5d2c3017 100644 --- a/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch +++ b/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:25:13 +0200 Subject: [PATCH] rtmutex: annotate sleeping lock context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The RCU code complains on schedule() within a rcu_readlock() section. The valid scenario on -RT is if a sleeping is held. In order to suppress diff --git a/debian/patches-rt/rtmutex-avoid-include-hell.patch b/debian/patches-rt/rtmutex-avoid-include-hell.patch index d406f4f54..a72c441fe 100644 --- a/debian/patches-rt/rtmutex-avoid-include-hell.patch +++ b/debian/patches-rt/rtmutex-avoid-include-hell.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Avoid include hell From: Thomas Gleixner Date: Wed, 29 Jun 2011 20:06:39 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch b/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch index 1fd5b2c85..3e1a81b09 100644 --- a/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch +++ b/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:36:39 +0200 Subject: rtmutex: export lockdep-less version of rt_mutex's lock, trylock and unlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Required for lock implementation ontop of rtmutex. diff --git a/debian/patches-rt/rtmutex-futex-prepare-rt.patch b/debian/patches-rt/rtmutex-futex-prepare-rt.patch index a36db15b7..7cc99053c 100644 --- a/debian/patches-rt/rtmutex-futex-prepare-rt.patch +++ b/debian/patches-rt/rtmutex-futex-prepare-rt.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Handle the various new futex race conditions From: Thomas Gleixner Date: Fri, 10 Jun 2011 11:04:15 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 @@ -33,7 +33,7 @@ Signed-off-by: Thomas Gleixner } else if (ret) { /* * rt_mutex_start_proxy_lock() detected a -@@ -3183,7 +3193,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3191,7 +3201,7 @@ static int futex_wait_requeue_pi(u32 __u struct hrtimer_sleeper timeout, *to = NULL; struct futex_pi_state *pi_state = NULL; struct rt_mutex_waiter rt_waiter; @@ -42,7 +42,7 @@ Signed-off-by: Thomas Gleixner union futex_key key2 = FUTEX_KEY_INIT; struct futex_q q = futex_q_init; int res, ret; -@@ -3241,20 +3251,55 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3249,20 +3259,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 /* Check if the requeue code acquired the second futex for us. */ if (!q.rt_waiter) { -@@ -3263,7 +3308,8 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3271,7 +3316,8 @@ 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)) { @@ -119,7 +119,7 @@ Signed-off-by: Thomas Gleixner ret = fixup_pi_state_owner(uaddr2, &q, current); if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) { pi_state = q.pi_state; -@@ -3274,7 +3320,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3282,7 +3328,7 @@ static int futex_wait_requeue_pi(u32 __u * the requeue_pi() code acquired for us. */ put_pi_state(q.pi_state); @@ -128,7 +128,7 @@ Signed-off-by: Thomas Gleixner } } else { struct rt_mutex *pi_mutex; -@@ -3288,7 +3334,8 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3296,7 +3342,8 @@ static int futex_wait_requeue_pi(u32 __u pi_mutex = &q.pi_state->pi_mutex; ret = rt_mutex_wait_proxy_lock(pi_mutex, to, &rt_waiter); diff --git a/debian/patches-rt/rtmutex-lock-killable.patch b/debian/patches-rt/rtmutex-lock-killable.patch index 50a3bfa1e..6d9d7a669 100644 --- a/debian/patches-rt/rtmutex-lock-killable.patch +++ b/debian/patches-rt/rtmutex-lock-killable.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Add rtmutex_lock_killable() From: Thomas Gleixner Date: Thu, 09 Jun 2011 11:43:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch b/debian/patches-rt/rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch index fdbed1011..00b6166da 100644 --- a/debian/patches-rt/rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch +++ b/debian/patches-rt/rtmutex-rwlock-preserve-state-like-a-sleeping-lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 11 Jan 2019 21:16:31 +0100 Subject: [PATCH] rtmutex/rwlock: preserve state like a sleeping lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The rwlock is spinning while acquiring a lock. Therefore it must become a sleeping lock on RT and preserve its task state while sleeping and diff --git a/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch b/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch index fc790358d..7204f5b20 100644 --- a/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch +++ b/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed 02 Dec 2015 11:34:07 +0100 Subject: rtmutex: trylock is okay on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/rtmutex-wire-up-RT-s-locking.patch b/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch index a115095c6..1119da9f0 100644 --- a/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch +++ b/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:31:14 +0200 Subject: rtmutex: wire up RT's locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches-rt/rtmutex_dont_include_rcu.patch b/debian/patches-rt/rtmutex_dont_include_rcu.patch index 1a35531c8..3d474536e 100644 --- a/debian/patches-rt/rtmutex_dont_include_rcu.patch +++ b/debian/patches-rt/rtmutex_dont_include_rcu.patch @@ -1,6 +1,6 @@ From: Sebastian Andrzej Siewior Subject: rbtree: don't include the rcu header -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The RCU header pulls in spinlock.h and fails due not yet defined types: diff --git a/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch b/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch index 4c4327ae0..419e7ba02 100644 --- a/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch +++ b/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Sun, 19 Aug 2018 08:28:35 +0200 Subject: [PATCH] sched: Allow pinned user tasks to be awakened to the CPU they pinned -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Since commit 7af443ee16976 ("sched/core: Require cpu_active() in select_task_rq(), for user tasks") select_fallback_rq() will BUG() if diff --git a/debian/patches-rt/sched-delay-put-task.patch b/debian/patches-rt/sched-delay-put-task.patch index b0628fdc8..e57e04cb3 100644 --- a/debian/patches-rt/sched-delay-put-task.patch +++ b/debian/patches-rt/sched-delay-put-task.patch @@ -1,7 +1,7 @@ Subject: sched: Move task_struct cleanup to RCU From: Thomas Gleixner Date: Tue, 31 May 2011 16:59:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz __put_task_struct() does quite some expensive work. We don't want to burden random tasks with that. diff --git a/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch b/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch index 4ff6ec141..32cd533ae 100644 --- a/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch +++ b/debian/patches-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 Date: Mon, 18 Jul 2011 17:03:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Carsten reported problems when running: diff --git a/debian/patches-rt/sched-disable-ttwu-queue.patch b/debian/patches-rt/sched-disable-ttwu-queue.patch index ea5627802..dd2a96542 100644 --- a/debian/patches-rt/sched-disable-ttwu-queue.patch +++ b/debian/patches-rt/sched-disable-ttwu-queue.patch @@ -1,7 +1,7 @@ Subject: sched: Disable TTWU_QUEUE on RT From: Thomas Gleixner Date: Tue, 13 Sep 2011 16:42:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch b/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch index 3363cd285..db7259638 100644 --- a/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch +++ b/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 8 Jan 2019 12:31:06 +0100 Subject: [PATCH] sched/fair: Make the hrtimers non-hard again -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Since commit "sched/fair: Robustify CFS-bandwidth timer locking" both hrtimer can run in softirq context because now interrupts are disabled diff --git a/debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch b/debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch index 2c6aecdcd..1d5acef09 100644 --- a/debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch +++ b/debian/patches-rt/sched-fair-Robustify-CFS-bandwidth-timer-locking.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra Date: Mon, 7 Jan 2019 13:52:31 +0100 Subject: [PATCH] sched/fair: Robustify CFS-bandwidth timer locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Traditionally hrtimer callbacks were run with IRQs disabled, but with the introduction of HRTIMER_MODE_SOFT it is possible they run from diff --git a/debian/patches-rt/sched-limit-nr-migrate.patch b/debian/patches-rt/sched-limit-nr-migrate.patch index ed1968f57..50d0b9cc7 100644 --- a/debian/patches-rt/sched-limit-nr-migrate.patch +++ b/debian/patches-rt/sched-limit-nr-migrate.patch @@ -1,7 +1,7 @@ Subject: sched: Limit the number of task migrations per batch From: Thomas Gleixner Date: Mon, 06 Jun 2011 12:12:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/sched-might-sleep-do-not-account-rcu-depth.patch b/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch index 46a49e4b6..f309adbbd 100644 --- a/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch +++ b/debian/patches-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 Date: Tue, 07 Jun 2011 09:19:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz RT changes the rcu_preempt_depth semantics, so we cannot check for it in might_sleep(). diff --git a/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch b/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch index b778b5543..a47fe8dad 100644 --- a/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch +++ b/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 9 Oct 2018 17:34:50 +0200 Subject: [PATCH] sched/migrate_disable: Add export_symbol_gpl for __migrate_disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Jonathan reported that lttng/modules can't use __migrate_disabled(). This function is only used by sched/core itself and the tracing diff --git a/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch b/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch index 5589fd6b2..ddb277c93 100644 --- a/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch +++ b/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 5 Jul 2018 14:44:51 +0200 Subject: [PATCH] sched/migrate_disable: fallback to preempt_disable() instead barrier() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz On SMP + !RT migrate_disable() is still around. It is not part of spin_lock() anymore so it has almost no users. However the futex code has a workaround for diff --git a/debian/patches-rt/sched-mmdrop-delayed.patch b/debian/patches-rt/sched-mmdrop-delayed.patch index e91f26e02..83b82f549 100644 --- a/debian/patches-rt/sched-mmdrop-delayed.patch +++ b/debian/patches-rt/sched-mmdrop-delayed.patch @@ -1,7 +1,7 @@ Subject: sched: Move mmdrop to RCU on RT From: Thomas Gleixner Date: Mon, 06 Jun 2011 12:20:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Takes sleeping locks and calls into the memory allocator, so nothing we want to do in task switch and oder atomic contexts. diff --git a/debian/patches-rt/sched-rt-mutex-wakeup.patch b/debian/patches-rt/sched-rt-mutex-wakeup.patch index c988b8334..2d1c73314 100644 --- a/debian/patches-rt/sched-rt-mutex-wakeup.patch +++ b/debian/patches-rt/sched-rt-mutex-wakeup.patch @@ -1,7 +1,7 @@ Subject: sched: Add saved_state for tasks blocked on sleeping locks From: Thomas Gleixner Date: Sat, 25 Jun 2011 09:21:04 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch b/debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch index 26f1d0d92..f3ba3897e 100644 --- a/debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch +++ b/debian/patches-rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Mon, 18 Mar 2013 15:12:49 -0400 Subject: sched/workqueue: Only wake up idle workers if not blocked on sleeping spin lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/scsi-fcoe-rt-aware.patch b/debian/patches-rt/scsi-fcoe-rt-aware.patch index de5604c62..c1f6dceaa 100644 --- a/debian/patches-rt/scsi-fcoe-rt-aware.patch +++ b/debian/patches-rt/scsi-fcoe-rt-aware.patch @@ -1,7 +1,7 @@ Subject: scsi/fcoe: Make RT aware. From: Thomas Gleixner Date: Sat, 12 Nov 2011 14:00:48 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. diff --git a/debian/patches-rt/seqlock-prevent-rt-starvation.patch b/debian/patches-rt/seqlock-prevent-rt-starvation.patch index ef42d9637..64f00a505 100644 --- a/debian/patches-rt/seqlock-prevent-rt-starvation.patch +++ b/debian/patches-rt/seqlock-prevent-rt-starvation.patch @@ -1,7 +1,7 @@ Subject: seqlock: Prevent rt starvation From: Thomas Gleixner Date: Wed, 22 Feb 2012 12:03:30 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/series b/debian/patches-rt/series index 38f477688..40166035d 100644 --- a/debian/patches-rt/series +++ b/debian/patches-rt/series @@ -22,7 +22,6 @@ irqchip-gic-v3-its-Move-pending-table-allocation-to-.patch kthread-convert-worker-lock-to-raw-spinlock.patch -pinctrl-bcm2835-Use-raw-spinlock-for-RT-compatibilit.patch crypto-caam-qi-simplify-CGR-allocation-freeing.patch sched-fair-Robustify-CFS-bandwidth-timer-locking.patch @@ -37,7 +36,6 @@ cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch fscache-initialize-cookie-hash-table-raw-spinlocks.patch Drivers-hv-vmbus-include-header-for-get_irq_regs.patch percpu-include-irqflags.h-for-raw_local_irq_save.patch -perf-x86-intel-Delay-memory-deallocation-until-cpu_d.patch ############################################################ # Ready for posting @@ -225,6 +223,8 @@ softirq-split-locks.patch net-core-use-local_bh_disable-in-netif_rx_ni.patch irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch softirq-split-timer-softirqs-out-of-ksoftirqd.patch +softirq-Avoid-local_softirq_pending-messages-if-ksof.patch +softirq-Avoid-local_softirq_pending-messages-if-task.patch rtmutex-trylock-is-okay-on-RT.patch # compile fix due to rtmutex locks @@ -300,6 +300,8 @@ md-raid5-percpu-handling-rt-aware.patch # CPU CHILL rt-introduce-cpu-chill.patch +hrtimer-Don-t-lose-state-in-cpu_chill.patch +hrtimer-cpu_chill-save-task-state-in-saved_state.patch # block block-blk-mq-move-blk_queue_usage_counter_release-in.patch @@ -397,6 +399,8 @@ lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch preempt-lazy-support.patch ftrace-Fix-trace-header-alignment.patch x86-preempt-lazy.patch +x86-lazy-preempt-properly-check-against-preempt-mask.patch +x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch arm-preempt-lazy-support.patch powerpc-preempt-lazy-support.patch arch-arm64-Add-lazy-preempt-support.patch diff --git a/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch b/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch index 93e0b1120..fbca7a0b1 100644 --- a/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch +++ b/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch @@ -1,7 +1,7 @@ Subject: signal: Revert ptrace preempt magic From: Thomas Gleixner Date: Wed, 21 Sep 2011 19:57:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more than a bandaid around the ptrace design trainwreck. It's not a @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -2052,15 +2052,7 @@ static void ptrace_stop(int exit_code, i +@@ -2094,15 +2094,7 @@ static void ptrace_stop(int exit_code, i if (gstop_done && ptrace_reparented(current)) do_notify_parent_cldstop(current, false, why); diff --git a/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch index 47b664062..5b7834030 100644 --- a/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:56 -0500 Subject: signals: Allow rt tasks to cache one sigqueue struct -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. @@ -188,7 +188,7 @@ Signed-off-by: Thomas Gleixner /* We only dequeue private signals from ourselves, we don't let * signalfd steal them */ -@@ -1705,7 +1765,8 @@ EXPORT_SYMBOL(kill_pid); +@@ -1747,7 +1807,8 @@ EXPORT_SYMBOL(kill_pid); */ struct sigqueue *sigqueue_alloc(void) { diff --git a/debian/patches-rt/skbufhead-raw-lock.patch b/debian/patches-rt/skbufhead-raw-lock.patch index ebb0a6171..0b11c4d51 100644 --- a/debian/patches-rt/skbufhead-raw-lock.patch +++ b/debian/patches-rt/skbufhead-raw-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 12 Jul 2011 15:38:34 +0200 Subject: net: Use skbufhead with raw lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 @@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -2967,6 +2967,7 @@ struct softnet_data { +@@ -2970,6 +2970,7 @@ struct softnet_data { unsigned int dropped; struct sk_buff_head input_pkt_queue; struct napi_struct backlog; @@ -134,7 +134,7 @@ Signed-off-by: Thomas Gleixner for (;;) { struct napi_struct *n; -@@ -9304,10 +9317,13 @@ static int dev_cpu_dead(unsigned int old +@@ -9307,10 +9320,13 @@ static int dev_cpu_dead(unsigned int old netif_rx_ni(skb); input_queue_head_incr(oldsd); } @@ -149,7 +149,7 @@ Signed-off-by: Thomas Gleixner return 0; } -@@ -9616,8 +9632,9 @@ static int __init net_dev_init(void) +@@ -9619,8 +9635,9 @@ static int __init net_dev_init(void) INIT_WORK(flush, flush_backlog); diff --git a/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch b/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch index ec51b528a..a2f91c11a 100644 --- a/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch +++ b/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 15 Apr 2015 19:00:47 +0200 Subject: slub: Disable SLUB_CPU_PARTIAL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 --- a/init/Kconfig +++ b/init/Kconfig -@@ -1697,7 +1697,7 @@ config SLAB_FREELIST_HARDENED +@@ -1698,7 +1698,7 @@ config SLAB_FREELIST_HARDENED config SLUB_CPU_PARTIAL default y diff --git a/debian/patches-rt/slub-enable-irqs-for-no-wait.patch b/debian/patches-rt/slub-enable-irqs-for-no-wait.patch index df2e54a8d..b9f3e9aba 100644 --- a/debian/patches-rt/slub-enable-irqs-for-no-wait.patch +++ b/debian/patches-rt/slub-enable-irqs-for-no-wait.patch @@ -1,7 +1,7 @@ Subject: slub: Enable irqs for __GFP_WAIT From: Thomas Gleixner Date: Wed, 09 Jan 2013 12:08:15 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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. diff --git a/debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-ksof.patch b/debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-ksof.patch new file mode 100644 index 000000000..737571f93 --- /dev/null +++ b/debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-ksof.patch @@ -0,0 +1,106 @@ +From: Sebastian Andrzej Siewior +Date: Mon, 18 Feb 2019 13:19:59 +0100 +Subject: [PATCH] softirq: Avoid "local_softirq_pending" messages if + ksoftirqd is blocked +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz + +If the ksoftirqd thread has a softirq pending and is blocked on the +`local_softirq_locks' lock then softirq_check_pending_idle() won't +complain because the "lock owner" will mask away this softirq from the +mask of pending softirqs. +If ksoftirqd has an additional softirq pending then it won't be masked +out because we never look at ksoftirqd's mask. + +If there are still pending softirqs while going to idle check +ksoftirqd's and ktimersfotd's mask before complaining about unhandled +softirqs. + +Cc: stable-rt@vger.kernel.org +Tested-by: Juri Lelli +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/softirq.c | 57 +++++++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 41 insertions(+), 16 deletions(-) + +--- a/kernel/softirq.c ++++ b/kernel/softirq.c +@@ -92,6 +92,31 @@ static inline void softirq_clr_runner(un + sr->runner[sirq] = NULL; + } + ++static bool softirq_check_runner_tsk(struct task_struct *tsk, ++ unsigned int *pending) ++{ ++ bool ret = false; ++ ++ if (!tsk) ++ return ret; ++ ++ /* ++ * The wakeup code in rtmutex.c wakes up the task ++ * _before_ it sets pi_blocked_on to NULL under ++ * tsk->pi_lock. So we need to check for both: state ++ * and pi_blocked_on. ++ */ ++ raw_spin_lock(&tsk->pi_lock); ++ if (tsk->pi_blocked_on || tsk->state == TASK_RUNNING) { ++ /* Clear all bits pending in that task */ ++ *pending &= ~(tsk->softirqs_raised); ++ ret = true; ++ } ++ raw_spin_unlock(&tsk->pi_lock); ++ ++ return ret; ++} ++ + /* + * On preempt-rt a softirq running context might be blocked on a + * lock. There might be no other runnable task on this CPU because the +@@ -104,6 +129,7 @@ static inline void softirq_clr_runner(un + */ + void softirq_check_pending_idle(void) + { ++ struct task_struct *tsk; + static int rate_limit; + struct softirq_runner *sr = this_cpu_ptr(&softirq_runners); + u32 warnpending; +@@ -113,24 +139,23 @@ void softirq_check_pending_idle(void) + return; + + warnpending = local_softirq_pending() & SOFTIRQ_STOP_IDLE_MASK; ++ if (!warnpending) ++ return; + for (i = 0; i < NR_SOFTIRQS; i++) { +- struct task_struct *tsk = sr->runner[i]; ++ tsk = sr->runner[i]; ++ ++ if (softirq_check_runner_tsk(tsk, &warnpending)) ++ warnpending &= ~(1 << i); ++ } + +- /* +- * The wakeup code in rtmutex.c wakes up the task +- * _before_ it sets pi_blocked_on to NULL under +- * tsk->pi_lock. So we need to check for both: state +- * and pi_blocked_on. +- */ +- if (tsk) { +- raw_spin_lock(&tsk->pi_lock); +- if (tsk->pi_blocked_on || tsk->state == TASK_RUNNING) { +- /* Clear all bits pending in that task */ +- warnpending &= ~(tsk->softirqs_raised); +- warnpending &= ~(1 << i); +- } +- raw_spin_unlock(&tsk->pi_lock); +- } ++ if (warnpending) { ++ tsk = __this_cpu_read(ksoftirqd); ++ softirq_check_runner_tsk(tsk, &warnpending); ++ } ++ ++ if (warnpending) { ++ tsk = __this_cpu_read(ktimer_softirqd); ++ softirq_check_runner_tsk(tsk, &warnpending); + } + + if (warnpending) { diff --git a/debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-task.patch b/debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-task.patch new file mode 100644 index 000000000..22426dd95 --- /dev/null +++ b/debian/patches-rt/softirq-Avoid-local_softirq_pending-messages-if-task.patch @@ -0,0 +1,35 @@ +From: Sebastian Andrzej Siewior +Date: Tue, 19 Feb 2019 16:49:29 +0100 +Subject: [PATCH] softirq: Avoid "local_softirq_pending" messages if task + is in cpu_chill() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz + +If the softirq thread enters cpu_chill() then ->state is UNINTERRUPTIBLE +and has no ->pi_blocked_on set and so its mask is not taken into account. + +->sleeping_lock is increased by cpu_chill() since it is also requried to +avoid a splat by RCU in case cpu_chill() is used while a RCU-read lock +is held. Use the same mechanism for the softirq-pending check. + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/softirq.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/kernel/softirq.c ++++ b/kernel/softirq.c +@@ -105,9 +105,12 @@ static bool softirq_check_runner_tsk(str + * _before_ it sets pi_blocked_on to NULL under + * tsk->pi_lock. So we need to check for both: state + * and pi_blocked_on. ++ * The test against UNINTERRUPTIBLE + ->sleeping_lock is in case the ++ * task does cpu_chill(). + */ + raw_spin_lock(&tsk->pi_lock); +- if (tsk->pi_blocked_on || tsk->state == TASK_RUNNING) { ++ if (tsk->pi_blocked_on || tsk->state == TASK_RUNNING || ++ (tsk->state == TASK_UNINTERRUPTIBLE && tsk->sleeping_lock)) { + /* Clear all bits pending in that task */ + *pending &= ~(tsk->softirqs_raised); + ret = true; diff --git a/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch b/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch index 42ef8c3d0..b77c261f5 100644 --- a/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch +++ b/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch @@ -1,7 +1,7 @@ Subject: softirq: Disable softirq stacks for RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 13:59:17 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. diff --git a/debian/patches-rt/softirq-preempt-fix-3-re.patch b/debian/patches-rt/softirq-preempt-fix-3-re.patch index 3327cd7e9..521f79f20 100644 --- a/debian/patches-rt/softirq-preempt-fix-3-re.patch +++ b/debian/patches-rt/softirq-preempt-fix-3-re.patch @@ -1,7 +1,7 @@ Subject: softirq: Check preemption after reenabling interrupts From: Thomas Gleixner Date: Sun, 13 Nov 2011 17:17:09 +0100 (CET) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz raise_softirq_irqoff() disables interrupts and wakes the softirq daemon, but after reenabling interrupts there is no preemption check, @@ -159,7 +159,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(__napi_schedule); -@@ -9286,6 +9292,7 @@ static int dev_cpu_dead(unsigned int old +@@ -9289,6 +9295,7 @@ static int dev_cpu_dead(unsigned int old raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); diff --git a/debian/patches-rt/softirq-split-locks.patch b/debian/patches-rt/softirq-split-locks.patch index 4909250c7..df2ad6cab 100644 --- a/debian/patches-rt/softirq-split-locks.patch +++ b/debian/patches-rt/softirq-split-locks.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 04 Oct 2012 14:20:47 +0100 Subject: softirq: Split softirq locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch b/debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch index e01bcabe9..ddaaefcb9 100644 --- a/debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch +++ b/debian/patches-rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 16:34:17 +0100 Subject: softirq: split timer softirqs out of ksoftirqd -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/spinlock-types-separate-raw.patch b/debian/patches-rt/spinlock-types-separate-raw.patch index 227641ae3..7f5ab53f3 100644 --- a/debian/patches-rt/spinlock-types-separate-raw.patch +++ b/debian/patches-rt/spinlock-types-separate-raw.patch @@ -1,7 +1,7 @@ Subject: spinlock: Split the lock types header From: Thomas Gleixner Date: Wed, 29 Jun 2011 19:34:01 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch b/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch index 48dd0c249..46cd252ba 100644 --- a/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch +++ b/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch @@ -2,7 +2,7 @@ From: Julia Cartwright Date: Mon, 7 May 2018 08:58:57 -0500 Subject: [PATCH] squashfs: make use of local lock in multi_cpu decompressor -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Currently, the squashfs multi_cpu decompressor makes use of get_cpu_ptr()/put_cpu_ptr(), which unconditionally disable preemption diff --git a/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch b/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch index aee500155..5c8f3f3e6 100644 --- a/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch +++ b/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 18:37:12 +0200 Subject: [PATCH] srcu: replace local_irqsave() with a locallock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz There are two instances which disable interrupts in order to become a stable this_cpu_ptr() pointer. The restore part is coupled with diff --git a/debian/patches-rt/srcu-use-cpu_online-instead-custom-check.patch b/debian/patches-rt/srcu-use-cpu_online-instead-custom-check.patch index 2432091e9..d3e30bba6 100644 --- a/debian/patches-rt/srcu-use-cpu_online-instead-custom-check.patch +++ b/debian/patches-rt/srcu-use-cpu_online-instead-custom-check.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 14:43:41 +0200 Subject: [PATCH] srcu: use cpu_online() instead custom check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The current check via srcu_online is slightly racy because after looking at srcu_online there could be an interrupt that interrupted us long diff --git a/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch index 19da84d08..f37d35c08 100644 --- a/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ b/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Wed, 18 Feb 2015 16:05:28 +0100 Subject: sunrpc: Make svc_xprt_do_enqueue() use get_cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/sysfs-realtime-entry.patch b/debian/patches-rt/sysfs-realtime-entry.patch index ff9a9d879..c322a0400 100644 --- a/debian/patches-rt/sysfs-realtime-entry.patch +++ b/debian/patches-rt/sysfs-realtime-entry.patch @@ -1,7 +1,7 @@ Subject: sysfs: Add /sys/kernel/realtime entry From: Clark Williams Date: Sat Jul 30 21:55:53 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Add a /sys/kernel entry to indicate that the kernel is a realtime kernel. diff --git a/debian/patches-rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch b/debian/patches-rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch index 24adce719..fc7fc9907 100644 --- a/debian/patches-rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch +++ b/debian/patches-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 Date: Tue Nov 29 20:18:22 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads, and spinlocks turn are mutexes. But this can cause issues with diff --git a/debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch b/debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch index 06f217492..a5faf5dce 100644 --- a/debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch +++ b/debian/patches-rt/thermal-Defer-thermal-wakups-to-threads.patch @@ -1,7 +1,7 @@ From: Daniel Wagner Date: Tue, 17 Feb 2015 09:37:44 +0100 Subject: thermal: Defer thermal wakups to threads -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz On RT the spin lock in pkg_temp_thermal_platfrom_thermal_notify will call schedule while we run in irq context. diff --git a/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch b/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch index 0b7bfe236..f53264a82 100644 --- a/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch +++ b/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 15 Nov 2017 17:29:51 +0100 Subject: [PATCH] time/hrtimer: avoid schedule_work() with interrupts disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz The NOHZ code tries to schedule a workqueue with interrupts disabled. Since this does not work -RT I am switching it to swork instead. diff --git a/debian/patches-rt/timekeeping-split-jiffies-lock.patch b/debian/patches-rt/timekeeping-split-jiffies-lock.patch index 0fb7d3750..8350e4446 100644 --- a/debian/patches-rt/timekeeping-split-jiffies-lock.patch +++ b/debian/patches-rt/timekeeping-split-jiffies-lock.patch @@ -1,7 +1,7 @@ Subject: timekeeping: Split jiffies seqlock From: Thomas Gleixner Date: Thu, 14 Feb 2013 22:36:59 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Replace jiffies_lock seqlock with a simple seqcounter and a rawlock so it can be taken in atomic context on RT. @@ -130,7 +130,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c -@@ -2415,8 +2415,10 @@ EXPORT_SYMBOL(hardpps); +@@ -2417,8 +2417,10 @@ EXPORT_SYMBOL(hardpps); */ void xtime_update(unsigned long ticks) { diff --git a/debian/patches-rt/timers-prepare-for-full-preemption.patch b/debian/patches-rt/timers-prepare-for-full-preemption.patch index 885785aec..36c82dd8b 100644 --- a/debian/patches-rt/timers-prepare-for-full-preemption.patch +++ b/debian/patches-rt/timers-prepare-for-full-preemption.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 Subject: timers: Prepare for full preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/tpm_tis-fix-stall-after-iowrite-s.patch b/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch index 26e858b79..1f7b046a3 100644 --- a/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch +++ b/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch @@ -1,7 +1,7 @@ From: Haris Okanovic Date: Tue, 15 Aug 2017 15:13:08 -0500 Subject: [PATCH] tpm_tis: fix stall after iowrite*()s -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz ioread8() operations to TPM MMIO addresses can stall the cpu when immediately following a sequence of iowrite*()'s to the same region. diff --git a/debian/patches-rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch b/debian/patches-rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch index 48cf4ccd4..1f5b83cf2 100644 --- a/debian/patches-rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch +++ b/debian/patches-rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Apr 2016 16:55:02 +0200 Subject: [PATCH] tty: serial: 8250: don't take the trylock during oops -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch b/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch index 6795aa1a2..730815778 100644 --- a/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch +++ b/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch @@ -4,7 +4,7 @@ Subject: [PATCH] tty: serial: pl011: explicitly initialize the flags variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Silence the following gcc warning: diff --git a/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch b/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch index fb636f77a..0d994719f 100644 --- a/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch +++ b/debian/patches-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 Date: Thu, 17 May 2012 09:35:11 +0530 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz 1)enqueue_to_backlog() (called from netif_rx) should be bind to a particluar CPU. This can be achieved by diff --git a/debian/patches-rt/usb-do-not-disable-interrupts-in-giveback.patch b/debian/patches-rt/usb-do-not-disable-interrupts-in-giveback.patch index 3d15273d1..0902e2b10 100644 --- a/debian/patches-rt/usb-do-not-disable-interrupts-in-giveback.patch +++ b/debian/patches-rt/usb-do-not-disable-interrupts-in-giveback.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 8 Nov 2013 17:34:54 +0100 Subject: usb: do no disable interrupts in giveback -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Since commit 94dfd7ed ("USB: HCD: support giveback of URB in tasklet context") the USB code disables interrupts before invoking the complete diff --git a/debian/patches-rt/wait.h-include-atomic.h.patch b/debian/patches-rt/wait.h-include-atomic.h.patch index eaf96a317..c17407a86 100644 --- a/debian/patches-rt/wait.h-include-atomic.h.patch +++ b/debian/patches-rt/wait.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 28 Oct 2013 12:19:57 +0100 Subject: wait.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz | CC init/main.o |In file included from include/linux/mmzone.h:9:0, diff --git a/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch b/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch index 02e260b1b..92ea6ad85 100644 --- a/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch +++ b/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Fri, 28 Sep 2018 21:03:51 +0000 Subject: [PATCH] watchdog: prevent deferral of watchdogd wakeup on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz When PREEMPT_RT_FULL is enabled, all hrtimer expiry functions are deferred for execution into the context of ktimersoftd unless otherwise diff --git a/debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch b/debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch index e30f5dee8..a08d3d520 100644 --- a/debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch +++ b/debian/patches-rt/work-queue-work-around-irqsafe-timer-optimization.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Mon, 01 Jul 2013 11:02:42 +0200 Subject: workqueue: Prevent workqueue versus ata-piix livelock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/work-simple-Simple-work-queue-implemenation.patch b/debian/patches-rt/work-simple-Simple-work-queue-implemenation.patch index 2ba90537f..2176fd4bf 100644 --- a/debian/patches-rt/work-simple-Simple-work-queue-implemenation.patch +++ b/debian/patches-rt/work-simple-Simple-work-queue-implemenation.patch @@ -1,7 +1,7 @@ From: Daniel Wagner Date: Fri, 11 Jul 2014 15:26:11 +0200 Subject: work-simple: Simple work queue implemenation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch b/debian/patches-rt/work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch index 50754288f..143a5b629 100644 --- a/debian/patches-rt/work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch +++ b/debian/patches-rt/work-simple-drop-a-shit-statement-in-SWORK_EVENT_PEN.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 10 Sep 2018 18:00:31 +0200 Subject: [PATCH] work-simple: drop a shit statement in SWORK_EVENT_PENDING -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Dan Carpenter reported | smatch warnings: diff --git a/debian/patches-rt/workqueue-distangle-from-rq-lock.patch b/debian/patches-rt/workqueue-distangle-from-rq-lock.patch index 97112b635..e6922d9ef 100644 --- a/debian/patches-rt/workqueue-distangle-from-rq-lock.patch +++ b/debian/patches-rt/workqueue-distangle-from-rq-lock.patch @@ -22,7 +22,7 @@ Cc: Jens Axboe Cc: Linus Torvalds Link: http://lkml.kernel.org/r/20110622174919.135236139@linutronix.de Signed-off-by: Thomas Gleixner -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz [bigeasy: preempt_disable() around wq_worker_sleeping() by Daniel Bristot de Oliveira] diff --git a/debian/patches-rt/workqueue-prevent-deadlock-stall.patch b/debian/patches-rt/workqueue-prevent-deadlock-stall.patch index 4bf9fb148..f376d5f42 100644 --- a/debian/patches-rt/workqueue-prevent-deadlock-stall.patch +++ b/debian/patches-rt/workqueue-prevent-deadlock-stall.patch @@ -1,7 +1,7 @@ Subject: workqueue: Prevent deadlock/stall on RT From: Thomas Gleixner Date: Fri, 27 Jun 2014 16:24:52 +0200 (CEST) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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. diff --git a/debian/patches-rt/workqueue-use-locallock.patch b/debian/patches-rt/workqueue-use-locallock.patch index 30b0103bf..cddd0ab4c 100644 --- a/debian/patches-rt/workqueue-use-locallock.patch +++ b/debian/patches-rt/workqueue-use-locallock.patch @@ -1,7 +1,7 @@ Subject: workqueue: Use local irq lock instead of irq disable regions From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:42:26 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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. diff --git a/debian/patches-rt/workqueue-use-rcu.patch b/debian/patches-rt/workqueue-use-rcu.patch index fd4e457aa..66c6f9986 100644 --- a/debian/patches-rt/workqueue-use-rcu.patch +++ b/debian/patches-rt/workqueue-use-rcu.patch @@ -1,7 +1,7 @@ Subject: workqueue: Use normal rcu From: Thomas Gleixner Date: Wed, 24 Jul 2013 15:26:54 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 diff --git a/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch b/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch index 48d4a0a78..482b45f7f 100644 --- a/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch +++ b/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch @@ -1,7 +1,7 @@ Subject: x86: crypto: Reduce preempt disabled regions From: Peter Zijlstra Date: Mon, 14 Nov 2011 18:19:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/x86-efi-drop-task_lock-from-efi_switch_mm.patch b/debian/patches-rt/x86-efi-drop-task_lock-from-efi_switch_mm.patch index e17c5324d..803ded331 100644 --- a/debian/patches-rt/x86-efi-drop-task_lock-from-efi_switch_mm.patch +++ b/debian/patches-rt/x86-efi-drop-task_lock-from-efi_switch_mm.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 24 Jul 2018 14:48:55 +0200 Subject: [PATCH] x86/efi: drop task_lock() from efi_switch_mm() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz efi_switch_mm() is a wrapper around switch_mm() which saves current's ->active_mm, sets the requests mm as ->active_mm and invokes diff --git a/debian/patches-rt/x86-fpu-Disable-preemption-around-local_bh_disable.patch b/debian/patches-rt/x86-fpu-Disable-preemption-around-local_bh_disable.patch index b9bbc5f15..facdc2765 100644 --- a/debian/patches-rt/x86-fpu-Disable-preemption-around-local_bh_disable.patch +++ b/debian/patches-rt/x86-fpu-Disable-preemption-around-local_bh_disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 11 Dec 2018 15:10:33 +0100 Subject: [PATCH] x86/fpu: Disable preemption around local_bh_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz __fpu__restore_sig() restores the content of the FPU state in the CPUs and in order to avoid concurency it disbles BH. On !RT it also disables diff --git a/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch b/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch index 5f6f82820..49540de2f 100644 --- a/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch +++ b/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 17:09:55 +0100 Subject: x86/highmem: Add a "already used pte" check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz This is a copy from kmap_atomic_prot(). diff --git a/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch b/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch index e5f6eaf19..a42ae24cc 100644 --- a/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch +++ b/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Tue, 17 Jul 2018 18:25:31 +0200 Subject: [PATCH] x86/ioapic: Don't let setaffinity unmask threaded EOI interrupt too early -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz There is an issue with threaded interrupts which are marked ONESHOT and using the fasteoi handler. diff --git a/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch b/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch index 36ff61b9b..3b601e815 100644 --- a/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch +++ b/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch @@ -1,7 +1,7 @@ Subject: x86: kvm Require const tsc for RT From: Thomas Gleixner Date: Sun, 06 Nov 2011 12:26:18 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -6692,6 +6692,13 @@ int kvm_arch_init(void *opaque) +@@ -6698,6 +6698,13 @@ int kvm_arch_init(void *opaque) goto out; } diff --git a/debian/patches-rt/x86-lazy-preempt-properly-check-against-preempt-mask.patch b/debian/patches-rt/x86-lazy-preempt-properly-check-against-preempt-mask.patch new file mode 100644 index 000000000..15ddaeb2d --- /dev/null +++ b/debian/patches-rt/x86-lazy-preempt-properly-check-against-preempt-mask.patch @@ -0,0 +1,26 @@ +From: Sebastian Andrzej Siewior +Date: Mon, 18 Feb 2019 16:57:09 +0100 +Subject: [PATCH] x86: lazy-preempt: properly check against preempt-mask +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz + +should_resched() should check against preempt_offset after unmasking the +need-resched-bit. Otherwise should_resched() won't work for +preempt_offset != 0 and lazy-preempt set. + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/x86/include/asm/preempt.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/include/asm/preempt.h ++++ b/arch/x86/include/asm/preempt.h +@@ -118,7 +118,7 @@ static __always_inline bool should_resch + + /* preempt count == 0 ? */ + tmp &= ~PREEMPT_NEED_RESCHED; +- if (tmp) ++ if (tmp != preempt_offset) + return false; + if (current_thread_info()->preempt_lazy_count) + return false; diff --git a/debian/patches-rt/x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch b/debian/patches-rt/x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch new file mode 100644 index 000000000..927d7efb1 --- /dev/null +++ b/debian/patches-rt/x86-lazy-preempt-use-proper-return-label-on-32bit-x8.patch @@ -0,0 +1,38 @@ +From: Sebastian Andrzej Siewior +Date: Tue, 26 Feb 2019 14:53:49 +0100 +Subject: [PATCH] x86: lazy-preempt: use proper return label on 32bit-x86 +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz + +The lazy-preempt uses the wrong return label in case preemption isn't +possible. This results crash while returning to the kernel. + +Use the correct return label if preemption isn' possible. + +Reported-by: Andri Yngvason +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/x86/entry/entry_32.S | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/x86/entry/entry_32.S ++++ b/arch/x86/entry/entry_32.S +@@ -773,15 +773,15 @@ ENTRY(resume_kernel) + + # atleast preempt count == 0 ? + cmpl $_PREEMPT_ENABLED,PER_CPU_VAR(__preempt_count) +- jne restore_all ++ jne restore_all_kernel + + movl PER_CPU_VAR(current_task), %ebp + cmpl $0,TASK_TI_preempt_lazy_count(%ebp) # non-zero preempt_lazy_count ? +- jnz restore_all ++ jnz restore_all_kernel + + testl $_TIF_NEED_RESCHED_LAZY, TASK_TI_flags(%ebp) +- jz restore_all +- test_int_off: ++ jz restore_all_kernel ++test_int_off: + #endif + testl $X86_EFLAGS_IF, PT_EFLAGS(%esp) # interrupts off (exception path) ? + jz restore_all_kernel diff --git a/debian/patches-rt/x86-mm-pat-disable-preemption-__split_large_page-aft.patch b/debian/patches-rt/x86-mm-pat-disable-preemption-__split_large_page-aft.patch index bc505892b..40acd0a12 100644 --- a/debian/patches-rt/x86-mm-pat-disable-preemption-__split_large_page-aft.patch +++ b/debian/patches-rt/x86-mm-pat-disable-preemption-__split_large_page-aft.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 11 Dec 2018 21:53:43 +0100 Subject: [PATCH] x86/mm/pat: disable preemption __split_large_page() after spin_lock() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Commit "x86/mm/pat: Disable preemption around __flush_tlb_all()" added a warning if __flush_tlb_all() is invoked in preemptible context. On !RT diff --git a/debian/patches-rt/x86-preempt-lazy.patch b/debian/patches-rt/x86-preempt-lazy.patch index 45c7ee510..4963a186a 100644 --- a/debian/patches-rt/x86-preempt-lazy.patch +++ b/debian/patches-rt/x86-preempt-lazy.patch @@ -1,7 +1,7 @@ Subject: x86: Support for lazy preemption From: Thomas Gleixner Date: Thu, 01 Nov 2012 11:03:47 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Implement the x86 pieces for lazy preempt. diff --git a/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch b/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch index cda9a0fa6..8e51799b4 100644 --- a/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch +++ b/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch @@ -1,7 +1,7 @@ From: Yang Shi Date: Thu, 10 Dec 2015 10:58:51 -0800 Subject: x86/signal: delay calling signals on 32bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz When running some ptrace single step tests on x86-32 machine, the below problem is triggered: diff --git a/debian/patches-rt/x86-stackprot-no-random-on-rt.patch b/debian/patches-rt/x86-stackprot-no-random-on-rt.patch index 0715035e5..2fc8772cc 100644 --- a/debian/patches-rt/x86-stackprot-no-random-on-rt.patch +++ b/debian/patches-rt/x86-stackprot-no-random-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 16 Dec 2010 14:25:18 +0100 Subject: x86: stackprotector: Avoid random pool on rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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-rt/x86-use-gen-rwsem-spinlocks-rt.patch b/debian/patches-rt/x86-use-gen-rwsem-spinlocks-rt.patch index fe7bd36b2..355dc4a7a 100644 --- a/debian/patches-rt/x86-use-gen-rwsem-spinlocks-rt.patch +++ b/debian/patches-rt/x86-use-gen-rwsem-spinlocks-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 26 Jul 2009 02:21:32 +0200 Subject: x86: Use generic rwsem_spinlocks on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.15-rt12.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.tar.xz Simplifies the separation of anon_rw_semaphores and rw_semaphores for -rt.