diff --git a/debian/changelog b/debian/changelog index ee353dfc5..558586ef2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -509,6 +509,16 @@ linux (4.14.7-1) UNRELEASED; urgency=medium [ Vagrant Cascadian ] * [armhf, arm64] Backport patches from 4.15.x to support dwmac-sun8i. + [ Ben Hutchings ] + * [rt] Update to 4.14.6-rt7: + - hrtimer: account for migrated timers + - crypto: mcryptd: protect the per-CPU queue with a lock + - tracing: Update inter-event hist trigger support to v7: + + Rename virtual "$common_timestamp" field to "common_timestamp" + + Fix use-after-free in trigger removal + - mm/slub: close possible memory-leak in kmem_cache_alloc_bulk() + - crypto: limit more FPU-enabled sections + -- Salvatore Bonaccorso Sun, 03 Dec 2017 10:18:39 +0100 linux (4.14.2-1) unstable; urgency=medium diff --git a/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch b/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch index 907f361bf..e535dc45a 100644 --- a/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch +++ b/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:38:42 +0100 Subject: [PATCH 01/36] timers: Use static keys for migrate_enable/nohz_active -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The members migrate_enable and nohz_active in the timer/hrtimer per CPU bases have been introduced to avoid accessing global variables for these diff --git a/debian/patches/features/all/rt/0001-tracing-Move-hist-trigger-Documentation-to-histogram.patch b/debian/patches/features/all/rt/0001-tracing-Move-hist-trigger-Documentation-to-histogram.patch index 2747a45b0..4ea07b7ad 100644 --- a/debian/patches/features/all/rt/0001-tracing-Move-hist-trigger-Documentation-to-histogram.patch +++ b/debian/patches/features/all/rt/0001-tracing-Move-hist-trigger-Documentation-to-histogram.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:40 -0600 +Date: Wed, 6 Dec 2017 16:37:42 -0600 Subject: [PATCH 01/37] tracing: Move hist trigger Documentation to histogram.txt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The hist trigger Documentation takes up a large part of events.txt - since it will be getting even larger, move it to a separate file. diff --git a/debian/patches/features/all/rt/0001-tracing-Steve-s-unofficial-trace_recursive_lock-patc.patch b/debian/patches/features/all/rt/0001-tracing-Steve-s-unofficial-trace_recursive_lock-patc.patch index aca441c6c..065b291b5 100644 --- a/debian/patches/features/all/rt/0001-tracing-Steve-s-unofficial-trace_recursive_lock-patc.patch +++ b/debian/patches/features/all/rt/0001-tracing-Steve-s-unofficial-trace_recursive_lock-patc.patch @@ -2,7 +2,7 @@ From: Steven Rostedt Date: Fri, 22 Sep 2017 14:58:15 -0500 Subject: [PATCH 01/42] tracing: Steve's unofficial trace_recursive_lock() patch -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On Tue, 5 Sep 2017 16:57:52 -0500 Tom Zanussi wrote: diff --git a/debian/patches/features/all/rt/0002-hrtimer-Correct-blantanly-wrong-comment.patch b/debian/patches/features/all/rt/0002-hrtimer-Correct-blantanly-wrong-comment.patch index 271e261db..1a4565b24 100644 --- a/debian/patches/features/all/rt/0002-hrtimer-Correct-blantanly-wrong-comment.patch +++ b/debian/patches/features/all/rt/0002-hrtimer-Correct-blantanly-wrong-comment.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:38:43 +0100 Subject: [PATCH 02/36] hrtimer: Correct blantanly wrong comment -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The protection of a hrtimer which runs its callback against migration to a different CPU has nothing to do with hard interrupt context. diff --git a/debian/patches/features/all/rt/0002-tracing-Add-Documentation-for-log2-modifier.patch b/debian/patches/features/all/rt/0002-tracing-Add-Documentation-for-log2-modifier.patch index 8e12ef1f5..22b8d13d2 100644 --- a/debian/patches/features/all/rt/0002-tracing-Add-Documentation-for-log2-modifier.patch +++ b/debian/patches/features/all/rt/0002-tracing-Add-Documentation-for-log2-modifier.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:41 -0600 +Date: Wed, 6 Dec 2017 16:37:43 -0600 Subject: [PATCH 02/37] tracing: Add Documentation for log2 modifier -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add a line for the log2 modifier, to keep it aligned with tracing/README. diff --git a/debian/patches/features/all/rt/0002-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch b/debian/patches/features/all/rt/0002-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch index f9b0925e3..c67fec3db 100644 --- a/debian/patches/features/all/rt/0002-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch +++ b/debian/patches/features/all/rt/0002-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch @@ -2,7 +2,7 @@ From: "Steven Rostedt (VMware)" Date: Fri, 22 Sep 2017 14:58:16 -0500 Subject: [PATCH 02/42] tracing: Reverse the order of trace_types_lock and event_mutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz In order to make future changes where we need to call tracing_set_clock() from within an event command, the order of diff --git a/debian/patches/features/all/rt/0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch b/debian/patches/features/all/rt/0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch index ee3501703..9186cb294 100644 --- a/debian/patches/features/all/rt/0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch +++ b/debian/patches/features/all/rt/0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:40 +0200 Subject: [PATCH 03/36] hrtimer: Fix kerneldoc for struct hrtimer_cpu_base -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The sequence '/**' marks the start of a struct description. Add the missing second asterisk. While at it adapt the ordering of the struct diff --git a/debian/patches/features/all/rt/0003-tracing-Add-support-to-detect-and-avoid-duplicates.patch b/debian/patches/features/all/rt/0003-tracing-Add-support-to-detect-and-avoid-duplicates.patch index 85e8ad5e8..a66d3ccf8 100644 --- a/debian/patches/features/all/rt/0003-tracing-Add-support-to-detect-and-avoid-duplicates.patch +++ b/debian/patches/features/all/rt/0003-tracing-Add-support-to-detect-and-avoid-duplicates.patch @@ -1,7 +1,7 @@ From: Vedang Patel -Date: Fri, 17 Nov 2017 14:32:42 -0600 +Date: Wed, 6 Dec 2017 16:37:44 -0600 Subject: [PATCH 03/37] tracing: Add support to detect and avoid duplicates -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz A duplicate in the tracing_map hash table is when 2 different entries have the same key and, as a result, the key_hash. This is possible due diff --git a/debian/patches/features/all/rt/0003-tracing-Exclude-generic-fields-from-histograms.patch b/debian/patches/features/all/rt/0003-tracing-Exclude-generic-fields-from-histograms.patch index 2d483dbf4..683996d93 100644 --- a/debian/patches/features/all/rt/0003-tracing-Exclude-generic-fields-from-histograms.patch +++ b/debian/patches/features/all/rt/0003-tracing-Exclude-generic-fields-from-histograms.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:17 -0500 Subject: [PATCH 03/42] tracing: Exclude 'generic fields' from histograms -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz There are a small number of 'generic fields' (comm/COMM/cpu/CPU) that are found by trace_find_event_field() but are only meant for diff --git a/debian/patches/features/all/rt/0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch b/debian/patches/features/all/rt/0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch index 873045b81..c2e719866 100644 --- a/debian/patches/features/all/rt/0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch +++ b/debian/patches/features/all/rt/0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:41 +0200 Subject: [PATCH 04/36] hrtimer: Cleanup clock argument in schedule_hrtimeout_range_clock() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz schedule_hrtimeout_range_clock() uses an integer for the clock id instead of the predefined type "clockid_t". The ID of the clock is diff --git a/debian/patches/features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch b/debian/patches/features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch index 6044bc4e3..380b185c0 100644 --- a/debian/patches/features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch +++ b/debian/patches/features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch @@ -1,7 +1,7 @@ From: Vedang Patel -Date: Fri, 17 Nov 2017 14:32:43 -0600 +Date: Wed, 6 Dec 2017 16:37:45 -0600 Subject: [PATCH 04/37] tracing: Remove code which merges duplicates -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz We now have the logic to detect and remove duplicates in the tracing_map hash table. The code which merges duplicates in the diff --git a/debian/patches/features/all/rt/0004-tracing-Remove-lookups-from-tracing_map-hitcount.patch b/debian/patches/features/all/rt/0004-tracing-Remove-lookups-from-tracing_map-hitcount.patch index 463888660..4ba01f7ce 100644 --- a/debian/patches/features/all/rt/0004-tracing-Remove-lookups-from-tracing_map-hitcount.patch +++ b/debian/patches/features/all/rt/0004-tracing-Remove-lookups-from-tracing_map-hitcount.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:18 -0500 Subject: [PATCH 04/42] tracing: Remove lookups from tracing_map hitcount -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Lookups inflate the hitcount, making it essentially useless. Only inserts and updates should really affect the hitcount anyway, so diff --git a/debian/patches/features/all/rt/0005-hrtimer-Fix-hrtimer-function-description.patch b/debian/patches/features/all/rt/0005-hrtimer-Fix-hrtimer-function-description.patch index 1f6fe340b..cbb0f96d8 100644 --- a/debian/patches/features/all/rt/0005-hrtimer-Fix-hrtimer-function-description.patch +++ b/debian/patches/features/all/rt/0005-hrtimer-Fix-hrtimer-function-description.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:42 +0200 Subject: [PATCH 05/36] hrtimer: Fix hrtimer function description -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The hrtimer_start[_range_ns]() starts a timer reliable on this CPU only when HRTIMER_MODE_PINNED is set. Furthermore the HRTIMER_MODE_PINNED mode diff --git a/debian/patches/features/all/rt/0005-ring-buffer-Add-interface-for-setting-absolute-time-.patch b/debian/patches/features/all/rt/0005-ring-buffer-Add-interface-for-setting-absolute-time-.patch index 34697198f..8b4965254 100644 --- a/debian/patches/features/all/rt/0005-ring-buffer-Add-interface-for-setting-absolute-time-.patch +++ b/debian/patches/features/all/rt/0005-ring-buffer-Add-interface-for-setting-absolute-time-.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:44 -0600 +Date: Wed, 6 Dec 2017 16:37:46 -0600 Subject: [PATCH 05/37] ring-buffer: Add interface for setting absolute time stamps -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Define a new function, tracing_set_time_stamp_abs(), which can be used to enable or disable the use of absolute timestamps rather than time diff --git a/debian/patches/features/all/rt/0005-tracing-Increase-tracing-map-KEYS_MAX-size.patch b/debian/patches/features/all/rt/0005-tracing-Increase-tracing-map-KEYS_MAX-size.patch index 10bcee88d..408a29c8b 100644 --- a/debian/patches/features/all/rt/0005-tracing-Increase-tracing-map-KEYS_MAX-size.patch +++ b/debian/patches/features/all/rt/0005-tracing-Increase-tracing-map-KEYS_MAX-size.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:19 -0500 Subject: [PATCH 05/42] tracing: Increase tracing map KEYS_MAX size -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The current default for the number of subkeys in a compound key is 2, which is too restrictive. Increase it to a more realistic value of 3. diff --git a/debian/patches/features/all/rt/0006-hrtimer-Ensure-POSIX-compliance-relative-CLOCK_REALT.patch b/debian/patches/features/all/rt/0006-hrtimer-Ensure-POSIX-compliance-relative-CLOCK_REALT.patch index 58d83ce7d..8a4a3fb71 100644 --- a/debian/patches/features/all/rt/0006-hrtimer-Ensure-POSIX-compliance-relative-CLOCK_REALT.patch +++ b/debian/patches/features/all/rt/0006-hrtimer-Ensure-POSIX-compliance-relative-CLOCK_REALT.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:43 +0200 Subject: [PATCH 06/36] hrtimer: Ensure POSIX compliance (relative CLOCK_REALTIME hrtimers) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz POSIX specification defines, that relative CLOCK_REALTIME timers are not affected by clock modifications. Those timers have to use CLOCK_MONOTONIC diff --git a/debian/patches/features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch b/debian/patches/features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch index 4ebcca750..a93616533 100644 --- a/debian/patches/features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch +++ b/debian/patches/features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:45 -0600 +Date: Wed, 6 Dec 2017 16:37:47 -0600 Subject: [PATCH 06/37] ring-buffer: Redefine the unimplemented RINGBUF_TYPE_TIME_STAMP -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz RINGBUF_TYPE_TIME_STAMP is defined but not used, and from what I can gather was reserved for something like an absolute timestamp feature diff --git a/debian/patches/features/all/rt/0006-tracing-Make-traceprobe-parsing-code-reusable.patch b/debian/patches/features/all/rt/0006-tracing-Make-traceprobe-parsing-code-reusable.patch index 4b9cb2385..64f826992 100644 --- a/debian/patches/features/all/rt/0006-tracing-Make-traceprobe-parsing-code-reusable.patch +++ b/debian/patches/features/all/rt/0006-tracing-Make-traceprobe-parsing-code-reusable.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:20 -0500 Subject: [PATCH 06/42] tracing: Make traceprobe parsing code reusable -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz traceprobe_probes_write() and traceprobe_command() actually contain nothing that ties them to kprobes - the code is generically useful for diff --git a/debian/patches/features/all/rt/0007-hrtimer-Cleanup-hrtimer_mode-enum.patch b/debian/patches/features/all/rt/0007-hrtimer-Cleanup-hrtimer_mode-enum.patch index 7384c9dbc..fb6c28e07 100644 --- a/debian/patches/features/all/rt/0007-hrtimer-Cleanup-hrtimer_mode-enum.patch +++ b/debian/patches/features/all/rt/0007-hrtimer-Cleanup-hrtimer_mode-enum.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:44 +0200 Subject: [PATCH 07/36] hrtimer: Cleanup hrtimer_mode enum -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz It's not obvious that the HRTIMER_MODE variants are bit combinations because all modes are hard coded constants. diff --git a/debian/patches/features/all/rt/0007-tracing-Add-timestamp_mode-trace-file.patch b/debian/patches/features/all/rt/0007-tracing-Add-timestamp_mode-trace-file.patch index c83d6c08b..e360bc318 100644 --- a/debian/patches/features/all/rt/0007-tracing-Add-timestamp_mode-trace-file.patch +++ b/debian/patches/features/all/rt/0007-tracing-Add-timestamp_mode-trace-file.patch @@ -1,13 +1,13 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:46 -0600 +Date: Wed, 6 Dec 2017 16:37:48 -0600 Subject: [PATCH 07/37] tracing: Add timestamp_mode trace file -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add a new option flag indicating whether or not the ring buffer is in 'absolute timestamp' mode. Currently this is only set/unset by hist triggers that make use of a -$common_timestamp. As such, there's no reason to make this writeable +common_timestamp. As such, there's no reason to make this writeable for users - its purpose is only to allow users to determine unequivocally whether or not the ring buffer is in that mode (although absolute timestamps can coexist with the normal delta timestamps, when diff --git a/debian/patches/features/all/rt/0007-tracing-Clean-up-hist_field_flags-enum.patch b/debian/patches/features/all/rt/0007-tracing-Clean-up-hist_field_flags-enum.patch index 6ccf6c8a5..e520a0061 100644 --- a/debian/patches/features/all/rt/0007-tracing-Clean-up-hist_field_flags-enum.patch +++ b/debian/patches/features/all/rt/0007-tracing-Clean-up-hist_field_flags-enum.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:21 -0500 Subject: [PATCH 07/42] tracing: Clean up hist_field_flags enum -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz As we add more flags, specifying explicit integers for the flag values becomes more unwieldy and error-prone - switch them over to left-shift diff --git a/debian/patches/features/all/rt/0008-tracing-Add-hist_field_name-accessor.patch b/debian/patches/features/all/rt/0008-tracing-Add-hist_field_name-accessor.patch index e7458eaea..05cb834ff 100644 --- a/debian/patches/features/all/rt/0008-tracing-Add-hist_field_name-accessor.patch +++ b/debian/patches/features/all/rt/0008-tracing-Add-hist_field_name-accessor.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:22 -0500 Subject: [PATCH 08/42] tracing: Add hist_field_name() accessor -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz In preparation for hist_fields that won't be strictly based on trace_event_fields, add a new hist_field_name() accessor to allow that diff --git a/debian/patches/features/all/rt/0008-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch b/debian/patches/features/all/rt/0008-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch index aad06ebca..38b43f8e8 100644 --- a/debian/patches/features/all/rt/0008-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch +++ b/debian/patches/features/all/rt/0008-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:47 -0600 +Date: Wed, 6 Dec 2017 16:37:49 -0600 Subject: [PATCH 08/37] tracing: Give event triggers access to ring_buffer_event -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The ring_buffer event can provide a timestamp that may be useful to various triggers - pass it into the handlers for that purpose. diff --git a/debian/patches/features/all/rt/0008-tracing-hrtimer-Take-all-clock-bases-and-modes-into-.patch b/debian/patches/features/all/rt/0008-tracing-hrtimer-Take-all-clock-bases-and-modes-into-.patch index 736bd0453..596a35aaf 100644 --- a/debian/patches/features/all/rt/0008-tracing-hrtimer-Take-all-clock-bases-and-modes-into-.patch +++ b/debian/patches/features/all/rt/0008-tracing-hrtimer-Take-all-clock-bases-and-modes-into-.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:45 +0200 Subject: [PATCH 08/36] tracing/hrtimer: Take all clock bases and modes into account -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz So far only CLOCK_MONOTONIC and CLOCK_REALTIME were taken into account as well as HRTIMER_MODE_ABS/REL in hrtimer_init tracepoint. The query for diff --git a/debian/patches/features/all/rt/0009-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch b/debian/patches/features/all/rt/0009-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch index 76013e6ff..b9d5af457 100644 --- a/debian/patches/features/all/rt/0009-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch +++ b/debian/patches/features/all/rt/0009-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:48 -0600 +Date: Wed, 6 Dec 2017 16:37:50 -0600 Subject: [PATCH 09/37] tracing: Add ring buffer event param to hist field functions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Some events such as timestamps require access to a ring_buffer_event struct; add a param so that hist field functions can access that. diff --git a/debian/patches/features/all/rt/0009-tracing-Reimplement-log2.patch b/debian/patches/features/all/rt/0009-tracing-Reimplement-log2.patch index d723eb483..af8158ae9 100644 --- a/debian/patches/features/all/rt/0009-tracing-Reimplement-log2.patch +++ b/debian/patches/features/all/rt/0009-tracing-Reimplement-log2.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:23 -0500 Subject: [PATCH 09/42] tracing: Reimplement log2 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz log2 as currently implemented applies only to u64 trace_event_field derived fields, and assumes that anything it's applied to is a u64 diff --git a/debian/patches/features/all/rt/0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch b/debian/patches/features/all/rt/0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch index 8c81d8f3d..c58f557e8 100644 --- a/debian/patches/features/all/rt/0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch +++ b/debian/patches/features/all/rt/0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:46 +0200 Subject: [PATCH 09/36] tracing/hrtimer: Print hrtimer mode in hrtimer_start tracepoint -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The hrtimer_start tracepoint lacks the mode information. The mode is important because consecutive starts can switch from ABS to REL or from diff --git a/debian/patches/features/all/rt/0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch b/debian/patches/features/all/rt/0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch index 6241d1ed7..a03adce18 100644 --- a/debian/patches/features/all/rt/0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch +++ b/debian/patches/features/all/rt/0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:47 +0200 Subject: [PATCH 10/36] hrtimer: Switch for loop to _ffs() evaluation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Looping over all clock bases to find active bits is suboptimal if not all bases are active. diff --git a/debian/patches/features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch b/debian/patches/features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch index da7f29d78..ebfbec546 100644 --- a/debian/patches/features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch +++ b/debian/patches/features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:49 -0600 +Date: Wed, 6 Dec 2017 16:37:51 -0600 Subject: [PATCH 10/37] tracing: Break out hist trigger assignment parsing -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz This will make it easier to add variables, and makes the parsing code cleaner regardless. diff --git a/debian/patches/features/all/rt/0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch b/debian/patches/features/all/rt/0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch index 61c098115..d386e26c0 100644 --- a/debian/patches/features/all/rt/0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch +++ b/debian/patches/features/all/rt/0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:48 +0200 Subject: [PATCH 11/36] hrtimer: Store running timer in hrtimer_clock_base -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The pointer to the currently running timer is stored in hrtimer_cpu_base before the base lock is dropped and the callback is invoked. diff --git a/debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch b/debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch index cdf367c67..1b7457ac2 100644 --- a/debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch +++ b/debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch @@ -1,28 +1,30 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:50 -0600 +Date: Wed, 6 Dec 2017 16:37:52 -0600 Subject: [PATCH 11/37] tracing: Add hist trigger timestamp support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add support for a timestamp event field. This is actually a 'pseudo-' event field in that it behaves like it's part of the event record, but is really part of the corresponding ring buffer event. To make use of the timestamp field, users can specify -"$common_timestamp" as a field name for any histogram. Note that this +"common_timestamp" as a field name for any histogram. Note that this doesn't make much sense on its own either as either a key or value, but needs to be supported even so, since follow-on patches will add -support for making use of this field in time deltas. The '$' is used -as a prefix on the variable name to indicate that it's not a bona fide -event field - so you won't find it in the event description - but -rather it's a synthetic field that can be used like a real field). +support for making use of this field in time deltas. The +common_timestamp 'field' is not a bona fide event field - so you won't +find it in the event description - but rather it's a synthetic field +that can be used like a real field. Note that the use of this field requires the ring buffer be put into 'absolute timestamp' mode, which saves the complete timestamp for each event rather than an offset. This mode will be enabled if and only if -a histogram makes use of the "$common_timestamp" field. +a histogram makes use of the "common_timestamp" field. Signed-off-by: Tom Zanussi Signed-off-by: Baohong Liu +[kasan use-after-free fix] +Signed-off-by: Vedang Patel Signed-off-by: Sebastian Andrzej Siewior --- kernel/trace/trace_events_hist.c | 94 +++++++++++++++++++++++++++++---------- @@ -64,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior else if (field->flags & HIST_FIELD_FL_LOG2) field_name = hist_field_name(field->operands[0], ++level); + else if (field->flags & HIST_FIELD_FL_TIMESTAMP) -+ field_name = "$common_timestamp"; ++ field_name = "common_timestamp"; if (field_name == NULL) field_name = ""; @@ -89,7 +91,7 @@ Signed-off-by: Sebastian Andrzej Siewior - if (!field || !field->size) { - ret = -EINVAL; - goto out; -+ if (strcmp(field_name, "$common_timestamp") == 0) { ++ if (strcmp(field_name, "common_timestamp") == 0) { + flags |= HIST_FIELD_FL_TIMESTAMP; + hist_data->enable_timestamps = true; + } else { @@ -110,7 +112,7 @@ Signed-off-by: Sebastian Andrzej Siewior - ret = -EINVAL; - goto out; - } -+ if (strcmp(field_name, "$common_timestamp") == 0) { ++ if (strcmp(field_name, "common_timestamp") == 0) { + flags |= HIST_FIELD_FL_TIMESTAMP; + hist_data->enable_timestamps = true; + key_size = sizeof(u64); @@ -149,7 +151,7 @@ Signed-off-by: Sebastian Andrzej Siewior - seq_printf(m, "%s", field_name); + if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) -+ seq_puts(m, "$common_timestamp"); ++ seq_puts(m, "common_timestamp"); + else if (field_name) + seq_printf(m, "%s", field_name); + @@ -212,7 +214,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (trace_event_trigger_enable_disable(file, 1) < 0) { list_del_rcu(&data->list); update_cond_flag(file); -@@ -1572,19 +1611,28 @@ static void hist_unregister_trigger(char +@@ -1572,17 +1611,26 @@ static void hist_unregister_trigger(char if (unregistered && test->ops->free) test->ops->free(test->ops, test); @@ -234,10 +236,8 @@ Signed-off-by: Sebastian Andrzej Siewior list_del_rcu(&test->list); trace_event_trigger_enable_disable(file, 0); update_cond_flag(file); - if (test->ops->free) - test->ops->free(test->ops, test); + if (hist_data->enable_timestamps) + tracing_set_time_stamp_abs(file->tr, false); + if (test->ops->free) + test->ops->free(test->ops, test); } - } - } diff --git a/debian/patches/features/all/rt/0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch b/debian/patches/features/all/rt/0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch index 7e8b46d66..c15cf9e13 100644 --- a/debian/patches/features/all/rt/0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch +++ b/debian/patches/features/all/rt/0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:50 +0200 Subject: [PATCH 12/36] hrtimer: Make room in struct hrtimer_cpu_base -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The upcoming softirq based hrtimers support requires an additional field in the hrtimer_cpu_base struct, which would grow the struct size beyond a diff --git a/debian/patches/features/all/rt/0012-tracing-Add-per-element-variable-support-to-tracing_.patch b/debian/patches/features/all/rt/0012-tracing-Add-per-element-variable-support-to-tracing_.patch index 51df05094..7537226e8 100644 --- a/debian/patches/features/all/rt/0012-tracing-Add-per-element-variable-support-to-tracing_.patch +++ b/debian/patches/features/all/rt/0012-tracing-Add-per-element-variable-support-to-tracing_.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:51 -0600 +Date: Wed, 6 Dec 2017 16:37:53 -0600 Subject: [PATCH 12/37] tracing: Add per-element variable support to tracing_map -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz In order to allow information to be passed between trace events, add support for per-element variables to tracing_map. This provides a diff --git a/debian/patches/features/all/rt/0013-hrtimer-Reduce-conditional-code-hres_active.patch b/debian/patches/features/all/rt/0013-hrtimer-Reduce-conditional-code-hres_active.patch index 970c0c959..50861176d 100644 --- a/debian/patches/features/all/rt/0013-hrtimer-Reduce-conditional-code-hres_active.patch +++ b/debian/patches/features/all/rt/0013-hrtimer-Reduce-conditional-code-hres_active.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:51 +0200 Subject: [PATCH 13/36] hrtimer: Reduce conditional code (hres_active) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The hrtimer_cpu_base struct has the CONFIG_HIGH_RES_TIMERS conditional struct member hres_active. All related functions to this member are diff --git a/debian/patches/features/all/rt/0013-tracing-Add-hist_data-member-to-hist_field.patch b/debian/patches/features/all/rt/0013-tracing-Add-hist_data-member-to-hist_field.patch index c89606433..bcf72f896 100644 --- a/debian/patches/features/all/rt/0013-tracing-Add-hist_data-member-to-hist_field.patch +++ b/debian/patches/features/all/rt/0013-tracing-Add-hist_data-member-to-hist_field.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:52 -0600 +Date: Wed, 6 Dec 2017 16:37:54 -0600 Subject: [PATCH 13/37] tracing: Add hist_data member to hist_field -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Allow hist_data access via hist_field. Some users of hist_fields require or will require more access to the associated hist_data. diff --git a/debian/patches/features/all/rt/0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch b/debian/patches/features/all/rt/0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch index 24c4b2773..0f284a9a2 100644 --- a/debian/patches/features/all/rt/0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch +++ b/debian/patches/features/all/rt/0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:52 +0200 Subject: [PATCH 14/36] hrtimer: Use accesor functions instead of direct access -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz __hrtimer_hres_active() is now available unconditionally. Replace the direct access to hrtimer_cpu_base.hres_active. diff --git a/debian/patches/features/all/rt/0014-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch b/debian/patches/features/all/rt/0014-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch index 87f1c498d..5f02c595a 100644 --- a/debian/patches/features/all/rt/0014-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch +++ b/debian/patches/features/all/rt/0014-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch @@ -1,15 +1,15 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:53 -0600 +Date: Wed, 6 Dec 2017 16:37:55 -0600 Subject: [PATCH 14/37] tracing: Add usecs modifier for hist trigger timestamps -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz -Appending .usecs onto a $common_timestamp field will cause the +Appending .usecs onto a common_timestamp field will cause the timestamp value to be in microseconds instead of the default nanoseconds. A typical latency histogram using usecs would look like this: - # echo 'hist:keys=pid,prio:ts0=$common_timestamp.usecs ... - # echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0 ... + # echo 'hist:keys=pid,prio:ts0=common_timestamp.usecs ... + # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0 ... This also adds an external trace_clock_in_ns() to trace.c for the timestamp conversion. @@ -29,7 +29,7 @@ Signed-off-by: Sebastian Andrzej Siewior .syscall display a syscall id as a system call name .execname display a common_pid as a program name .log2 display log2 value rather than raw number -+ .usecs display a $common_timestamp in microseconds ++ .usecs display a common_timestamp in microseconds Note that in general the semantics of a given field aren't interpreted when applying a modifier to it, but there are some @@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior - "\t .log2 display log2 value rather than raw number\n\n" + "\t .syscall display a syscall id as a syscall name\n" + "\t .log2 display log2 value rather than raw number\n" -+ "\t .usecs display a $common_timestamp in microseconds\n\n" ++ "\t .usecs display a common_timestamp in microseconds\n\n" "\t The 'pause' parameter can be used to pause an existing hist\n" "\t trigger or to start a hist trigger but not log any events\n" "\t until told to do so. 'continue' can be used to start or\n" @@ -135,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto out; @@ -643,6 +655,8 @@ static int create_key_field(struct hist_ - if (strcmp(field_name, "$common_timestamp") == 0) { + if (strcmp(field_name, "common_timestamp") == 0) { flags |= HIST_FIELD_FL_TIMESTAMP; hist_data->enable_timestamps = true; + if (flags & HIST_FIELD_FL_TIMESTAMP_USECS) diff --git a/debian/patches/features/all/rt/0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch b/debian/patches/features/all/rt/0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch index fad1851e5..918c03cde 100644 --- a/debian/patches/features/all/rt/0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch +++ b/debian/patches/features/all/rt/0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:53 +0200 Subject: [PATCH 15/36] hrtimer: Make the remote enqueue check unconditional -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz hrtimer_cpu_base.expires_next is used to cache the next event armed in the timer hardware. The value is used to check whether an hrtimer can be diff --git a/debian/patches/features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch b/debian/patches/features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch index 67c328675..8a7a8637d 100644 --- a/debian/patches/features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch +++ b/debian/patches/features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:54 -0600 +Date: Wed, 6 Dec 2017 16:37:56 -0600 Subject: [PATCH 15/37] tracing: Add variable support to hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add support for saving the value of a current event's event field by assigning it to a variable that can be read by a subsequent event. @@ -12,23 +12,23 @@ to any event field. Both keys and values can be saved and retrieved in this way: - # echo 'hist:keys=next_pid:vals=$ts0:ts0=$common_timestamp ... + # echo 'hist:keys=next_pid:vals=$ts0:ts0=common_timestamp ... # echo 'hist:timer_pid=common_pid:key=$timer_pid ...' If a variable isn't a key variable or prefixed with 'vals=', the associated event field will be saved in a variable but won't be summed as a value: - # echo 'hist:keys=next_pid:ts1=$common_timestamp:... + # echo 'hist:keys=next_pid:ts1=common_timestamp:... Multiple variables can be assigned at the same time: - # echo 'hist:keys=pid:vals=$ts0,$b,field2:ts0=$common_timestamp,b=field1 ... + # echo 'hist:keys=pid:vals=$ts0,$b,field2:ts0=common_timestamp,b=field1 ... Multiple (or single) variables can also be assigned at the same time using separate assignments: - # echo 'hist:keys=pid:vals=$ts0:ts0=$common_timestamp:b=field1:c=field2 ... + # echo 'hist:keys=pid:vals=$ts0:ts0=common_timestamp:b=field1:c=field2 ... Variables set as above can be used by being referenced from another event, as described in a subsequent patch. @@ -645,7 +645,7 @@ Signed-off-by: Sebastian Andrzej Siewior + seq_printf(m, "%s=", hist_field->var.name); + if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) - seq_puts(m, "$common_timestamp"); + seq_puts(m, "common_timestamp"); else if (field_name) @@ -1285,7 +1544,8 @@ static int event_hist_trigger_print(stru struct event_trigger_data *data) diff --git a/debian/patches/features/all/rt/0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch b/debian/patches/features/all/rt/0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch index 44d3d94ee..f54543294 100644 --- a/debian/patches/features/all/rt/0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch +++ b/debian/patches/features/all/rt/0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:54 +0200 Subject: [PATCH 16/36] hrtimer: Make hrtimer_cpu_base.next_timer handling unconditional -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz hrtimer_cpu_base.next_timer stores the pointer to the next expiring timer in a cpu base. diff --git a/debian/patches/features/all/rt/0016-tracing-Account-for-variables-in-named-trigger-compa.patch b/debian/patches/features/all/rt/0016-tracing-Account-for-variables-in-named-trigger-compa.patch index a5299cadb..f149156bd 100644 --- a/debian/patches/features/all/rt/0016-tracing-Account-for-variables-in-named-trigger-compa.patch +++ b/debian/patches/features/all/rt/0016-tracing-Account-for-variables-in-named-trigger-compa.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:55 -0600 +Date: Wed, 6 Dec 2017 16:37:57 -0600 Subject: [PATCH 16/37] tracing: Account for variables in named trigger compatibility -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Named triggers must also have the same set of variables in order to be considered compatible - update the trigger match test to account for diff --git a/debian/patches/features/all/rt/0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch b/debian/patches/features/all/rt/0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch index 1faf6c1a6..7fa37f86a 100644 --- a/debian/patches/features/all/rt/0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch +++ b/debian/patches/features/all/rt/0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:55 +0200 Subject: [PATCH 17/36] hrtimer: Make hrtimer_reprogramm() unconditional -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz hrtimer_reprogram() needs to be available unconditionally for softirq based hrtimers. Move the function and all required struct members out of the diff --git a/debian/patches/features/all/rt/0017-tracing-Move-get_hist_field_flags.patch b/debian/patches/features/all/rt/0017-tracing-Move-get_hist_field_flags.patch index 9e83719a0..0c8ab63dc 100644 --- a/debian/patches/features/all/rt/0017-tracing-Move-get_hist_field_flags.patch +++ b/debian/patches/features/all/rt/0017-tracing-Move-get_hist_field_flags.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:56 -0600 +Date: Wed, 6 Dec 2017 16:37:58 -0600 Subject: [PATCH 17/37] tracing: Move get_hist_field_flags() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Move get_hist_field_flags() to make it more easily accessible for new code (and keep the move separate from new functionality). diff --git a/debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch b/debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch index e240d3761..ce4d0d82d 100644 --- a/debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch +++ b/debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:56 +0200 Subject: [PATCH 18/36] hrtimer: Make hrtimer_force_reprogramm() unconditionally available -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz hrtimer_force_reprogram() needs to be available unconditionally for softirq based hrtimers. Move the function and all required struct members out of diff --git a/debian/patches/features/all/rt/0018-tracing-Add-simple-expression-support-to-hist-trigge.patch b/debian/patches/features/all/rt/0018-tracing-Add-simple-expression-support-to-hist-trigge.patch index 21e28f26e..28c52e7dd 100644 --- a/debian/patches/features/all/rt/0018-tracing-Add-simple-expression-support-to-hist-trigge.patch +++ b/debian/patches/features/all/rt/0018-tracing-Add-simple-expression-support-to-hist-trigge.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:57 -0600 +Date: Wed, 6 Dec 2017 16:37:59 -0600 Subject: [PATCH 18/37] tracing: Add simple expression support to hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add support for simple addition, subtraction, and unary expressions (-(expr) and expr, where expr = b-a, a+b, a+b+c) to hist triggers, in @@ -17,8 +17,8 @@ parsing. Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 513 +++++++++++++++++++++++++++++++++------ - 1 file changed, 440 insertions(+), 73 deletions(-) + kernel/trace/trace_events_hist.c | 482 +++++++++++++++++++++++++++++++++------ + 1 file changed, 409 insertions(+), 73 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -98,13 +98,13 @@ Signed-off-by: Sebastian Andrzej Siewior @@ -258,6 +303,8 @@ static const char *hist_field_name(struc field_name = hist_field_name(field->operands[0], ++level); else if (field->flags & HIST_FIELD_FL_TIMESTAMP) - field_name = "$common_timestamp"; + field_name = "common_timestamp"; + else if (field->flags & HIST_FIELD_FL_EXPR) + field_name = field->name; if (field_name == NULL) field_name = ""; -@@ -519,6 +566,93 @@ static const char *get_hist_field_flags( +@@ -519,6 +566,95 @@ static const char *get_hist_field_flags( return flags_str; } @@ -131,6 +131,8 @@ Signed-off-by: Sebastian Andrzej Siewior + strcat(expr, subexpr); + strcat(expr, ")"); + ++ kfree(subexpr); ++ + return expr; + } + @@ -198,7 +200,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_hist_field(struct hist_field *hist_field, unsigned int level) { -@@ -534,6 +668,7 @@ static void destroy_hist_field(struct hi +@@ -534,6 +670,7 @@ static void destroy_hist_field(struct hi destroy_hist_field(hist_field->operands[i], level + 1); kfree(hist_field->var.name); @@ -206,7 +208,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_field); } -@@ -554,6 +689,9 @@ static struct hist_field *create_hist_fi +@@ -554,6 +691,9 @@ static struct hist_field *create_hist_fi hist_field->hist_data = hist_data; @@ -216,66 +218,17 @@ Signed-off-by: Sebastian Andrzej Siewior if (flags & HIST_FIELD_FL_HITCOUNT) { hist_field->fn = hist_field_counter; goto out; -@@ -626,59 +764,323 @@ static void destroy_hist_fields(struct h +@@ -626,6 +766,257 @@ static void destroy_hist_fields(struct h } } --static int create_hitcount_val(struct hist_trigger_data *hist_data) -+static char *field_name_from_var(struct hist_trigger_data *hist_data, -+ char *var_name) - { -- hist_data->fields[HITCOUNT_IDX] = -- create_hist_field(hist_data, NULL, HIST_FIELD_FL_HITCOUNT, NULL); -- if (!hist_data->fields[HITCOUNT_IDX]) -- return -ENOMEM; -+ char *name, *field; -+ unsigned int i; - -- hist_data->n_vals++; -- hist_data->n_fields++; -+ for (i = 0; i < hist_data->attrs->var_defs.n_vars; i++) { -+ name = hist_data->attrs->var_defs.name[i]; - -- if (WARN_ON(hist_data->n_vals > TRACING_MAP_VALS_MAX)) -- return -EINVAL; -+ if (strcmp(var_name, name) == 0) { -+ field = hist_data->attrs->var_defs.expr[i]; -+ if (contains_operator(field)) -+ continue; -+ return field; -+ } -+ } - -- return 0; -+ return NULL; - } - --static int __create_val_field(struct hist_trigger_data *hist_data, -- unsigned int val_idx, -- struct trace_event_file *file, -- char *var_name, char *field_str, -- unsigned long flags) -+static char *local_field_var_ref(struct hist_trigger_data *hist_data, -+ char *var_name) -+{ -+ var_name++; -+ -+ return field_name_from_var(hist_data, var_name); -+} -+ +static struct ftrace_event_field * +parse_field(struct hist_trigger_data *hist_data, struct trace_event_file *file, + char *field_str, unsigned long *flags) - { - struct ftrace_event_field *field = NULL; -- char *field_name; -- int ret = 0; ++{ ++ struct ftrace_event_field *field = NULL; + char *field_name, *modifier, *str; - -- field_name = strsep(&field_str, "."); -- if (field_str) { -- if (strcmp(field_str, "hex") == 0) -- flags |= HIST_FIELD_FL_HEX; ++ + modifier = str = kstrdup(field_str, GFP_KERNEL); + if (!modifier) + return ERR_PTR(-ENOMEM); @@ -297,27 +250,24 @@ Signed-off-by: Sebastian Andrzej Siewior + *flags |= HIST_FIELD_FL_LOG2; + else if (strcmp(modifier, "usecs") == 0) + *flags |= HIST_FIELD_FL_TIMESTAMP_USECS; - else { -- ret = -EINVAL; ++ else { + field = ERR_PTR(-EINVAL); - goto out; - } - } - - if (strcmp(field_name, "$common_timestamp") == 0) { -- flags |= HIST_FIELD_FL_TIMESTAMP; ++ goto out; ++ } ++ } ++ ++ if (strcmp(field_name, "common_timestamp") == 0) { + *flags |= HIST_FIELD_FL_TIMESTAMP; - hist_data->enable_timestamps = true; ++ hist_data->enable_timestamps = true; + if (*flags & HIST_FIELD_FL_TIMESTAMP_USECS) + hist_data->attrs->ts_in_usecs = true; - } else { - field = trace_find_event_field(file->event_call, field_name); - if (!field || !field->size) { -- ret = -EINVAL; ++ } else { ++ field = trace_find_event_field(file->event_call, field_name); ++ if (!field || !field->size) { + field = ERR_PTR(-EINVAL); - goto out; - } - } ++ goto out; ++ } ++ } + out: + kfree(str); + @@ -328,29 +278,22 @@ Signed-off-by: Sebastian Andrzej Siewior + struct trace_event_file *file, char *str, + unsigned long *flags, char *var_name) +{ -+ char *s; + struct ftrace_event_field *field = NULL; + struct hist_field *hist_field = NULL; + int ret = 0; + -+ s = local_field_var_ref(hist_data, str); -+ if (s) -+ str = s; -+ + field = parse_field(hist_data, file, str, flags); + if (IS_ERR(field)) { + ret = PTR_ERR(field); + goto out; + } - -- hist_data->fields[val_idx] = create_hist_field(hist_data, field, flags, var_name); -- if (!hist_data->fields[val_idx]) { ++ + hist_field = create_hist_field(hist_data, field, *flags, var_name); + if (!hist_field) { - ret = -ENOMEM; - goto out; - } - ++ ret = -ENOMEM; ++ goto out; ++ } ++ + return hist_field; + out: + return ERR_PTR(ret); @@ -530,43 +473,54 @@ Signed-off-by: Sebastian Andrzej Siewior + return ERR_PTR(ret); +} + -+static int create_hitcount_val(struct hist_trigger_data *hist_data) -+{ -+ hist_data->fields[HITCOUNT_IDX] = -+ create_hist_field(hist_data, NULL, HIST_FIELD_FL_HITCOUNT, NULL); -+ if (!hist_data->fields[HITCOUNT_IDX]) -+ return -ENOMEM; -+ -+ hist_data->n_vals++; -+ hist_data->n_fields++; -+ -+ if (WARN_ON(hist_data->n_vals > TRACING_MAP_VALS_MAX)) -+ return -EINVAL; -+ -+ return 0; -+} -+ -+static int __create_val_field(struct hist_trigger_data *hist_data, -+ unsigned int val_idx, -+ struct trace_event_file *file, -+ char *var_name, char *field_str, -+ unsigned long flags) -+{ + static int create_hitcount_val(struct hist_trigger_data *hist_data) + { + hist_data->fields[HITCOUNT_IDX] = +@@ -648,37 +1039,17 @@ static int __create_val_field(struct his + char *var_name, char *field_str, + unsigned long flags) + { +- struct ftrace_event_field *field = NULL; +- char *field_name; + struct hist_field *hist_field; -+ int ret = 0; -+ + int ret = 0; + +- field_name = strsep(&field_str, "."); +- if (field_str) { +- if (strcmp(field_str, "hex") == 0) +- flags |= HIST_FIELD_FL_HEX; +- else { +- ret = -EINVAL; +- goto out; +- } +- } +- +- if (strcmp(field_name, "common_timestamp") == 0) { +- flags |= HIST_FIELD_FL_TIMESTAMP; +- hist_data->enable_timestamps = true; +- } else { +- field = trace_find_event_field(file->event_call, field_name); +- if (!field || !field->size) { +- ret = -EINVAL; +- goto out; +- } +- } +- +- hist_data->fields[val_idx] = create_hist_field(hist_data, field, flags, var_name); +- if (!hist_data->fields[val_idx]) { +- ret = -ENOMEM; + hist_field = parse_expr(hist_data, file, field_str, flags, var_name, 0); + if (IS_ERR(hist_field)) { + ret = PTR_ERR(hist_field); -+ goto out; -+ } -+ + goto out; + } + + hist_data->fields[val_idx] = hist_field; + ++hist_data->n_vals; ++hist_data->n_fields; -@@ -765,8 +1167,8 @@ static int create_key_field(struct hist_ +@@ -765,8 +1136,8 @@ static int create_key_field(struct hist_ struct trace_event_file *file, char *field_str) { @@ -576,7 +530,7 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned long flags = 0; unsigned int key_size; int ret = 0; -@@ -781,60 +1183,24 @@ static int create_key_field(struct hist_ +@@ -781,60 +1152,24 @@ static int create_key_field(struct hist_ key_size = sizeof(unsigned long) * HIST_STACKTRACE_DEPTH; hist_field = create_hist_field(hist_data, NULL, flags, NULL); } else { @@ -609,7 +563,7 @@ Signed-off-by: Sebastian Andrzej Siewior + goto out; } -- if (strcmp(field_name, "$common_timestamp") == 0) { +- if (strcmp(field_name, "common_timestamp") == 0) { - flags |= HIST_FIELD_FL_TIMESTAMP; - hist_data->enable_timestamps = true; - if (flags & HIST_FIELD_FL_TIMESTAMP_USECS) @@ -646,7 +600,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_data->key_size > HIST_KEY_SIZE_MAX) { ret = -EINVAL; goto out; -@@ -1419,7 +1785,8 @@ hist_trigger_entry_print(struct seq_file +@@ -1419,7 +1754,8 @@ hist_trigger_entry_print(struct seq_file for (i = 1; i < hist_data->n_vals; i++) { field_name = hist_field_name(hist_data->fields[i], 0); diff --git a/debian/patches/features/all/rt/0019-hrtimer-Unify-handling-of-hrtimer-remove.patch b/debian/patches/features/all/rt/0019-hrtimer-Unify-handling-of-hrtimer-remove.patch index 51a1b424e..7c0764b01 100644 --- a/debian/patches/features/all/rt/0019-hrtimer-Unify-handling-of-hrtimer-remove.patch +++ b/debian/patches/features/all/rt/0019-hrtimer-Unify-handling-of-hrtimer-remove.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:57 +0200 Subject: [PATCH 19/36] hrtimer: Unify handling of hrtimer remove -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz When the first hrtimer on the current CPU is removed, hrtimer_force_reprogram() is invoked but only when diff --git a/debian/patches/features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch b/debian/patches/features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch index 4e030d3df..a4b00b6ca 100644 --- a/debian/patches/features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch +++ b/debian/patches/features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:58 -0600 +Date: Wed, 6 Dec 2017 16:38:00 -0600 Subject: [PATCH 19/37] tracing: Generalize per-element hist trigger data -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Up until now, hist triggers only needed per-element support for saving 'comm' data, which was saved directly as a private data pointer. @@ -106,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static const char *get_hist_field_flags(struct hist_field *hist_field) -@@ -1512,21 +1532,6 @@ static int create_tracing_map_fields(str +@@ -1481,21 +1501,6 @@ static int create_tracing_map_fields(str return 0; } @@ -128,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_trigger_data * create_hist_data(unsigned int map_bits, struct hist_trigger_attrs *attrs, -@@ -1552,8 +1557,7 @@ create_hist_data(unsigned int map_bits, +@@ -1521,8 +1526,7 @@ create_hist_data(unsigned int map_bits, if (ret) goto free; @@ -138,7 +138,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_data->map = tracing_map_create(map_bits, hist_data->key_size, map_ops, hist_data); -@@ -1741,7 +1745,13 @@ hist_trigger_entry_print(struct seq_file +@@ -1710,7 +1714,13 @@ hist_trigger_entry_print(struct seq_file seq_printf(m, "%s: [%llx] %-55s", field_name, uval, str); } else if (key_field->flags & HIST_FIELD_FL_EXECNAME) { diff --git a/debian/patches/features/all/rt/0020-hrtimer-Unify-handling-of-remote-enqueue.patch b/debian/patches/features/all/rt/0020-hrtimer-Unify-handling-of-remote-enqueue.patch index 9a3fb6c47..9af38aca4 100644 --- a/debian/patches/features/all/rt/0020-hrtimer-Unify-handling-of-remote-enqueue.patch +++ b/debian/patches/features/all/rt/0020-hrtimer-Unify-handling-of-remote-enqueue.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:58 +0200 Subject: [PATCH 20/36] hrtimer: Unify handling of remote enqueue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz hrtimer_reprogram() is conditionally invoked from hrtimer_start_range_ns() when hrtimer_cpu_base.hres_active is true. diff --git a/debian/patches/features/all/rt/0020-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch b/debian/patches/features/all/rt/0020-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch index 6fb95ed92..7e34ad822 100644 --- a/debian/patches/features/all/rt/0020-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch +++ b/debian/patches/features/all/rt/0020-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:32:59 -0600 +Date: Wed, 6 Dec 2017 16:38:01 -0600 Subject: [PATCH 20/37] tracing: Pass tracing_map_elt to hist_field accessor functions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Some accessor functions, such as for variable references, require access to a corrsponding tracing_map_elt. @@ -182,7 +182,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct hist_trigger_data *hist_data = hist_field->hist_data; struct trace_array *tr = hist_data->event_file->tr; -@@ -1598,7 +1621,7 @@ static void hist_trigger_elt_update(stru +@@ -1567,7 +1590,7 @@ static void hist_trigger_elt_update(stru for_each_hist_val_field(i, hist_data) { hist_field = hist_data->fields[i]; @@ -191,7 +191,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_field->flags & HIST_FIELD_FL_VAR) { var_idx = hist_field->var.idx; tracing_map_set_var(elt, var_idx, hist_val); -@@ -1610,7 +1633,7 @@ static void hist_trigger_elt_update(stru +@@ -1579,7 +1602,7 @@ static void hist_trigger_elt_update(stru for_each_hist_key_field(i, hist_data) { hist_field = hist_data->fields[i]; if (hist_field->flags & HIST_FIELD_FL_VAR) { @@ -200,7 +200,7 @@ Signed-off-by: Sebastian Andrzej Siewior var_idx = hist_field->var.idx; tracing_map_set_var(elt, var_idx, hist_val); } -@@ -1648,9 +1671,9 @@ static void event_hist_trigger(struct ev +@@ -1617,9 +1640,9 @@ static void event_hist_trigger(struct ev bool use_compound_key = (hist_data->n_keys > 1); unsigned long entries[HIST_STACKTRACE_DEPTH]; char compound_key[HIST_KEY_SIZE_MAX]; @@ -211,7 +211,7 @@ Signed-off-by: Sebastian Andrzej Siewior u64 field_contents; void *key = NULL; unsigned int i; -@@ -1671,7 +1694,7 @@ static void event_hist_trigger(struct ev +@@ -1640,7 +1663,7 @@ static void event_hist_trigger(struct ev key = entries; } else { diff --git a/debian/patches/features/all/rt/0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch b/debian/patches/features/all/rt/0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch index 70c42007e..0a1cd0e67 100644 --- a/debian/patches/features/all/rt/0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch +++ b/debian/patches/features/all/rt/0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:59 +0200 Subject: [PATCH 21/36] hrtimer: Make remote enqueue decision less restrictive -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The current decision whether a timer can be queued on a remote CPU checks for timer->expiry <= remote_cpu_base.expires_next. diff --git a/debian/patches/features/all/rt/0021-tracing-Add-hist_field-type-field.patch b/debian/patches/features/all/rt/0021-tracing-Add-hist_field-type-field.patch index e18df7a69..3b988c05c 100644 --- a/debian/patches/features/all/rt/0021-tracing-Add-hist_field-type-field.patch +++ b/debian/patches/features/all/rt/0021-tracing-Add-hist_field-type-field.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:00 -0600 +Date: Wed, 6 Dec 2017 16:38:02 -0600 Subject: [PATCH 21/37] tracing: Add hist_field 'type' field -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Future support for synthetic events requires hist_field 'type' information, so add a field for that. @@ -25,7 +25,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct hist_field *operands[HIST_FIELD_OPERANDS_MAX]; struct hist_trigger_data *hist_data; struct hist_var var; -@@ -712,6 +713,7 @@ static void destroy_hist_field(struct hi +@@ -714,6 +715,7 @@ static void destroy_hist_field(struct hi kfree(hist_field->var.name); kfree(hist_field->name); @@ -33,7 +33,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_field); } -@@ -737,6 +739,10 @@ static struct hist_field *create_hist_fi +@@ -739,6 +741,10 @@ static struct hist_field *create_hist_fi if (flags & HIST_FIELD_FL_HITCOUNT) { hist_field->fn = hist_field_counter; @@ -44,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; } -@@ -750,12 +756,18 @@ static struct hist_field *create_hist_fi +@@ -752,12 +758,18 @@ static struct hist_field *create_hist_fi hist_field->fn = hist_field_log2; hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL); hist_field->size = hist_field->operands[0]->size; @@ -63,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; } -@@ -765,6 +777,11 @@ static struct hist_field *create_hist_fi +@@ -767,6 +779,11 @@ static struct hist_field *create_hist_fi if (is_string_field(field)) { flags |= HIST_FIELD_FL_STRING; @@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (field->filter_type == FILTER_STATIC_STRING) hist_field->fn = hist_field_string; else if (field->filter_type == FILTER_DYN_STRING) -@@ -772,6 +789,12 @@ static struct hist_field *create_hist_fi +@@ -774,6 +791,12 @@ static struct hist_field *create_hist_fi else hist_field->fn = hist_field_pstring; } else { @@ -88,7 +88,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_field->fn = select_value_fn(field->size, field->is_signed); if (!hist_field->fn) { -@@ -981,6 +1004,11 @@ static struct hist_field *parse_unary(st +@@ -950,6 +973,11 @@ static struct hist_field *parse_unary(st expr->operands[0] = operand1; expr->operator = FIELD_OP_UNARY_MINUS; expr->name = expr_str(expr, 0); @@ -100,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior return expr; free: -@@ -1070,6 +1098,11 @@ static struct hist_field *parse_expr(str +@@ -1039,6 +1067,11 @@ static struct hist_field *parse_expr(str expr->operands[1] = operand2; expr->operator = field_op; expr->name = expr_str(expr, 0); diff --git a/debian/patches/features/all/rt/0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch b/debian/patches/features/all/rt/0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch index 95aaa97a0..b580fd533 100644 --- a/debian/patches/features/all/rt/0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch +++ b/debian/patches/features/all/rt/0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:40:00 +0200 Subject: [PATCH 22/36] hrtimer: Remove base argument from hrtimer_reprogram() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz hrtimer_reprogram() must have access to the hrtimer_clock_base of the new first expiring timer to access hrtimer_clock_base.offset for adjusting the diff --git a/debian/patches/features/all/rt/0022-tracing-Add-variable-reference-handling-to-hist-trig.patch b/debian/patches/features/all/rt/0022-tracing-Add-variable-reference-handling-to-hist-trig.patch index 08a9d4d58..c46486c59 100644 --- a/debian/patches/features/all/rt/0022-tracing-Add-variable-reference-handling-to-hist-trig.patch +++ b/debian/patches/features/all/rt/0022-tracing-Add-variable-reference-handling-to-hist-trig.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:01 -0600 +Date: Wed, 6 Dec 2017 16:38:03 -0600 Subject: [PATCH 22/37] tracing: Add variable reference handling to hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add the necessary infrastructure to allow the variables defined on one event to be referenced in another. This allows variables set by a @@ -11,8 +11,8 @@ variable values saved by that previous event and the event fields of the current event. For example, here's how a latency can be calculated and saved into yet another variable named 'wakeup_lat': - # echo 'hist:keys=pid,prio:ts0=$common_timestamp ... - # echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp-$ts0 ... + # echo 'hist:keys=pid,prio:ts0=common_timestamp ... + # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ... In the first event, the event's timetamp is saved into the variable ts0. In the next line, ts0 is subtracted from the second event's @@ -27,9 +27,9 @@ Signed-off-by: Sebastian Andrzej Siewior --- kernel/trace/trace.c | 2 kernel/trace/trace.h | 3 - kernel/trace/trace_events_hist.c | 632 ++++++++++++++++++++++++++++++++++-- + kernel/trace/trace_events_hist.c | 673 +++++++++++++++++++++++++++++++++++- kernel/trace/trace_events_trigger.c | 6 - 4 files changed, 623 insertions(+), 20 deletions(-) + 4 files changed, 668 insertions(+), 16 deletions(-) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -100,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_timestamp(struct hist_field *hist_field, -@@ -271,6 +279,216 @@ static u64 hist_field_timestamp(struct h +@@ -271,6 +279,214 @@ static u64 hist_field_timestamp(struct h return ts; } @@ -184,11 +184,9 @@ Signed-off-by: Sebastian Andrzej Siewior + struct hist_field *found = NULL; + struct hist_var_data *var_data; + -+ found = find_var_ref(hist_data, hist_data, var_idx); -+ if (found) -+ return found; -+ + list_for_each_entry(var_data, &tr->hist_vars, list) { ++ if (var_data->hist_data == hist_data) ++ continue; + found = find_var_ref(var_data->hist_data, hist_data, var_idx); + if (found) + break; @@ -317,7 +315,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field *find_var_field(struct hist_trigger_data *hist_data, const char *var_name) { -@@ -313,10 +531,148 @@ static struct hist_field *find_var(struc +@@ -313,10 +529,150 @@ static struct hist_field *find_var(struc return NULL; } @@ -335,6 +333,8 @@ Signed-off-by: Sebastian Andrzej Siewior + list_for_each_entry(var_data, &tr->hist_vars, list) { + var_hist_data = var_data->hist_data; + file = var_hist_data->event_file; ++ if (file == found) ++ continue; + call = file->event_call; + name = trace_event_name(call); + @@ -469,7 +469,7 @@ Signed-off-by: Sebastian Andrzej Siewior @@ -331,8 +687,20 @@ static const char *hist_field_name(struc field_name = hist_field_name(field->operands[0], ++level); else if (field->flags & HIST_FIELD_FL_TIMESTAMP) - field_name = "$common_timestamp"; + field_name = "common_timestamp"; - else if (field->flags & HIST_FIELD_FL_EXPR) - field_name = field->name; + else if (field->flags & HIST_FIELD_FL_EXPR || @@ -489,7 +489,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (field_name == NULL) field_name = ""; -@@ -636,6 +1004,8 @@ static char *expr_str(struct hist_field +@@ -638,6 +1006,8 @@ static char *expr_str(struct hist_field return expr; } @@ -498,7 +498,7 @@ Signed-off-by: Sebastian Andrzej Siewior strcat(expr, hist_field_name(field->operands[0], 0)); if (field->operands[0]->flags) { const char *flags_str = get_hist_field_flags(field->operands[0]); -@@ -658,6 +1028,8 @@ static char *expr_str(struct hist_field +@@ -660,6 +1030,8 @@ static char *expr_str(struct hist_field return NULL; } @@ -507,7 +507,7 @@ Signed-off-by: Sebastian Andrzej Siewior strcat(expr, hist_field_name(field->operands[1], 0)); if (field->operands[1]->flags) { const char *flags_str = get_hist_field_flags(field->operands[1]); -@@ -737,6 +1109,11 @@ static struct hist_field *create_hist_fi +@@ -739,6 +1111,11 @@ static struct hist_field *create_hist_fi if (flags & HIST_FIELD_FL_EXPR) goto out; /* caller will populate */ @@ -519,7 +519,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (flags & HIST_FIELD_FL_HITCOUNT) { hist_field->fn = hist_field_counter; hist_field->size = sizeof(u64); -@@ -830,6 +1207,77 @@ static void destroy_hist_fields(struct h +@@ -832,6 +1209,142 @@ static void destroy_hist_fields(struct h } } @@ -594,30 +594,53 @@ Signed-off-by: Sebastian Andrzej Siewior + return true; +} + - static char *field_name_from_var(struct hist_trigger_data *hist_data, - char *var_name) - { -@@ -841,7 +1289,7 @@ static char *field_name_from_var(struct - - if (strcmp(var_name, name) == 0) { - field = hist_data->attrs->var_defs.expr[i]; -- if (contains_operator(field)) ++static char *field_name_from_var(struct hist_trigger_data *hist_data, ++ char *var_name) ++{ ++ char *name, *field; ++ unsigned int i; ++ ++ for (i = 0; i < hist_data->attrs->var_defs.n_vars; i++) { ++ name = hist_data->attrs->var_defs.name[i]; ++ ++ if (strcmp(var_name, name) == 0) { ++ field = hist_data->attrs->var_defs.expr[i]; + if (contains_operator(field) || is_var_ref(field)) - continue; - return field; - } -@@ -853,11 +1301,32 @@ static char *field_name_from_var(struct - static char *local_field_var_ref(struct hist_trigger_data *hist_data, - char *var_name) - { ++ continue; ++ return field; ++ } ++ } ++ ++ return NULL; ++} ++ ++static char *local_field_var_ref(struct hist_trigger_data *hist_data, ++ char *system, char *event_name, ++ char *var_name) ++{ ++ struct trace_event_call *call; ++ ++ if (system && event_name) { ++ call = hist_data->event_file->event_call; ++ ++ if (strcmp(system, call->class->system) != 0) ++ return NULL; ++ ++ if (strcmp(event_name, trace_event_name(call)) != 0) ++ return NULL; ++ } ++ ++ if (!!system != !!event_name) ++ return NULL; ++ + if (!is_var_ref(var_name)) + return NULL; + - var_name++; - - return field_name_from_var(hist_data, var_name); - } - ++ var_name++; ++ ++ return field_name_from_var(hist_data, var_name); ++} ++ +static struct hist_field *parse_var_ref(struct hist_trigger_data *hist_data, + char *system, char *event_name, + char *var_name) @@ -639,18 +662,15 @@ Signed-off-by: Sebastian Andrzej Siewior static struct ftrace_event_field * parse_field(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *field_str, unsigned long *flags) -@@ -914,13 +1383,38 @@ struct hist_field *parse_atom(struct his +@@ -888,10 +1401,40 @@ struct hist_field *parse_atom(struct his struct trace_event_file *file, char *str, unsigned long *flags, char *var_name) { -- char *s; + char *s, *ref_system = NULL, *ref_event = NULL, *ref_var = str; struct ftrace_event_field *field = NULL; struct hist_field *hist_field = NULL; int ret = 0; -- s = local_field_var_ref(hist_data, str); -- if (s) + s = strchr(str, '.'); + if (s) { + s = strchr(++s, '.'); @@ -669,7 +689,7 @@ Signed-off-by: Sebastian Andrzej Siewior + } + } + -+ s = local_field_var_ref(hist_data, ref_var); ++ s = local_field_var_ref(hist_data, ref_system, ref_event, ref_var); + if (!s) { + hist_field = parse_var_ref(hist_data, ref_system, ref_event, ref_var); + if (hist_field) { @@ -678,10 +698,12 @@ Signed-off-by: Sebastian Andrzej Siewior + return hist_field; + } + } else - str = s; - ++ str = s; ++ field = parse_field(hist_data, file, str, flags); -@@ -1094,6 +1588,9 @@ static struct hist_field *parse_expr(str + if (IS_ERR(field)) { + ret = PTR_ERR(field); +@@ -1063,6 +1606,9 @@ static struct hist_field *parse_expr(str goto free; } @@ -691,7 +713,7 @@ Signed-off-by: Sebastian Andrzej Siewior expr->operands[0] = operand1; expr->operands[1] = operand2; expr->operator = field_op; -@@ -1266,6 +1763,12 @@ static int create_key_field(struct hist_ +@@ -1235,6 +1781,12 @@ static int create_key_field(struct hist_ goto out; } @@ -704,7 +726,7 @@ Signed-off-by: Sebastian Andrzej Siewior key_size = hist_field->size; } -@@ -1604,6 +2107,7 @@ create_hist_data(unsigned int map_bits, +@@ -1573,6 +2125,7 @@ create_hist_data(unsigned int map_bits, hist_data->attrs = attrs; hist_data->remove = remove; @@ -712,7 +734,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = create_hist_fields(hist_data, file); if (ret) -@@ -1626,12 +2130,6 @@ create_hist_data(unsigned int map_bits, +@@ -1595,12 +2148,6 @@ create_hist_data(unsigned int map_bits, ret = create_tracing_map_fields(hist_data); if (ret) goto free; @@ -725,7 +747,7 @@ Signed-off-by: Sebastian Andrzej Siewior out: return hist_data; free: -@@ -1646,12 +2144,17 @@ create_hist_data(unsigned int map_bits, +@@ -1615,12 +2162,17 @@ create_hist_data(unsigned int map_bits, static void hist_trigger_elt_update(struct hist_trigger_data *hist_data, struct tracing_map_elt *elt, void *rec, @@ -744,7 +766,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_hist_val_field(i, hist_data) { hist_field = hist_data->fields[i]; hist_val = hist_field->fn(hist_field, elt, rbe, rec); -@@ -1703,6 +2206,7 @@ static void event_hist_trigger(struct ev +@@ -1672,6 +2224,7 @@ static void event_hist_trigger(struct ev struct hist_trigger_data *hist_data = data->private_data; bool use_compound_key = (hist_data->n_keys > 1); unsigned long entries[HIST_STACKTRACE_DEPTH]; @@ -752,7 +774,7 @@ Signed-off-by: Sebastian Andrzej Siewior char compound_key[HIST_KEY_SIZE_MAX]; struct tracing_map_elt *elt = NULL; struct stack_trace stacktrace; -@@ -1742,9 +2246,15 @@ static void event_hist_trigger(struct ev +@@ -1711,9 +2264,15 @@ static void event_hist_trigger(struct ev if (use_compound_key) key = compound_key; @@ -770,10 +792,10 @@ Signed-off-by: Sebastian Andrzej Siewior } static void hist_trigger_stacktrace_print(struct seq_file *m, -@@ -1961,8 +2471,11 @@ static void hist_field_print(struct seq_ +@@ -1930,8 +2489,11 @@ static void hist_field_print(struct seq_ if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) - seq_puts(m, "$common_timestamp"); + seq_puts(m, "common_timestamp"); - else if (field_name) + else if (field_name) { + if (hist_field->flags & HIST_FIELD_FL_VAR_REF) @@ -783,7 +805,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_field->flags) { const char *flags_str = get_hist_field_flags(hist_field); -@@ -2102,7 +2615,11 @@ static void event_hist_trigger_free(stru +@@ -2071,7 +2633,11 @@ static void event_hist_trigger_free(stru if (!data->ref) { if (data->name) del_named_trigger(data); @@ -795,7 +817,7 @@ Signed-off-by: Sebastian Andrzej Siewior destroy_hist_data(hist_data); } } -@@ -2315,23 +2832,55 @@ static int hist_register_trigger(char *g +@@ -2284,23 +2850,55 @@ static int hist_register_trigger(char *g goto out; } @@ -855,7 +877,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void hist_unregister_trigger(char *glob, struct event_trigger_ops *ops, struct event_trigger_data *data, struct trace_event_file *file) -@@ -2364,11 +2913,30 @@ static void hist_unregister_trigger(char +@@ -2333,11 +2931,30 @@ static void hist_unregister_trigger(char } } @@ -886,7 +908,7 @@ Signed-off-by: Sebastian Andrzej Siewior list_for_each_entry_safe(test, n, &file->triggers, list) { if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { hist_data = test->private_data; -@@ -2444,6 +3012,11 @@ static int event_hist_trigger_func(struc +@@ -2413,6 +3030,11 @@ static int event_hist_trigger_func(struc } if (remove) { @@ -898,7 +920,7 @@ Signed-off-by: Sebastian Andrzej Siewior cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file); ret = 0; goto out_free; -@@ -2461,14 +3034,33 @@ static int event_hist_trigger_func(struc +@@ -2430,14 +3052,33 @@ static int event_hist_trigger_func(struc goto out_free; } else if (ret < 0) goto out_free; diff --git a/debian/patches/features/all/rt/0023-hrtimer-Split-hrtimer_start_range_ns.patch b/debian/patches/features/all/rt/0023-hrtimer-Split-hrtimer_start_range_ns.patch index 921b62feb..a61f11515 100644 --- a/debian/patches/features/all/rt/0023-hrtimer-Split-hrtimer_start_range_ns.patch +++ b/debian/patches/features/all/rt/0023-hrtimer-Split-hrtimer_start_range_ns.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:40:01 +0200 Subject: [PATCH 23/36] hrtimer: Split hrtimer_start_range_ns() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Preparatory patch for softirq based hrtimers to avoid code duplication. No functional change. diff --git a/debian/patches/features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch b/debian/patches/features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch index b71a54acb..ea6cd069e 100644 --- a/debian/patches/features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch +++ b/debian/patches/features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:02 -0600 +Date: Wed, 6 Dec 2017 16:38:04 -0600 Subject: [PATCH 23/37] tracing: Add hist trigger action hook -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add a hook for executing extra actions whenever a histogram entry is added or updated. @@ -17,8 +17,8 @@ implemented on top of it in later patches. Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 108 +++++++++++++++++++++++++++++++++++++-- - 1 file changed, 105 insertions(+), 3 deletions(-) + kernel/trace/trace_events_hist.c | 106 ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 104 insertions(+), 2 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -101,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -2038,11 +2071,55 @@ static int create_sort_keys(struct hist_ +@@ -2056,11 +2089,55 @@ static int create_sort_keys(struct hist_ return ret; } @@ -157,7 +157,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_data); } -@@ -2109,6 +2186,10 @@ create_hist_data(unsigned int map_bits, +@@ -2127,6 +2204,10 @@ create_hist_data(unsigned int map_bits, hist_data->remove = remove; hist_data->event_file = file; @@ -168,7 +168,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = create_hist_fields(hist_data, file); if (ret) goto free; -@@ -2200,6 +2281,20 @@ static inline void add_to_key(char *comp +@@ -2218,6 +2299,20 @@ static inline void add_to_key(char *comp memcpy(compound_key + key_field->offset, key, size); } @@ -189,7 +189,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void event_hist_trigger(struct event_trigger_data *data, void *rec, struct ring_buffer_event *rbe) { -@@ -2255,6 +2350,9 @@ static void event_hist_trigger(struct ev +@@ -2273,6 +2368,9 @@ static void event_hist_trigger(struct ev return; hist_trigger_elt_update(hist_data, elt, rec, rbe, var_ref_vals); @@ -199,7 +199,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void hist_trigger_stacktrace_print(struct seq_file *m, -@@ -3041,6 +3139,10 @@ static int event_hist_trigger_func(struc +@@ -3059,6 +3157,10 @@ static int event_hist_trigger_func(struc if (has_hist_vars(hist_data)) save_hist_vars(hist_data); @@ -210,13 +210,3 @@ Signed-off-by: Sebastian Andrzej Siewior ret = tracing_map_init(hist_data->map); if (ret) goto out_unreg; -@@ -3062,8 +3164,8 @@ static int event_hist_trigger_func(struc - remove_hist_vars(hist_data); - - kfree(trigger_data); -- - destroy_hist_data(hist_data); -+ - goto out; - } - diff --git a/debian/patches/features/all/rt/0024-hrtimer-Split-__hrtimer_get_next_event.patch b/debian/patches/features/all/rt/0024-hrtimer-Split-__hrtimer_get_next_event.patch index 5e4687fc8..df18b08fd 100644 --- a/debian/patches/features/all/rt/0024-hrtimer-Split-__hrtimer_get_next_event.patch +++ b/debian/patches/features/all/rt/0024-hrtimer-Split-__hrtimer_get_next_event.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:40:02 +0200 Subject: [PATCH 24/36] hrtimer: Split __hrtimer_get_next_event() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Preparatory patch for softirq based hrtimers to avoid code duplication. No functional change. diff --git a/debian/patches/features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch b/debian/patches/features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch index 53eb79ea2..6d40ac822 100644 --- a/debian/patches/features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch +++ b/debian/patches/features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:03 -0600 +Date: Wed, 6 Dec 2017 16:38:05 -0600 Subject: [PATCH 24/37] tracing: Add support for 'synthetic' events -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Synthetic events are user-defined events generated from hist trigger variables saved from one or more other events. @@ -50,8 +50,8 @@ Signed-off-by: Tom Zanussi Signed-off-by: Fengguang Wu Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 908 ++++++++++++++++++++++++++++++++++++++- - 1 file changed, 906 insertions(+), 2 deletions(-) + kernel/trace/trace_events_hist.c | 899 ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 897 insertions(+), 2 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -99,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct action_data; typedef void (*action_fn_t) (struct hist_trigger_data *hist_data, -@@ -282,6 +308,803 @@ struct action_data { +@@ -282,6 +308,794 @@ struct action_data { unsigned int var_ref_idx; }; @@ -267,7 +267,7 @@ Signed-off-by: Sebastian Andrzej Siewior + fmt = "%lu"; + else if (strcmp(type, "pid_t") == 0) + fmt = "%d"; -+ else if (strchr(type, '[') != NULL) ++ else if (synth_field_is_string(type)) + fmt = "%s"; + + return fmt; @@ -356,7 +356,7 @@ Signed-off-by: Sebastian Andrzej Siewior + strncpy(str_field, str_val, STR_VAR_LEN_MAX); + n_u64 += STR_VAR_LEN_MAX / sizeof(u64); + } else { -+ entry->fields[i] = var_ref_vals[var_ref_idx + i]; ++ entry->fields[n_u64] = var_ref_vals[var_ref_idx + i]; + n_u64++; + } + } @@ -666,6 +666,20 @@ Signed-off-by: Sebastian Andrzej Siewior + return event; +} + ++static void add_or_delete_synth_event(struct synth_event *event, int delete) ++{ ++ if (delete) ++ free_synth_event(event); ++ else { ++ mutex_lock(&synth_event_mutex); ++ if (!find_synth_event(event->name)) ++ list_add(&event->list, &synth_event_list); ++ else ++ free_synth_event(event); ++ mutex_unlock(&synth_event_mutex); ++ } ++} ++ +static int create_synth_event(int argc, char **argv) +{ + struct synth_field *field, *fields[SYNTH_FIELDS_MAX]; @@ -749,23 +763,10 @@ Signed-off-by: Sebastian Andrzej Siewior + if (event) { + if (delete_event) { + ret = unregister_synth_event(event); -+ if (!ret) -+ free_synth_event(event); -+ else { -+ mutex_lock(&synth_event_mutex); -+ if (!find_synth_event(event->name)) -+ list_add(&event->list, &synth_event_list); -+ mutex_unlock(&synth_event_mutex); -+ } ++ add_or_delete_synth_event(event, !ret); + } else { + ret = register_synth_event(event); -+ if (!ret) { -+ mutex_lock(&synth_event_mutex); -+ if (!find_synth_event(event->name)) -+ list_add(&event->list, &synth_event_list); -+ mutex_unlock(&synth_event_mutex); -+ } else -+ free_synth_event(event); ++ add_or_delete_synth_event(event, ret); + } + } + @@ -797,10 +798,8 @@ Signed-off-by: Sebastian Andrzej Siewior + } + } + -+ list_for_each_entry_safe(event, e, &synth_event_list, list) { -+ list_del(&event->list); -+ list_add(&event->list, &release_events); -+ } ++ list_for_each_entry_safe(event, e, &synth_event_list, list) ++ list_move(&event->list, &release_events); + + mutex_unlock(&synth_event_mutex); + @@ -808,15 +807,7 @@ Signed-off-by: Sebastian Andrzej Siewior + list_del(&event->list); + + ret = unregister_synth_event(event); -+ if (ret == 0) -+ free_synth_event(event); -+ else { -+ err = ret; -+ mutex_lock(&synth_event_mutex); -+ if (!find_synth_event(event->name)) -+ list_add(&event->list, &synth_event_list); -+ mutex_unlock(&synth_event_mutex); -+ } ++ add_or_delete_synth_event(event, !ret); + } + + if (err) @@ -903,7 +894,7 @@ Signed-off-by: Sebastian Andrzej Siewior static u64 hist_field_timestamp(struct hist_field *hist_field, struct tracing_map_elt *elt, struct ring_buffer_event *rbe, -@@ -2956,6 +3779,28 @@ static int hist_trigger_enable(struct ev +@@ -2974,6 +3788,28 @@ static int hist_trigger_enable(struct ev return ret; } @@ -932,7 +923,7 @@ Signed-off-by: Sebastian Andrzej Siewior static bool hist_trigger_check_refs(struct event_trigger_data *data, struct trace_event_file *file) { -@@ -3031,6 +3876,8 @@ static void hist_unreg_all(struct trace_ +@@ -3049,6 +3885,8 @@ static void hist_unreg_all(struct trace_ { struct event_trigger_data *test, *n; struct hist_trigger_data *hist_data; @@ -941,7 +932,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_file_check_refs(file)) return; -@@ -3040,6 +3887,14 @@ static void hist_unreg_all(struct trace_ +@@ -3058,6 +3896,14 @@ static void hist_unreg_all(struct trace_ hist_data = test->private_data; list_del_rcu(&test->list); trace_event_trigger_enable_disable(file, 0); @@ -954,9 +945,9 @@ Signed-off-by: Sebastian Andrzej Siewior + mutex_unlock(&synth_event_mutex); + update_cond_flag(file); - if (test->ops->free) - test->ops->free(test->ops, test); -@@ -3058,6 +3913,8 @@ static int event_hist_trigger_func(struc + if (hist_data->enable_timestamps) + tracing_set_time_stamp_abs(file->tr, false); +@@ -3076,6 +3922,8 @@ static int event_hist_trigger_func(struc struct hist_trigger_attrs *attrs; struct event_trigger_ops *trigger_ops; struct hist_trigger_data *hist_data; @@ -965,7 +956,7 @@ Signed-off-by: Sebastian Andrzej Siewior bool remove = false; char *trigger; int ret = 0; -@@ -3088,10 +3945,11 @@ static int event_hist_trigger_func(struc +@@ -3106,10 +3954,11 @@ static int event_hist_trigger_func(struc trigger_ops = cmd_ops->get_trigger_ops(cmd, trigger); @@ -979,7 +970,7 @@ Signed-off-by: Sebastian Andrzej Siewior trigger_data->count = -1; trigger_data->ops = trigger_ops; -@@ -3110,12 +3968,23 @@ static int event_hist_trigger_func(struc +@@ -3128,12 +3977,23 @@ static int event_hist_trigger_func(struc } if (remove) { @@ -1003,7 +994,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = 0; goto out_free; } -@@ -3151,6 +4020,13 @@ static int event_hist_trigger_func(struc +@@ -3169,6 +4029,13 @@ static int event_hist_trigger_func(struc if (ret) goto out_unreg; @@ -1017,7 +1008,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Just return zero, not the number of registered triggers */ ret = 0; out: -@@ -3323,3 +4199,31 @@ static __init void unregister_trigger_hi +@@ -3341,3 +4208,31 @@ static __init void unregister_trigger_hi return ret; } diff --git a/debian/patches/features/all/rt/0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch b/debian/patches/features/all/rt/0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch index 403d1a5b9..44d8976e7 100644 --- a/debian/patches/features/all/rt/0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch +++ b/debian/patches/features/all/rt/0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:40:03 +0200 Subject: [PATCH 25/36] hrtimer: Use irqsave/irqrestore around __run_hrtimer() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz __run_hrtimer() is called with the hrtimer_cpu_base.lock held and interrupts disabled. Before invoking the timer callback the base lock is diff --git a/debian/patches/features/all/rt/0025-tracing-Add-support-for-field-variables.patch b/debian/patches/features/all/rt/0025-tracing-Add-support-for-field-variables.patch index 30d571933..68a7ec932 100644 --- a/debian/patches/features/all/rt/0025-tracing-Add-support-for-field-variables.patch +++ b/debian/patches/features/all/rt/0025-tracing-Add-support-for-field-variables.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:04 -0600 +Date: Wed, 6 Dec 2017 16:38:06 -0600 Subject: [PATCH 25/37] tracing: Add support for 'field variables' -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Users should be able to directly specify event fields in hist trigger 'actions' rather than being forced to explicitly create a variable for @@ -31,18 +31,18 @@ once a hist trigger is defined, variables can't be added to it later. echo 'wakeup_latency u64 lat; pid_t pid; int prio' >> /sys/kernel/debug/tracing/synthetic_events - echo 'hist:keys=pid:ts0=$common_timestamp.usecs >> + echo 'hist:keys=pid:ts0=common_timestamp.usecs >> /sys/kernel/debug/tracing/events/sched/sched_waking/trigger -echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0: +echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0: onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,prio) >> /sys/kernel/debug/tracing/events/sched/sched_switch/trigger Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 536 ++++++++++++++++++++++++++++++++++++++- - 1 file changed, 535 insertions(+), 1 deletion(-) + kernel/trace/trace_events_hist.c | 531 ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 530 insertions(+), 1 deletion(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -63,13 +63,11 @@ Signed-off-by: Sebastian Andrzej Siewior struct hist_trigger_data { struct hist_field *fields[HIST_FIELDS_MAX]; unsigned int n_vals; -@@ -274,6 +284,14 @@ struct hist_trigger_data { +@@ -274,6 +284,12 @@ struct hist_trigger_data { struct action_data *actions[HIST_ACTIONS_MAX]; unsigned int n_actions; + -+ struct hist_field *synth_var_refs[SYNTH_FIELDS_MAX]; -+ unsigned int n_synth_var_refs; + struct field_var *field_vars[SYNTH_FIELDS_MAX]; + unsigned int n_field_vars; + unsigned int n_field_var_str; @@ -78,16 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct synth_field { -@@ -1387,6 +1405,8 @@ static struct trace_event_file *find_var - list_for_each_entry(var_data, &tr->hist_vars, list) { - var_hist_data = var_data->hist_data; - file = var_hist_data->event_file; -+ if (file == found) -+ continue; - call = file->event_call; - name = trace_event_name(call); - -@@ -1453,6 +1473,7 @@ static struct hist_field *find_event_var +@@ -1444,6 +1460,7 @@ static struct hist_field *find_event_var struct hist_elt_data { char *comm; u64 *var_ref_vals; @@ -95,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_var_ref(struct hist_field *hist_field, -@@ -1757,6 +1778,11 @@ static inline void save_comm(char *comm, +@@ -1748,6 +1765,11 @@ static inline void save_comm(char *comm, static void hist_elt_data_free(struct hist_elt_data *elt_data) { @@ -107,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(elt_data->comm); kfree(elt_data); } -@@ -1774,7 +1800,7 @@ static int hist_trigger_elt_data_alloc(s +@@ -1765,7 +1787,7 @@ static int hist_trigger_elt_data_alloc(s unsigned int size = TASK_COMM_LEN + 1; struct hist_elt_data *elt_data; struct hist_field *key_field; @@ -116,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior elt_data = kzalloc(sizeof(*elt_data), GFP_KERNEL); if (!elt_data) -@@ -1793,6 +1819,18 @@ static int hist_trigger_elt_data_alloc(s +@@ -1784,6 +1806,18 @@ static int hist_trigger_elt_data_alloc(s } } @@ -135,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior elt->private_data = elt_data; return 0; -@@ -2477,6 +2515,471 @@ static struct hist_field *parse_expr(str +@@ -2486,6 +2520,470 @@ static struct hist_field *parse_expr(str return ERR_PTR(ret); } @@ -305,7 +294,7 @@ Signed-off-by: Sebastian Andrzej Siewior + /* See if a synthetic field variable has already been created */ + event_var = find_synthetic_field_var(target_hist_data, subsys_name, + event_name, field_name); -+ if (event_var && !IS_ERR(event_var)) ++ if (!IS_ERR_OR_NULL(event_var)) + return event_var; + + var_hist = kzalloc(sizeof(*var_hist), GFP_KERNEL); @@ -367,8 +356,7 @@ Signed-off-by: Sebastian Andrzej Siewior + /* If we can't find the variable, something went wrong */ + event_var = find_synthetic_field_var(target_hist_data, subsys_name, + event_name, field_name); -+ if (!event_var || IS_ERR(event_var)) { -+ kfree(cmd); ++ if (IS_ERR_OR_NULL(event_var)) { + kfree(var_hist->cmd); + kfree(var_hist); + return ERR_PTR(-EINVAL); @@ -607,7 +595,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = -@@ -2932,6 +3435,16 @@ static int create_actions(struct hist_tr +@@ -2941,6 +3439,16 @@ static int create_actions(struct hist_tr return ret; } @@ -624,7 +612,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_hist_data(struct hist_trigger_data *hist_data) { if (!hist_data) -@@ -2942,6 +3455,8 @@ static void destroy_hist_data(struct his +@@ -2951,6 +3459,8 @@ static void destroy_hist_data(struct his tracing_map_destroy(hist_data->map); destroy_actions(hist_data); @@ -633,7 +621,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_data); } -@@ -3078,6 +3593,8 @@ static void hist_trigger_elt_update(stru +@@ -3087,6 +3597,8 @@ static void hist_trigger_elt_update(stru tracing_map_set_var(elt, var_idx, hist_val); } } @@ -642,8 +630,8 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline void add_to_key(char *compound_key, void *key, -@@ -3824,6 +4341,21 @@ static bool hist_trigger_check_refs(stru - return false; +@@ -3533,6 +4045,21 @@ static int event_hist_trigger_init(struc + return 0; } +static void unregister_field_var_hists(struct hist_trigger_data *hist_data) @@ -661,22 +649,15 @@ Signed-off-by: Sebastian Andrzej Siewior + } +} + - static void hist_unregister_trigger(char *glob, struct event_trigger_ops *ops, - struct event_trigger_data *data, - struct trace_event_file *file) -@@ -3839,6 +4371,7 @@ static void hist_unregister_trigger(char - if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { - if (!hist_trigger_match(data, test, named_data, false)) - continue; -+ unregister_field_var_hists(test->private_data); - unregistered = true; - list_del_rcu(&test->list); - trace_event_trigger_enable_disable(file, 0); -@@ -3885,6 +4418,7 @@ static void hist_unreg_all(struct trace_ - list_for_each_entry_safe(test, n, &file->triggers, list) { - if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { - hist_data = test->private_data; -+ unregister_field_var_hists(hist_data); - list_del_rcu(&test->list); - trace_event_trigger_enable_disable(file, 0); + static void event_hist_trigger_free(struct event_trigger_ops *ops, + struct event_trigger_data *data) + { +@@ -3550,6 +4077,8 @@ static void event_hist_trigger_free(stru + remove_hist_vars(hist_data); + ++ unregister_field_var_hists(hist_data); ++ + destroy_hist_data(hist_data); + } + } diff --git a/debian/patches/features/all/rt/0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch b/debian/patches/features/all/rt/0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch index 5d00e3d27..1de7c5af8 100644 --- a/debian/patches/features/all/rt/0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch +++ b/debian/patches/features/all/rt/0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:40:04 +0200 Subject: [PATCH 26/36] hrtimer: Add clock bases and hrtimer mode for soft irq context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz hrtimer callback functions are always executed in hard interrupt context. Users of hrtimer which need their timer function to be executed diff --git a/debian/patches/features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch b/debian/patches/features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch index 98b7a9b94..44d0923c1 100644 --- a/debian/patches/features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch +++ b/debian/patches/features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:05 -0600 +Date: Wed, 6 Dec 2017 16:38:07 -0600 Subject: [PATCH 26/37] tracing: Add 'onmatch' hist trigger action support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add an 'onmatch(matching.event).(param list)' hist trigger action which is invoked with the set of variables or @@ -43,12 +43,21 @@ Signed-off-by: Tom Zanussi Signed-off-by: Rajvi Jingar Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 472 +++++++++++++++++++++++++++++++++++++-- - 1 file changed, 459 insertions(+), 13 deletions(-) + kernel/trace/trace_events_hist.c | 488 +++++++++++++++++++++++++++++++++++++-- + 1 file changed, 475 insertions(+), 13 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -323,7 +323,18 @@ typedef void (*action_fn_t) (struct hist +@@ -285,6 +285,8 @@ struct hist_trigger_data { + struct action_data *actions[HIST_ACTIONS_MAX]; + unsigned int n_actions; + ++ struct hist_field *synth_var_refs[SYNTH_FIELDS_MAX]; ++ unsigned int n_synth_var_refs; + struct field_var *field_vars[SYNTH_FIELDS_MAX]; + unsigned int n_field_vars; + unsigned int n_field_var_str; +@@ -321,7 +323,18 @@ typedef void (*action_fn_t) (struct hist struct action_data { action_fn_t fn; @@ -68,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static LIST_HEAD(synth_event_list); -@@ -889,6 +900,21 @@ static struct synth_event *alloc_synth_e +@@ -887,6 +900,21 @@ static struct synth_event *alloc_synth_e return event; } @@ -87,10 +96,10 @@ Signed-off-by: Sebastian Andrzej Siewior + struct hist_trigger_data *hist_data; +}; + - static int create_synth_event(int argc, char **argv) + static void add_or_delete_synth_event(struct synth_event *event, int delete) { - struct synth_field *field, *fields[SYNTH_FIELDS_MAX]; -@@ -1139,11 +1165,6 @@ static u64 hist_field_timestamp(struct h + if (delete) +@@ -1128,11 +1156,6 @@ static u64 hist_field_timestamp(struct h return ts; } @@ -102,7 +111,22 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field * check_field_for_var_ref(struct hist_field *hist_field, struct hist_trigger_data *var_data, -@@ -1452,6 +1473,37 @@ static struct hist_field *find_file_var( +@@ -1198,6 +1221,14 @@ static struct hist_field *find_var_ref(s + return found; + } + ++ for (i = 0; i < hist_data->n_synth_var_refs; i++) { ++ hist_field = hist_data->synth_var_refs[i]; ++ found = check_field_for_var_refs(hist_data, hist_field, ++ var_data, var_idx, 0); ++ if (found) ++ return found; ++ } ++ + return found; + } + +@@ -1439,6 +1470,37 @@ static struct hist_field *find_file_var( return NULL; } @@ -140,7 +164,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field *find_event_var(struct hist_trigger_data *hist_data, char *system, char *event_name, -@@ -1461,6 +1513,14 @@ static struct hist_field *find_event_var +@@ -1448,6 +1510,14 @@ static struct hist_field *find_event_var struct hist_field *hist_field = NULL; struct trace_event_file *file; @@ -155,7 +179,7 @@ Signed-off-by: Sebastian Andrzej Siewior file = find_var_file(tr, system, event_name, var_name); if (!file) return NULL; -@@ -1652,11 +1712,21 @@ static void destroy_hist_trigger_attrs(s +@@ -1639,11 +1709,21 @@ static void destroy_hist_trigger_attrs(s static int parse_action(char *str, struct hist_trigger_attrs *attrs) { @@ -178,7 +202,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -2643,7 +2713,7 @@ find_synthetic_field_var(struct hist_tri +@@ -2648,7 +2728,7 @@ find_synthetic_field_var(struct hist_tri * * Return: The variable created for the field. */ @@ -187,7 +211,7 @@ Signed-off-by: Sebastian Andrzej Siewior create_field_var_hist(struct hist_trigger_data *target_hist_data, char *subsys_name, char *event_name, char *field_name) { -@@ -2757,7 +2827,7 @@ create_field_var_hist(struct hist_trigge +@@ -2761,7 +2841,7 @@ create_field_var_hist(struct hist_trigge return event_var; } @@ -196,7 +220,7 @@ Signed-off-by: Sebastian Andrzej Siewior find_target_event_var(struct hist_trigger_data *hist_data, char *subsys_name, char *event_name, char *var_name) { -@@ -2928,7 +2998,7 @@ static struct field_var *create_field_va +@@ -2932,7 +3012,7 @@ static struct field_var *create_field_va * * Return: The variable created for the field. */ @@ -205,7 +229,7 @@ Signed-off-by: Sebastian Andrzej Siewior create_target_field_var(struct hist_trigger_data *target_hist_data, char *subsys_name, char *event_name, char *var_name) { -@@ -2952,6 +3022,27 @@ create_target_field_var(struct hist_trig +@@ -2956,6 +3036,27 @@ create_target_field_var(struct hist_trig return create_field_var(target_hist_data, file, var_name); } @@ -233,7 +257,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_field_var(struct field_var *field_var) { if (!field_var) -@@ -2971,8 +3062,8 @@ static void destroy_field_vars(struct hi +@@ -2975,8 +3076,8 @@ static void destroy_field_vars(struct hi destroy_field_var(hist_data->field_vars[i]); } @@ -244,7 +268,7 @@ Signed-off-by: Sebastian Andrzej Siewior { hist_data->field_vars[hist_data->n_field_vars++] = field_var; -@@ -2980,6 +3071,298 @@ void save_field_var(struct hist_trigger_ +@@ -2984,6 +3085,304 @@ void save_field_var(struct hist_trigger_ hist_data->n_field_var_str++; } @@ -404,6 +428,7 @@ Signed-off-by: Sebastian Andrzej Siewior + mutex_unlock(&synth_event_mutex); + return -EINVAL; + } ++ event->ref++; + mutex_unlock(&synth_event_mutex); + + var_ref_idx = hist_data->n_var_refs; @@ -414,7 +439,7 @@ Signed-off-by: Sebastian Andrzej Siewior + p = param = kstrdup(data->params[i], GFP_KERNEL); + if (!param) { + ret = -ENOMEM; -+ goto out; ++ goto err; + } + + system = strsep(¶m, "."); @@ -426,7 +451,7 @@ Signed-off-by: Sebastian Andrzej Siewior + if (!param) { + kfree(p); + ret = -EINVAL; -+ goto out; ++ goto err; + } + } + @@ -442,7 +467,7 @@ Signed-off-by: Sebastian Andrzej Siewior + if (!hist_field) { + kfree(p); + ret = -EINVAL; -+ goto out; ++ goto err; + } + + if (check_synth_field(event, hist_field, field_pos) == 0) { @@ -450,7 +475,7 @@ Signed-off-by: Sebastian Andrzej Siewior + if (!var_ref) { + kfree(p); + ret = -ENOMEM; -+ goto out; ++ goto err; + } + + save_synth_var_ref(hist_data, var_ref); @@ -461,20 +486,25 @@ Signed-off-by: Sebastian Andrzej Siewior + + kfree(p); + ret = -EINVAL; -+ goto out; ++ goto err; + } + + if (field_pos != event->n_fields) { + ret = -EINVAL; -+ goto out; ++ goto err; + } + + data->fn = action_trace; + data->onmatch.synth_event = event; + data->onmatch.var_ref_idx = var_ref_idx; -+ event->ref++; + out: + return ret; ++ err: ++ mutex_lock(&synth_event_mutex); ++ event->ref--; ++ mutex_unlock(&synth_event_mutex); ++ ++ goto out; +} + +static struct action_data *onmatch_parse(struct trace_array *tr, char *str) @@ -543,7 +573,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = -@@ -3404,18 +3787,39 @@ static void destroy_actions(struct hist_ +@@ -3408,18 +3807,39 @@ static void destroy_actions(struct hist_ for (i = 0; i < hist_data->n_actions; i++) { struct action_data *data = hist_data->actions[i]; @@ -584,7 +614,7 @@ Signed-off-by: Sebastian Andrzej Siewior } return ret; -@@ -3430,11 +3834,50 @@ static int create_actions(struct hist_tr +@@ -3434,11 +3854,50 @@ static int create_actions(struct hist_tr for (i = 0; i < hist_data->attrs->n_actions; i++) { data = hist_data->actions[i]; @@ -635,7 +665,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_field_var_hists(struct hist_trigger_data *hist_data) { unsigned int i; -@@ -3457,6 +3900,7 @@ static void destroy_hist_data(struct his +@@ -3461,6 +3920,7 @@ static void destroy_hist_data(struct his destroy_actions(hist_data); destroy_field_vars(hist_data); destroy_field_var_hists(hist_data); @@ -643,7 +673,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_data); } -@@ -4015,6 +4459,8 @@ static int event_hist_trigger_print(stru +@@ -4019,6 +4479,8 @@ static int event_hist_trigger_print(stru } seq_printf(m, ":size=%u", (1 << hist_data->map->map_bits)); diff --git a/debian/patches/features/all/rt/0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch b/debian/patches/features/all/rt/0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch index f67468db7..165940c4a 100644 --- a/debian/patches/features/all/rt/0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch +++ b/debian/patches/features/all/rt/0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:40:05 +0200 Subject: [PATCH 27/36] hrtimer: Prepare handling of hard and softirq based hrtimers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The softirq based hrtimer can utilize most of the existing hrtimers functions, but need to operate on a different data set. diff --git a/debian/patches/features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch b/debian/patches/features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch index 875d4c0f5..a24161b5a 100644 --- a/debian/patches/features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch +++ b/debian/patches/features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:06 -0600 +Date: Wed, 6 Dec 2017 16:38:08 -0600 Subject: [PATCH 27/37] tracing: Add 'onmax' hist trigger action support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add an 'onmax(var).save(field,...)' hist trigger action which is invoked whenever an event exceeds the current maximum. @@ -21,12 +21,12 @@ the timestamp difference is calculated. If the resulting latency exceeds the current maximum latency, the specified save() values are saved: - # echo 'hist:keys=pid:ts0=$common_timestamp.usecs \ + # echo 'hist:keys=pid:ts0=common_timestamp.usecs \ if comm=="cyclictest"' >> \ /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger # echo 'hist:keys=next_pid:\ - wakeup_lat=$common_timestamp.usecs-$ts0:\ + wakeup_lat=common_timestamp.usecs-$ts0:\ onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) \ if next_comm=="cyclictest"' >> \ /sys/kernel/debug/tracing/events/sched/sched_switch/trigger @@ -86,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; }; -@@ -1717,7 +1729,8 @@ static int parse_action(char *str, struc +@@ -1714,7 +1726,8 @@ static int parse_action(char *str, struc if (attrs->n_actions >= HIST_ACTIONS_MAX) return ret; @@ -96,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior attrs->action_str[attrs->n_actions] = kstrdup(str, GFP_KERNEL); if (!attrs->action_str[attrs->n_actions]) { ret = -ENOMEM; -@@ -1889,7 +1902,7 @@ static int hist_trigger_elt_data_alloc(s +@@ -1886,7 +1899,7 @@ static int hist_trigger_elt_data_alloc(s } } @@ -105,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior size = STR_VAR_LEN_MAX; -@@ -2893,6 +2906,15 @@ static void update_field_vars(struct his +@@ -2907,6 +2920,15 @@ static void update_field_vars(struct his hist_data->n_field_vars, 0); } @@ -121,7 +121,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field *create_var(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *name, int size, const char *type) -@@ -3022,6 +3044,227 @@ create_target_field_var(struct hist_trig +@@ -3036,6 +3058,227 @@ create_target_field_var(struct hist_trig return create_field_var(target_hist_data, file, var_name); } @@ -191,13 +191,11 @@ Signed-off-by: Sebastian Andrzej Siewior +static int onmax_create(struct hist_trigger_data *hist_data, + struct action_data *data) +{ -+ struct trace_event_call *call = hist_data->event_file->event_call; + struct trace_event_file *file = hist_data->event_file; + struct hist_field *var_field, *ref_field, *max_var; + unsigned int var_ref_idx = hist_data->n_var_refs; + struct field_var *field_var; + char *onmax_var_str, *param; -+ const char *event_name; + unsigned long flags; + unsigned int i; + int ret = 0; @@ -207,7 +205,6 @@ Signed-off-by: Sebastian Andrzej Siewior + return -EINVAL; + onmax_var_str++; + -+ event_name = trace_event_name(call); + var_field = find_target_event_var(hist_data, NULL, NULL, onmax_var_str); + if (!var_field) + return -EINVAL; @@ -303,8 +300,11 @@ Signed-off-by: Sebastian Andrzej Siewior + return ERR_PTR(-ENOMEM); + + onmax_var_str = strsep(&str, ")"); -+ if (!onmax_var_str || !str) -+ return ERR_PTR(-EINVAL); ++ if (!onmax_var_str || !str) { ++ ret = -EINVAL; ++ goto free; ++ } ++ + data->onmax.var_str = kstrdup(onmax_var_str, GFP_KERNEL); + if (!data->onmax.var_str) { + ret = -ENOMEM; @@ -349,7 +349,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void onmatch_destroy(struct action_data *data) { unsigned int i; -@@ -3106,39 +3349,6 @@ static int check_synth_field(struct synt +@@ -3120,39 +3363,6 @@ static int check_synth_field(struct synt return 0; } @@ -389,7 +389,7 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field * onmatch_find_var(struct hist_trigger_data *hist_data, struct action_data *data, char *system, char *event, char *var) -@@ -3789,6 +3999,8 @@ static void destroy_actions(struct hist_ +@@ -3809,6 +4019,8 @@ static void destroy_actions(struct hist_ if (data->fn == action_trace) onmatch_destroy(data); @@ -398,7 +398,7 @@ Signed-off-by: Sebastian Andrzej Siewior else kfree(data); } -@@ -3814,6 +4026,15 @@ static int parse_actions(struct hist_tri +@@ -3834,6 +4046,15 @@ static int parse_actions(struct hist_tri break; } data->fn = action_trace; @@ -414,7 +414,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else { ret = -EINVAL; break; -@@ -3839,12 +4060,48 @@ static int create_actions(struct hist_tr +@@ -3859,12 +4080,48 @@ static int create_actions(struct hist_tr ret = onmatch_create(hist_data, file, data); if (ret) return ret; @@ -463,7 +463,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void print_onmatch_spec(struct seq_file *m, struct hist_trigger_data *hist_data, struct action_data *data) -@@ -3875,6 +4132,8 @@ static void print_actions_spec(struct se +@@ -3895,6 +4152,8 @@ static void print_actions_spec(struct se if (data->fn == action_trace) print_onmatch_spec(m, hist_data, data); @@ -472,7 +472,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -4256,6 +4515,8 @@ hist_trigger_entry_print(struct seq_file +@@ -4276,6 +4535,8 @@ hist_trigger_entry_print(struct seq_file } } diff --git a/debian/patches/features/all/rt/0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch b/debian/patches/features/all/rt/0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch index a57d87139..4d6c4c834 100644 --- a/debian/patches/features/all/rt/0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch +++ b/debian/patches/features/all/rt/0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:40:06 +0200 Subject: [PATCH 28/36] hrtimer: Implement support for softirq based hrtimers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz hrtimer callbacks are always invoked in hard interrupt context. Several users in tree require soft interrupt context for their callbacks and diff --git a/debian/patches/features/all/rt/0028-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch b/debian/patches/features/all/rt/0028-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch index 84becd2e1..919b409ad 100644 --- a/debian/patches/features/all/rt/0028-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch +++ b/debian/patches/features/all/rt/0028-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:07 -0600 +Date: Wed, 6 Dec 2017 16:38:09 -0600 Subject: [PATCH 28/37] tracing: Allow whitespace to surround hist trigger filter -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The existing code only allows for one space before and after the 'if' specifying the filter for a hist trigger. Add code to make that more @@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -5157,7 +5157,7 @@ static int event_hist_trigger_func(struc +@@ -5177,7 +5177,7 @@ static int event_hist_trigger_func(struc struct synth_event *se; const char *se_name; bool remove = false; @@ -28,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior int ret = 0; if (!param) -@@ -5166,10 +5166,37 @@ static int event_hist_trigger_func(struc +@@ -5186,10 +5186,37 @@ static int event_hist_trigger_func(struc if (glob[0] == '!') remove = true; diff --git a/debian/patches/features/all/rt/0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch b/debian/patches/features/all/rt/0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch index e1101059f..193413d29 100644 --- a/debian/patches/features/all/rt/0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch +++ b/debian/patches/features/all/rt/0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:40:07 +0200 Subject: [PATCH 29/36] hrtimer: Implement SOFT/HARD clock base selection -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz All prerequisites to handle hrtimers for expiry in either hard or soft interrupt context are in place. diff --git a/debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch b/debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch index 8d48422a1..b7b05159e 100644 --- a/debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch +++ b/debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch @@ -1,24 +1,21 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:08 -0600 +Date: Wed, 6 Dec 2017 16:38:10 -0600 Subject: [PATCH 29/37] tracing: Add cpu field for hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz A common key to use in a histogram is the cpuid - add a new cpu -'synthetic' field for that purpose. This field is named cpu rather -than $cpu or $common_cpu because 'cpu' already exists as a special -filter field and it makes more sense to match that rather than add -another name for the same thing. +'synthetic' field named 'cpu' for that purpose. Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/histogram.txt | 17 +++++++++++++++++ + Documentation/trace/histogram.txt | 15 +++++++++++++++ kernel/trace/trace_events_hist.c | 28 +++++++++++++++++++++++++++- - 2 files changed, 44 insertions(+), 1 deletion(-) + 2 files changed, 42 insertions(+), 1 deletion(-) --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt -@@ -172,6 +172,23 @@ +@@ -172,6 +172,21 @@ The examples below provide a more concrete illustration of the concepts and typical usage patterns discussed above. @@ -30,11 +27,9 @@ Signed-off-by: Sebastian Andrzej Siewior + they were actual event fields, but aren't really part of the event's + field definition or format file. They are however available for any + event, and can be used anywhere an actual event field could be. -+ 'Special' field names are always prefixed with a '$' character to -+ indicate that they're not normal fields (with the exception of -+ 'cpu', for compatibility with existing filter usage): ++ They are: + -+ $common_timestamp u64 - timestamp (from ring buffer) associated ++ common_timestamp u64 - timestamp (from ring buffer) associated + with the event, in nanoseconds. May be + modified by .usecs to have timestamps + interpreted as microseconds. @@ -52,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct var_defs { -@@ -1177,6 +1178,16 @@ static u64 hist_field_timestamp(struct h +@@ -1168,6 +1169,16 @@ static u64 hist_field_timestamp(struct h return ts; } @@ -69,23 +64,23 @@ Signed-off-by: Sebastian Andrzej Siewior static struct hist_field * check_field_for_var_ref(struct hist_field *hist_field, struct hist_trigger_data *var_data, -@@ -1622,6 +1633,8 @@ static const char *hist_field_name(struc +@@ -1619,6 +1630,8 @@ static const char *hist_field_name(struc field_name = hist_field_name(field->operands[0], ++level); else if (field->flags & HIST_FIELD_FL_TIMESTAMP) - field_name = "$common_timestamp"; + field_name = "common_timestamp"; + else if (field->flags & HIST_FIELD_FL_CPU) + field_name = "cpu"; else if (field->flags & HIST_FIELD_FL_EXPR || field->flags & HIST_FIELD_FL_VAR_REF) { if (field->system) { -@@ -2125,6 +2138,15 @@ static struct hist_field *create_hist_fi +@@ -2124,6 +2137,15 @@ static struct hist_field *create_hist_fi goto out; } + if (flags & HIST_FIELD_FL_CPU) { + hist_field->fn = hist_field_cpu; + hist_field->size = sizeof(int); -+ hist_field->type = kstrdup("int", GFP_KERNEL); ++ hist_field->type = kstrdup("unsigned int", GFP_KERNEL); + if (!hist_field->type) + goto free; + goto out; @@ -94,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON_ONCE(!field)) goto out; -@@ -2343,7 +2365,9 @@ parse_field(struct hist_trigger_data *hi +@@ -2358,7 +2380,9 @@ parse_field(struct hist_trigger_data *hi hist_data->enable_timestamps = true; if (*flags & HIST_FIELD_FL_TIMESTAMP_USECS) hist_data->attrs->ts_in_usecs = true; @@ -105,10 +100,10 @@ Signed-off-by: Sebastian Andrzej Siewior field = trace_find_event_field(file->event_call, field_name); if (!field || !field->size) { field = ERR_PTR(-EINVAL); -@@ -4614,6 +4638,8 @@ static void hist_field_print(struct seq_ +@@ -4634,6 +4658,8 @@ static void hist_field_print(struct seq_ if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) - seq_puts(m, "$common_timestamp"); + seq_puts(m, "common_timestamp"); + else if (hist_field->flags & HIST_FIELD_FL_CPU) + seq_puts(m, "cpu"); else if (field_name) { diff --git a/debian/patches/features/all/rt/0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch b/debian/patches/features/all/rt/0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch index 70b21d8a9..67bd3b4f9 100644 --- a/debian/patches/features/all/rt/0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch +++ b/debian/patches/features/all/rt/0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:11 +0100 Subject: [PATCH 30/36] can/bcm: Replace hrtimer_tasklet with softirq based hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. diff --git a/debian/patches/features/all/rt/0030-tracing-Add-hist-trigger-support-for-variable-refere.patch b/debian/patches/features/all/rt/0030-tracing-Add-hist-trigger-support-for-variable-refere.patch index 2b7ba886c..2f2a86b44 100644 --- a/debian/patches/features/all/rt/0030-tracing-Add-hist-trigger-support-for-variable-refere.patch +++ b/debian/patches/features/all/rt/0030-tracing-Add-hist-trigger-support-for-variable-refere.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:09 -0600 +Date: Wed, 6 Dec 2017 16:38:11 -0600 Subject: [PATCH 30/37] tracing: Add hist trigger support for variable reference aliases -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add support for alias=$somevar where alias can be used as onmatch.xxx($alias). @@ -14,7 +14,7 @@ event invocation is opaque or doesn't fit well stylistically with previous triggers, so creates an alias of $new_lat named $latency and uses that in the call instead: - # echo 'hist:keys=next_pid:new_lat=$common_timestamp.usecs' > + # echo 'hist:keys=next_pid:new_lat=common_timestamp.usecs' > /sys/kernel/debug/tracing/events/sched/sched_switch/trigger # echo 'hist:keys=pid:latency=$new_lat: @@ -37,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct var_defs { -@@ -1629,7 +1630,8 @@ static const char *hist_field_name(struc +@@ -1626,7 +1627,8 @@ static const char *hist_field_name(struc if (field->field) field_name = field->field->name; @@ -46,8 +46,8 @@ Signed-off-by: Sebastian Andrzej Siewior + field->flags & HIST_FIELD_FL_ALIAS) field_name = hist_field_name(field->operands[0], ++level); else if (field->flags & HIST_FIELD_FL_TIMESTAMP) - field_name = "$common_timestamp"; -@@ -2096,7 +2098,7 @@ static struct hist_field *create_hist_fi + field_name = "common_timestamp"; +@@ -2095,7 +2097,7 @@ static struct hist_field *create_hist_fi hist_field->hist_data = hist_data; @@ -56,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; /* caller will populate */ if (flags & HIST_FIELD_FL_VAR_REF) { -@@ -2380,6 +2382,28 @@ parse_field(struct hist_trigger_data *hi +@@ -2395,6 +2397,28 @@ parse_field(struct hist_trigger_data *hi return field; } @@ -85,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct hist_field *parse_atom(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *str, unsigned long *flags, char *var_name) -@@ -2413,6 +2437,13 @@ struct hist_field *parse_atom(struct his +@@ -2428,6 +2452,13 @@ struct hist_field *parse_atom(struct his if (hist_field) { hist_data->var_refs[hist_data->n_var_refs] = hist_field; hist_field->var_ref_idx = hist_data->n_var_refs++; @@ -99,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior return hist_field; } } else -@@ -2517,6 +2548,26 @@ static int check_expr_operands(struct hi +@@ -2532,6 +2563,26 @@ static int check_expr_operands(struct hi unsigned long operand1_flags = operand1->flags; unsigned long operand2_flags = operand2->flags; @@ -126,7 +126,7 @@ Signed-off-by: Sebastian Andrzej Siewior if ((operand1_flags & HIST_FIELD_FL_TIMESTAMP_USECS) != (operand2_flags & HIST_FIELD_FL_TIMESTAMP_USECS)) return -EINVAL; -@@ -4641,7 +4692,8 @@ static void hist_field_print(struct seq_ +@@ -4661,7 +4712,8 @@ static void hist_field_print(struct seq_ else if (hist_field->flags & HIST_FIELD_FL_CPU) seq_puts(m, "cpu"); else if (field_name) { diff --git a/debian/patches/features/all/rt/0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch b/debian/patches/features/all/rt/0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch index ecf9f3467..ed0579bc5 100644 --- a/debian/patches/features/all/rt/0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch +++ b/debian/patches/features/all/rt/0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:12 +0100 Subject: [PATCH 31/36] mac80211_hwsim: Replace hrtimer tasklet with softirq hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. diff --git a/debian/patches/features/all/rt/0031-tracing-Add-last-error-error-facility-for-hist-trigg.patch b/debian/patches/features/all/rt/0031-tracing-Add-last-error-error-facility-for-hist-trigg.patch index c9341d21d..bfaf54961 100644 --- a/debian/patches/features/all/rt/0031-tracing-Add-last-error-error-facility-for-hist-trigg.patch +++ b/debian/patches/features/all/rt/0031-tracing-Add-last-error-error-facility-for-hist-trigg.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:10 -0600 +Date: Wed, 6 Dec 2017 16:38:12 -0600 Subject: [PATCH 31/37] tracing: Add 'last error' error facility for hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz With the addition of variables and actions, it's become necessary to provide more detailed error information to users about syntax errors. @@ -27,12 +27,12 @@ Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- Documentation/trace/histogram.txt | 20 ++++ - kernel/trace/trace_events_hist.c | 167 +++++++++++++++++++++++++++++++++++--- - 2 files changed, 174 insertions(+), 13 deletions(-) + kernel/trace/trace_events_hist.c | 156 +++++++++++++++++++++++++++++++++++--- + 2 files changed, 164 insertions(+), 12 deletions(-) --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt -@@ -190,6 +190,26 @@ +@@ -188,6 +188,26 @@ interpreted as microseconds. cpu int - the cpu on which the event occurred. @@ -127,7 +127,7 @@ Signed-off-by: Sebastian Andrzej Siewior static LIST_HEAD(synth_event_list); static DEFINE_MUTEX(synth_event_mutex); -@@ -1458,6 +1517,7 @@ static struct trace_event_file *find_var +@@ -1455,6 +1514,7 @@ static struct trace_event_file *find_var if (!system || !event_name) { if (find_var(var_hist_data, file, var_name)) { if (found) { @@ -135,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior return NULL; } -@@ -1518,6 +1578,7 @@ find_match_var(struct hist_trigger_data +@@ -1515,6 +1575,7 @@ find_match_var(struct hist_trigger_data hist_field = find_file_var(file, var_name); if (hist_field) { if (found) { @@ -143,7 +143,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ERR_PTR(-EINVAL); } -@@ -1801,6 +1862,7 @@ static int parse_assignment(char *str, s +@@ -1798,6 +1859,7 @@ static int parse_assignment(char *str, s char *assignment; if (attrs->n_assignments == TRACING_MAP_VARS_MAX) { @@ -151,27 +151,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto out; } -@@ -2271,9 +2333,18 @@ static struct hist_field *create_var_ref - return ref_field; - } - -+static bool is_common_field(char *var_name) -+{ -+ if (strncmp(var_name, "$common_timestamp", strlen("$common_timestamp")) == 0) -+ return true; -+ -+ return false; -+} -+ - static bool is_var_ref(char *var_name) - { -- if (!var_name || strlen(var_name) < 2 || var_name[0] != '$') -+ if (!var_name || strlen(var_name) < 2 || var_name[0] != '$' || -+ is_common_field(var_name)) - return false; - - return true; -@@ -2325,6 +2396,10 @@ static struct hist_field *parse_var_ref( +@@ -2340,6 +2402,10 @@ static struct hist_field *parse_var_ref( if (var_field) ref_field = create_var_ref(var_field, system, event_name); @@ -182,7 +162,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ref_field; } -@@ -2569,8 +2644,10 @@ static int check_expr_operands(struct hi +@@ -2584,8 +2650,10 @@ static int check_expr_operands(struct hi } if ((operand1_flags & HIST_FIELD_FL_TIMESTAMP_USECS) != @@ -194,7 +174,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -2816,12 +2893,17 @@ create_field_var_hist(struct hist_trigge +@@ -2831,12 +2899,17 @@ create_field_var_hist(struct hist_trigge char *cmd; int ret; @@ -213,7 +193,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = PTR_ERR(file); return ERR_PTR(ret); } -@@ -2833,8 +2915,11 @@ create_field_var_hist(struct hist_trigge +@@ -2848,8 +2921,11 @@ create_field_var_hist(struct hist_trigge * yet a registered histogram so we can't use that. */ hist_data = find_compatible_hist(target_hist_data, file); @@ -226,7 +206,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* See if a synthetic field variable has already been created */ event_var = find_synthetic_field_var(target_hist_data, subsys_name, -@@ -2893,6 +2978,8 @@ create_field_var_hist(struct hist_trigge +@@ -2908,6 +2984,8 @@ create_field_var_hist(struct hist_trigge kfree(cmd); kfree(var_hist->cmd); kfree(var_hist); @@ -235,8 +215,8 @@ Signed-off-by: Sebastian Andrzej Siewior return ERR_PTR(ret); } -@@ -2905,6 +2992,8 @@ create_field_var_hist(struct hist_trigge - kfree(cmd); +@@ -2919,6 +2997,8 @@ create_field_var_hist(struct hist_trigge + if (IS_ERR_OR_NULL(event_var)) { kfree(var_hist->cmd); kfree(var_hist); + hist_err_event("onmatch: Couldn't find synthetic variable: ", @@ -244,7 +224,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ERR_PTR(-EINVAL); } -@@ -3041,18 +3130,21 @@ static struct field_var *create_field_va +@@ -3055,18 +3135,21 @@ static struct field_var *create_field_va int ret = 0; if (hist_data->n_field_vars >= SYNTH_FIELDS_MAX) { @@ -266,7 +246,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(val); ret = PTR_ERR(var); goto err; -@@ -3197,14 +3289,18 @@ static int onmax_create(struct hist_trig +@@ -3209,13 +3292,17 @@ static int onmax_create(struct hist_trig int ret = 0; onmax_var_str = data->onmax.var_str; @@ -277,7 +257,6 @@ Signed-off-by: Sebastian Andrzej Siewior + } onmax_var_str++; - event_name = trace_event_name(call); var_field = find_target_event_var(hist_data, NULL, NULL, onmax_var_str); - if (!var_field) + if (!var_field) { @@ -287,7 +266,7 @@ Signed-off-by: Sebastian Andrzej Siewior flags = HIST_FIELD_FL_VAR_REF; ref_field = create_hist_field(hist_data, NULL, flags, NULL); -@@ -3224,6 +3320,7 @@ static int onmax_create(struct hist_trig +@@ -3235,6 +3322,7 @@ static int onmax_create(struct hist_trig data->onmax.max_var_ref_idx = var_ref_idx; max_var = create_var(hist_data, file, "max", sizeof(u64), "u64"); if (IS_ERR(max_var)) { @@ -295,7 +274,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = PTR_ERR(max_var); goto out; } -@@ -3238,6 +3335,7 @@ static int onmax_create(struct hist_trig +@@ -3249,6 +3337,7 @@ static int onmax_create(struct hist_trig field_var = create_target_field_var(hist_data, NULL, NULL, param); if (IS_ERR(field_var)) { @@ -303,7 +282,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = PTR_ERR(field_var); kfree(param); goto out; -@@ -3270,6 +3368,7 @@ static int parse_action_params(char *par +@@ -3281,6 +3370,7 @@ static int parse_action_params(char *par param = strstrip(param); if (strlen(param) < 2) { @@ -311,7 +290,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto out; } -@@ -3442,6 +3541,9 @@ onmatch_find_var(struct hist_trigger_dat +@@ -3456,6 +3546,9 @@ onmatch_find_var(struct hist_trigger_dat hist_field = find_event_var(hist_data, system, event, var); } @@ -321,7 +300,7 @@ Signed-off-by: Sebastian Andrzej Siewior return hist_field; } -@@ -3509,6 +3611,7 @@ static int onmatch_create(struct hist_tr +@@ -3523,6 +3616,7 @@ static int onmatch_create(struct hist_tr mutex_lock(&synth_event_mutex); event = find_synth_event(data->onmatch.synth_event_name); if (!event) { @@ -329,7 +308,7 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_unlock(&synth_event_mutex); return -EINVAL; } -@@ -3567,12 +3670,15 @@ static int onmatch_create(struct hist_tr +@@ -3582,12 +3676,15 @@ static int onmatch_create(struct hist_tr continue; } @@ -337,15 +316,15 @@ Signed-off-by: Sebastian Andrzej Siewior + system, event_name, param); kfree(p); ret = -EINVAL; - goto out; + goto err; } if (field_pos != event->n_fields) { + hist_err("onmatch: Param count doesn't match synthetic event field count: ", event->name); ret = -EINVAL; - goto out; + goto err; } -@@ -3597,15 +3703,22 @@ static struct action_data *onmatch_parse +@@ -3617,15 +3714,22 @@ static struct action_data *onmatch_parse return ERR_PTR(-ENOMEM); match_event = strsep(&str, ")"); @@ -371,7 +350,7 @@ Signed-off-by: Sebastian Andrzej Siewior data->onmatch.match_event = kstrdup(match_event, GFP_KERNEL); if (!data->onmatch.match_event) { -@@ -3620,12 +3733,16 @@ static struct action_data *onmatch_parse +@@ -3640,12 +3744,16 @@ static struct action_data *onmatch_parse } strsep(&str, "."); @@ -390,7 +369,7 @@ Signed-off-by: Sebastian Andrzej Siewior data->onmatch.synth_event_name = kstrdup(synth_event_name, GFP_KERNEL); if (!data->onmatch.synth_event_name) { -@@ -3634,8 +3751,10 @@ static struct action_data *onmatch_parse +@@ -3654,8 +3762,10 @@ static struct action_data *onmatch_parse } params = strsep(&str, ")"); @@ -402,7 +381,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = parse_action_params(params, data); if (ret) -@@ -3710,7 +3829,9 @@ static int create_var_field(struct hist_ +@@ -3730,7 +3840,9 @@ static int create_var_field(struct hist_ if (WARN_ON(val_idx >= TRACING_MAP_VALS_MAX + TRACING_MAP_VARS_MAX)) return -EINVAL; @@ -412,7 +391,7 @@ Signed-off-by: Sebastian Andrzej Siewior return -EINVAL; } -@@ -3791,6 +3912,7 @@ static int create_key_field(struct hist_ +@@ -3811,6 +3923,7 @@ static int create_key_field(struct hist_ } if (hist_field->flags & HIST_FIELD_FL_VAR_REF) { @@ -420,7 +399,7 @@ Signed-off-by: Sebastian Andrzej Siewior destroy_hist_field(hist_field, 0); ret = -EINVAL; goto out; -@@ -3904,11 +4026,13 @@ static int parse_var_defs(struct hist_tr +@@ -3924,11 +4037,13 @@ static int parse_var_defs(struct hist_tr var_name = strsep(&field_str, "="); if (!var_name || !field_str) { @@ -434,7 +413,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto free; } -@@ -4662,6 +4786,11 @@ static int hist_show(struct seq_file *m, +@@ -4682,6 +4797,11 @@ static int hist_show(struct seq_file *m, hist_trigger_show(m, data, n++); } @@ -446,7 +425,7 @@ Signed-off-by: Sebastian Andrzej Siewior out_unlock: mutex_unlock(&event_mutex); -@@ -5009,6 +5138,7 @@ static int hist_register_trigger(char *g +@@ -5046,6 +5166,7 @@ static int hist_register_trigger(char *g if (named_data) { if (!hist_trigger_match(data, named_data, named_data, true)) { @@ -454,7 +433,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto out; } -@@ -5028,13 +5158,16 @@ static int hist_register_trigger(char *g +@@ -5065,13 +5186,16 @@ static int hist_register_trigger(char *g test->paused = false; else if (hist_data->attrs->clear) hist_clear(test); @@ -472,7 +451,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -ENOENT; goto out; } -@@ -5238,6 +5371,11 @@ static int event_hist_trigger_func(struc +@@ -5258,6 +5382,11 @@ static int event_hist_trigger_func(struc char *trigger, *p; int ret = 0; @@ -484,7 +463,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!param) return -EINVAL; -@@ -5376,6 +5514,9 @@ static int event_hist_trigger_func(struc +@@ -5396,6 +5525,9 @@ static int event_hist_trigger_func(struc /* Just return zero, not the number of registered triggers */ ret = 0; out: diff --git a/debian/patches/features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch b/debian/patches/features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch index 06d91513c..9421e641b 100644 --- a/debian/patches/features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch +++ b/debian/patches/features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:11 -0600 +Date: Wed, 6 Dec 2017 16:38:13 -0600 Subject: [PATCH 32/37] tracing: Add inter-event hist trigger Documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add background and details on inter-event hist triggers, including hist variables, synthetic events, and actions. @@ -10,12 +10,12 @@ Signed-off-by: Tom Zanussi Signed-off-by: Baohong Liu Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/histogram.txt | 382 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 382 insertions(+) + Documentation/trace/histogram.txt | 381 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 381 insertions(+) --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt -@@ -1605,3 +1605,385 @@ +@@ -1603,3 +1603,384 @@ Hits: 489 Entries: 7 Dropped: 0 @@ -80,12 +80,11 @@ Signed-off-by: Sebastian Andrzej Siewior + - Trace events don't have a 'timestamp' associated with them, but + there is an implicit timestamp saved along with an event in the + underlying ftrace ring buffer. This timestamp is now exposed as a -+ a synthetic field named '$common_timestamp' which can be used in -+ histograms as if it were any other event field. Note that it has -+ a '$' prefixed to it - this is meant to indicate that it isn't an -+ actual field in the trace format but rather is a synthesized value -+ that nonetheless can be used as if it were an actual field. By -+ default it is in units of nanoseconds; appending '.usecs' to a ++ a synthetic field named 'common_timestamp' which can be used in ++ histograms as if it were any other event field; it isn't an actual ++ field in the trace format but rather is a synthesized value that ++ nonetheless can be used as if it were an actual field. By default ++ it is in units of nanoseconds; appending '.usecs' to a + common_timestamp field changes the units to microseconds. + +These features are decribed in more detail in the following sections. @@ -116,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior +creates a variable named 'ts0' for a histogram entry with the key +'next_pid': + -+ # echo 'hist:keys=next_pid:vals=$ts0:ts0=$common_timestamp ... >> \ ++ # echo 'hist:keys=next_pid:vals=$ts0:ts0=common_timestamp ... >> \ + event/trigger + +The ts0 variable can be accessed by any subsequent event having the @@ -126,7 +125,7 @@ Signed-off-by: Sebastian Andrzej Siewior +the '$' sign. Thus for example, the ts0 variable above would be +referenced as '$ts0' in expressions. + -+Because 'vals=' is used, the $common_timestamp variable value above ++Because 'vals=' is used, the common_timestamp variable value above +will also be summed as a normal histogram value would (though for a +timestamp it makes little sense). + @@ -138,35 +137,35 @@ Signed-off-by: Sebastian Andrzej Siewior +associated event field will be saved in a variable but won't be summed +as a value: + -+ # echo 'hist:keys=next_pid:ts1=$common_timestamp ... >> event/trigger ++ # echo 'hist:keys=next_pid:ts1=common_timestamp ... >> event/trigger + +Multiple variables can be assigned at the same time. The below would +result in both ts0 and b being created as variables, with both +common_timestamp and field1 additionally being summed as values: + -+ # echo 'hist:keys=pid:vals=$ts0,$b:ts0=$common_timestamp,b=field1 ... >> \ ++ # echo 'hist:keys=pid:vals=$ts0,$b:ts0=common_timestamp,b=field1 ... >> \ + event/trigger + +Note that variable assignments can appear either preceding or +following their use. The command below behaves identically to the +command above: + -+ # echo 'hist:keys=pid:ts0=$common_timestamp,b=field1:vals=$ts0,$b ... >> \ ++ # echo 'hist:keys=pid:ts0=common_timestamp,b=field1:vals=$ts0,$b ... >> \ + event/trigger + +Any number of variables not bound to a 'vals=' prefix can also be +assigned by simply separating them with colons. Below is the same +thing but without the values being summed in the histogram: + -+ # echo 'hist:keys=pid:ts0=$common_timestamp:b=field1 ... >> event/trigger ++ # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ... >> event/trigger + +Variables set as above can be referenced and used in expressions on +another event. + +For example, here's how a latency can be calculated: + -+ # echo 'hist:keys=pid,prio:ts0=$common_timestamp ... >> event1/trigger -+ # echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp-$ts0 ... >> event2/trigger ++ # echo 'hist:keys=pid,prio:ts0=common_timestamp ... >> event1/trigger ++ # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ... >> event2/trigger + +In the first line above, the event's timetamp is saved into the +variable ts0. In the next line, ts0 is subtracted from the second @@ -323,7 +322,7 @@ Signed-off-by: Sebastian Andrzej Siewior + Next, we specify that whenever we see a sched_waking event for a + cyclictest thread, save the timestamp in a 'ts0' variable: + -+ # echo 'hist:keys=$saved_pid:saved_pid=pid:ts0=$common_timestamp.usecs \ ++ # echo 'hist:keys=$saved_pid:saved_pid=pid:ts0=common_timestamp.usecs \ + if comm=="cyclictest"' >> \ + /sys/kernel/debug/tracing/events/sched/sched_waking/trigger + @@ -332,7 +331,7 @@ Signed-off-by: Sebastian Andrzej Siewior + along with another variable and an event field to generate a + wakeup_latency synthetic event: + -+ # echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0:\ ++ # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:\ + onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,\ + $saved_pid,next_prio) if next_comm=="cyclictest"' >> \ + /sys/kernel/debug/tracing/events/sched/sched_switch/trigger @@ -371,12 +370,12 @@ Signed-off-by: Sebastian Andrzej Siewior + maximum latency, the values specified in the save() fields are + recoreded: + -+ # echo 'hist:keys=pid:ts0=$common_timestamp.usecs \ ++ # echo 'hist:keys=pid:ts0=common_timestamp.usecs \ + if comm=="cyclictest"' >> \ + /sys/kernel/debug/tracing/events/sched/sched_waking/trigger + + # echo 'hist:keys=next_pid:\ -+ wakeup_lat=$common_timestamp.usecs-$ts0:\ ++ wakeup_lat=common_timestamp.usecs-$ts0:\ + onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) \ + if next_comm=="cyclictest"' >> \ + /sys/kernel/debug/tracing/events/sched/sched_switch/trigger diff --git a/debian/patches/features/all/rt/0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch b/debian/patches/features/all/rt/0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch index 14d0867dd..3d86dc0fa 100644 --- a/debian/patches/features/all/rt/0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch +++ b/debian/patches/features/all/rt/0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:13 +0100 Subject: [PATCH 32/36] xfrm: Replace hrtimer tasklet with softirq hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. diff --git a/debian/patches/features/all/rt/0033-softirq-Remove-tasklet_hrtimer.patch b/debian/patches/features/all/rt/0033-softirq-Remove-tasklet_hrtimer.patch index 5b9966d9e..dbd3a5552 100644 --- a/debian/patches/features/all/rt/0033-softirq-Remove-tasklet_hrtimer.patch +++ b/debian/patches/features/all/rt/0033-softirq-Remove-tasklet_hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:14 +0100 Subject: [PATCH 33/36] softirq: Remove tasklet_hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz There are no more tasklet_hrtimer users of this interface. Remove it. diff --git a/debian/patches/features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch b/debian/patches/features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch index b45308236..1a4d07524 100644 --- a/debian/patches/features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch +++ b/debian/patches/features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:12 -0600 +Date: Wed, 6 Dec 2017 16:38:14 -0600 Subject: [PATCH 33/37] tracing: Make tracing_set_clock() non-static -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Allow tracing code outside of trace.c to access tracing_set_clock(). diff --git a/debian/patches/features/all/rt/0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch b/debian/patches/features/all/rt/0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch index 19a91aad6..4395e4856 100644 --- a/debian/patches/features/all/rt/0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch +++ b/debian/patches/features/all/rt/0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:15 +0100 Subject: [PATCH 34/36] ALSA/dummy: Replace tasklet with softirq hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The tasklet is used to defer the execution of snd_pcm_period_elapsed() to the softirq context. Using the HRTIMER_MODE_SOFT mode invokes the timer diff --git a/debian/patches/features/all/rt/0034-tracing-Add-a-clock-attribute-for-hist-triggers.patch b/debian/patches/features/all/rt/0034-tracing-Add-a-clock-attribute-for-hist-triggers.patch index e3dceee22..77f92c4ba 100644 --- a/debian/patches/features/all/rt/0034-tracing-Add-a-clock-attribute-for-hist-triggers.patch +++ b/debian/patches/features/all/rt/0034-tracing-Add-a-clock-attribute-for-hist-triggers.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:13 -0600 +Date: Wed, 6 Dec 2017 16:38:15 -0600 Subject: [PATCH 34/37] tracing: Add a clock attribute for hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The default clock if timestamps are used in a histogram is "global". If timestamps aren't used, the clock is irrelevant. @@ -13,18 +13,18 @@ Signed-off-by: Tom Zanussi Signed-off-by: Rajvi Jingar Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/histogram.txt | 11 ++++++++++- - kernel/trace/trace_events_hist.c | 38 ++++++++++++++++++++++++++++++++++++-- - 2 files changed, 46 insertions(+), 3 deletions(-) + Documentation/trace/histogram.txt | 11 +++++++++ + kernel/trace/trace_events_hist.c | 42 +++++++++++++++++++++++++++++++++++--- + 2 files changed, 49 insertions(+), 4 deletions(-) --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt -@@ -1674,7 +1674,16 @@ specification. In support of this overa - default it is in units of nanoseconds; appending '.usecs' to a +@@ -1671,7 +1671,16 @@ specification. In support of this overa + it is in units of nanoseconds; appending '.usecs' to a common_timestamp field changes the units to microseconds. -These features are decribed in more detail in the following sections. -+A note on inter-event timestamps: If $common_timestamp is used in a ++A note on inter-event timestamps: If common_timestamp is used in a +histogram, the trace buffer is automatically switched over to using +absolute timestamps and the "global" trace clock, in order to avoid +bogus timestamp differences with other clocks that aren't coherent @@ -47,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior bool pause; bool cont; bool clear; -@@ -1795,6 +1796,7 @@ static void destroy_hist_trigger_attrs(s +@@ -1792,6 +1793,7 @@ static void destroy_hist_trigger_attrs(s kfree(attrs->sort_key_str); kfree(attrs->keys_str); kfree(attrs->vals_str); @@ -55,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(attrs); } -@@ -1850,6 +1852,19 @@ static int parse_assignment(char *str, s +@@ -1847,6 +1849,19 @@ static int parse_assignment(char *str, s ret = -ENOMEM; goto out; } @@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else if (strncmp(str, "size=", strlen("size=")) == 0) { int map_bits = parse_map_size(str); -@@ -1914,6 +1929,14 @@ static struct hist_trigger_attrs *parse_ +@@ -1911,6 +1926,14 @@ static struct hist_trigger_attrs *parse_ goto free; } @@ -90,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior return attrs; free: destroy_hist_trigger_attrs(attrs); -@@ -4926,6 +4949,8 @@ static int event_hist_trigger_print(stru +@@ -4937,6 +4960,8 @@ static int event_hist_trigger_print(stru seq_puts(m, ".descending"); } seq_printf(m, ":size=%u", (1 << hist_data->map->map_bits)); @@ -99,7 +99,15 @@ Signed-off-by: Sebastian Andrzej Siewior print_actions_spec(m, hist_data); -@@ -5188,10 +5213,19 @@ static int hist_register_trigger(char *g +@@ -5204,7 +5229,6 @@ static int hist_register_trigger(char *g + data->paused = true; + + if (named_data) { +- destroy_hist_data(data->private_data); + data->private_data = named_data->private_data; + set_named_trigger_data(data, named_data); + data->ops = &event_hist_trigger_named_ops; +@@ -5216,10 +5240,22 @@ static int hist_register_trigger(char *g goto out; } @@ -117,6 +125,9 @@ Signed-off-by: Sebastian Andrzej Siewior tracing_set_time_stamp_abs(file->tr, true); + } + ++ if (named_data) ++ destroy_hist_data(hist_data); ++ + ret++; out: return ret; diff --git a/debian/patches/features/all/rt/0035-tracing-Increase-trace_recursive_lock-limit-for-synt.patch b/debian/patches/features/all/rt/0035-tracing-Increase-trace_recursive_lock-limit-for-synt.patch index 8d8b31434..9ad0b25f6 100644 --- a/debian/patches/features/all/rt/0035-tracing-Increase-trace_recursive_lock-limit-for-synt.patch +++ b/debian/patches/features/all/rt/0035-tracing-Increase-trace_recursive_lock-limit-for-synt.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:14 -0600 +Date: Wed, 6 Dec 2017 16:38:16 -0600 Subject: [PATCH 35/37] tracing: Increase trace_recursive_lock() limit for synthetic events -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Synthetic event generation needs to happen while the current event is still in progress, so add 1 to the trace_recursive_lock() recursion diff --git a/debian/patches/features/all/rt/0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch b/debian/patches/features/all/rt/0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch index aa91494a9..d8a4ad41d 100644 --- a/debian/patches/features/all/rt/0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch +++ b/debian/patches/features/all/rt/0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:16 +0100 Subject: [PATCH 35/36] usb/gadget/NCM: Replace tasklet with softirq hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The tx_tasklet tasklet is used in invoke the hrtimer (task_timer) in softirq context. This can be also achieved without the tasklet but diff --git a/debian/patches/features/all/rt/0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch b/debian/patches/features/all/rt/0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch index b122591eb..997e0b5c6 100644 --- a/debian/patches/features/all/rt/0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch +++ b/debian/patches/features/all/rt/0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:17 +0100 Subject: [PATCH 36/36] net/mvpp2: Replace tasklet with softirq hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The tx_done_tasklet tasklet is used in invoke the hrtimer (mvpp2_hr_timer_cb) in softirq context. This can be also achieved without diff --git a/debian/patches/features/all/rt/0036-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch b/debian/patches/features/all/rt/0036-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch index 30c04991e..7d8346ba7 100644 --- a/debian/patches/features/all/rt/0036-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch +++ b/debian/patches/features/all/rt/0036-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch @@ -1,8 +1,8 @@ From: Tom Zanussi -Date: Fri, 17 Nov 2017 14:33:15 -0600 +Date: Wed, 6 Dec 2017 16:38:17 -0600 Subject: [PATCH 36/37] tracing: Add inter-event blurb to HIST_TRIGGERS config option -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz So that users know that inter-event tracing is supported as part of the HIST_TRIGGERS option, include text to that effect in the help @@ -11,18 +11,20 @@ text. Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/Kconfig | 3 +++ - 1 file changed, 3 insertions(+) + kernel/trace/Kconfig | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig -@@ -585,6 +585,9 @@ config HIST_TRIGGERS +@@ -585,7 +585,10 @@ config HIST_TRIGGERS event activity as an initial guide for further investigation using more advanced tools. +- See Documentation/trace/events.txt. + Inter-event tracing of quantities such as latencies is also + supported using hist triggers under this option. + - See Documentation/trace/events.txt. ++ See Documentation/trace/histogram.txt. If in doubt, say N. + config MMIOTRACE_TEST diff --git a/debian/patches/features/all/rt/0037-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch b/debian/patches/features/all/rt/0037-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch index 604fc66ef..968f7d438 100644 --- a/debian/patches/features/all/rt/0037-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch +++ b/debian/patches/features/all/rt/0037-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch @@ -1,8 +1,8 @@ From: Rajvi Jingar -Date: Fri, 17 Nov 2017 14:33:16 -0600 +Date: Wed, 6 Dec 2017 16:38:18 -0600 Subject: [PATCH 37/37] selftests: ftrace: Add inter-event hist triggers testcases -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz This adds inter-event hist triggers testcases which covers following: - create/remove synthetic event @@ -96,8 +96,8 @@ Signed-off-by: Sebastian Andrzej Siewior +do_reset + +echo "Test extended error support" -+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger -+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger &>/dev/null ++echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger ++echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger &>/dev/null +if ! grep -q "ERROR:" events/sched/sched_wakeup/hist; then + fail "Failed to generate extended error in histogram" +fi @@ -140,8 +140,8 @@ Signed-off-by: Sebastian Andrzej Siewior +echo "Test field variable support" + +echo 'wakeup_latency u64 lat; pid_t pid; int prio; char comm[16]' > synthetic_events -+echo 'hist:keys=comm:ts0=$common_timestamp.usecs if comm=="ping"' > events/sched/sched_waking/trigger -+echo 'hist:keys=next_comm:wakeup_lat=$common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,sched.sched_waking.prio,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger ++echo 'hist:keys=comm:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_waking/trigger ++echo 'hist:keys=next_comm:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,sched.sched_waking.prio,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger +echo 'hist:keys=pid,prio,comm:vals=lat:sort=pid,prio' > events/synthetic/wakeup_latency/trigger + +ping localhost -c 3 @@ -153,7 +153,7 @@ Signed-off-by: Sebastian Andrzej Siewior + fail "Failed to create histogram with field variable" +fi + -+echo '!hist:keys=next_comm:wakeup_lat=$common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,sched.sched_waking.prio,next_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger ++echo '!hist:keys=next_comm:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,sched.sched_waking.prio,next_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger + +if grep -q "synthetic_prio=prio" events/sched/sched_waking/hist; then + fail "Failed to remove histogram with field variable" @@ -203,13 +203,13 @@ Signed-off-by: Sebastian Andrzej Siewior + +echo "Test combined histogram" + -+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' > events/sched/sched_waking/trigger -+echo 'hist:keys=pid:waking_lat=$common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).waking_latency($waking_lat,pid) if comm=="ping"' > events/sched/sched_wakeup/trigger ++echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_waking/trigger ++echo 'hist:keys=pid:waking_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).waking_latency($waking_lat,pid) if comm=="ping"' > events/sched/sched_wakeup/trigger +echo 'hist:keys=pid,lat:sort=pid,lat' > events/synthetic/waking_latency/trigger + +echo 'wakeup_latency u64 lat pid_t pid' >> synthetic_events -+echo 'hist:keys=pid:ts1=$common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger -+echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts1:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid) if next_comm=="ping"' > events/sched/sched_switch/trigger ++echo 'hist:keys=pid:ts1=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger ++echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts1:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid) if next_comm=="ping"' > events/sched/sched_switch/trigger + +echo 'waking+wakeup_latency u64 lat; pid_t pid' >> synthetic_events +echo 'hist:keys=pid,lat:sort=pid,lat:ww_lat=$waking_lat+$wakeup_lat:onmatch(synthetic.wakeup_latency).waking+wakeup_latency($ww_lat,pid)' >> events/synthetic/wakeup_latency/trigger @@ -265,8 +265,8 @@ Signed-off-by: Sebastian Andrzej Siewior +echo "Test create histogram for synthetic event" +echo "Test histogram variables,simple expression support and onmatch action" + -+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger -+echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger ++echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger ++echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger +echo 'hist:keys=comm,pid,lat:wakeup_lat=lat:sort=lat' > events/synthetic/wakeup_latency/trigger +ping localhost -c 5 +if ! grep -q "ping" events/synthetic/wakeup_latency/hist; then @@ -318,8 +318,8 @@ Signed-off-by: Sebastian Andrzej Siewior +echo "Test create histogram for synthetic event" +echo "Test histogram variables,simple expression support and onmatch-onmax action" + -+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger -+echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid,next_comm):onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger ++echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger ++echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid,next_comm):onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger +echo 'hist:keys=comm,pid,lat:wakeup_lat=lat:sort=lat' > events/synthetic/wakeup_latency/trigger +ping localhost -c 5 +if [ ! grep -q "ping" events/synthetic/wakeup_latency/hist -o ! grep -q "max:" events/sched/sched_switch/hist]; then @@ -370,8 +370,8 @@ Signed-off-by: Sebastian Andrzej Siewior + +echo "Test onmax action" + -+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' >> events/sched/sched_waking/trigger -+echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0:onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger ++echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_waking/trigger ++echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger +ping localhost -c 3 +if ! grep -q "max:" events/sched/sched_switch/hist; then + fail "Failed to create onmax action inter-event histogram" diff --git a/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch b/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch index 05515141f..274cdd10b 100644 --- a/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch +++ b/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch @@ -1,7 +1,7 @@ From: "Yadi.hu" 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Probably happens on all ARM, with CONFIG_PREEMPT_RT_FULL diff --git a/debian/patches/features/all/rt/Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch b/debian/patches/features/all/rt/Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch index 3b0810c68..112b78127 100644 --- a/debian/patches/features/all/rt/Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch +++ b/debian/patches/features/all/rt/Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 15:35:57 +0200 Subject: Bluetooth: avoid recursive locking in hci_send_to_channel() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Mart reported a deadlock in -RT in the call path: hci_send_monitor_ctrl_event() -> hci_send_to_channel() @@ -16,7 +16,7 @@ the readlock to be held. Cc: Marcel Holtmann Cc: Johan Hedberg -Cc: rt-stable@vger.kernel.org +Cc: stable-rt@vger.kernel.org Fixes: 38ceaa00d02d ("Bluetooth: Add support for sending MGMT commands and events to monitor") Reported-by: Mart van de Wege Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch b/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch index 43c250588..1da66193a 100644 --- a/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch +++ b/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch index 688ee6cef..e5610190b 100644 --- a/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ b/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -1,7 +1,7 @@ From: Josh Cartwright 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch index 0ac57b4da..3675a9d3a 100644 --- a/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +++ b/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -5,7 +5,7 @@ Cc: Anna Schumaker , 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 @@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c -@@ -2641,7 +2641,7 @@ static int _nfs4_open_and_get_state(stru +@@ -2638,7 +2638,7 @@ static int _nfs4_open_and_get_state(stru unsigned int seq; int ret; @@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = _nfs4_proc_open(opendata); if (ret != 0) -@@ -2679,7 +2679,7 @@ static int _nfs4_open_and_get_state(stru +@@ -2676,7 +2676,7 @@ static int _nfs4_open_and_get_state(stru if (d_inode(dentry) == state->inode) { nfs_inode_attach_open_context(ctx); diff --git a/debian/patches/features/all/rt/RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch b/debian/patches/features/all/rt/RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch index 92c8a26b5..d7ef7bbe6 100644 --- a/debian/patches/features/all/rt/RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch +++ b/debian/patches/features/all/rt/RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:25:13 +0200 Subject: [PATCH] RCU: we need to skip that warning but only on sleeping locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz This check is okay for upstream. On RT we trigger this while blocking on sleeping lock. In this case, it is okay to schedule() within a RCU diff --git a/debian/patches/features/all/rt/Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch b/debian/patches/features/all/rt/Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch index 91a689ea4..a44b22f4d 100644 --- a/debian/patches/features/all/rt/Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch +++ b/debian/patches/features/all/rt/Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch @@ -1,13 +1,13 @@ From: Sebastian Andrzej Siewior Date: Thu, 23 Nov 2017 17:51:51 +0100 Subject: [PATCH] Revert "fs: jbd2: pull your plug when waiting for space" -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz This reverts commit "fs: jbd2: pull your plug when waiting for space". This was a duct-tape fix which shouldn't be needed since commit "locking/rt-mutex: fix deadlock in device mapper / block-IO". -Cc: stable@vger.kernel.org +Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- fs/jbd2/checkpoint.c | 2 -- diff --git a/debian/patches/features/all/rt/Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch b/debian/patches/features/all/rt/Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch index c2572d997..a4c36c2ea 100644 --- a/debian/patches/features/all/rt/Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch +++ b/debian/patches/features/all/rt/Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch @@ -2,7 +2,7 @@ From: "Steven Rostedt (VMware)" Date: Wed, 22 Nov 2017 07:31:19 -0500 Subject: [PATCH] Revert "memcontrol: Prevent scheduling while atomic in cgroup code" -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The commit "memcontrol: Prevent scheduling while atomic in cgroup code" fixed this issue: @@ -19,7 +19,7 @@ the calls to res_counter_uncharge() in drain_stock() to the lockless function page_counter_uncharge(). There is no more spin lock there and no more reason to have that local lock. -Cc: +Cc: Reported-by: Haiyang HY1 Tan Signed-off-by: Steven Rostedt (VMware) [bigeasy: That upstream commit appeared in v3.19 and the patch in diff --git a/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch b/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch index 2d104dc9c..db75932f1 100644 --- a/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch +++ b/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Wed, 13 Feb 2013 09:26:05 -0500 Subject: acpi/rt: Convert acpi_gbl_hardware lock back to a raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz We hit the following bug with 3.6-rt: diff --git a/debian/patches/features/all/rt/add_migrate_disable.patch b/debian/patches/features/all/rt/add_migrate_disable.patch index 8caa90acc..f3913a22c 100644 --- a/debian/patches/features/all/rt/add_migrate_disable.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz --- include/linux/preempt.h | 23 ++++++++ @@ -80,7 +80,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 * boot command line: --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1023,7 +1023,15 @@ void set_cpus_allowed_common(struct task +@@ -1022,7 +1022,15 @@ void set_cpus_allowed_common(struct task p->nr_cpus_allowed = cpumask_weight(new_mask); } @@ -97,7 +97,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 { struct rq *rq = task_rq(p); bool queued, running; -@@ -1052,6 +1060,20 @@ void do_set_cpus_allowed(struct task_str +@@ -1051,6 +1059,20 @@ void do_set_cpus_allowed(struct task_str set_curr_task(rq, p); } @@ -118,7 +118,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 /* * Change a given task's CPU affinity. Migrate the thread to a * proper CPU and schedule it away if the CPU it's executing on -@@ -1110,9 +1132,16 @@ static int __set_cpus_allowed_ptr(struct +@@ -1109,9 +1131,16 @@ static int __set_cpus_allowed_ptr(struct } /* Can the task run on the task's current CPU? If so, we're done */ @@ -136,7 +136,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask); if (task_running(rq, p) || p->state == TASK_WAKING) { struct migration_arg arg = { p, dest_cpu }; -@@ -6760,3 +6789,100 @@ const u32 sched_prio_to_wmult[40] = { +@@ -6759,3 +6788,100 @@ const u32 sched_prio_to_wmult[40] = { /* 10 */ 39045157, 49367440, 61356676, 76695844, 95443717, /* 15 */ 119304647, 148102320, 186737708, 238609294, 286331153, }; diff --git a/debian/patches/features/all/rt/apparmor-use-a-locallock-instead-preempt_disable.patch b/debian/patches/features/all/rt/apparmor-use-a-locallock-instead-preempt_disable.patch index 68dde890c..cd9079689 100644 --- a/debian/patches/features/all/rt/apparmor-use-a-locallock-instead-preempt_disable.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch b/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch index 0d9375bbc..ad21aacab 100644 --- a/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch +++ b/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch @@ -1,7 +1,7 @@ From: Anders Roxell 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch b/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch index e46d3c5e6..d033df504 100644 --- a/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch +++ b/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch @@ -1,7 +1,7 @@ From: Benedikt Spranger Date: Sat, 6 Mar 2010 17:47:10 +0100 Subject: ARM: AT91: PIT: Remove irq handler when clock event is unused -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Setup and remove the interrupt handler in clock event mode selection. This avoids calling the (shared) interrupt handler when the device is diff --git a/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch b/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch index 6336b7e69..a11cb6454 100644 --- a/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch +++ b/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sat, 1 May 2010 18:29:35 +0200 Subject: ARM: at91: tclib: Default to tclib timer for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz RT is not too happy about the shared timer interrupt in AT91 devices. Default to tclib timer for RT. diff --git a/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch b/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch index 4605ca109..41a1e6005 100644 --- a/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch +++ b/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch @@ -1,7 +1,7 @@ From: Frank Rowand 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The arm boot_lock is used by the secondary processor startup code. The locking task is the idle thread, which has idle->sched_class == &idle_sched_class. diff --git a/debian/patches/features/all/rt/arm-disable-NEON-in-kernel-mode.patch b/debian/patches/features/all/rt/arm-disable-NEON-in-kernel-mode.patch new file mode 100644 index 000000000..0146808ea --- /dev/null +++ b/debian/patches/features/all/rt/arm-disable-NEON-in-kernel-mode.patch @@ -0,0 +1,128 @@ +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.14/older/patches-4.14.6-rt7.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 +is enabled on first invocation and may allocate/free/map memory before +the NEON mode is disabled again. +This needs to be changed until it can be enabled. +On ARM NEON in kernel mode can be simply disabled. on ARM64 it needs to +stay on due to possible EFI callbacks so here I disable each algorithm. + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/arm/Kconfig | 2 +- + arch/arm64/crypto/Kconfig | 20 ++++++++++---------- + arch/arm64/crypto/crc32-ce-glue.c | 3 ++- + 3 files changed, 13 insertions(+), 12 deletions(-) + +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -2164,7 +2164,7 @@ config NEON + + config KERNEL_MODE_NEON + bool "Support for NEON in kernel mode" +- depends on NEON && AEABI ++ depends on NEON && AEABI && !PREEMPT_RT_BASE + help + Say Y to include support for NEON in kernel mode. + +--- a/arch/arm64/crypto/Kconfig ++++ b/arch/arm64/crypto/Kconfig +@@ -19,19 +19,19 @@ config CRYPTO_SHA512_ARM64 + + config CRYPTO_SHA1_ARM64_CE + tristate "SHA-1 digest algorithm (ARMv8 Crypto Extensions)" +- depends on KERNEL_MODE_NEON ++ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE + select CRYPTO_HASH + select CRYPTO_SHA1 + + config CRYPTO_SHA2_ARM64_CE + tristate "SHA-224/SHA-256 digest algorithm (ARMv8 Crypto Extensions)" +- depends on KERNEL_MODE_NEON ++ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE + select CRYPTO_HASH + select CRYPTO_SHA256_ARM64 + + config CRYPTO_GHASH_ARM64_CE + tristate "GHASH/AES-GCM using ARMv8 Crypto Extensions" +- depends on KERNEL_MODE_NEON ++ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE + select CRYPTO_HASH + select CRYPTO_GF128MUL + select CRYPTO_AES +@@ -39,7 +39,7 @@ config CRYPTO_GHASH_ARM64_CE + + config CRYPTO_CRCT10DIF_ARM64_CE + tristate "CRCT10DIF digest algorithm using PMULL instructions" +- depends on KERNEL_MODE_NEON && CRC_T10DIF ++ depends on KERNEL_MODE_NEON && CRC_T10DIF && !PREEMPT_RT_BASE + select CRYPTO_HASH + + config CRYPTO_CRC32_ARM64_CE +@@ -53,13 +53,13 @@ config CRYPTO_AES_ARM64 + + config CRYPTO_AES_ARM64_CE + tristate "AES core cipher using ARMv8 Crypto Extensions" +- depends on ARM64 && KERNEL_MODE_NEON ++ depends on ARM64 && KERNEL_MODE_NEON && !PREEMPT_RT_BASE + select CRYPTO_ALGAPI + select CRYPTO_AES_ARM64 + + config CRYPTO_AES_ARM64_CE_CCM + tristate "AES in CCM mode using ARMv8 Crypto Extensions" +- depends on ARM64 && KERNEL_MODE_NEON ++ depends on ARM64 && KERNEL_MODE_NEON && !PREEMPT_RT_BASE + select CRYPTO_ALGAPI + select CRYPTO_AES_ARM64_CE + select CRYPTO_AES_ARM64 +@@ -67,7 +67,7 @@ config CRYPTO_AES_ARM64_CE_CCM + + config CRYPTO_AES_ARM64_CE_BLK + tristate "AES in ECB/CBC/CTR/XTS modes using ARMv8 Crypto Extensions" +- depends on KERNEL_MODE_NEON ++ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE + select CRYPTO_BLKCIPHER + select CRYPTO_AES_ARM64_CE + select CRYPTO_AES_ARM64 +@@ -75,7 +75,7 @@ config CRYPTO_AES_ARM64_CE_BLK + + config CRYPTO_AES_ARM64_NEON_BLK + tristate "AES in ECB/CBC/CTR/XTS modes using NEON instructions" +- depends on KERNEL_MODE_NEON ++ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE + select CRYPTO_BLKCIPHER + select CRYPTO_AES_ARM64 + select CRYPTO_AES +@@ -83,13 +83,13 @@ config CRYPTO_AES_ARM64_NEON_BLK + + config CRYPTO_CHACHA20_NEON + tristate "NEON accelerated ChaCha20 symmetric cipher" +- depends on KERNEL_MODE_NEON ++ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE + select CRYPTO_BLKCIPHER + select CRYPTO_CHACHA20 + + config CRYPTO_AES_ARM64_BS + tristate "AES in ECB/CBC/CTR/XTS modes using bit-sliced NEON algorithm" +- depends on KERNEL_MODE_NEON ++ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE + select CRYPTO_BLKCIPHER + select CRYPTO_AES_ARM64_NEON_BLK + select CRYPTO_AES_ARM64 +--- a/arch/arm64/crypto/crc32-ce-glue.c ++++ b/arch/arm64/crypto/crc32-ce-glue.c +@@ -206,7 +206,8 @@ static struct shash_alg crc32_pmull_algs + + static int __init crc32_pmull_mod_init(void) + { +- if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && (elf_hwcap & HWCAP_PMULL)) { ++ if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && ++ !IS_ENABLED(CONFIG_PREEMPT_RT_BASE) && (elf_hwcap & HWCAP_PMULL)) { + crc32_pmull_algs[0].update = crc32_pmull_update; + crc32_pmull_algs[1].update = crc32c_pmull_update; + diff --git a/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch b/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch index 692ef55bb..6d3efece4 100644 --- a/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch +++ b/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch @@ -1,7 +1,7 @@ Subject: arm: Enable highmem for rt From: Thomas Gleixner Date: Wed, 13 Feb 2013 11:03:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz fixup highmem for ARM. diff --git a/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch b/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch index 39848e95c..a981a0708 100644 --- a/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch +++ b/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The tlb should be flushed on unmap and thus make the mapping entry invalid. This is only done in the non-debug case which does not look diff --git a/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch b/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch index 57af6a00d..8045ee013 100644 --- a/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch +++ b/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch @@ -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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch b/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch index 594e4a36d..71795d4ad 100644 --- a/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch +++ b/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch @@ -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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz When running kprobe on -rt kernel, the below bug is caught: diff --git a/debian/patches/features/all/rt/arm-preempt-lazy-support.patch b/debian/patches/features/all/rt/arm-preempt-lazy-support.patch index 406c31a78..1e0682916 100644 --- a/debian/patches/features/all/rt/arm-preempt-lazy-support.patch +++ b/debian/patches/features/all/rt/arm-preempt-lazy-support.patch @@ -1,7 +1,7 @@ Subject: arm: Add support for lazy preemption From: Thomas Gleixner Date: Wed, 31 Oct 2012 12:04:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Implement the arm pieces for lazy preempt. diff --git a/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch b/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch index b9e8d9aa2..783921437 100644 --- a/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch +++ b/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Mostly unwind is done with irqs enabled however SLUB may call it with irqs disabled while creating a new SLUB cache. diff --git a/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch b/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch index f3af76524..9cfbff8e3 100644 --- a/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch +++ b/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch @@ -1,7 +1,7 @@ Subject: arm64/xen: Make XEN depend on !RT From: Thomas Gleixner Date: Mon, 12 Oct 2015 11:18:40 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz It's not ready and probably never will be, unless xen folks have a look at it. diff --git a/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch b/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch index 972a80f4e..b1e9ad3fb 100644 --- a/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch +++ b/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Currently the driver will disable the clock and enable it one line later if it is switching from periodic mode into one shot. diff --git a/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch b/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch index 71952ae6e..d41b2efe2 100644 --- a/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch +++ b/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Fri, 3 Jul 2009 08:44:29 -0500 Subject: ata: Do not disable interrupts in ide code for preempt-rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Use the local_irq_*_nort variants. diff --git a/debian/patches/features/all/rt/block-blk-mq-use-swait.patch b/debian/patches/features/all/rt/block-blk-mq-use-swait.patch index 6b456d009..880ff708b 100644 --- a/debian/patches/features/all/rt/block-blk-mq-use-swait.patch +++ b/debian/patches/features/all/rt/block-blk-mq-use-swait.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 13 Feb 2015 11:01:26 +0100 Subject: block: blk-mq: Use swait -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 | in_atomic(): 1, irqs_disabled(): 0, pid: 255, name: kworker/u257:6 @@ -46,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -783,7 +783,7 @@ int blk_queue_enter(struct request_queue +@@ -784,7 +784,7 @@ int blk_queue_enter(struct request_queue */ smp_rmb(); @@ -55,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior !atomic_read(&q->mq_freeze_depth) || blk_queue_dying(q)); if (blk_queue_dying(q)) -@@ -803,7 +803,7 @@ static void blk_queue_usage_counter_rele +@@ -804,7 +804,7 @@ static void blk_queue_usage_counter_rele struct request_queue *q = container_of(ref, struct request_queue, q_usage_counter); @@ -64,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void blk_rq_timed_out_timer(unsigned long data) -@@ -878,7 +878,7 @@ struct request_queue *blk_alloc_queue_no +@@ -880,7 +880,7 @@ struct request_queue *blk_alloc_queue_no q->bypass_depth = 1; __set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); diff --git a/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch b/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch index be483b48a..1ffde853e 100644 --- a/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch +++ b/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/block-mq-drop-preempt-disable.patch b/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch index 729e73028..8c9426390 100644 --- a/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch +++ b/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/block-mq-use-cpu_light.patch b/debian/patches/features/all/rt/block-mq-use-cpu_light.patch index 34434ed97..e608691b7 100644 --- a/debian/patches/features/all/rt/block-mq-use-cpu_light.patch +++ b/debian/patches/features/all/rt/block-mq-use-cpu_light.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/block-shorten-interrupt-disabled-regions.patch b/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch index c589eb54b..09e13a867 100644 --- a/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch +++ b/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch @@ -1,7 +1,7 @@ Subject: block: Shorten interrupt disabled regions From: Thomas Gleixner Date: Wed, 22 Jun 2011 19:47:02 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Moving the blk_sched_flush_plug() call out of the interrupt/preempt disabled region in the scheduler allows us to replace @@ -48,7 +48,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -3288,7 +3288,7 @@ static void queue_unplugged(struct reque +@@ -3290,7 +3290,7 @@ static void queue_unplugged(struct reque blk_run_queue_async(q); else __blk_run_queue(q); @@ -57,7 +57,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de } static void flush_plug_callbacks(struct blk_plug *plug, bool from_schedule) -@@ -3336,7 +3336,6 @@ EXPORT_SYMBOL(blk_check_plugged); +@@ -3338,7 +3338,6 @@ EXPORT_SYMBOL(blk_check_plugged); void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) { struct request_queue *q; @@ -65,7 +65,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de struct request *rq; LIST_HEAD(list); unsigned int depth; -@@ -3356,11 +3355,6 @@ void blk_flush_plug_list(struct blk_plug +@@ -3358,11 +3357,6 @@ void blk_flush_plug_list(struct blk_plug q = NULL; depth = 0; @@ -77,7 +77,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de while (!list_empty(&list)) { rq = list_entry_rq(list.next); list_del_init(&rq->queuelist); -@@ -3373,7 +3367,7 @@ void blk_flush_plug_list(struct blk_plug +@@ -3375,7 +3369,7 @@ void blk_flush_plug_list(struct blk_plug queue_unplugged(q, depth, from_schedule); q = rq->q; depth = 0; @@ -86,7 +86,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de } /* -@@ -3400,8 +3394,6 @@ void blk_flush_plug_list(struct blk_plug +@@ -3402,8 +3396,6 @@ void blk_flush_plug_list(struct blk_plug */ if (q) queue_unplugged(q, depth, from_schedule); diff --git a/debian/patches/features/all/rt/block-use-cpu-chill.patch b/debian/patches/features/all/rt/block-use-cpu-chill.patch index 0a44a39dc..99b68e863 100644 --- a/debian/patches/features/all/rt/block-use-cpu-chill.patch +++ b/debian/patches/features/all/rt/block-use-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: block: Use cpu_chill() for retry loops From: Thomas Gleixner Date: Thu, 20 Dec 2012 18:28:26 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Steven also observed a live lock when there was a diff --git a/debian/patches/features/all/rt/bug-rt-dependend-variants.patch b/debian/patches/features/all/rt/bug-rt-dependend-variants.patch index c53e6ef7d..321e68665 100644 --- a/debian/patches/features/all/rt/bug-rt-dependend-variants.patch +++ b/debian/patches/features/all/rt/bug-rt-dependend-variants.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:58 -0500 Subject: bug: BUG_ON/WARN_ON variants dependend on RT/!RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Introduce RT/NON-RT WARN/BUG statements to avoid ifdefs in the code. diff --git a/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch b/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch index da05901dc..918ec582c 100644 --- a/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch +++ b/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sat, 21 Jun 2014 10:09:48 +0200 Subject: memcontrol: Prevent scheduling while atomic in cgroup code -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz mm, memcg: make refill_stock() use get_cpu_light() diff --git a/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch b/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch index 5141d459b..4f594fd65 100644 --- a/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch +++ b/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz To avoid: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 diff --git a/debian/patches/features/all/rt/char-random-don-t-print-that-the-init-is-done.patch b/debian/patches/features/all/rt/char-random-don-t-print-that-the-init-is-done.patch index 9170d84e4..ef0decab8 100644 --- a/debian/patches/features/all/rt/char-random-don-t-print-that-the-init-is-done.patch +++ b/debian/patches/features/all/rt/char-random-don-t-print-that-the-init-is-done.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 30 May 2017 16:39:01 +0200 Subject: char/random: don't print that the init is done -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On RT we run into circular locking with pendingb_lock (workqueue), port_lock_key (uart) and the primary_crng (random): diff --git a/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch b/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch index 49bba06b2..a6c543f2d 100644 --- a/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch +++ b/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch @@ -1,7 +1,7 @@ From: Alexandre Belloni Date: Thu, 17 Mar 2016 21:09:43 +0100 Subject: [PATCH] clockevents/drivers/timer-atmel-pit: fix double free_irq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz clockevents_exchange_device() changes the state from detached to shutdown and so at that point the IRQ has not yet been requested. diff --git a/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch b/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch index c136c8d27..785783674 100644 --- a/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch +++ b/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch @@ -1,7 +1,7 @@ From: Benedikt Spranger 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz As default the TCLIB uses the 32KiHz base clock rate for clock events. Add a compile time selection to allow higher clock resulution. diff --git a/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch b/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch index 4a4b7b91a..d8734bbf4 100644 --- a/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch +++ b/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch @@ -1,7 +1,7 @@ Subject: completion: Use simple wait queues From: Thomas Gleixner Date: Fri, 11 Jan 2013 11:23:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Completions have no long lasting callbacks and therefor do not need the complex waitqueue variant. Use simple waitqueues which reduces the @@ -124,7 +124,7 @@ Signed-off-by: Thomas Gleixner extern suspend_state_t mem_sleep_default; --- a/include/linux/swait.h +++ b/include/linux/swait.h -@@ -147,6 +147,7 @@ static inline bool swq_has_sleeper(struc +@@ -148,6 +148,7 @@ static inline bool swq_has_sleeper(struc extern void swake_up(struct swait_queue_head *q); extern void swake_up_all(struct swait_queue_head *q); extern void swake_up_locked(struct swait_queue_head *q); @@ -291,7 +291,7 @@ Signed-off-by: Thomas Gleixner EXPORT_SYMBOL(completion_done); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -6930,7 +6930,10 @@ void migrate_disable(void) +@@ -6816,7 +6816,10 @@ void migrate_disable(void) return; } #ifdef CONFIG_SCHED_DEBUG @@ -303,7 +303,7 @@ Signed-off-by: Thomas Gleixner #endif if (p->migrate_disable) { -@@ -6960,7 +6963,10 @@ void migrate_enable(void) +@@ -6846,7 +6849,10 @@ void migrate_enable(void) } #ifdef CONFIG_SCHED_DEBUG diff --git a/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch b/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch index fde80db53..3b6d0e8a0 100644 --- a/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch +++ b/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch @@ -1,7 +1,7 @@ Subject: sched: Use the proper LOCK_OFFSET for cond_resched() From: Thomas Gleixner Date: Sun, 17 Jul 2011 22:51:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz RT does not increment preempt count when a 'sleeping' spinlock is locked. Update PREEMPT_LOCK_OFFSET for that case. diff --git a/debian/patches/features/all/rt/cond-resched-softirq-rt.patch b/debian/patches/features/all/rt/cond-resched-softirq-rt.patch index b691e5f7d..fce79cb0d 100644 --- a/debian/patches/features/all/rt/cond-resched-softirq-rt.patch +++ b/debian/patches/features/all/rt/cond-resched-softirq-rt.patch @@ -1,7 +1,7 @@ Subject: sched: Take RT softirq semantics into account in cond_resched() From: Thomas Gleixner Date: Thu, 14 Jul 2011 09:56:44 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The softirq semantics work different on -RT. There is no SOFTIRQ_MASK in the preemption counter which leads to the BUG_ON() statement in @@ -35,7 +35,7 @@ Signed-off-by: Thomas Gleixner { --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -4946,6 +4946,7 @@ int __cond_resched_lock(spinlock_t *lock +@@ -4945,6 +4945,7 @@ int __cond_resched_lock(spinlock_t *lock } EXPORT_SYMBOL(__cond_resched_lock); @@ -43,7 +43,7 @@ Signed-off-by: Thomas Gleixner int __sched __cond_resched_softirq(void) { BUG_ON(!in_softirq()); -@@ -4959,6 +4960,7 @@ int __sched __cond_resched_softirq(void) +@@ -4958,6 +4959,7 @@ int __sched __cond_resched_softirq(void) return 0; } EXPORT_SYMBOL(__cond_resched_softirq); diff --git a/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch b/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch index b1a58760c..11c7b3a38 100644 --- a/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +++ b/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch @@ -2,7 +2,7 @@ From: Mike Galbraith 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931 |in_atomic(): 1, irqs_disabled(): 0, pid: 31807, name: sleep diff --git a/debian/patches/features/all/rt/cpu-hotplug--Implement-CPU-pinning.patch b/debian/patches/features/all/rt/cpu-hotplug--Implement-CPU-pinning.patch index 801445d56..100636e2a 100644 --- a/debian/patches/features/all/rt/cpu-hotplug--Implement-CPU-pinning.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Signed-off-by: Thomas Gleixner --- diff --git a/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch b/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch index cf5815bb4..af5c86535 100644 --- a/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch +++ b/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Tue, 4 Mar 2014 12:28:32 -0500 Subject: cpu_chill: Add a UNINTERRUPTIBLE hrtimer_nanosleep -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz We hit another bug that was caused by switching cpu_chill() from msleep() to hrtimer_nanosleep(). @@ -34,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1739,12 +1739,13 @@ int nanosleep_copyout(struct restart_blo +@@ -1743,12 +1743,13 @@ int nanosleep_copyout(struct restart_blo return -ERESTART_RESTARTBLOCK; } @@ -50,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_start_expires(&t->timer, mode); if (likely(t->task)) -@@ -1782,13 +1783,15 @@ static long __sched hrtimer_nanosleep_re +@@ -1786,13 +1787,15 @@ static long __sched hrtimer_nanosleep_re hrtimer_init_sleeper_on_stack(&t, restart->nanosleep.clockid, HRTIMER_MODE_ABS, current); hrtimer_set_expires_tv64(&t.timer, restart->nanosleep.expires); @@ -69,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct restart_block *restart; struct hrtimer_sleeper t; -@@ -1801,7 +1804,7 @@ long hrtimer_nanosleep(const struct time +@@ -1805,7 +1808,7 @@ long hrtimer_nanosleep(const struct time hrtimer_init_sleeper_on_stack(&t, clockid, mode, current); hrtimer_set_expires_range_ns(&t.timer, timespec64_to_ktime(*rqtp), slack); @@ -78,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (ret != -ERESTART_RESTARTBLOCK) goto out; -@@ -1820,6 +1823,12 @@ long hrtimer_nanosleep(const struct time +@@ -1824,6 +1827,12 @@ long hrtimer_nanosleep(const struct time return ret; } @@ -91,7 +91,7 @@ Signed-off-by: Sebastian Andrzej Siewior SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp, struct timespec __user *, rmtp) { -@@ -1867,7 +1876,8 @@ void cpu_chill(void) +@@ -1871,7 +1880,8 @@ void cpu_chill(void) unsigned int freeze_flag = current->flags & PF_NOFREEZE; current->flags |= PF_NOFREEZE; diff --git a/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch b/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch index e198ecefb..de88b2e5f 100644 --- a/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch +++ b/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Ralf posted a picture of a backtrace from diff --git a/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch b/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch index fdb3a1b86..151322f57 100644 --- a/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch +++ b/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch @@ -1,7 +1,7 @@ Subject: cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT From: Thomas Gleixner Date: Wed, 14 Dec 2011 01:03:49 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz There are "valid" GFP_ATOMIC allocations such as diff --git a/debian/patches/features/all/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/debian/patches/features/all/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch index 2deabde3a..0ec8a42c0 100644 --- a/debian/patches/features/all/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The two commits below add up to a cpuset might_sleep() splat for RT: diff --git a/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch b/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch index a8b621716..bf06b41cc 100644 --- a/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch +++ b/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Don Estabrook reported | kernel: WARNING: CPU: 2 PID: 858 at kernel/sched/core.c:2428 migrate_disable+0xed/0x100() diff --git a/debian/patches/features/all/rt/crypto-limit-more-FPU-enabled-sections.patch b/debian/patches/features/all/rt/crypto-limit-more-FPU-enabled-sections.patch new file mode 100644 index 000000000..704cd3d59 --- /dev/null +++ b/debian/patches/features/all/rt/crypto-limit-more-FPU-enabled-sections.patch @@ -0,0 +1,477 @@ +From: Sebastian Andrzej Siewior +Date: Thu, 30 Nov 2017 13:40:10 +0100 +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.14/older/patches-4.14.6-rt7.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 +disables preemption. +There are two problems with the way they are used: +- the while loop which processes X bytes may create latency spikes and + should be avoided or limited. +- the cipher-walk-next part may allocate/free memory and may use + kmap_atomic(). + +The whole kernel_fpu_begin()/end() processing isn't probably that cheap. +It most likely makes sense to process as much of those as possible in one +go. The new *_fpu_sched_rt() schedules only if a RT task is pending. + +Probably we should measure the performance those ciphers in pure SW +mode and with this optimisations to see if it makes sense to keep them +for RT. + +This kernel_fpu_resched() makes the code more preemptible which might hurt +performance. + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/x86/crypto/camellia_aesni_avx2_glue.c | 20 ++++++++++++++++++++ + arch/x86/crypto/camellia_aesni_avx_glue.c | 19 +++++++++++++++++++ + arch/x86/crypto/cast6_avx_glue.c | 24 +++++++++++++++++++----- + arch/x86/crypto/chacha20_glue.c | 9 +++++---- + arch/x86/crypto/serpent_avx2_glue.c | 19 +++++++++++++++++++ + arch/x86/crypto/serpent_avx_glue.c | 23 +++++++++++++++++++---- + arch/x86/crypto/serpent_sse2_glue.c | 23 +++++++++++++++++++---- + arch/x86/crypto/twofish_avx_glue.c | 27 +++++++++++++++++++++++++-- + arch/x86/include/asm/fpu/api.h | 1 + + arch/x86/kernel/fpu/core.c | 12 ++++++++++++ + 10 files changed, 158 insertions(+), 19 deletions(-) + +--- a/arch/x86/crypto/camellia_aesni_avx2_glue.c ++++ b/arch/x86/crypto/camellia_aesni_avx2_glue.c +@@ -206,6 +206,20 @@ struct crypt_priv { + bool fpu_enabled; + }; + ++#ifdef CONFIG_PREEMPT_RT_FULL ++static void camellia_fpu_end_rt(struct crypt_priv *ctx) ++{ ++ bool fpu_enabled = ctx->fpu_enabled; ++ ++ if (!fpu_enabled) ++ return; ++ camellia_fpu_end(fpu_enabled); ++ ctx->fpu_enabled = false; ++} ++#else ++static void camellia_fpu_end_rt(struct crypt_priv *ctx) { } ++#endif ++ + static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) + { + const unsigned int bsize = CAMELLIA_BLOCK_SIZE; +@@ -221,16 +235,19 @@ static void encrypt_callback(void *priv, + } + + if (nbytes >= CAMELLIA_AESNI_PARALLEL_BLOCKS * bsize) { ++ kernel_fpu_resched(); + camellia_ecb_enc_16way(ctx->ctx, srcdst, srcdst); + srcdst += bsize * CAMELLIA_AESNI_PARALLEL_BLOCKS; + nbytes -= bsize * CAMELLIA_AESNI_PARALLEL_BLOCKS; + } + + while (nbytes >= CAMELLIA_PARALLEL_BLOCKS * bsize) { ++ kernel_fpu_resched(); + camellia_enc_blk_2way(ctx->ctx, srcdst, srcdst); + srcdst += bsize * CAMELLIA_PARALLEL_BLOCKS; + nbytes -= bsize * CAMELLIA_PARALLEL_BLOCKS; + } ++ camellia_fpu_end_rt(ctx); + + for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) + camellia_enc_blk(ctx->ctx, srcdst, srcdst); +@@ -251,16 +268,19 @@ static void decrypt_callback(void *priv, + } + + if (nbytes >= CAMELLIA_AESNI_PARALLEL_BLOCKS * bsize) { ++ kernel_fpu_resched(); + camellia_ecb_dec_16way(ctx->ctx, srcdst, srcdst); + srcdst += bsize * CAMELLIA_AESNI_PARALLEL_BLOCKS; + nbytes -= bsize * CAMELLIA_AESNI_PARALLEL_BLOCKS; + } + + while (nbytes >= CAMELLIA_PARALLEL_BLOCKS * bsize) { ++ kernel_fpu_resched(); + camellia_dec_blk_2way(ctx->ctx, srcdst, srcdst); + srcdst += bsize * CAMELLIA_PARALLEL_BLOCKS; + nbytes -= bsize * CAMELLIA_PARALLEL_BLOCKS; + } ++ camellia_fpu_end_rt(ctx); + + for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) + camellia_dec_blk(ctx->ctx, srcdst, srcdst); +--- a/arch/x86/crypto/camellia_aesni_avx_glue.c ++++ b/arch/x86/crypto/camellia_aesni_avx_glue.c +@@ -210,6 +210,21 @@ struct crypt_priv { + bool fpu_enabled; + }; + ++#ifdef CONFIG_PREEMPT_RT_FULL ++static void camellia_fpu_end_rt(struct crypt_priv *ctx) ++{ ++ bool fpu_enabled = ctx->fpu_enabled; ++ ++ if (!fpu_enabled) ++ return; ++ camellia_fpu_end(fpu_enabled); ++ ctx->fpu_enabled = false; ++} ++ ++#else ++static void camellia_fpu_end_rt(struct crypt_priv *ctx) { } ++#endif ++ + static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) + { + const unsigned int bsize = CAMELLIA_BLOCK_SIZE; +@@ -225,10 +240,12 @@ static void encrypt_callback(void *priv, + } + + while (nbytes >= CAMELLIA_PARALLEL_BLOCKS * bsize) { ++ kernel_fpu_resched(); + camellia_enc_blk_2way(ctx->ctx, srcdst, srcdst); + srcdst += bsize * CAMELLIA_PARALLEL_BLOCKS; + nbytes -= bsize * CAMELLIA_PARALLEL_BLOCKS; + } ++ camellia_fpu_end_rt(ctx); + + for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) + camellia_enc_blk(ctx->ctx, srcdst, srcdst); +@@ -249,10 +266,12 @@ static void decrypt_callback(void *priv, + } + + while (nbytes >= CAMELLIA_PARALLEL_BLOCKS * bsize) { ++ kernel_fpu_resched(); + camellia_dec_blk_2way(ctx->ctx, srcdst, srcdst); + srcdst += bsize * CAMELLIA_PARALLEL_BLOCKS; + nbytes -= bsize * CAMELLIA_PARALLEL_BLOCKS; + } ++ camellia_fpu_end_rt(ctx); + + for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) + camellia_dec_blk(ctx->ctx, srcdst, srcdst); +--- a/arch/x86/crypto/cast6_avx_glue.c ++++ b/arch/x86/crypto/cast6_avx_glue.c +@@ -205,19 +205,33 @@ struct crypt_priv { + bool fpu_enabled; + }; + ++#ifdef CONFIG_PREEMPT_RT_FULL ++static void cast6_fpu_end_rt(struct crypt_priv *ctx) ++{ ++ bool fpu_enabled = ctx->fpu_enabled; ++ ++ if (!fpu_enabled) ++ return; ++ cast6_fpu_end(fpu_enabled); ++ ctx->fpu_enabled = false; ++} ++ ++#else ++static void cast6_fpu_end_rt(struct crypt_priv *ctx) { } ++#endif ++ + static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) + { + const unsigned int bsize = CAST6_BLOCK_SIZE; + struct crypt_priv *ctx = priv; + int i; + +- ctx->fpu_enabled = cast6_fpu_begin(ctx->fpu_enabled, nbytes); +- + if (nbytes == bsize * CAST6_PARALLEL_BLOCKS) { ++ ctx->fpu_enabled = cast6_fpu_begin(ctx->fpu_enabled, nbytes); + cast6_ecb_enc_8way(ctx->ctx, srcdst, srcdst); ++ cast6_fpu_end_rt(ctx); + return; + } +- + for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) + __cast6_encrypt(ctx->ctx, srcdst, srcdst); + } +@@ -228,10 +242,10 @@ static void decrypt_callback(void *priv, + struct crypt_priv *ctx = priv; + int i; + +- ctx->fpu_enabled = cast6_fpu_begin(ctx->fpu_enabled, nbytes); +- + if (nbytes == bsize * CAST6_PARALLEL_BLOCKS) { ++ ctx->fpu_enabled = cast6_fpu_begin(ctx->fpu_enabled, nbytes); + cast6_ecb_dec_8way(ctx->ctx, srcdst, srcdst); ++ cast6_fpu_end_rt(ctx); + return; + } + +--- a/arch/x86/crypto/chacha20_glue.c ++++ b/arch/x86/crypto/chacha20_glue.c +@@ -81,23 +81,24 @@ static int chacha20_simd(struct skcipher + + crypto_chacha20_init(state, ctx, walk.iv); + +- kernel_fpu_begin(); +- + while (walk.nbytes >= CHACHA20_BLOCK_SIZE) { ++ kernel_fpu_begin(); ++ + chacha20_dosimd(state, walk.dst.virt.addr, walk.src.virt.addr, + rounddown(walk.nbytes, CHACHA20_BLOCK_SIZE)); ++ kernel_fpu_end(); + err = skcipher_walk_done(&walk, + walk.nbytes % CHACHA20_BLOCK_SIZE); + } + + if (walk.nbytes) { ++ kernel_fpu_begin(); + chacha20_dosimd(state, walk.dst.virt.addr, walk.src.virt.addr, + walk.nbytes); ++ kernel_fpu_end(); + err = skcipher_walk_done(&walk, 0); + } + +- kernel_fpu_end(); +- + return err; + } + +--- a/arch/x86/crypto/serpent_avx2_glue.c ++++ b/arch/x86/crypto/serpent_avx2_glue.c +@@ -184,6 +184,21 @@ struct crypt_priv { + bool fpu_enabled; + }; + ++#ifdef CONFIG_PREEMPT_RT_FULL ++static void serpent_fpu_end_rt(struct crypt_priv *ctx) ++{ ++ bool fpu_enabled = ctx->fpu_enabled; ++ ++ if (!fpu_enabled) ++ return; ++ serpent_fpu_end(fpu_enabled); ++ ctx->fpu_enabled = false; ++} ++ ++#else ++static void serpent_fpu_end_rt(struct crypt_priv *ctx) { } ++#endif ++ + static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) + { + const unsigned int bsize = SERPENT_BLOCK_SIZE; +@@ -199,10 +214,12 @@ static void encrypt_callback(void *priv, + } + + while (nbytes >= SERPENT_PARALLEL_BLOCKS * bsize) { ++ kernel_fpu_resched(); + serpent_ecb_enc_8way_avx(ctx->ctx, srcdst, srcdst); + srcdst += bsize * SERPENT_PARALLEL_BLOCKS; + nbytes -= bsize * SERPENT_PARALLEL_BLOCKS; + } ++ serpent_fpu_end_rt(ctx); + + for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) + __serpent_encrypt(ctx->ctx, srcdst, srcdst); +@@ -223,10 +240,12 @@ static void decrypt_callback(void *priv, + } + + while (nbytes >= SERPENT_PARALLEL_BLOCKS * bsize) { ++ kernel_fpu_resched(); + serpent_ecb_dec_8way_avx(ctx->ctx, srcdst, srcdst); + srcdst += bsize * SERPENT_PARALLEL_BLOCKS; + nbytes -= bsize * SERPENT_PARALLEL_BLOCKS; + } ++ serpent_fpu_end_rt(ctx); + + for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) + __serpent_decrypt(ctx->ctx, srcdst, srcdst); +--- a/arch/x86/crypto/serpent_avx_glue.c ++++ b/arch/x86/crypto/serpent_avx_glue.c +@@ -218,16 +218,31 @@ struct crypt_priv { + bool fpu_enabled; + }; + ++#ifdef CONFIG_PREEMPT_RT_FULL ++static void serpent_fpu_end_rt(struct crypt_priv *ctx) ++{ ++ bool fpu_enabled = ctx->fpu_enabled; ++ ++ if (!fpu_enabled) ++ return; ++ serpent_fpu_end(fpu_enabled); ++ ctx->fpu_enabled = false; ++} ++ ++#else ++static void serpent_fpu_end_rt(struct crypt_priv *ctx) { } ++#endif ++ + static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) + { + const unsigned int bsize = SERPENT_BLOCK_SIZE; + struct crypt_priv *ctx = priv; + int i; + +- ctx->fpu_enabled = serpent_fpu_begin(ctx->fpu_enabled, nbytes); +- + if (nbytes == bsize * SERPENT_PARALLEL_BLOCKS) { ++ ctx->fpu_enabled = serpent_fpu_begin(ctx->fpu_enabled, nbytes); + serpent_ecb_enc_8way_avx(ctx->ctx, srcdst, srcdst); ++ serpent_fpu_end_rt(ctx); + return; + } + +@@ -241,10 +256,10 @@ static void decrypt_callback(void *priv, + struct crypt_priv *ctx = priv; + int i; + +- ctx->fpu_enabled = serpent_fpu_begin(ctx->fpu_enabled, nbytes); +- + if (nbytes == bsize * SERPENT_PARALLEL_BLOCKS) { ++ ctx->fpu_enabled = serpent_fpu_begin(ctx->fpu_enabled, nbytes); + serpent_ecb_dec_8way_avx(ctx->ctx, srcdst, srcdst); ++ serpent_fpu_end_rt(ctx); + return; + } + +--- a/arch/x86/crypto/serpent_sse2_glue.c ++++ b/arch/x86/crypto/serpent_sse2_glue.c +@@ -187,16 +187,31 @@ struct crypt_priv { + bool fpu_enabled; + }; + ++#ifdef CONFIG_PREEMPT_RT_FULL ++static void serpent_fpu_end_rt(struct crypt_priv *ctx) ++{ ++ bool fpu_enabled = ctx->fpu_enabled; ++ ++ if (!fpu_enabled) ++ return; ++ serpent_fpu_end(fpu_enabled); ++ ctx->fpu_enabled = false; ++} ++ ++#else ++static void serpent_fpu_end_rt(struct crypt_priv *ctx) { } ++#endif ++ + static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) + { + const unsigned int bsize = SERPENT_BLOCK_SIZE; + struct crypt_priv *ctx = priv; + int i; + +- ctx->fpu_enabled = serpent_fpu_begin(ctx->fpu_enabled, nbytes); +- + if (nbytes == bsize * SERPENT_PARALLEL_BLOCKS) { ++ ctx->fpu_enabled = serpent_fpu_begin(ctx->fpu_enabled, nbytes); + serpent_enc_blk_xway(ctx->ctx, srcdst, srcdst); ++ serpent_fpu_end_rt(ctx); + return; + } + +@@ -210,10 +225,10 @@ static void decrypt_callback(void *priv, + struct crypt_priv *ctx = priv; + int i; + +- ctx->fpu_enabled = serpent_fpu_begin(ctx->fpu_enabled, nbytes); +- + if (nbytes == bsize * SERPENT_PARALLEL_BLOCKS) { ++ ctx->fpu_enabled = serpent_fpu_begin(ctx->fpu_enabled, nbytes); + serpent_dec_blk_xway(ctx->ctx, srcdst, srcdst); ++ serpent_fpu_end_rt(ctx); + return; + } + +--- a/arch/x86/crypto/twofish_avx_glue.c ++++ b/arch/x86/crypto/twofish_avx_glue.c +@@ -218,6 +218,21 @@ struct crypt_priv { + bool fpu_enabled; + }; + ++#ifdef CONFIG_PREEMPT_RT_FULL ++static void twofish_fpu_end_rt(struct crypt_priv *ctx) ++{ ++ bool fpu_enabled = ctx->fpu_enabled; ++ ++ if (!fpu_enabled) ++ return; ++ twofish_fpu_end(fpu_enabled); ++ ctx->fpu_enabled = false; ++} ++ ++#else ++static void twofish_fpu_end_rt(struct crypt_priv *ctx) { } ++#endif ++ + static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) + { + const unsigned int bsize = TF_BLOCK_SIZE; +@@ -228,12 +243,16 @@ static void encrypt_callback(void *priv, + + if (nbytes == bsize * TWOFISH_PARALLEL_BLOCKS) { + twofish_ecb_enc_8way(ctx->ctx, srcdst, srcdst); ++ twofish_fpu_end_rt(ctx); + return; + } + +- for (i = 0; i < nbytes / (bsize * 3); i++, srcdst += bsize * 3) ++ for (i = 0; i < nbytes / (bsize * 3); i++, srcdst += bsize * 3) { ++ kernel_fpu_resched(); + twofish_enc_blk_3way(ctx->ctx, srcdst, srcdst); ++ } + ++ twofish_fpu_end_rt(ctx); + nbytes %= bsize * 3; + + for (i = 0; i < nbytes / bsize; i++, srcdst += bsize) +@@ -250,11 +269,15 @@ static void decrypt_callback(void *priv, + + if (nbytes == bsize * TWOFISH_PARALLEL_BLOCKS) { + twofish_ecb_dec_8way(ctx->ctx, srcdst, srcdst); ++ twofish_fpu_end_rt(ctx); + return; + } + +- for (i = 0; i < nbytes / (bsize * 3); i++, srcdst += bsize * 3) ++ for (i = 0; i < nbytes / (bsize * 3); i++, srcdst += bsize * 3) { ++ kernel_fpu_resched(); + twofish_dec_blk_3way(ctx->ctx, srcdst, srcdst); ++ } ++ twofish_fpu_end_rt(ctx); + + nbytes %= bsize * 3; + +--- a/arch/x86/include/asm/fpu/api.h ++++ b/arch/x86/include/asm/fpu/api.h +@@ -25,6 +25,7 @@ extern void __kernel_fpu_begin(void); + extern void __kernel_fpu_end(void); + extern void kernel_fpu_begin(void); + extern void kernel_fpu_end(void); ++extern void kernel_fpu_resched(void); + extern bool irq_fpu_usable(void); + + /* +--- a/arch/x86/kernel/fpu/core.c ++++ b/arch/x86/kernel/fpu/core.c +@@ -137,6 +137,18 @@ void kernel_fpu_end(void) + } + EXPORT_SYMBOL_GPL(kernel_fpu_end); + ++void kernel_fpu_resched(void) ++{ ++ WARN_ON_FPU(!this_cpu_read(in_kernel_fpu)); ++ ++ if (should_resched(PREEMPT_OFFSET)) { ++ kernel_fpu_end(); ++ cond_resched(); ++ kernel_fpu_begin(); ++ } ++} ++EXPORT_SYMBOL_GPL(kernel_fpu_resched); ++ + /* + * Save the FPU state (mark it for reload if necessary): + * diff --git a/debian/patches/features/all/rt/crypto-mcryptd-protect-the-per-CPU-queue-with-a-lock.patch b/debian/patches/features/all/rt/crypto-mcryptd-protect-the-per-CPU-queue-with-a-lock.patch new file mode 100644 index 000000000..f7eff5b1b --- /dev/null +++ b/debian/patches/features/all/rt/crypto-mcryptd-protect-the-per-CPU-queue-with-a-lock.patch @@ -0,0 +1,107 @@ +From: Sebastian Andrzej Siewior +Date: Thu, 30 Nov 2017 13:03:09 +0100 +Subject: [PATCH] crypto: mcryptd: protect the per-CPU queue with a lock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz + +mcryptd_enqueue_request() grabs the per-CPU queue struct and protects +access to it with disabled preemption. Then it schedules a worker on the +same CPU. The worker in mcryptd_queue_worker() guards access to the same +per-CPU variable with disabled preemption. + +If we take CPU-hotplug into account then it is possible that between +queue_work_on() and the actual invocation of the worker the CPU goes +down and the worker will be scheduled on _another_ CPU. And here the +preempt_disable() protection does not work anymore. The easiest thing is +to add a spin_lock() to guard access to the list. + +Another detail: mcryptd_queue_worker() is not processing more than +MCRYPTD_BATCH invocation in a row. If there are still items left, then +it will invoke queue_work() to proceed with more later. *I* would +suggest to simply drop that check because it does not use a system +workqueue and the workqueue is already marked as "CPU_INTENSIVE". And if +preemption is required then the scheduler should do it. +However if queue_work() is used then to work item is marked as CPU +unbound. That means it will try to run on the local CPU but it may run +on another CPU as well. Especially with CONFIG_DEBUG_WQ_FORCE_RR_CPU=y. +Again, the preempt_disable() won't work here but lock which was +introduced will help. +In order to keep work-item on the local CPU (and avoid RR) I changed it +to queue_work_on(). + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior +--- + crypto/mcryptd.c | 23 ++++++++++------------- + include/crypto/mcryptd.h | 1 + + 2 files changed, 11 insertions(+), 13 deletions(-) + +--- a/crypto/mcryptd.c ++++ b/crypto/mcryptd.c +@@ -81,6 +81,7 @@ static int mcryptd_init_queue(struct mcr + pr_debug("cpu_queue #%d %p\n", cpu, queue->cpu_queue); + crypto_init_queue(&cpu_queue->queue, max_cpu_qlen); + INIT_WORK(&cpu_queue->work, mcryptd_queue_worker); ++ spin_lock_init(&cpu_queue->q_lock); + } + return 0; + } +@@ -104,15 +105,16 @@ static int mcryptd_enqueue_request(struc + int cpu, err; + struct mcryptd_cpu_queue *cpu_queue; + +- cpu = get_cpu(); +- cpu_queue = this_cpu_ptr(queue->cpu_queue); +- rctx->tag.cpu = cpu; ++ cpu_queue = raw_cpu_ptr(queue->cpu_queue); ++ spin_lock(&cpu_queue->q_lock); ++ cpu = smp_processor_id(); ++ rctx->tag.cpu = smp_processor_id(); + + err = crypto_enqueue_request(&cpu_queue->queue, request); + pr_debug("enqueue request: cpu %d cpu_queue %p request %p\n", + cpu, cpu_queue, request); ++ spin_unlock(&cpu_queue->q_lock); + queue_work_on(cpu, kcrypto_wq, &cpu_queue->work); +- put_cpu(); + + return err; + } +@@ -161,16 +163,11 @@ static void mcryptd_queue_worker(struct + cpu_queue = container_of(work, struct mcryptd_cpu_queue, work); + i = 0; + while (i < MCRYPTD_BATCH || single_task_running()) { +- /* +- * preempt_disable/enable is used to prevent +- * being preempted by mcryptd_enqueue_request() +- */ +- local_bh_disable(); +- preempt_disable(); ++ ++ spin_lock_bh(&cpu_queue->q_lock); + backlog = crypto_get_backlog(&cpu_queue->queue); + req = crypto_dequeue_request(&cpu_queue->queue); +- preempt_enable(); +- local_bh_enable(); ++ spin_unlock_bh(&cpu_queue->q_lock); + + if (!req) { + mcryptd_opportunistic_flush(); +@@ -185,7 +182,7 @@ static void mcryptd_queue_worker(struct + ++i; + } + if (cpu_queue->queue.qlen) +- queue_work(kcrypto_wq, &cpu_queue->work); ++ queue_work_on(smp_processor_id(), kcrypto_wq, &cpu_queue->work); + } + + void mcryptd_flusher(struct work_struct *__work) +--- a/include/crypto/mcryptd.h ++++ b/include/crypto/mcryptd.h +@@ -27,6 +27,7 @@ static inline struct mcryptd_ahash *__mc + + struct mcryptd_cpu_queue { + struct crypto_queue queue; ++ spinlock_t q_lock; + struct work_struct work; + }; + diff --git a/debian/patches/features/all/rt/debugobjects-rt.patch b/debian/patches/features/all/rt/debugobjects-rt.patch index cd660267a..87c755dfa 100644 --- a/debian/patches/features/all/rt/debugobjects-rt.patch +++ b/debian/patches/features/all/rt/debugobjects-rt.patch @@ -1,7 +1,7 @@ Subject: debugobjects: Make RT aware From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:41:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Avoid filling the pool / allocating memory with irqs off(). diff --git a/debian/patches/features/all/rt/delayacct-use-raw_spinlocks.patch b/debian/patches/features/all/rt/delayacct-use-raw_spinlocks.patch index 94014a93e..b39a817f1 100644 --- a/debian/patches/features/all/rt/delayacct-use-raw_spinlocks.patch +++ b/debian/patches/features/all/rt/delayacct-use-raw_spinlocks.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 20 May 2017 12:32:23 +0200 Subject: [PATCH] delayacct: use raw_spinlocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz try_to_wake_up() might invoke delayacct_blkio_end() while holding the pi_lock. The lock is only held for a short amount of time so it should diff --git a/debian/patches/features/all/rt/dm-make-rt-aware.patch b/debian/patches/features/all/rt/dm-make-rt-aware.patch index d7acc65ff..029bcf105 100644 --- a/debian/patches/features/all/rt/dm-make-rt-aware.patch +++ b/debian/patches/features/all/rt/dm-make-rt-aware.patch @@ -1,7 +1,7 @@ Subject: dm: Make rt aware From: Thomas Gleixner Date: Mon, 14 Nov 2011 23:06:09 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Use the BUG_ON_NORT variant for the irq_disabled() checks. RT has interrupts legitimately enabled here as we cant deadlock against the diff --git a/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch index fa5b07394..e16a678c9 100644 --- a/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ b/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch @@ -2,7 +2,7 @@ From: Mike Galbraith 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz They're nondeterministic, and lead to ___might_sleep() splats in -rt. OTOH, they're a lot less wasteful than an rtmutex per page. diff --git a/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch b/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch index b3d0748f1..391e5d864 100644 --- a/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch +++ b/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:24 -0500 Subject: drivers/net: Use disable_irq_nosync() in 8139too -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Use disable_irq_nosync() instead of disable_irq() as this might be called in atomic context with netpoll. diff --git a/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch b/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch index 84ad16286..7e3fba817 100644 --- a/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch +++ b/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Fri, 3 Jul 2009 08:30:00 -0500 Subject: drivers/net: vortex fix locking issues -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Argh, cut and paste wasn't enough... diff --git a/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch b/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch index 5f0362cc6..d82f36fcd 100644 --- a/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch +++ b/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:30 -0500 Subject: drivers: random: Reduce preempt disabled region -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz No need to keep preemption disabled across the whole function. diff --git a/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch b/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch index 1e391cace..51c963d11 100644 --- a/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch +++ b/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch @@ -1,7 +1,7 @@ Subject: tty/serial/omap: Make the locking RT aware From: Thomas Gleixner Date: Thu, 28 Jul 2011 13:32:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and diff --git a/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch b/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch index 5974ffbfe..8b58ce1d6 100644 --- a/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch +++ b/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch @@ -1,7 +1,7 @@ Subject: tty/serial/pl011: Make the locking work on RT From: Thomas Gleixner Date: Tue, 08 Jan 2013 21:36:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch b/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch index e28ec91f1..db3b2a96c 100644 --- a/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +++ b/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch @@ -2,7 +2,7 @@ From: Mike Galbraith 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz In v4.7, the driver switched to percpu compression streams, disabling preemption via get/put_cpu_ptr(). Use a per-zcomp_strm lock here. We diff --git a/debian/patches/features/all/rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch b/debian/patches/features/all/rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch index 07f4c2067..1c719636b 100644 --- a/debian/patches/features/all/rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/drm-i915-init-spinlock-properly-on-RT.patch b/debian/patches/features/all/rt/drm-i915-init-spinlock-properly-on-RT.patch deleted file mode 100644 index 23dc0d52d..000000000 --- a/debian/patches/features/all/rt/drm-i915-init-spinlock-properly-on-RT.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Sebastian Andrzej Siewior -Date: Mon, 29 May 2017 15:33:52 +0200 -Subject: [PATCH] drm/i915: init spinlock properly on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz - -THe lockinit is opencoded so need to fix it up… - -Signed-off-by: Sebastian Andrzej Siewior ---- - drivers/gpu/drm/i915/i915_gem_timeline.c | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/drivers/gpu/drm/i915/i915_gem_timeline.c -+++ b/drivers/gpu/drm/i915/i915_gem_timeline.c -@@ -34,7 +34,12 @@ static void __intel_timeline_init(struct - tl->fence_context = context; - tl->common = parent; - #ifdef CONFIG_DEBUG_SPINLOCK -+# ifdef CONFIG_PREEMPT_RT_FULL -+ rt_mutex_init(&tl->lock.lock); -+ __rt_spin_lock_init(&tl->lock, lockname, lockclass); -+# else - __raw_spin_lock_init(&tl->lock.rlock, lockname, lockclass); -+# endif - #else - spin_lock_init(&tl->lock); - #endif diff --git a/debian/patches/features/all/rt/drm-i915-properly-init-lockdep-class.patch b/debian/patches/features/all/rt/drm-i915-properly-init-lockdep-class.patch new file mode 100644 index 000000000..5ea45c082 --- /dev/null +++ b/debian/patches/features/all/rt/drm-i915-properly-init-lockdep-class.patch @@ -0,0 +1,32 @@ +From: Sebastian Andrzej Siewior +Date: Thu, 30 Nov 2017 16:06:13 +0100 +Subject: [PATCH] drm/i915: properly init lockdep class +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz + +The code has an ifdef and uses two functions to either init the bare +spinlock or init it and set a lock-class. It is possible to do the same +thing without an ifdef. +With this patch (in debug case) we first use the "default" lock class +which is later overwritten to the supplied one. Without lockdep the set +name/class function vanishes. + +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/gpu/drm/i915/i915_gem_timeline.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/drivers/gpu/drm/i915/i915_gem_timeline.c ++++ b/drivers/gpu/drm/i915/i915_gem_timeline.c +@@ -33,11 +33,8 @@ static void __intel_timeline_init(struct + { + tl->fence_context = context; + tl->common = parent; +-#ifdef CONFIG_DEBUG_SPINLOCK +- __raw_spin_lock_init(&tl->lock.rlock, lockname, lockclass); +-#else + spin_lock_init(&tl->lock); +-#endif ++ lockdep_set_class_and_name(&tl->lock, lockclass, lockname); + init_request_active(&tl->last_request, NULL); + INIT_LIST_HEAD(&tl->requests); + i915_syncmap_init(&tl->sync); diff --git a/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch b/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch index 1b7fa51db..d636dbd44 100644 --- a/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch +++ b/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch @@ -1,7 +1,7 @@ Subject: drm,i915: Use local_lock/unlock_irq() in intel_pipe_update_start/end() From: Mike Galbraith Date: Sat, 27 Feb 2016 09:01:42 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz [ 8.014039] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:918 diff --git a/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch b/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch index 31b636738..666202f80 100644 --- a/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch +++ b/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch @@ -1,7 +1,7 @@ Subject: drm,radeon,i915: Use preempt_disable/enable_rt() where recommended From: Mike Galbraith Date: Sat, 27 Feb 2016 08:09:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz DRM folks identified the spots, so use them. diff --git a/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch b/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch index 96f68707d..d02314694 100644 --- a/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch +++ b/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch @@ -1,7 +1,7 @@ Subject: fs/epoll: Do not disable preemption on RT From: Thomas Gleixner Date: Fri, 08 Jul 2011 16:35:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz ep_call_nested() takes a sleeping lock so we can't disable preemption. The light version is enough since ep_call_nested() doesn't mind beeing diff --git a/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch b/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch index b378b30b8..35168fcdc 100644 --- a/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch +++ b/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/fs-block-rt-support.patch b/debian/patches/features/all/rt/fs-block-rt-support.patch index eb58a2abd..df09e6448 100644 --- a/debian/patches/features/all/rt/fs-block-rt-support.patch +++ b/debian/patches/features/all/rt/fs-block-rt-support.patch @@ -1,7 +1,7 @@ Subject: block: Turn off warning which is bogus on RT From: Thomas Gleixner Date: Tue, 14 Jun 2011 17:05:09 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On -RT the context is always with IRQs enabled. Ignore this warning on -RT. diff --git a/debian/patches/features/all/rt/fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch b/debian/patches/features/all/rt/fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch index 251e99ee9..e8f7e0394 100644 --- a/debian/patches/features/all/rt/fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch +++ b/debian/patches/features/all/rt/fs-dcache-bringt-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: bringt back explicit INIT_HLIST_BL_HEAD init -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/debian/patches/features/all/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch index 9709f1def..659aaf36d 100644 --- a/debian/patches/features/all/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch b/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch index 34e582962..f6fdfb242 100644 --- a/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch +++ b/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch @@ -1,7 +1,7 @@ Subject: fs: dcache: Use cpu_chill() in trylock loops From: Thomas Gleixner Date: Wed, 07 Mar 2012 21:00:34 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system diff --git a/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch index 4bc9ba834..e816d4da8 100644 --- a/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ b/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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. @@ -92,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* --- a/fs/namei.c +++ b/fs/namei.c -@@ -1637,7 +1637,7 @@ static struct dentry *lookup_slow(const +@@ -1628,7 +1628,7 @@ static struct dentry *lookup_slow(const { struct dentry *dentry = ERR_PTR(-ENOENT), *old; struct inode *inode = dir->d_inode; @@ -101,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior inode_lock_shared(inode); /* Don't go there if it's already dead */ -@@ -3110,7 +3110,7 @@ static int lookup_open(struct nameidata +@@ -3101,7 +3101,7 @@ static int lookup_open(struct nameidata struct dentry *dentry; int error, create_error = 0; umode_t mode = op->mode; diff --git a/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch b/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch index 3cffe5ece..808253ba4 100644 --- a/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch +++ b/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz bit_spin_locks break under RT. diff --git a/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch b/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch index 424f2d911..4efe2012a 100644 --- a/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch +++ b/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 17 Feb 2014 17:30:03 +0100 Subject: fs: jbd2: pull your plug when waiting for space -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Two cps in parallel managed to stall the the ext4 fs. It seems that journal code is either waiting for locks or sleeping waiting for diff --git a/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch b/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch index 5eb5462d3..229daed64 100644 --- a/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch +++ b/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 19 Jul 2009 08:44:27 -0500 Subject: fs: namespace preemption fix -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On RT we cannot loop with preemption disabled here as mnt_make_readonly() might have been preempted. We can safely enable diff --git a/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch b/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch index b65adc4ef..bd39225ad 100644 --- a/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch +++ b/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch b/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch index b460b3455..e8521f12e 100644 --- a/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch +++ b/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Fri, 3 Jul 2009 08:44:12 -0500 Subject: fs: ntfs: disable interrupt only on !RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On Sat, 2007-10-27 at 11:44 +0200, Ingo Molnar wrote: > * Nick Piggin wrote: diff --git a/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch b/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch index 062bd7dc3..5700408f3 100644 --- a/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch +++ b/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Wrap the bit_spin_lock calls into a separate inline and add the RT replacements with a real spinlock. @@ -76,7 +76,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(end_buffer_async_write); -@@ -3409,6 +3401,7 @@ struct buffer_head *alloc_buffer_head(gf +@@ -3417,6 +3409,7 @@ struct buffer_head *alloc_buffer_head(gf struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags); if (ret) { INIT_LIST_HEAD(&ret->b_assoc_buffers); diff --git a/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch b/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch index 61a3c7acf..c6e1e8b22 100644 --- a/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch +++ b/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch @@ -1,7 +1,7 @@ From: Mike Galbraith 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Line up helper arrows to the right column. diff --git a/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch b/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch index 3f6641461..0df2fbb7a 100644 --- a/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch +++ b/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Signed-off-by: Thomas Gleixner --- diff --git a/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch index ab40579c3..932234c3f 100644 --- a/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch +++ b/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz In exit_pi_state_list() we have the following locking construct: diff --git a/debian/patches/features/all/rt/futex-requeue-pi-fix.patch b/debian/patches/features/all/rt/futex-requeue-pi-fix.patch index 2a105e8c2..1164e3e4d 100644 --- a/debian/patches/features/all/rt/futex-requeue-pi-fix.patch +++ b/debian/patches/features/all/rt/futex-requeue-pi-fix.patch @@ -1,7 +1,7 @@ From: Steven Rostedt 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Requeue with timeout causes a bug with PREEMPT_RT_FULL. diff --git a/debian/patches/features/all/rt/futex-workaround-migrate_disable-enable-in-different.patch b/debian/patches/features/all/rt/futex-workaround-migrate_disable-enable-in-different.patch index 78a5b46c6..e728f9ee5 100644 --- a/debian/patches/features/all/rt/futex-workaround-migrate_disable-enable-in-different.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch b/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch index 227b87855..f079c209f 100644 --- a/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch +++ b/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch @@ -1,7 +1,7 @@ From: Ingo Molnar 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Creates long latencies for no value diff --git a/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch b/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch index e71fe2b37..31c5f5751 100644 --- a/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch +++ b/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Joe Korty reported, that __irq_set_affinity_locked() schedules a workqueue while holding a rawlock which results in a might_sleep() @@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include -@@ -229,6 +230,7 @@ extern void resume_device_irqs(void); +@@ -227,6 +228,7 @@ extern void resume_device_irqs(void); * struct irq_affinity_notify - context for notification of IRQ affinity changes * @irq: Interrupt to which notification applies * @kref: Reference count, for internal use @@ -32,7 +32,7 @@ Signed-off-by: Sebastian Andrzej Siewior * @work: Work item, for internal use * @notify: Function to be called on change. This will be * called in process context. -@@ -240,7 +242,11 @@ extern void resume_device_irqs(void); +@@ -238,7 +240,11 @@ extern void resume_device_irqs(void); struct irq_affinity_notify { unsigned int irq; struct kref kref; diff --git a/debian/patches/features/all/rt/genirq-force-threading.patch b/debian/patches/features/all/rt/genirq-force-threading.patch index 98a4ee620..42a4e078f 100644 --- a/debian/patches/features/all/rt/genirq-force-threading.patch +++ b/debian/patches/features/all/rt/genirq-force-threading.patch @@ -1,7 +1,7 @@ Subject: genirq: Force interrupt thread on RT From: Thomas Gleixner Date: Sun, 03 Apr 2011 11:57:29 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Force threaded_irqs and optimize the code (force_irqthreads) in regard to this. diff --git a/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch b/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch index 1ed03b199..d13ab49c7 100644 --- a/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch +++ b/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch @@ -1,7 +1,7 @@ From: Josh Cartwright 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 @@ -15,7 +15,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -2191,7 +2191,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state) +@@ -2202,7 +2202,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state) * This call sets the internal irqchip state of an interrupt, * depending on the value of @which. * diff --git a/debian/patches/features/all/rt/greybus-audio-don-t-inclide-rwlock.h-directly.patch b/debian/patches/features/all/rt/greybus-audio-don-t-inclide-rwlock.h-directly.patch index fb2dcc330..b68c8967a 100644 --- a/debian/patches/features/all/rt/greybus-audio-don-t-inclide-rwlock.h-directly.patch +++ b/debian/patches/features/all/rt/greybus-audio-don-t-inclide-rwlock.h-directly.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 5 Oct 2017 14:38:52 +0200 Subject: [PATCH] greybus: audio: don't inclide rwlock.h directly. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz rwlock.h should not be included directly. Instead linux/splinlock.h should be included. One thing it does is to break the RT build. diff --git a/debian/patches/features/all/rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch b/debian/patches/features/all/rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch index a964e7055..fa51ed378 100644 --- a/debian/patches/features/all/rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch b/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch index ce4582d78..889af4d20 100644 --- a/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch +++ b/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch @@ -1,7 +1,7 @@ Subject: hotplug: Lightweight get online cpus From: Thomas Gleixner Date: Wed, 15 Jun 2011 12:36:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz get_online_cpus() is a heavy weight function which involves a global mutex. migrate_disable() wants a simpler construct which prevents only @@ -65,7 +65,7 @@ Signed-off-by: Thomas Gleixner void cpus_read_lock(void) --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -6912,6 +6912,7 @@ void migrate_disable(void) +@@ -6914,6 +6914,7 @@ void migrate_disable(void) } preempt_disable(); @@ -73,7 +73,7 @@ Signed-off-by: Thomas Gleixner migrate_disable_update_cpus_allowed(p); p->migrate_disable = 1; -@@ -6974,12 +6975,15 @@ void migrate_enable(void) +@@ -6979,12 +6980,15 @@ void migrate_enable(void) arg.task = p; arg.dest_cpu = dest_cpu; diff --git a/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch b/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch index 2d663258c..50a6301e0 100644 --- a/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch +++ b/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch @@ -1,7 +1,7 @@ From: Yang Shi 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz When run ltp leapsec_timer test, the following call trace is caught: @@ -52,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -728,6 +728,29 @@ static void hrtimer_switch_to_hres(void) +@@ -730,6 +730,29 @@ static void hrtimer_switch_to_hres(void) retrigger_next_event(NULL); } @@ -82,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void clock_was_set_work(struct work_struct *work) { clock_was_set(); -@@ -743,6 +766,7 @@ void clock_was_set_delayed(void) +@@ -745,6 +768,7 @@ void clock_was_set_delayed(void) { schedule_work(&hrtimer_work); } diff --git a/debian/patches/features/all/rt/hrtimer-account-for-migrated-timers.patch b/debian/patches/features/all/rt/hrtimer-account-for-migrated-timers.patch new file mode 100644 index 000000000..ec2c83027 --- /dev/null +++ b/debian/patches/features/all/rt/hrtimer-account-for-migrated-timers.patch @@ -0,0 +1,42 @@ +From: Sebastian Andrzej Siewior +Date: Thu, 14 Dec 2017 11:31:40 +0100 +Subject: [PATCH] hrtimer: account for migrated timers +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz + +if the timer is enqueud on CPUX and we run on CPUY then we have to +cpu_base bits of the correct CPU. Not sure if this accounts for all the +pieces but it might be okay with the check we have in +hrtimer_check_target() (that we have nothing to do but just wait). + +Reported-by: bert schulze +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/time/hrtimer.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -775,16 +775,18 @@ static void hrtimer_reprogram(struct hrt + expires = 0; + + if (timer->is_soft) { +- if (cpu_base->softirq_activated) ++ struct hrtimer_cpu_base *timer_cpu_base = base->cpu_base; ++ ++ if (timer_cpu_base->softirq_activated) + return; + +- if (!ktime_before(expires, cpu_base->softirq_expires_next)) ++ if (!ktime_before(expires, timer_cpu_base->softirq_expires_next)) + return; + +- cpu_base->softirq_next_timer = timer; +- cpu_base->softirq_expires_next = expires; ++ timer_cpu_base->softirq_next_timer = timer; ++ timer_cpu_base->softirq_expires_next = expires; + +- if (!ktime_before(expires, cpu_base->expires_next) || ++ if (!ktime_before(expires, timer_cpu_base->expires_next) || + !reprogram) + return; + } diff --git a/debian/patches/features/all/rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch b/debian/patches/features/all/rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch index f4d0ee202..e86535ed2 100644 --- a/debian/patches/features/all/rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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. @@ -19,15 +19,15 @@ Signed-off-by: Sebastian Andrzej Siewior kernel/sched/core.c | 2 +- kernel/sched/deadline.c | 2 +- kernel/sched/rt.c | 4 ++-- - kernel/time/hrtimer.c | 34 +++++++++++++++++++++++++++++++--- + kernel/time/hrtimer.c | 34 ++++++++++++++++++++++++++++++++-- kernel/time/tick-broadcast-hrtimer.c | 2 +- kernel/time/tick-sched.c | 2 +- kernel/watchdog.c | 2 +- - 10 files changed, 47 insertions(+), 13 deletions(-) + 10 files changed, 48 insertions(+), 12 deletions(-) --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c -@@ -2093,7 +2093,7 @@ int kvm_create_lapic(struct kvm_vcpu *vc +@@ -2098,7 +2098,7 @@ int kvm_create_lapic(struct kvm_vcpu *vc apic->vcpu = vcpu; hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC, @@ -115,16 +115,18 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -423,7 +423,7 @@ static inline void debug_hrtimer_activat +@@ -422,8 +422,10 @@ static inline void debug_hrtimer_activat + * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft * match, when a timer is started via__hrtimer_start_range_ns(). */ ++#ifndef CONFIG_PREEMPT_RT_BASE if (modecheck) -- WARN_ON_ONCE(!(mode & HRTIMER_MODE_SOFT) ^ !timer->is_soft); -+ WARN_ON_ONCE((mode & HRTIMER_MODE_SOFT) & !timer->is_soft); + WARN_ON_ONCE(!(mode & HRTIMER_MODE_SOFT) ^ !timer->is_soft); ++#endif debug_object_activate(timer, &hrtimer_debug_descr); } -@@ -1247,10 +1247,17 @@ static inline int hrtimer_clockid_to_bas +@@ -1249,10 +1251,17 @@ static inline int hrtimer_clockid_to_bas static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, enum hrtimer_mode mode) { @@ -144,7 +146,7 @@ Signed-off-by: Sebastian Andrzej Siewior memset(timer, 0, sizeof(struct hrtimer)); cpu_base = raw_cpu_ptr(&hrtimer_bases); -@@ -1630,11 +1637,32 @@ static enum hrtimer_restart hrtimer_wake +@@ -1632,11 +1641,32 @@ static enum hrtimer_restart hrtimer_wake return HRTIMER_NORESTART; } diff --git a/debian/patches/features/all/rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch b/debian/patches/features/all/rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch index af1b5102c..c03da25dd 100644 --- a/debian/patches/features/all/rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch +++ b/debian/patches/features/all/rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 4 Sep 2017 18:31:50 +0200 Subject: [PATCH] hrtimer: consolidate hrtimer_init() + hrtimer_init_sleeper() calls -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz hrtimer_init_sleeper() calls require a prior initialisation of the hrtimer object with hrtimer_init(). Lets make the initialisation of the @@ -80,7 +80,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern int schedule_hrtimeout_range_clock(ktime_t *expires, --- a/include/linux/wait.h +++ b/include/linux/wait.h -@@ -486,8 +486,8 @@ do { \ +@@ -487,8 +487,8 @@ do { \ int __ret = 0; \ struct hrtimer_sleeper __t; \ \ @@ -135,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior } --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1602,13 +1602,44 @@ static enum hrtimer_restart hrtimer_wake +@@ -1604,13 +1604,44 @@ static enum hrtimer_restart hrtimer_wake return HRTIMER_NORESTART; } @@ -181,7 +181,7 @@ Signed-off-by: Sebastian Andrzej Siewior int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) { switch(restart->nanosleep.type) { -@@ -1632,8 +1663,6 @@ static int __sched do_nanosleep(struct h +@@ -1634,8 +1665,6 @@ static int __sched do_nanosleep(struct h { struct restart_block *restart; @@ -190,7 +190,7 @@ Signed-off-by: Sebastian Andrzej Siewior do { set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t->timer, mode); -@@ -1670,10 +1699,9 @@ static long __sched hrtimer_nanosleep_re +@@ -1672,10 +1701,9 @@ static long __sched hrtimer_nanosleep_re struct hrtimer_sleeper t; int ret; @@ -203,7 +203,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = do_nanosleep(&t, HRTIMER_MODE_ABS); destroy_hrtimer_on_stack(&t.timer); return ret; -@@ -1691,7 +1719,7 @@ long hrtimer_nanosleep(const struct time +@@ -1693,7 +1721,7 @@ long hrtimer_nanosleep(const struct time if (dl_task(current) || rt_task(current)) slack = 0; @@ -212,7 +212,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_set_expires_range_ns(&t.timer, timespec64_to_ktime(*rqtp), slack); ret = do_nanosleep(&t, mode); if (ret != -ERESTART_RESTARTBLOCK) -@@ -1876,11 +1904,9 @@ schedule_hrtimeout_range_clock(ktime_t * +@@ -1878,11 +1906,9 @@ schedule_hrtimeout_range_clock(ktime_t * return -EINTR; } diff --git a/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch b/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch index 6aa0091e7..53eb0f63e 100644 --- a/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch +++ b/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch @@ -1,7 +1,7 @@ From: Ingo Molnar 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Make cancellation of a running callback in softirq context safe against preemption. @@ -61,7 +61,7 @@ Signed-off-by: Thomas Gleixner } --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -930,6 +930,33 @@ u64 hrtimer_forward(struct hrtimer *time +@@ -932,6 +932,33 @@ u64 hrtimer_forward(struct hrtimer *time } EXPORT_SYMBOL_GPL(hrtimer_forward); @@ -95,7 +95,7 @@ Signed-off-by: Thomas Gleixner /* * enqueue_hrtimer - internal function to (re)start a timer * -@@ -1156,7 +1183,7 @@ int hrtimer_cancel(struct hrtimer *timer +@@ -1158,7 +1185,7 @@ int hrtimer_cancel(struct hrtimer *timer if (ret >= 0) return ret; @@ -104,7 +104,7 @@ Signed-off-by: Thomas Gleixner } } EXPORT_SYMBOL_GPL(hrtimer_cancel); -@@ -1430,6 +1457,7 @@ static __latent_entropy void hrtimer_run +@@ -1432,6 +1459,7 @@ static __latent_entropy void hrtimer_run hrtimer_update_softirq_timer(cpu_base, true); raw_spin_unlock_irqrestore(&cpu_base->lock, flags); @@ -112,7 +112,7 @@ Signed-off-by: Thomas Gleixner } #ifdef CONFIG_HIGH_RES_TIMERS -@@ -1792,6 +1820,9 @@ int hrtimers_prepare_cpu(unsigned int cp +@@ -1794,6 +1822,9 @@ int hrtimers_prepare_cpu(unsigned int cp cpu_base->hres_active = 0; cpu_base->expires_next = KTIME_MAX; cpu_base->softirq_expires_next = KTIME_MAX; diff --git a/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch b/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch index 7596fbff2..b514b8a26 100644 --- a/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch +++ b/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:16 -0500 Subject: ide: Do not disable interrupts for PREEMPT-RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Use the local_irq_*_nort variants. diff --git a/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch b/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch index ede2e720d..2a4f560c1 100644 --- a/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch +++ b/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch @@ -1,7 +1,7 @@ From: Sven-Thorsten Dietrich Date: Fri, 3 Jul 2009 08:30:35 -0500 Subject: infiniband: Mellanox IB driver patch use _nort() primitives -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Fixes in_atomic stack-dump, when Mellanox module is loaded into the RT Kernel. diff --git a/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch b/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch index 9b8acf7a3..ac5cfcf06 100644 --- a/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch +++ b/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:16 -0500 Subject: input: gameport: Do not disable interrupts on PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Use the _nort() primitives. diff --git a/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch b/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch index db5224e9d..b1168eea5 100644 --- a/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch +++ b/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch @@ -1,7 +1,7 @@ Subject: iommu/amd: Use WARN_ON_NORT in __attach_device() From: Thomas Gleixner Date: Sat, 27 Feb 2016 10:22:23 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz RT does not disable interrupts here, but the protection is still correct. Fixup the WARN_ON so it won't yell on RT. diff --git a/debian/patches/features/all/rt/iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch b/debian/patches/features/all/rt/iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch index d8e3ac5d8..284b6b8eb 100644 --- a/debian/patches/features/all/rt/iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch +++ b/debian/patches/features/all/rt/iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 17:21:40 +0200 Subject: [PATCH] iommu/iova: Use raw_cpu_ptr() instead of get_cpu_ptr() for ->fq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz get_cpu_ptr() disabled preemption and returns the ->fq object of the current CPU. raw_cpu_ptr() does the same except that it not disable diff --git a/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch b/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch index 37ede28ac..e6c830dfb 100644 --- a/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch +++ b/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch @@ -1,7 +1,7 @@ Subject: genirq: Allow disabling of softirq processing in irq thread context From: Thomas Gleixner Date: Tue, 31 Jan 2012 13:01:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 @@ -21,7 +21,7 @@ Signed-off-by: Thomas Gleixner --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -63,6 +63,7 @@ +@@ -64,6 +64,7 @@ * interrupt handler after suspending interrupts. For system * wakeup devices users need to implement wakeup detection in * their interrupt handlers. @@ -29,7 +29,7 @@ Signed-off-by: Thomas Gleixner */ #define IRQF_SHARED 0x00000080 #define IRQF_PROBE_SHARED 0x00000100 -@@ -76,6 +77,7 @@ +@@ -77,6 +78,7 @@ #define IRQF_NO_THREAD 0x00010000 #define IRQF_EARLY_RESUME 0x00020000 #define IRQF_COND_SUSPEND 0x00040000 @@ -65,7 +65,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -885,7 +885,15 @@ irq_forced_thread_fn(struct irq_desc *de +@@ -922,7 +922,15 @@ irq_forced_thread_fn(struct irq_desc *de local_bh_disable(); ret = action->thread_fn(action->irq, action->dev_id); irq_finalize_oneshot(desc, action); @@ -82,7 +82,7 @@ Signed-off-by: Thomas Gleixner return ret; } -@@ -1362,6 +1370,9 @@ static int +@@ -1410,6 +1418,9 @@ static int irqd_set(&desc->irq_data, IRQD_NO_BALANCING); } diff --git a/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch b/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch index 00b75b20a..08d1b0cd9 100644 --- a/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch +++ b/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch @@ -1,7 +1,7 @@ Subject: irqwork: Move irq safe work to irq context From: Thomas Gleixner Date: Sun, 15 Nov 2015 18:40:17 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On architectures where arch_irq_work_has_interrupt() returns false, we end up running the irq safe work from the softirq context. That diff --git a/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch b/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch index dee8c5e65..0c7dc484a 100644 --- a/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch +++ b/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch @@ -1,7 +1,7 @@ Subject: irqwork: push most work into softirq context From: Sebastian Andrzej Siewior Date: Tue, 23 Jun 2015 15:32:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/jump-label-rt.patch b/debian/patches/features/all/rt/jump-label-rt.patch index ba15b2bd4..ad0ceec58 100644 --- a/debian/patches/features/all/rt/jump-label-rt.patch +++ b/debian/patches/features/all/rt/jump-label-rt.patch @@ -1,7 +1,7 @@ Subject: jump-label: disable if stop_machine() is used From: Thomas Gleixner Date: Wed, 08 Jul 2015 17:14:48 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Some architectures are using stop_machine() while switching the opcode which leads to latency spikes. diff --git a/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch b/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch index 40127d2a4..30df0bef2 100644 --- a/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch +++ b/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch @@ -1,7 +1,7 @@ Subject: kconfig: Disable config options which are not RT compatible From: Thomas Gleixner Date: Sun, 24 Jul 2011 12:11:43 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Disable stuff which is known to have issues on RT diff --git a/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch b/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch index 9a1f31d2e..da8341994 100644 --- a/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch +++ b/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch @@ -1,7 +1,7 @@ Subject: kconfig: Add PREEMPT_RT_FULL From: Thomas Gleixner Date: Wed, 29 Jun 2011 14:58:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Introduce the final symbol for PREEMPT_RT_FULL. diff --git a/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch b/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch index 4a9274c65..cd432217d 100644 --- a/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch +++ b/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 19 Mar 2013 14:44:30 +0100 Subject: kernel/SRCU: provide a static initializer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz There are macros for static initializer for the three out of four possible notifier types, that are: diff --git a/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch b/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch index 1ab931f2a..e0d500a99 100644 --- a/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch +++ b/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch b/debian/patches/features/all/rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch index aa93b8789..b206abc3a 100644 --- a/debian/patches/features/all/rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 @@ -345,7 +345,7 @@ Signed-off-by: Sebastian Andrzej Siewior * parent) --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -960,7 +960,7 @@ static struct rq *__migrate_task(struct +@@ -959,7 +959,7 @@ static struct rq *__migrate_task(struct } /* Affinity changed (again). */ @@ -354,7 +354,7 @@ Signed-off-by: Sebastian Andrzej Siewior return rq; update_rq_clock(rq); -@@ -988,7 +988,7 @@ static int migration_cpu_stop(void *data +@@ -987,7 +987,7 @@ static int migration_cpu_stop(void *data local_irq_disable(); /* * We need to explicitly wake pending tasks before running @@ -363,7 +363,7 @@ Signed-off-by: Sebastian Andrzej Siewior * during wakeups, see set_cpus_allowed_ptr()'s TASK_WAKING test. */ sched_ttwu_pending(); -@@ -1019,7 +1019,7 @@ static int migration_cpu_stop(void *data +@@ -1018,7 +1018,7 @@ static int migration_cpu_stop(void *data */ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_mask) { @@ -372,7 +372,7 @@ Signed-off-by: Sebastian Andrzej Siewior p->nr_cpus_allowed = cpumask_weight(new_mask); } -@@ -1089,7 +1089,7 @@ static int __set_cpus_allowed_ptr(struct +@@ -1088,7 +1088,7 @@ static int __set_cpus_allowed_ptr(struct goto out; } @@ -381,7 +381,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; if (!cpumask_intersects(new_mask, cpu_valid_mask)) { -@@ -1250,10 +1250,10 @@ static int migrate_swap_stop(void *data) +@@ -1249,10 +1249,10 @@ static int migrate_swap_stop(void *data) if (task_cpu(arg->src_task) != arg->src_cpu) goto unlock; @@ -394,7 +394,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto unlock; __migrate_swap_task(arg->src_task, arg->dst_cpu); -@@ -1294,10 +1294,10 @@ int migrate_swap(struct task_struct *cur +@@ -1293,10 +1293,10 @@ int migrate_swap(struct task_struct *cur if (!cpu_active(arg.src_cpu) || !cpu_active(arg.dst_cpu)) goto out; @@ -407,7 +407,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto out; trace_sched_swap_numa(cur, arg.src_cpu, p, arg.dst_cpu); -@@ -1441,7 +1441,7 @@ void kick_process(struct task_struct *p) +@@ -1440,7 +1440,7 @@ void kick_process(struct task_struct *p) EXPORT_SYMBOL_GPL(kick_process); /* @@ -416,7 +416,7 @@ Signed-off-by: Sebastian Andrzej Siewior * * A few notes on cpu_active vs cpu_online: * -@@ -1481,14 +1481,14 @@ static int select_fallback_rq(int cpu, s +@@ -1480,14 +1480,14 @@ static int select_fallback_rq(int cpu, s for_each_cpu(dest_cpu, nodemask) { if (!cpu_active(dest_cpu)) continue; @@ -433,7 +433,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!(p->flags & PF_KTHREAD) && !cpu_active(dest_cpu)) continue; if (!cpu_online(dest_cpu)) -@@ -1533,7 +1533,7 @@ static int select_fallback_rq(int cpu, s +@@ -1532,7 +1532,7 @@ static int select_fallback_rq(int cpu, s } /* @@ -442,7 +442,7 @@ Signed-off-by: Sebastian Andrzej Siewior */ static inline int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags) -@@ -1543,11 +1543,11 @@ int select_task_rq(struct task_struct *p +@@ -1542,11 +1542,11 @@ int select_task_rq(struct task_struct *p if (p->nr_cpus_allowed > 1) cpu = p->sched_class->select_task_rq(p, cpu, sd_flags, wake_flags); else @@ -456,7 +456,7 @@ Signed-off-by: Sebastian Andrzej Siewior * CPU. * * Since this is common to all placement strategies, this lives here. -@@ -1555,7 +1555,7 @@ int select_task_rq(struct task_struct *p +@@ -1554,7 +1554,7 @@ int select_task_rq(struct task_struct *p * [ this allows ->select_task() to simply return task_cpu(p) and * not worry about this generic constraint ] */ @@ -465,7 +465,7 @@ Signed-off-by: Sebastian Andrzej Siewior !cpu_online(cpu))) cpu = select_fallback_rq(task_cpu(p), p); -@@ -2445,7 +2445,7 @@ void wake_up_new_task(struct task_struct +@@ -2444,7 +2444,7 @@ void wake_up_new_task(struct task_struct #ifdef CONFIG_SMP /* * Fork balancing, do it here and not earlier because: @@ -474,7 +474,7 @@ Signed-off-by: Sebastian Andrzej Siewior * - any previously selected CPU might disappear through hotplug * * Use __set_task_cpu() to avoid calling sched_class::migrate_task_rq, -@@ -4162,7 +4162,7 @@ static int __sched_setscheduler(struct t +@@ -4161,7 +4161,7 @@ static int __sched_setscheduler(struct t * the entire root_domain to become SCHED_DEADLINE. We * will also fail if there's no bandwidth available. */ @@ -483,7 +483,7 @@ Signed-off-by: Sebastian Andrzej Siewior rq->rd->dl_bw.bw == 0) { task_rq_unlock(rq, p, &rf); return -EPERM; -@@ -4756,7 +4756,7 @@ long sched_getaffinity(pid_t pid, struct +@@ -4755,7 +4755,7 @@ long sched_getaffinity(pid_t pid, struct goto out_unlock; raw_spin_lock_irqsave(&p->pi_lock, flags); @@ -492,7 +492,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&p->pi_lock, flags); out_unlock: -@@ -5321,7 +5321,7 @@ int task_can_attach(struct task_struct * +@@ -5320,7 +5320,7 @@ int task_can_attach(struct task_struct * * allowed nodes is unnecessary. Thus, cpusets are not * applicable for such threads. This prevents checking for * success of set_cpus_allowed_ptr() on all attached tasks @@ -501,7 +501,7 @@ Signed-off-by: Sebastian Andrzej Siewior */ if (p->flags & PF_NO_SETAFFINITY) { ret = -EINVAL; -@@ -5348,7 +5348,7 @@ int migrate_task_to(struct task_struct * +@@ -5347,7 +5347,7 @@ int migrate_task_to(struct task_struct * if (curr_cpu == target_cpu) return 0; @@ -510,7 +510,7 @@ Signed-off-by: Sebastian Andrzej Siewior return -EINVAL; /* TODO: This is not properly updating schedstats */ -@@ -5485,7 +5485,7 @@ static void migrate_tasks(struct rq *dea +@@ -5484,7 +5484,7 @@ static void migrate_tasks(struct rq *dea put_prev_task(rq, next); /* diff --git a/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index 217595a73..f8260c9f8 100644 --- a/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz There is no need to free the stack before the task struct. This also comes handy on -RT because we can't free memory in preempt disabled @@ -43,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior security_task_free(tsk); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2706,15 +2706,6 @@ static struct rq *finish_task_switch(str +@@ -2705,15 +2705,6 @@ static struct rq *finish_task_switch(str if (prev->sched_class->task_dead) prev->sched_class->task_dead(prev); diff --git a/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch b/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch index 2481e8d75..e686e61fc 100644 --- a/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch +++ b/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 9 Feb 2016 18:17:18 +0100 Subject: kernel: softirq: unlock with irqs on -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz We unlock the lock while the interrupts are off. This isn't a problem now but will get because the migrate_disable() + enable are not diff --git a/debian/patches/features/all/rt/kgb-serial-hackaround.patch b/debian/patches/features/all/rt/kgb-serial-hackaround.patch index b3758ef95..dc59d06d5 100644 --- a/debian/patches/features/all/rt/kgb-serial-hackaround.patch +++ b/debian/patches/features/all/rt/kgb-serial-hackaround.patch @@ -1,7 +1,7 @@ From: Jason Wessel 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On 07/27/2011 04:37 PM, Thomas Gleixner wrote: > - KGDB (not yet disabled) is reportedly unusable on -rt right now due @@ -34,7 +34,7 @@ Jason. #include #include #include -@@ -3216,6 +3217,8 @@ void serial8250_console_write(struct uar +@@ -3219,6 +3220,8 @@ void serial8250_console_write(struct uar if (port->sysrq || oops_in_progress) locked = 0; diff --git a/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch b/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch index 4d48a1a9a..f7b7cec66 100644 --- a/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch +++ b/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz as it triggers: |CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 diff --git a/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch b/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch index cd547e173..523a0ee7b 100644 --- a/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch +++ b/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch @@ -1,7 +1,7 @@ From: Josh Cartwright 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz At first glance, the use of 'static inline' seems appropriate for INIT_HLIST_BL_HEAD(). diff --git a/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch b/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch index 52b9617d6..0bde88aef 100644 --- a/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch +++ b/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch @@ -1,7 +1,7 @@ From: Paul Gortmaker 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz As per changes in include/linux/jbd_common.h for avoiding the bit_spin_locks on RT ("fs: jbd/jbd2: Make state lock and journal diff --git a/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch b/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch index 31bad2b37..047039a18 100644 --- a/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch +++ b/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 21 Jul 2009 22:34:14 +0200 Subject: rt: local_irq_* variants depending on RT/!RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add local_irq_*_(no)rt variant which are mainly used to break interrupt disabled sections on PREEMPT_RT or to explicitely disable diff --git a/debian/patches/features/all/rt/localversion.patch b/debian/patches/features/all/rt/localversion.patch index 5a6cb30e3..c097d889d 100644 --- a/debian/patches/features/all/rt/localversion.patch +++ b/debian/patches/features/all/rt/localversion.patch @@ -1,7 +1,7 @@ Subject: Add localversion for -RT release From: Thomas Gleixner Date: Fri, 08 Jul 2011 20:25:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Signed-off-by: Thomas Gleixner --- @@ -11,4 +11,4 @@ Signed-off-by: Thomas Gleixner --- /dev/null +++ b/localversion-rt @@ -0,0 +1 @@ -+-rt3 ++-rt7 diff --git a/debian/patches/features/all/rt/lockdep-disable-self-test.patch b/debian/patches/features/all/rt/lockdep-disable-self-test.patch index 0a911ca6b..6c5cfce5d 100644 --- a/debian/patches/features/all/rt/lockdep-disable-self-test.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch b/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch index 965295c53..08b80dc6c 100644 --- a/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch +++ b/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch @@ -1,7 +1,7 @@ Subject: lockdep: Make it RT aware From: Thomas Gleixner Date: Sun, 17 Jul 2011 18:51:23 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz teach lockdep that we don't really do softirqs on -RT. diff --git a/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch index 9eb2aa956..fc97f9173 100644 --- a/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ b/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch @@ -1,7 +1,7 @@ From: Josh Cartwright 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz "lockdep: Selftest: Only do hardirq context test for raw spinlock" disabled the execution of certain tests with PREEMPT_RT_FULL, but did diff --git a/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch b/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch index ce21f3da0..572da91a4 100644 --- a/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch +++ b/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch @@ -1,7 +1,7 @@ Subject: lockdep: selftest: Only do hardirq context test for raw spinlock From: Yong Zhang Date: Mon, 16 Apr 2012 15:01:56 +0800 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz From: Yong Zhang diff --git a/debian/patches/features/all/rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/debian/patches/features/all/rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch index 2f3271982..28af73fdb 100644 --- a/debian/patches/features/all/rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch b/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch index 99e2eb840..d38bc9220 100644 --- a/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch +++ b/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch @@ -1,7 +1,7 @@ From: "Wolfgang M. Reimer" 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Including rwlock.h directly will cause kernel builds to fail if CONFIG_PREEMPT_RT_FULL is defined. The correct header file diff --git a/debian/patches/features/all/rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch b/debian/patches/features/all/rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch index 3a3a822ec..f0decac8f 100644 --- a/debian/patches/features/all/rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/locking-rtmutex-don-t-drop-the-wait_lock-twice.patch b/debian/patches/features/all/rt/locking-rtmutex-don-t-drop-the-wait_lock-twice.patch index 46361bd95..e82cbe27b 100644 --- a/debian/patches/features/all/rt/locking-rtmutex-don-t-drop-the-wait_lock-twice.patch +++ b/debian/patches/features/all/rt/locking-rtmutex-don-t-drop-the-wait_lock-twice.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 7 Sep 2017 12:38:47 +0200 Subject: locking/rtmutex: don't drop the wait_lock twice -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Since the futex rework, __rt_mutex_start_proxy_lock() does no longer acquire the wait_lock so it must not drop it. Otherwise the lock is not @@ -11,7 +11,7 @@ It is okay to remove that line because this function does not disable interrupts nor does it acquire the ->wait_lock. The caller does this so it is wrong do it here (after the futex rework). -Cc: rt-stable@vger.kernel.org #v4.9.18-rt14+ +Cc: stable-rt@vger.kernel.org #v4.9.18-rt14+ Reported-by: Gusenleitner Klaus Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches/features/all/rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch b/debian/patches/features/all/rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch index 81ed08963..957544cfe 100644 --- a/debian/patches/features/all/rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/md-disable-bcache.patch b/debian/patches/features/all/rt/md-disable-bcache.patch index 968a9eae6..3ffac98aa 100644 --- a/debian/patches/features/all/rt/md-disable-bcache.patch +++ b/debian/patches/features/all/rt/md-disable-bcache.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 11:48:57 +0200 Subject: md: disable bcache -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz It uses anon semaphores |drivers/md/bcache/request.c: In function ‘cached_dev_write_complete’: diff --git a/debian/patches/features/all/rt/md-raid5-do-not-disable-interrupts.patch b/debian/patches/features/all/rt/md-raid5-do-not-disable-interrupts.patch index 6a130b57d..74e18bd86 100644 --- a/debian/patches/features/all/rt/md-raid5-do-not-disable-interrupts.patch +++ b/debian/patches/features/all/rt/md-raid5-do-not-disable-interrupts.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 17 Nov 2017 16:21:00 +0100 Subject: [PATCH] md/raid5: do not disable interrupts -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:974 |in_atomic(): 0, irqs_disabled(): 1, pid: 2992, name: lvm diff --git a/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch b/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch index 64515e1da..da3cc3e1f 100644 --- a/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch +++ b/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz __raid_run_ops() disables preemption with get_cpu() around the access to the raid5_percpu variables. That causes scheduling while atomic diff --git a/debian/patches/features/all/rt/mfd-syscon-atmel-smc-include-string.h.patch b/debian/patches/features/all/rt/mfd-syscon-atmel-smc-include-string.h.patch index dcea452c8..188b0d4d5 100644 --- a/debian/patches/features/all/rt/mfd-syscon-atmel-smc-include-string.h.patch +++ b/debian/patches/features/all/rt/mfd-syscon-atmel-smc-include-string.h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 4 Oct 2017 09:55:58 +0200 Subject: [PATCH] mfd: syscon: atmel-smc: include string.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The string.h header file is needed for the memset() definition. The RT build fails because it is not pulled in via other header files. diff --git a/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch b/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch index 8e9abaaee..5a2c365c0 100644 --- a/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch +++ b/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch @@ -1,7 +1,7 @@ Subject: mips: Disable highmem on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:10:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The current highmem handling on -RT is not compatible and needs fixups. diff --git a/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch b/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch index a87ba139e..bc4c28bec 100644 --- a/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch +++ b/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch @@ -1,7 +1,7 @@ Subject: mm: rt: Fix generic kmap_atomic for RT From: Thomas Gleixner Date: Sat, 19 Sep 2015 10:15:00 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The update to 4.1 brought in the mainline variant of the pagefault disable distangling from preempt count. That introduced a diff --git a/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch b/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch index f95195a4a..791df0816 100644 --- a/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch +++ b/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 5 Feb 2016 12:17:14 +0100 Subject: mm: backing-dev: don't disable IRQs in wb_congested_put() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz it triggers: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:930 diff --git a/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch b/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch index 46696c9d1..353618b13 100644 --- a/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch +++ b/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch @@ -1,7 +1,7 @@ Subject: mm: bounce: Use local_irq_save_nort From: Thomas Gleixner Date: Wed, 09 Jan 2013 10:33:09 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz kmap_atomic() is preemptible on RT. diff --git a/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch b/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch index 1330a634f..7de0d14f4 100644 --- a/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch +++ b/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch @@ -1,7 +1,7 @@ From: Ingo Molnar 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Replace global locks (get_cpu + local_irq_save) with "local_locks()". Currently there is one of for "rotate" and one for "swap". @@ -45,7 +45,7 @@ Signed-off-by: Thomas Gleixner } --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -6857,8 +6857,9 @@ void __init free_area_init(unsigned long +@@ -6862,8 +6862,9 @@ void __init free_area_init(unsigned long static int page_alloc_cpu_dead(unsigned int cpu) { diff --git a/debian/patches/features/all/rt/mm-disable-sloub-rt.patch b/debian/patches/features/all/rt/mm-disable-sloub-rt.patch index 7e6c58473..cbd2bb807 100644 --- a/debian/patches/features/all/rt/mm-disable-sloub-rt.patch +++ b/debian/patches/features/all/rt/mm-disable-sloub-rt.patch @@ -1,7 +1,7 @@ From: Ingo Molnar 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs. diff --git a/debian/patches/features/all/rt/mm-enable-slub.patch b/debian/patches/features/all/rt/mm-enable-slub.patch index 7aba4c423..ec354ce84 100644 --- a/debian/patches/features/all/rt/mm-enable-slub.patch +++ b/debian/patches/features/all/rt/mm-enable-slub.patch @@ -1,7 +1,7 @@ Subject: mm: Enable SLUB for RT From: Thomas Gleixner Date: Thu, 25 Oct 2012 10:32:35 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Make SLUB RT aware by converting locks to raw and using free lists to move the freeing out of the lock held region. diff --git a/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch b/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch index e35c54688..8673f2b1a 100644 --- a/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch +++ b/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch @@ -1,7 +1,7 @@ From: Ingo Molnar 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Disable preemption on -RT for the vmstat code. On vanila the code runs in IRQ-off regions while on -RT it is not. "preempt_disable" ensures that the diff --git a/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch index e3eaf6c8a..91ee40f97 100644 --- a/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ b/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch @@ -1,7 +1,7 @@ From: Yang Shi 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The following trace is triggered when running ltp oom test cases: diff --git a/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch b/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch index 794b0d7cc..a64025673 100644 --- a/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch +++ b/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch @@ -1,13 +1,12 @@ 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. Signed-off-by: Sebastian Andrzej Siewior -[bwh: Adjust context after 4.14.4] --- mm/memcontrol.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch b/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch index 78a8abc51..4b12a8f04 100644 --- a/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch +++ b/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch @@ -1,7 +1,7 @@ Subject: mm: page_alloc: Use local_lock_on() instead of plain spinlock From: Thomas Gleixner Date: Thu, 27 Sep 2012 11:11:46 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The plain spinlock while sufficient does not update the local_lock internals. Use a proper local_lock function instead to ease debugging. diff --git a/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch b/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch index cda662518..2ba52957b 100644 --- a/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch +++ b/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra Date: Fri Jul 3 08:44:37 2009 -0500 Subject: mm: page_alloc: Reduce lock sections further -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Split out the pages which are to be freed into a separate list and call free_pages_bulk() outside of the percpu page allocator locks. @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -1100,7 +1100,7 @@ static bool bulkfree_pcp_prepare(struct +@@ -1109,7 +1109,7 @@ static bool bulkfree_pcp_prepare(struct #endif /* CONFIG_DEBUG_VM */ /* @@ -23,7 +23,7 @@ Signed-off-by: Thomas Gleixner * Assumes all pages on list are in same zone, and of same order. * count is the number of pages to free. * -@@ -1111,15 +1111,53 @@ static bool bulkfree_pcp_prepare(struct +@@ -1120,15 +1120,53 @@ static bool bulkfree_pcp_prepare(struct * pinned" detection logic. */ static void free_pcppages_bulk(struct zone *zone, int count, @@ -81,7 +81,7 @@ Signed-off-by: Thomas Gleixner while (count) { struct page *page; struct list_head *list; -@@ -1135,7 +1173,7 @@ static void free_pcppages_bulk(struct zo +@@ -1144,7 +1182,7 @@ static void free_pcppages_bulk(struct zo batch_free++; if (++migratetype == MIGRATE_PCPTYPES) migratetype = 0; @@ -90,7 +90,7 @@ Signed-off-by: Thomas Gleixner } while (list_empty(list)); /* This is the only non-empty list. Free them all. */ -@@ -1143,27 +1181,12 @@ static void free_pcppages_bulk(struct zo +@@ -1152,27 +1190,12 @@ static void free_pcppages_bulk(struct zo batch_free = count; do { @@ -119,7 +119,7 @@ Signed-off-by: Thomas Gleixner } static void free_one_page(struct zone *zone, -@@ -1171,13 +1194,15 @@ static void free_one_page(struct zone *z +@@ -1180,13 +1203,15 @@ static void free_one_page(struct zone *z unsigned int order, int migratetype) { @@ -137,7 +137,7 @@ Signed-off-by: Thomas Gleixner } static void __meminit __init_single_page(struct page *page, unsigned long pfn, -@@ -2384,16 +2409,18 @@ static int rmqueue_bulk(struct zone *zon +@@ -2393,16 +2418,18 @@ static int rmqueue_bulk(struct zone *zon void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) { unsigned long flags; @@ -157,7 +157,7 @@ Signed-off-by: Thomas Gleixner } #endif -@@ -2409,16 +2436,21 @@ static void drain_pages_zone(unsigned in +@@ -2418,16 +2445,21 @@ static void drain_pages_zone(unsigned in unsigned long flags; struct per_cpu_pageset *pset; struct per_cpu_pages *pcp; @@ -181,7 +181,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -2656,8 +2688,13 @@ void free_hot_cold_page(struct page *pag +@@ -2661,8 +2693,13 @@ void free_hot_cold_page(struct page *pag pcp->count++; if (pcp->count >= pcp->high) { unsigned long batch = READ_ONCE(pcp->batch); diff --git a/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch b/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch index 38eb0a346..a8b9e8504 100644 --- a/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch @@ -1,7 +1,7 @@ From: Ingo Molnar 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 -@@ -1250,10 +1263,10 @@ static void __free_pages_ok(struct page +@@ -1259,10 +1272,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) -@@ -2373,14 +2386,14 @@ void drain_zone_pages(struct zone *zone, +@@ -2382,14 +2395,14 @@ void drain_zone_pages(struct zone *zone, unsigned long flags; int to_drain, batch; @@ -75,7 +75,7 @@ Signed-off-by: Thomas Gleixner } #endif -@@ -2397,7 +2410,7 @@ static void drain_pages_zone(unsigned in +@@ -2406,7 +2419,7 @@ static void drain_pages_zone(unsigned in struct per_cpu_pageset *pset; struct per_cpu_pages *pcp; @@ -84,7 +84,7 @@ Signed-off-by: Thomas Gleixner pset = per_cpu_ptr(zone->pageset, cpu); pcp = &pset->pcp; -@@ -2405,7 +2418,7 @@ static void drain_pages_zone(unsigned in +@@ -2414,7 +2427,7 @@ static void drain_pages_zone(unsigned in free_pcppages_bulk(zone, pcp->count, pcp); pcp->count = 0; } @@ -93,7 +93,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -2440,6 +2453,7 @@ void drain_local_pages(struct zone *zone +@@ -2449,6 +2462,7 @@ void drain_local_pages(struct zone *zone drain_pages(cpu); } @@ -101,7 +101,7 @@ Signed-off-by: Thomas Gleixner static void drain_local_pages_wq(struct work_struct *work) { /* -@@ -2453,6 +2467,7 @@ static void drain_local_pages_wq(struct +@@ -2462,6 +2476,7 @@ static void drain_local_pages_wq(struct drain_local_pages(NULL); preempt_enable(); } @@ -109,7 +109,7 @@ Signed-off-by: Thomas Gleixner /* * Spill all the per-cpu pages from all CPUs back into the buddy allocator. -@@ -2523,7 +2538,14 @@ void drain_all_pages(struct zone *zone) +@@ -2528,7 +2543,14 @@ void drain_all_pages(struct zone *zone) else cpumask_clear_cpu(cpu, &cpus_with_pcps); } @@ -125,7 +125,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); -@@ -2531,6 +2553,7 @@ void drain_all_pages(struct zone *zone) +@@ -2536,6 +2558,7 @@ void drain_all_pages(struct zone *zone) } for_each_cpu(cpu, &cpus_with_pcps) flush_work(per_cpu_ptr(&pcpu_drain, cpu)); @@ -133,7 +133,7 @@ Signed-off-by: Thomas Gleixner mutex_unlock(&pcpu_drain_mutex); } -@@ -2607,7 +2630,7 @@ void free_hot_cold_page(struct page *pag +@@ -2612,7 +2635,7 @@ void free_hot_cold_page(struct page *pag migratetype = get_pfnblock_migratetype(page, pfn); set_pcppage_migratetype(page, migratetype); @@ -142,7 +142,7 @@ Signed-off-by: Thomas Gleixner __count_vm_event(PGFREE); /* -@@ -2638,7 +2661,7 @@ void free_hot_cold_page(struct page *pag +@@ -2643,7 +2666,7 @@ void free_hot_cold_page(struct page *pag } out: @@ -151,7 +151,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -2795,7 +2818,7 @@ static struct page *rmqueue_pcplist(stru +@@ -2800,7 +2823,7 @@ static struct page *rmqueue_pcplist(stru struct page *page; unsigned long flags; @@ -160,7 +160,7 @@ Signed-off-by: Thomas Gleixner pcp = &this_cpu_ptr(zone->pageset)->pcp; list = &pcp->lists[migratetype]; page = __rmqueue_pcplist(zone, migratetype, cold, pcp, list); -@@ -2803,7 +2826,7 @@ static struct page *rmqueue_pcplist(stru +@@ -2808,7 +2831,7 @@ static struct page *rmqueue_pcplist(stru __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); zone_statistics(preferred_zone, zone); } @@ -169,7 +169,7 @@ Signed-off-by: Thomas Gleixner return page; } -@@ -2830,7 +2853,7 @@ struct page *rmqueue(struct zone *prefer +@@ -2835,7 +2858,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)); @@ -178,7 +178,7 @@ Signed-off-by: Thomas Gleixner do { page = NULL; -@@ -2850,14 +2873,14 @@ struct page *rmqueue(struct zone *prefer +@@ -2855,14 +2878,14 @@ struct page *rmqueue(struct zone *prefer __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); zone_statistics(preferred_zone, zone); @@ -195,7 +195,7 @@ Signed-off-by: Thomas Gleixner return NULL; } -@@ -7695,7 +7718,7 @@ void zone_pcp_reset(struct zone *zone) +@@ -7707,7 +7730,7 @@ void zone_pcp_reset(struct zone *zone) struct per_cpu_pageset *pset; /* avoid races with drain_pages() */ @@ -204,7 +204,7 @@ Signed-off-by: Thomas Gleixner if (zone->pageset != &boot_pageset) { for_each_online_cpu(cpu) { pset = per_cpu_ptr(zone->pageset, cpu); -@@ -7704,7 +7727,7 @@ void zone_pcp_reset(struct zone *zone) +@@ -7716,7 +7739,7 @@ void zone_pcp_reset(struct zone *zone) free_percpu(zone->pageset); zone->pageset = &boot_pageset; } diff --git a/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch b/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch index 953096d8b..d675a224a 100644 --- a/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch +++ b/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch @@ -1,7 +1,7 @@ From: Luiz Capitulino 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz lru_add_drain_all() works by scheduling lru_add_drain_cpu() to run on all CPUs that have non-empty LRU pagevecs and then waiting for diff --git a/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch b/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch index c7deb2552..b6b00b561 100644 --- a/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch +++ b/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch @@ -1,7 +1,7 @@ From: Yong Zhang 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/mm-rt-kmap-atomic-scheduling.patch b/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch index 17fd805e5..17b99f5cd 100644 --- a/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch +++ b/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch @@ -1,7 +1,7 @@ Subject: mm, rt: kmap_atomic scheduling From: Peter Zijlstra Date: Thu, 28 Jul 2011 10:43:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch b/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch index 3ab542af7..28948df65 100644 --- a/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch +++ b/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz For -RT it is enough to keep pagefault disabled (which is currently handled by kmap_atomic()). diff --git a/debian/patches/features/all/rt/mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch b/debian/patches/features/all/rt/mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch new file mode 100644 index 000000000..cba2e7502 --- /dev/null +++ b/debian/patches/features/all/rt/mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch @@ -0,0 +1,26 @@ +From: Sebastian Andrzej Siewior +Date: Wed, 13 Dec 2017 12:44:14 +0100 +Subject: [PATCH] mm/slub: close possible memory-leak in + kmem_cache_alloc_bulk() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz + +Under certain circumstances we could leak elements which were moved to +the local "to_free" list. The damage is limited since I can't find +any users here. + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior +--- + mm/slub.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/mm/slub.c ++++ b/mm/slub.c +@@ -3241,6 +3241,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca + return i; + error: + local_irq_enable(); ++ free_delayed(&to_free); + slab_post_alloc_hook(s, flags, i, p); + __kmem_cache_free_bulk(s, i, p); + return 0; diff --git a/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch b/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch index 129b1e482..f097a0961 100644 --- a/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch +++ b/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch @@ -1,7 +1,7 @@ Subject: mm/vmalloc: Another preempt disable region which sucks From: Thomas Gleixner Date: Tue, 12 Jul 2011 11:39:36 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Avoid the preempt disable version of get_cpu_var(). The inner-lock should provide enough serialisation. diff --git a/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch b/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch index 37d67b905..1859c6938 100644 --- a/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch +++ b/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Jan 2015 17:19:44 +0100 Subject: mm/workingset: Do not protect workingset_shadow_nodes with irq off -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz workingset_shadow_nodes is protected by local_irq_disable(). Some users use spin_lock_irq(). diff --git a/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch b/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch index 46d9b1ae3..e9d243db7 100644 --- a/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch +++ b/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch @@ -1,7 +1,7 @@ From: Mike Galbraith 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz get_cpu_var() disables preemption and triggers a might_sleep() splat later. This is replaced with get_locked_var(). diff --git a/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch b/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch index 1db40a96f..99552ecda 100644 --- a/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch +++ b/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch @@ -1,7 +1,7 @@ Subject: mmci: Remove bogus local_irq_save() From: Thomas Gleixner Date: Wed, 09 Jan 2013 12:11:12 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On !RT interrupt runs with interrupts disabled. On RT it's in a thread, so no need to disable interrupts at all. diff --git a/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch b/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch index a7beb47de..c65469936 100644 --- a/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch +++ b/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch @@ -1,7 +1,7 @@ Date: Wed, 26 Jun 2013 15:28:11 -0400 From: Steven Rostedt Subject: rt,ntp: Move call to schedule_delayed_work() to helper thread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The ntp code for notify_cmos_timer() is called from a hard interrupt context. schedule_delayed_work() under PREEMPT_RT_FULL calls spinlocks diff --git a/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch b/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch index e3708085a..4bb2a425c 100644 --- a/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch +++ b/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Drop spin on owner for mutex / rwsem. We are most likely not using it but… diff --git a/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch b/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch index 1b325242b..b4081065f 100644 --- a/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch +++ b/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch @@ -2,7 +2,7 @@ From: Steven Rostedt 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch b/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch index 65e7724a1..533263288 100644 --- a/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ b/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/net-add-a-lock-around-icmp_sk.patch b/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch index e9ef27a64..9f308ad6b 100644 --- a/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch +++ b/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz It looks like the this_cpu_ptr() access in icmp_sk() is protected with local_bh_disable(). To avoid missing serialization in -RT I am adding diff --git a/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch b/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch index baa726228..eae087866 100644 --- a/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch +++ b/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch @@ -5,7 +5,7 @@ Subject: [PATCH] net: add back the missing serialization in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch b/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch index 1e7dd0e48..787093ada 100644 --- a/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch +++ b/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Replace it by a local lock. Though that's pretty inefficient :( diff --git a/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch b/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch index 87b8f34a1..f01336aa4 100644 --- a/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch +++ b/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch @@ -1,7 +1,7 @@ Subject: net/core/cpuhotplug: Drain input_pkt_queue lockless From: Grygorii Strashko Date: Fri, 9 Oct 2015 09:25:49 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz I can constantly see below error report with 4.1 RT-kernel on TI ARM dra7-evm if I'm trying to unplug cpu1: diff --git a/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch b/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch index 8ed4b497b..6b947717f 100644 --- a/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch +++ b/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On -RT the code running in BH can not be moved to another CPU so CPU local variable remain local. However the code can be preempted diff --git a/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch index c226bcdc3..a82b5f9fe 100644 --- a/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ b/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch b/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch index 0fabbbaa8..fcc3fbe2f 100644 --- a/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch +++ b/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch @@ -1,7 +1,7 @@ Subject: net: netfilter: Serialize xt_write_recseq sections on RT From: Thomas Gleixner Date: Sun, 28 Oct 2012 11:18:08 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch b/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch index 00b44dbe5..1d76a96d8 100644 --- a/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch +++ b/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On RT write_seqcount_begin() disables preemption and device_rename() allocates memory with GFP_KERNEL and grabs later the sysfs_mutex diff --git a/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch b/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch index cd030c785..682d3af5e 100644 --- a/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch +++ b/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch b/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch index ed49f633b..b4d240fdd 100644 --- a/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch +++ b/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch @@ -1,7 +1,7 @@ Subject: net-flip-lock-dep-thingy.patch From: Thomas Gleixner Date: Tue, 28 Jun 2011 10:59:58 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz ======================================================= [ INFO: possible circular locking dependency detected ] diff --git a/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch b/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch index 9315e860a..48f70a40b 100644 --- a/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch +++ b/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch b/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch index 137708cce..e7f372718 100644 --- a/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch +++ b/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch @@ -1,7 +1,7 @@ From: Marc Kleine-Budde 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch b/debian/patches/features/all/rt/net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch index ee73bf1ea..cbb0694b1 100644 --- a/debian/patches/features/all/rt/net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch +++ b/debian/patches/features/all/rt/net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 21 Aug 2017 15:09:13 +0200 Subject: [PATCH] net: take the tcp_sk_lock lock with BH disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Lockdep may complain about an unsafe locking scenario: | CPU0 CPU1 diff --git a/debian/patches/features/all/rt/net-use-cpu-chill.patch b/debian/patches/features/all/rt/net-use-cpu-chill.patch index aa9a1a5c6..16b547ebf 100644 --- a/debian/patches/features/all/rt/net-use-cpu-chill.patch +++ b/debian/patches/features/all/rt/net-use-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: net: Use cpu_chill() instead of cpu_relax() From: Thomas Gleixner Date: Wed, 07 Mar 2012 21:10:04 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system diff --git a/debian/patches/features/all/rt/net-use-trylock-in-icmp_sk.patch b/debian/patches/features/all/rt/net-use-trylock-in-icmp_sk.patch index 41985bb1a..2c720ff50 100644 --- a/debian/patches/features/all/rt/net-use-trylock-in-icmp_sk.patch +++ b/debian/patches/features/all/rt/net-use-trylock-in-icmp_sk.patch @@ -1,12 +1,12 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:42:04 +0200 Subject: net: use trylock in icmp_sk -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The locking path can be recursive (same as for sk->sk_lock.slock) and therefore we need a trylock version for the locallock, too. -Cc: rt-stable@vger.kernel.org +Cc: stable-rt@vger.kernel.org Reported-by: Jacek Konieczny Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches/features/all/rt/net-wireless-warn-nort.patch b/debian/patches/features/all/rt/net-wireless-warn-nort.patch index 587187314..bf3e0771f 100644 --- a/debian/patches/features/all/rt/net-wireless-warn-nort.patch +++ b/debian/patches/features/all/rt/net-wireless-warn-nort.patch @@ -1,7 +1,7 @@ Subject: net/wireless: Use WARN_ON_NORT() From: Thomas Gleixner Date: Thu, 21 Jul 2011 21:05:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The softirq counter is meaningless on RT, so the check triggers a false positive. diff --git a/debian/patches/features/all/rt/net_disable_NET_RX_BUSY_POLL.patch b/debian/patches/features/all/rt/net_disable_NET_RX_BUSY_POLL.patch index 48a9ef0cf..a29172db5 100644 --- a/debian/patches/features/all/rt/net_disable_NET_RX_BUSY_POLL.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/oleg-signal-rt-fix.patch b/debian/patches/features/all/rt/oleg-signal-rt-fix.patch index 287d73ccc..1f455da59 100644 --- a/debian/patches/features/all/rt/oleg-signal-rt-fix.patch +++ b/debian/patches/features/all/rt/oleg-signal-rt-fix.patch @@ -1,7 +1,7 @@ From: Oleg Nesterov 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/panic-disable-random-on-rt.patch b/debian/patches/features/all/rt/panic-disable-random-on-rt.patch index 2798924bd..489990778 100644 --- a/debian/patches/features/all/rt/panic-disable-random-on-rt.patch +++ b/debian/patches/features/all/rt/panic-disable-random-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch b/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch index f3abf728b..5ebc4051c 100644 --- a/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch +++ b/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch @@ -1,7 +1,7 @@ Subject: rcu: Make ksoftirqd do RCU quiescent states From: "Paul E. McKenney" Date: Wed, 5 Oct 2011 11:45:18 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch b/debian/patches/features/all/rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch index c62c548ea..3776cbf10 100644 --- a/debian/patches/features/all/rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch b/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch index cabf7e5f4..1b0f6555f 100644 --- a/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch +++ b/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 9 Apr 2014 11:58:17 +0200 Subject: percpu_ida: Use local locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz the local_irq_save() + spin_lock() does not work that well on -RT diff --git a/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch b/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch index bdabb0c4c..19daa2705 100644 --- a/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch +++ b/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch @@ -1,7 +1,7 @@ Subject: rcu: Frob softirq test From: Peter Zijlstra Date: Sat Aug 13 00:23:17 CEST 2011 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz With RT_FULL we get the below wreckage: diff --git a/debian/patches/features/all/rt/peterz-percpu-rwsem-rt.patch b/debian/patches/features/all/rt/peterz-percpu-rwsem-rt.patch index b08e4cf5e..8283bc235 100644 --- a/debian/patches/features/all/rt/peterz-percpu-rwsem-rt.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Effective revert commit: diff --git a/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch b/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch index d8c86291c..f3aedeae2 100644 --- a/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch +++ b/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch @@ -1,7 +1,7 @@ Subject: crypto: Convert crypto notifier chain to SRCU From: Peter Zijlstra Date: Fri, 05 Oct 2012 09:03:24 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The crypto notifier deadlocks on RT. Though this can be a real deadlock on mainline as well due to fifo fair rwsems. diff --git a/debian/patches/features/all/rt/pid.h-include-atomic.h.patch b/debian/patches/features/all/rt/pid.h-include-atomic.h.patch index 6a9a680f1..6b49a0790 100644 --- a/debian/patches/features/all/rt/pid.h-include-atomic.h.patch +++ b/debian/patches/features/all/rt/pid.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Grygorii Strashko 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz This patch fixes build error: CC kernel/pid_namespace.o diff --git a/debian/patches/features/all/rt/ping-sysrq.patch b/debian/patches/features/all/rt/ping-sysrq.patch index d13fb3602..064446494 100644 --- a/debian/patches/features/all/rt/ping-sysrq.patch +++ b/debian/patches/features/all/rt/ping-sysrq.patch @@ -1,7 +1,7 @@ Subject: net: sysrq via icmp From: Carsten Emde Date: Tue, 19 Jul 2011 13:51:17 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz There are (probably rare) situations when a system crashed and the system console becomes unresponsive but the network icmp layer still is alive. diff --git a/debian/patches/features/all/rt/posix-timers-no-broadcast.patch b/debian/patches/features/all/rt/posix-timers-no-broadcast.patch index 1ff536c6b..1e60de9d6 100644 --- a/debian/patches/features/all/rt/posix-timers-no-broadcast.patch +++ b/debian/patches/features/all/rt/posix-timers-no-broadcast.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:29:20 -0500 Subject: posix-timers: Prevent broadcast signals -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Posix timers should not send broadcast signals and kernel only signals. Prevent it. diff --git a/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch b/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch index 7ccfd7a8c..3aeee89b6 100644 --- a/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch +++ b/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch @@ -1,7 +1,7 @@ From: John Stultz 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz posix-cpu-timer code takes non -rt safe locks in hard irq context. Move it to a thread. diff --git a/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch b/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch index 12a4cec16..46b402315 100644 --- a/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch +++ b/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch @@ -1,7 +1,7 @@ Subject: powerpc: Disable highmem on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:08:34 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The current highmem handling on -RT is not compatible and needs fixups. diff --git a/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch b/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch index 776eaf8ca..605faf4de 100644 --- a/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch +++ b/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Use generic code which uses rtmutex diff --git a/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch index 5508a1f90..37244bd38 100644 --- a/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ b/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch @@ -1,7 +1,7 @@ From: Bogdan Purcareata 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/powerpc-preempt-lazy-support.patch b/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch index 01c32b158..fe0c9c0c0 100644 --- a/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch +++ b/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Implement the powerpc pieces for lazy preempt. diff --git a/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch b/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch index e5acbae10..a7bcb653b 100644 --- a/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch +++ b/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch @@ -1,7 +1,7 @@ From: Paul Gortmaker Date: Sun, 31 May 2015 14:44:42 -0400 Subject: powerpc: ps3/device-init.c - adapt to completions using swait vs wait -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz To fix: diff --git a/debian/patches/features/all/rt/preempt-lazy-support.patch b/debian/patches/features/all/rt/preempt-lazy-support.patch index 7be92a0ac..856cf97ff 100644 --- a/debian/patches/features/all/rt/preempt-lazy-support.patch +++ b/debian/patches/features/all/rt/preempt-lazy-support.patch @@ -1,7 +1,7 @@ Subject: sched: Add support for lazy preemption From: Thomas Gleixner Date: Fri, 26 Oct 2012 18:50:54 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz It has become an obsession to mitigate the determinism vs. throughput loss of RT. Looking at the mainline semantics of preemption points @@ -283,7 +283,7 @@ Signed-off-by: Thomas Gleixner void resched_cpu(int cpu) { struct rq *rq = cpu_rq(cpu); -@@ -2445,6 +2487,9 @@ int sched_fork(unsigned long clone_flags +@@ -2444,6 +2486,9 @@ int sched_fork(unsigned long clone_flags p->on_cpu = 0; #endif init_task_preempt_count(p); @@ -293,7 +293,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_SMP plist_node_init(&p->pushable_tasks, MAX_PRIO); RB_CLEAR_NODE(&p->pushable_dl_tasks); -@@ -3362,6 +3407,7 @@ static void __sched notrace __schedule(b +@@ -3361,6 +3406,7 @@ static void __sched notrace __schedule(b next = pick_next_task(rq, prev, &rf); clear_tsk_need_resched(prev); @@ -301,7 +301,7 @@ Signed-off-by: Thomas Gleixner clear_preempt_need_resched(); if (likely(prev != next)) { -@@ -3552,6 +3598,30 @@ static void __sched notrace preempt_sche +@@ -3551,6 +3597,30 @@ static void __sched notrace preempt_sche } while (need_resched()); } @@ -332,7 +332,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_PREEMPT /* * this is the entry point to schedule() from in-kernel preemption -@@ -3566,7 +3636,8 @@ asmlinkage __visible void __sched notrac +@@ -3565,7 +3635,8 @@ asmlinkage __visible void __sched notrac */ if (likely(!preemptible())) return; @@ -342,7 +342,7 @@ Signed-off-by: Thomas Gleixner preempt_schedule_common(); } NOKPROBE_SYMBOL(preempt_schedule); -@@ -3593,6 +3664,9 @@ asmlinkage __visible void __sched notrac +@@ -3592,6 +3663,9 @@ asmlinkage __visible void __sched notrac if (likely(!preemptible())) return; @@ -352,7 +352,7 @@ Signed-off-by: Thomas Gleixner do { /* * Because the function tracer can trace preempt_count_sub() -@@ -5332,7 +5406,9 @@ void init_idle(struct task_struct *idle, +@@ -5331,7 +5405,9 @@ void init_idle(struct task_struct *idle, /* Set the preempt count _outside_ the spinlocks! */ init_idle_preempt_count(idle, cpu); @@ -363,7 +363,7 @@ Signed-off-by: Thomas Gleixner /* * The idle tasks have their own, simple scheduling class: */ -@@ -6888,6 +6964,7 @@ void migrate_disable(void) +@@ -6887,6 +6963,7 @@ void migrate_disable(void) } preempt_disable(); @@ -371,7 +371,7 @@ Signed-off-by: Thomas Gleixner pin_current_cpu(); migrate_disable_update_cpus_allowed(p); -@@ -6955,6 +7032,7 @@ void migrate_enable(void) +@@ -6954,6 +7031,7 @@ void migrate_enable(void) arg.dest_cpu = dest_cpu; unpin_current_cpu(); @@ -379,7 +379,7 @@ Signed-off-by: Thomas Gleixner preempt_enable(); stop_one_cpu(task_cpu(p), migration_cpu_stop, &arg); tlb_migrate_finish(p->mm); -@@ -6963,6 +7041,7 @@ void migrate_enable(void) +@@ -6962,6 +7040,7 @@ void migrate_enable(void) } } unpin_current_cpu(); diff --git a/debian/patches/features/all/rt/preempt-nort-rt-variants.patch b/debian/patches/features/all/rt/preempt-nort-rt-variants.patch index d9c7b6ca1..88a6b4371 100644 --- a/debian/patches/features/all/rt/preempt-nort-rt-variants.patch +++ b/debian/patches/features/all/rt/preempt-nort-rt-variants.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz RT needs a few preempt_disable/enable points which are not necessary otherwise. Implement variants to avoid #ifdeffery. diff --git a/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch b/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch index 4322dd983..d2cf96939 100644 --- a/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch +++ b/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch @@ -1,7 +1,7 @@ Subject: printk: Add "force_early_printk" boot param to help with debugging From: Peter Zijlstra Date: Fri, 02 Sep 2011 14:41:29 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Gives me an option to screw printk and actually see what the machine says. diff --git a/debian/patches/features/all/rt/printk-kill.patch b/debian/patches/features/all/rt/printk-kill.patch index 55f50a06e..61957589c 100644 --- a/debian/patches/features/all/rt/printk-kill.patch +++ b/debian/patches/features/all/rt/printk-kill.patch @@ -1,7 +1,7 @@ Subject: printk: Add a printk kill switch From: Ingo Molnar Date: Fri, 22 Jul 2011 17:58:40 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/printk-rt-aware.patch b/debian/patches/features/all/rt/printk-rt-aware.patch index 338182f31..87cdb33ae 100644 --- a/debian/patches/features/all/rt/printk-rt-aware.patch +++ b/debian/patches/features/all/rt/printk-rt-aware.patch @@ -1,7 +1,7 @@ Subject: printk: Make rt aware From: Thomas Gleixner Date: Wed, 19 Sep 2012 14:50:37 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch index 6a73f8966..8668df601 100644 --- a/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ b/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz As explained by Alexander Fyodorov : @@ -116,7 +116,7 @@ Signed-off-by: Sebastian Andrzej Siewior spin_unlock_irq(&task->sighand->siglock); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1359,6 +1359,18 @@ int migrate_swap(struct task_struct *cur +@@ -1358,6 +1358,18 @@ int migrate_swap(struct task_struct *cur return ret; } @@ -135,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * wait_task_inactive - wait for a thread to unschedule. * -@@ -1403,7 +1415,7 @@ unsigned long wait_task_inactive(struct +@@ -1402,7 +1414,7 @@ unsigned long wait_task_inactive(struct * is actually now running somewhere else! */ while (task_running(rq, p)) { @@ -144,7 +144,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; cpu_relax(); } -@@ -1418,7 +1430,8 @@ unsigned long wait_task_inactive(struct +@@ -1417,7 +1429,8 @@ unsigned long wait_task_inactive(struct running = task_running(rq, p); queued = task_on_rq_queued(p); ncsw = 0; diff --git a/debian/patches/features/all/rt/radix-tree-use-local-locks.patch b/debian/patches/features/all/rt/radix-tree-use-local-locks.patch index 08308110a..dac78afd3 100644 --- a/debian/patches/features/all/rt/radix-tree-use-local-locks.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/random-avoid-preempt_disable-ed-section.patch b/debian/patches/features/all/rt/random-avoid-preempt_disable-ed-section.patch index c18be8f5e..e96ce27ec 100644 --- a/debian/patches/features/all/rt/random-avoid-preempt_disable-ed-section.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz extract_crng() will use sleeping locks while in a preempt_disable() section due to get_cpu_var(). diff --git a/debian/patches/features/all/rt/random-make-it-work-on-rt.patch b/debian/patches/features/all/rt/random-make-it-work-on-rt.patch index b4a2de28c..370b08004 100644 --- a/debian/patches/features/all/rt/random-make-it-work-on-rt.patch +++ b/debian/patches/features/all/rt/random-make-it-work-on-rt.patch @@ -1,7 +1,7 @@ Subject: random: Make it work on rt From: Thomas Gleixner Date: Tue, 21 Aug 2012 20:38:50 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq diff --git a/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch b/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch index fd56c8c71..6addd2a39 100644 --- a/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch +++ b/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 11:52:17 +0200 Subject: rbtree: include rcu.h because we use it -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Since commit c1adf20052d8 ("Introduce rb_replace_node_rcu()") rbtree_augmented.h uses RCU related data structures but does not include diff --git a/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch b/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch index cfce6e1b9..ad984b703 100644 --- a/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch +++ b/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch @@ -1,7 +1,7 @@ From: "Paul E. McKenney" 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch b/debian/patches/features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch index a8f5f445a..6997b0a0c 100644 --- a/debian/patches/features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch +++ b/debian/patches/features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch @@ -1,7 +1,7 @@ From: "Paul E. McKenney" Date: Tue, 19 Sep 2017 15:36:42 -0700 Subject: [PATCH] rcu: Suppress lockdep false-positive ->boost_mtx complaints -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Upstream commit bcda31a2659497df39d6bedfbdf17498b4f4ac89 diff --git a/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch b/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch index aaed70df9..b999cf35a 100644 --- a/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch +++ b/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch @@ -1,7 +1,7 @@ Subject: rcu: Disable RCU_FAST_NO_HZ on RT From: Thomas Gleixner Date: Sun, 28 Oct 2012 13:26:09 +0000 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch b/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch index 108bb94f9..e8910549e 100644 --- a/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch +++ b/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch @@ -1,7 +1,7 @@ From: Julia Cartwright 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch b/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch index 479374f1c..1e9556920 100644 --- a/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch +++ b/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch b/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch index e879b442d..d3e2f4178 100644 --- a/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch +++ b/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch @@ -1,7 +1,7 @@ Subject: rcu: Merge RCU-bh into RCU-preempt Date: Wed, 5 Oct 2011 11:59:38 -0700 From: Thomas Gleixner -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/rcu-segcblist-include-rcupdate.h.patch b/debian/patches/features/all/rt/rcu-segcblist-include-rcupdate.h.patch index 8434a9e76..c1758e0a0 100644 --- a/debian/patches/features/all/rt/rcu-segcblist-include-rcupdate.h.patch +++ b/debian/patches/features/all/rt/rcu-segcblist-include-rcupdate.h.patch @@ -1,9 +1,10 @@ From: Sebastian Andrzej Siewior Date: Fri, 22 Sep 2017 15:01:46 +0200 Subject: [PATCH] rcu/segcblist: include rcupdate.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz -The RT build on ARM complains about non-existing ULONG_CMP_LT. +The RT build on ARM complains about non-existing ULONG_CMP_LT. Since +rcu_segcblist.c uses that macro it should include the header file. Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch b/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch index 6417803b4..31162faca 100644 --- a/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch +++ b/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch @@ -1,7 +1,7 @@ From: Tiejun Chen Date: Wed, 18 Dec 2013 17:51:49 +0800 Subject: rcutree/rcu_bh_qs: Disable irq while calling rcu_preempt_qs() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Any callers to the function rcu_preempt_qs() must disable irqs in order to protect the assignment to ->rcu_read_unlock_special. In diff --git a/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch b/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch index 375d1ecdb..a3fa1e917 100644 --- a/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch +++ b/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch @@ -1,7 +1,7 @@ Subject: ARM: Initialize split page table locks for vector page From: Frank Rowand Date: Sat, 1 Oct 2011 18:58:13 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch b/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch index 95cdd8911..fa2a5d47b 100644 --- a/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch +++ b/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch @@ -1,7 +1,7 @@ Subject: ARM: smp: Move clear_tasks_mm_cpumask() call to __cpu_die() From: Grygorii Strashko Date: Fri, 11 Sep 2015 21:21:23 +0300 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz When running with the RT-kernel (4.1.5-rt5) on TI OMAP dra7-evm and trying to do Suspend to RAM, the following backtrace occurs: diff --git a/debian/patches/features/all/rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch b/debian/patches/features/all/rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch index ef4b0fac9..2d726cad7 100644 --- a/debian/patches/features/all/rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 @@ -81,7 +81,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -6851,6 +6851,47 @@ const u32 sched_prio_to_wmult[40] = { +@@ -6850,6 +6850,47 @@ const u32 sched_prio_to_wmult[40] = { #if defined(CONFIG_PREEMPT_COUNT) && defined(CONFIG_SMP) @@ -129,7 +129,7 @@ Signed-off-by: Sebastian Andrzej Siewior void migrate_disable(void) { struct task_struct *p = current; -@@ -6871,10 +6912,9 @@ void migrate_disable(void) +@@ -6873,10 +6914,9 @@ void migrate_disable(void) } preempt_disable(); @@ -142,7 +142,7 @@ Signed-off-by: Sebastian Andrzej Siewior preempt_enable(); } -@@ -6903,9 +6943,8 @@ void migrate_enable(void) +@@ -6908,9 +6948,8 @@ void migrate_enable(void) preempt_disable(); diff --git a/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch b/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch index d17478b50..ad0a95184 100644 --- a/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch +++ b/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: rt: Introduce cpu_chill() From: Thomas Gleixner Date: Wed, 07 Mar 2012 20:51:03 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() @@ -101,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior #endif /* defined(_LINUX_DELAY_H) */ --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1855,6 +1855,25 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct +@@ -1859,6 +1859,25 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct } #endif diff --git a/debian/patches/features/all/rt/rt-local-irq-lock.patch b/debian/patches/features/all/rt/rt-local-irq-lock.patch index def761942..bd229d8aa 100644 --- a/debian/patches/features/all/rt/rt-local-irq-lock.patch +++ b/debian/patches/features/all/rt/rt-local-irq-lock.patch @@ -1,7 +1,7 @@ Subject: rt: Add local irq locks From: Thomas Gleixner Date: Mon, 20 Jun 2011 09:03:47 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Introduce locallock. For !RT this maps to preempt_disable()/ local_irq_disable() so there is not much that changes. For RT this will diff --git a/debian/patches/features/all/rt/rt-preempt-base-config.patch b/debian/patches/features/all/rt/rt-preempt-base-config.patch index adf2bef4c..8a7f4925b 100644 --- a/debian/patches/features/all/rt/rt-preempt-base-config.patch +++ b/debian/patches/features/all/rt/rt-preempt-base-config.patch @@ -1,7 +1,7 @@ Subject: rt: Provide PREEMPT_RT_BASE config switch From: Thomas Gleixner Date: Fri, 17 Jun 2011 12:39:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Introduce PREEMPT_RT_BASE which enables parts of PREEMPT_RT_FULL. Forces interrupt threading and enables some of the RT diff --git a/debian/patches/features/all/rt/rt-serial-warn-fix.patch b/debian/patches/features/all/rt/rt-serial-warn-fix.patch index 878f61539..09f58526f 100644 --- a/debian/patches/features/all/rt/rt-serial-warn-fix.patch +++ b/debian/patches/features/all/rt/rt-serial-warn-fix.patch @@ -1,7 +1,7 @@ Subject: rt: Improve the serial console PASS_LIMIT From: Ingo Molnar Date: Wed Dec 14 13:05:54 CET 2011 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Beyond the warning: diff --git a/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch b/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch index 8b461cb4b..4b9717d47 100644 --- a/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch +++ b/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Handle non enqueued waiters gracefully From: Thomas Gleixner Date: Fri, 06 Nov 2015 18:51:03 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Yimin debugged that in case of a PI wakeup in progress when rt_mutex_start_proxy_lock() calls task_blocks_on_rt_mutex() the latter diff --git a/debian/patches/features/all/rt/rtmutex-Make-lock_killable-work.patch b/debian/patches/features/all/rt/rtmutex-Make-lock_killable-work.patch index fd46a2c99..1dc8f6791 100644 --- a/debian/patches/features/all/rt/rtmutex-Make-lock_killable-work.patch +++ b/debian/patches/features/all/rt/rtmutex-Make-lock_killable-work.patch @@ -1,14 +1,14 @@ 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. Use signal_pending_state() unconditionaly. -Cc: rt-stable@vger.kernel.org +Cc: stable-rt@vger.kernel.org Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches/features/all/rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch b/debian/patches/features/all/rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch index 6de0ade8a..df42521df 100644 --- a/debian/patches/features/all/rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. diff --git a/debian/patches/features/all/rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch b/debian/patches/features/all/rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch index af3126743..d3199cab3 100644 --- a/debian/patches/features/all/rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches/features/all/rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch b/debian/patches/features/all/rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch index 1c9a1c229..2ff03a643 100644 --- a/debian/patches/features/all/rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The implementation is bias-based, similar to the rwsem implementation. diff --git a/debian/patches/features/all/rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch b/debian/patches/features/all/rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch index 560a4b650..1f3cd49dd 100644 --- a/debian/patches/features/all/rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/rtmutex-add-sleeping-lock-implementation.patch b/debian/patches/features/all/rt/rtmutex-add-sleeping-lock-implementation.patch index 1142674a1..b1fb15012 100644 --- a/debian/patches/features/all/rt/rtmutex-add-sleeping-lock-implementation.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches/features/all/rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/debian/patches/features/all/rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch index a9f1cf6bd..926b004d6 100644 --- a/debian/patches/features/all/rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch b/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch index 8bbaff576..3687ab4b9 100644 --- a/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch +++ b/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Avoid include hell From: Thomas Gleixner Date: Wed, 29 Jun 2011 20:06:39 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Include only the required raw types. This avoids pulling in the complete spinlock header which in turn requires rtmutex.h at some point. diff --git a/debian/patches/features/all/rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch b/debian/patches/features/all/rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch index 253aec6b1..9bae7397c 100644 --- a/debian/patches/features/all/rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Required for lock implementation ontop of rtmutex. diff --git a/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch b/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch index e0071e659..d274e2754 100644 --- a/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch +++ b/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Handle the various new futex race conditions From: Thomas Gleixner Date: Fri, 10 Jun 2011 11:04:15 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/rtmutex-lock-killable.patch b/debian/patches/features/all/rt/rtmutex-lock-killable.patch index 6c57bd1ee..cfad544ab 100644 --- a/debian/patches/features/all/rt/rtmutex-lock-killable.patch +++ b/debian/patches/features/all/rt/rtmutex-lock-killable.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Add rtmutex_lock_killable() From: Thomas Gleixner Date: Thu, 09 Jun 2011 11:43:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add "killable" type to rtmutex. We need this since rtmutex are used as "normal" mutexes which do use this type. diff --git a/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch b/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch index 6efa7010c..f4f342f13 100644 --- a/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch +++ b/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz non-RT kernel could deadlock on rt_mutex_trylock() in softirq context. On -RT we don't run softirqs in IRQ context but in thread context so it is diff --git a/debian/patches/features/all/rt/rtmutex-wire-up-RT-s-locking.patch b/debian/patches/features/all/rt/rtmutex-wire-up-RT-s-locking.patch index 6addc8fa4..0ed690772 100644 --- a/debian/patches/features/all/rt/rtmutex-wire-up-RT-s-locking.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch b/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch index b061d2106..387c4ec2d 100644 --- a/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch +++ b/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch @@ -1,6 +1,6 @@ From: Sebastian Andrzej Siewior Subject: rbtree: don't include the rcu header -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The RCU header pulls in spinlock.h and fails due not yet defined types: diff --git a/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch b/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch index d34705969..98e97a52b 100644 --- a/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch +++ b/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 21 Oct 2016 10:54:50 +0200 Subject: [PATCH] rxrpc: remove unused static variables -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The rxrpc_security_methods and rxrpc_security_sem user has been removed in 648af7fca159 ("rxrpc: Absorb the rxkad security module"). This was diff --git a/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch b/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch index ae6b46293..9453938af 100644 --- a/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch +++ b/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch @@ -1,7 +1,7 @@ From: Paul Gortmaker Date: Sat, 14 Feb 2015 11:01:16 -0500 Subject: sas-ata/isci: dont't disable interrupts in qc_issue handler -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz On 3.14-rt we see the following trace on Canoe Pass for SCSI_ISCI "Intel(R) C600 Series Chipset SAS Controller" diff --git a/debian/patches/features/all/rt/sched-Prevent-task-state-corruption-by-spurious-lock.patch b/debian/patches/features/all/rt/sched-Prevent-task-state-corruption-by-spurious-lock.patch index 821caad6e..a447915a0 100644 --- a/debian/patches/features/all/rt/sched-Prevent-task-state-corruption-by-spurious-lock.patch +++ b/debian/patches/features/all/rt/sched-Prevent-task-state-corruption-by-spurious-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 6 Jun 2017 14:20:37 +0200 Subject: sched: Prevent task state corruption by spurious lock wakeup -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Mathias and others reported GDB failures on RT. @@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2207,7 +2207,7 @@ EXPORT_SYMBOL(wake_up_process); +@@ -2206,7 +2206,7 @@ EXPORT_SYMBOL(wake_up_process); */ int wake_up_lock_sleeper(struct task_struct *p) { diff --git a/debian/patches/features/all/rt/sched-Remove-TASK_ALL.patch b/debian/patches/features/all/rt/sched-Remove-TASK_ALL.patch index 5b6e910cf..d717ac0a5 100644 --- a/debian/patches/features/all/rt/sched-Remove-TASK_ALL.patch +++ b/debian/patches/features/all/rt/sched-Remove-TASK_ALL.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra Date: Wed, 7 Jun 2017 10:12:45 +0200 Subject: [PATCH] sched: Remove TASK_ALL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz It's unused: diff --git a/debian/patches/features/all/rt/sched-delay-put-task.patch b/debian/patches/features/all/rt/sched-delay-put-task.patch index 0551bf8f0..72e7bd63f 100644 --- a/debian/patches/features/all/rt/sched-delay-put-task.patch +++ b/debian/patches/features/all/rt/sched-delay-put-task.patch @@ -1,7 +1,7 @@ Subject: sched: Move task_struct cleanup to RCU From: Thomas Gleixner Date: Tue, 31 May 2011 16:59:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/sched-disable-rt-group-sched-on-rt.patch b/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch index bbed0703e..4eac62f3a 100644 --- a/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch +++ b/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch @@ -1,7 +1,7 @@ Subject: sched: Disable CONFIG_RT_GROUP_SCHED on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:03:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Carsten reported problems when running: diff --git a/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch b/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch index 2b4e9fb45..46e686dfa 100644 --- a/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch +++ b/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch @@ -1,7 +1,7 @@ Subject: sched: Disable TTWU_QUEUE on RT From: Thomas Gleixner Date: Tue, 13 Sep 2011 16:42:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The queued remote wakeup mechanism can introduce rather large latencies if the number of migrated tasks is high. Disable it for RT. diff --git a/debian/patches/features/all/rt/sched-limit-nr-migrate.patch b/debian/patches/features/all/rt/sched-limit-nr-migrate.patch index 128058a42..d381299a6 100644 --- a/debian/patches/features/all/rt/sched-limit-nr-migrate.patch +++ b/debian/patches/features/all/rt/sched-limit-nr-migrate.patch @@ -1,7 +1,7 @@ Subject: sched: Limit the number of task migrations per batch From: Thomas Gleixner Date: Mon, 06 Jun 2011 12:12:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Put an upper limit on the number of tasks which are migrated per batch to avoid large latencies. diff --git a/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch b/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch index b5e548581..0042ddb7d 100644 --- a/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch +++ b/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch @@ -1,7 +1,7 @@ Subject: sched: Do not account rcu_preempt_depth on RT in might_sleep() From: Thomas Gleixner Date: Tue, 07 Jun 2011 09:19:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz RT changes the rcu_preempt_depth semantics, so we cannot check for it in might_sleep(). @@ -37,7 +37,7 @@ Signed-off-by: Thomas Gleixner /* Internal to kernel */ --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -6050,7 +6050,7 @@ void __init sched_init(void) +@@ -6049,7 +6049,7 @@ void __init sched_init(void) #ifdef CONFIG_DEBUG_ATOMIC_SLEEP static inline int preempt_count_equals(int preempt_offset) { diff --git a/debian/patches/features/all/rt/sched-mmdrop-delayed.patch b/debian/patches/features/all/rt/sched-mmdrop-delayed.patch index cb76f7c59..6b541d381 100644 --- a/debian/patches/features/all/rt/sched-mmdrop-delayed.patch +++ b/debian/patches/features/all/rt/sched-mmdrop-delayed.patch @@ -1,7 +1,7 @@ Subject: sched: Move mmdrop to RCU on RT From: Thomas Gleixner Date: Mon, 06 Jun 2011 12:20:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Takes sleeping locks and calls into the memory allocator, so nothing we want to do in task switch and oder atomic contexts. @@ -78,7 +78,7 @@ Signed-off-by: Thomas Gleixner VM_BUG_ON(atomic_read(&mm->mm_users)); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2696,8 +2696,12 @@ static struct rq *finish_task_switch(str +@@ -2695,8 +2695,12 @@ static struct rq *finish_task_switch(str finish_arch_post_lock_switch(); fire_sched_in_preempt_notifiers(current); @@ -92,7 +92,7 @@ Signed-off-by: Thomas Gleixner if (unlikely(prev_state == TASK_DEAD)) { if (prev->sched_class->task_dead) prev->sched_class->task_dead(prev); -@@ -5434,6 +5438,8 @@ void sched_setnuma(struct task_struct *p +@@ -5433,6 +5437,8 @@ void sched_setnuma(struct task_struct *p #endif /* CONFIG_NUMA_BALANCING */ #ifdef CONFIG_HOTPLUG_CPU @@ -101,7 +101,7 @@ Signed-off-by: Thomas Gleixner /* * Ensure that the idle task is using init_mm right before its CPU goes * offline. -@@ -5448,7 +5454,12 @@ void idle_task_exit(void) +@@ -5447,7 +5453,12 @@ void idle_task_exit(void) switch_mm(mm, &init_mm, current); finish_arch_post_lock_switch(); } @@ -115,7 +115,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -5751,6 +5762,10 @@ int sched_cpu_dying(unsigned int cpu) +@@ -5750,6 +5761,10 @@ int sched_cpu_dying(unsigned int cpu) update_max_interval(); nohz_balance_exit_idle(cpu); hrtick_clear(rq); diff --git a/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch b/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch index 1bd5ea88a..4e135153f 100644 --- a/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch +++ b/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch @@ -1,7 +1,7 @@ Subject: sched: Add saved_state for tasks blocked on sleeping locks From: Thomas Gleixner Date: Sat, 25 Jun 2011 09:21:04 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 @@ -37,7 +37,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_SMP --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2016,8 +2016,25 @@ try_to_wake_up(struct task_struct *p, un +@@ -2015,8 +2015,25 @@ try_to_wake_up(struct task_struct *p, un */ raw_spin_lock_irqsave(&p->pi_lock, flags); smp_mb__after_spinlock(); @@ -64,7 +64,7 @@ Signed-off-by: Thomas Gleixner trace_sched_waking(p); -@@ -2181,6 +2198,18 @@ int wake_up_process(struct task_struct * +@@ -2180,6 +2197,18 @@ int wake_up_process(struct task_struct * } EXPORT_SYMBOL(wake_up_process); diff --git a/debian/patches/features/all/rt/sched-swait-include-wait.h.patch b/debian/patches/features/all/rt/sched-swait-include-wait.h.patch new file mode 100644 index 000000000..155f96e19 --- /dev/null +++ b/debian/patches/features/all/rt/sched-swait-include-wait.h.patch @@ -0,0 +1,36 @@ +From: Sebastian Andrzej Siewior +Date: Mon, 4 Dec 2017 13:11:10 +0100 +Subject: [PATCH] sched/swait: include wait.h +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz + +kbuild bot reported against an intermediate RT patch that the build +fails with: + +> In file included from include/linux/completion.h:12:0, +> from include/linux/rcupdate_wait.h:10, +> from kernel/rcu/srcutiny.c:27: +> kernel/rcu/srcutiny.c: In function 'srcu_drive_gp': +> >> include/linux/swait.h:172:7: error: implicit declaration of function '___wait_is_interruptible'; did you mean '__swait_event_interruptible'? +> if (___wait_is_interruptible(state) && __int) { \ + +That error vanishes a few patches later (in the RT queue) because wait.h +is then pulled in by other means. It does not seem to surface on !RT. +I think that swait should include a header file for a function/macro +(___wait_is_interruptible()) it is using. + +Reported-by: kbuild test robot +Signed-off-by: Sebastian Andrzej Siewior +--- + include/linux/swait.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/linux/swait.h ++++ b/include/linux/swait.h +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + #include + + /* diff --git a/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch b/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch index 8c5477dbf..ba6ace5ed 100644 --- a/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch +++ b/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch @@ -1,7 +1,7 @@ Subject: sched: ttwu: Return success when only changing the saved_state value From: Thomas Gleixner Date: Tue, 13 Dec 2011 21:42:19 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz When a task blocks on a rt lock, it saves the current state in p->saved_state, so a lock related wake up will not destroy the @@ -21,7 +21,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2023,8 +2023,10 @@ try_to_wake_up(struct task_struct *p, un +@@ -2022,8 +2022,10 @@ try_to_wake_up(struct task_struct *p, un * if the wakeup condition is true. */ if (!(wake_flags & WF_LOCK_SLEEPER)) { diff --git a/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch b/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch index 20f59c350..d506e4b92 100644 --- a/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch +++ b/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch @@ -1,7 +1,7 @@ From: Steven Rostedt 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz In -rt, most spin_locks() turn into mutexes. One of these spin_lock conversions is performed on the workqueue gcwq->lock. When the idle @@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -3388,8 +3388,10 @@ static void __sched notrace __schedule(b +@@ -3387,8 +3387,10 @@ static void __sched notrace __schedule(b * If a worker went to sleep, notify and ask workqueue * whether it wants to wake up a task to maintain * concurrency. diff --git a/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch b/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch index 8222465d0..0b10f3e79 100644 --- a/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch +++ b/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch @@ -1,7 +1,7 @@ Subject: scsi/fcoe: Make RT aware. From: Thomas Gleixner Date: Sat, 12 Nov 2011 14:00:48 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. diff --git a/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch b/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch index 68261e548..e1c26b704 100644 --- a/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch +++ b/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch @@ -1,7 +1,7 @@ Subject: scsi: qla2xxx: Use local_irq_save_nort() in qla2x00_poll From: John Kacur Date: Fri, 27 Apr 2012 12:48:46 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz RT triggers the following: diff --git a/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch b/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch index 232a9e024..db0892c4e 100644 --- a/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch +++ b/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch @@ -1,7 +1,7 @@ Subject: seqlock: Prevent rt starvation From: Thomas Gleixner Date: Wed, 22 Feb 2012 12:03:30 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz If a low prio writer gets preempted while holding the seqlock write locked, a high prio reader spins forever on RT. diff --git a/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch b/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch index 323d615fd..9d798a13f 100644 --- a/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch +++ b/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch @@ -1,7 +1,7 @@ Subject: signal: Make __lock_task_sighand() RT aware From: Thomas Gleixner Date: Fri, 22 Jul 2011 08:07:08 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz local_irq_save() + spin_lock(&sighand->siglock) does not work on -RT. Use the nort variants. diff --git a/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch b/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch index 95c1db309..7359827f5 100644 --- a/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch +++ b/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch @@ -1,7 +1,7 @@ Subject: signal: Revert ptrace preempt magic From: Thomas Gleixner Date: Wed, 21 Sep 2011 19:57:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more than a bandaid around the ptrace design trainwreck. It's not a diff --git a/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch index 5ab18e347..81ea63791 100644 --- a/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. diff --git a/debian/patches/features/all/rt/skbufhead-raw-lock.patch b/debian/patches/features/all/rt/skbufhead-raw-lock.patch index d8e8389a6..448ecb28c 100644 --- a/debian/patches/features/all/rt/skbufhead-raw-lock.patch +++ b/debian/patches/features/all/rt/skbufhead-raw-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch b/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch index 15b1c4acd..afa9101c1 100644 --- a/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch +++ b/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 diff --git a/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch b/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch index 443a82d88..7405eb83c 100644 --- a/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch +++ b/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch @@ -1,7 +1,7 @@ Subject: slub: Enable irqs for __GFP_WAIT From: Thomas Gleixner Date: Wed, 09 Jan 2013 12:08:15 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch b/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch index f3f7726af..54172cb6e 100644 --- a/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch +++ b/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Wed, 18 Feb 2015 15:09:23 +0100 Subject: snd/pcm: fix snd_pcm_stream_lock*() irqs_disabled() splats -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Locking functions previously using read_lock_irq()/read_lock_irqsave() were changed to local_irq_disable/save(), leading to gripes. Use nort variants. diff --git a/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch b/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch index 255bc0626..5b3a94cad 100644 --- a/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch +++ b/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch @@ -1,7 +1,7 @@ Subject: softirq: Disable softirq stacks for RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 13:59:17 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. @@ -146,7 +146,7 @@ Signed-off-by: Thomas Gleixner { --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -495,7 +495,7 @@ struct softirq_action +@@ -501,7 +501,7 @@ struct softirq_action asmlinkage void do_softirq(void); asmlinkage void __do_softirq(void); diff --git a/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch b/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch index 520de31f3..1e6625a81 100644 --- a/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch +++ b/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch @@ -1,7 +1,7 @@ Subject: softirq: Check preemption after reenabling interrupts From: Thomas Gleixner Date: Sun, 13 Nov 2011 17:17:09 +0100 (CET) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz raise_softirq_irqoff() disables interrupts and wakes the softirq daemon, but after reenabling interrupts there is no preemption check, diff --git a/debian/patches/features/all/rt/softirq-split-locks.patch b/debian/patches/features/all/rt/softirq-split-locks.patch index 107ea6e39..ca574d897 100644 --- a/debian/patches/features/all/rt/softirq-split-locks.patch +++ b/debian/patches/features/all/rt/softirq-split-locks.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 @@ -86,7 +86,7 @@ Signed-off-by: Thomas Gleixner #endif /* _LINUX_BH_H */ --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -492,10 +492,11 @@ struct softirq_action +@@ -498,10 +498,11 @@ struct softirq_action void (*action)(struct softirq_action *); }; @@ -100,7 +100,7 @@ Signed-off-by: Thomas Gleixner void do_softirq_own_stack(void); #else static inline void do_softirq_own_stack(void) -@@ -503,6 +504,9 @@ static inline void do_softirq_own_stack( +@@ -509,6 +510,9 @@ static inline void do_softirq_own_stack( __do_softirq(); } #endif @@ -110,7 +110,7 @@ Signed-off-by: Thomas Gleixner extern void open_softirq(int nr, void (*action)(struct softirq_action *)); extern void softirq_init(void); -@@ -510,6 +514,7 @@ extern void __raise_softirq_irqoff(unsig +@@ -516,6 +520,7 @@ extern void __raise_softirq_irqoff(unsig extern void raise_softirq_irqoff(unsigned int nr); extern void raise_softirq(unsigned int nr); @@ -118,7 +118,7 @@ Signed-off-by: Thomas Gleixner DECLARE_PER_CPU(struct task_struct *, ksoftirqd); -@@ -642,6 +647,12 @@ extern void tasklet_kill_immediate(struc +@@ -648,6 +653,12 @@ extern void tasklet_kill_immediate(struc extern void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data); diff --git a/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch b/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch index 567030d2b..548195843 100644 --- a/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch +++ b/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/softirq-wake-the-timer-softirq-if-needed.patch b/debian/patches/features/all/rt/softirq-wake-the-timer-softirq-if-needed.patch index 765ad53ac..c0f18385a 100644 --- a/debian/patches/features/all/rt/softirq-wake-the-timer-softirq-if-needed.patch +++ b/debian/patches/features/all/rt/softirq-wake-the-timer-softirq-if-needed.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Fri, 20 Jan 2017 18:10:20 +0100 Subject: [PATCH] softirq: wake the timer softirq if needed -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The irq-exit path only checks the "normal"-softirq thread if it is running and ignores the state of the "timer"-softirq thread. It is possible diff --git a/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch b/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch index 2318d766c..2715e6574 100644 --- a/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch +++ b/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch @@ -1,7 +1,7 @@ From: Allen Pais Date: Fri, 13 Dec 2013 09:44:41 +0530 Subject: sparc64: use generic rwsem spinlocks rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Signed-off-by: Allen Pais Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches/features/all/rt/spinlock-types-separate-raw.patch b/debian/patches/features/all/rt/spinlock-types-separate-raw.patch index 5d1f9599f..52f3d5ca4 100644 --- a/debian/patches/features/all/rt/spinlock-types-separate-raw.patch +++ b/debian/patches/features/all/rt/spinlock-types-separate-raw.patch @@ -1,7 +1,7 @@ Subject: spinlock: Split the lock types header From: Thomas Gleixner Date: Wed, 29 Jun 2011 19:34:01 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Split raw_spinlock into its own file and the remaining spinlock_t into its own non-RT header. The non-RT header will be replaced later by sleeping diff --git a/debian/patches/features/all/rt/srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch b/debian/patches/features/all/rt/srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch index 5474b7297..d3c34412b 100644 --- a/debian/patches/features/all/rt/srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch +++ b/debian/patches/features/all/rt/srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch @@ -1,7 +1,7 @@ From: "Paul E. McKenney" Date: Tue, 10 Oct 2017 13:52:30 -0700 Subject: srcu: Prohibit call_srcu() use under raw spinlocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Upstream commit 08265b8f1a139c1cff052b35ab7cf929528f88bb diff --git a/debian/patches/features/all/rt/srcu-replace-local_irqsave-with-a-locallock.patch b/debian/patches/features/all/rt/srcu-replace-local_irqsave-with-a-locallock.patch index 2da3d9cfd..38f3a4aa9 100644 --- a/debian/patches/features/all/rt/srcu-replace-local_irqsave-with-a-locallock.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/srcu-use-cpu_online-instead-custom-check.patch b/debian/patches/features/all/rt/srcu-use-cpu_online-instead-custom-check.patch index 79f43d266..fd25badc0 100644 --- a/debian/patches/features/all/rt/srcu-use-cpu_online-instead-custom-check.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/stop-machine-raw-lock.patch b/debian/patches/features/all/rt/stop-machine-raw-lock.patch index fb43eef93..77af958c8 100644 --- a/debian/patches/features/all/rt/stop-machine-raw-lock.patch +++ b/debian/patches/features/all/rt/stop-machine-raw-lock.patch @@ -1,7 +1,7 @@ Subject: stop_machine: Use raw spinlocks From: Thomas Gleixner Date: Wed, 29 Jun 2011 11:01:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Use raw-locks in stomp_machine() to allow locking in irq-off regions. diff --git a/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch b/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch index bfd452886..e8d64ff8b 100644 --- a/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch +++ b/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:27 -0500 Subject: stop_machine: convert stop_machine_run() to PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Instead of playing with non-preemption, introduce explicit startup serialization. This is more robust and cleaner as diff --git a/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch index 9fad76c39..ffa4d9808 100644 --- a/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ b/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch @@ -1,7 +1,7 @@ From: Mike Galbraith 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 3194, name: rpc.nfsd diff --git a/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch b/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch index b4967b936..755cc0076 100644 --- a/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch +++ b/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 15 Jul 2010 10:29:00 +0200 Subject: suspend: Prevent might sleep splats -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz timekeeping suspend/resume calls read_persistant_clock() which takes rtc_lock. That results in might sleep warnings because at that point diff --git a/debian/patches/features/all/rt/sysfs-realtime-entry.patch b/debian/patches/features/all/rt/sysfs-realtime-entry.patch index f5d6b3254..231235d98 100644 --- a/debian/patches/features/all/rt/sysfs-realtime-entry.patch +++ b/debian/patches/features/all/rt/sysfs-realtime-entry.patch @@ -1,7 +1,7 @@ Subject: sysfs: Add /sys/kernel/realtime entry From: Clark Williams Date: Sat Jul 30 21:55:53 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Add a /sys/kernel entry to indicate that the kernel is a realtime kernel. diff --git a/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch b/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch index 5411ff78e..3c5cb5dd3 100644 --- a/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch +++ b/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch @@ -1,7 +1,7 @@ Subject: tasklet: Prevent tasklets from going into infinite spin in RT From: Ingo Molnar Date: Tue Nov 29 20:18:22 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads, and spinlocks turn are mutexes. But this can cause issues with @@ -44,7 +44,7 @@ Signed-off-by: Thomas Gleixner --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h -@@ -531,8 +531,9 @@ static inline struct task_struct *this_c +@@ -537,8 +537,9 @@ static inline struct task_struct *this_c to be executed on some cpu at least once after this. * If the tasklet is already scheduled, but its execution is still not started, it will be executed only once. @@ -56,7 +56,7 @@ Signed-off-by: Thomas Gleixner * Tasklet is strictly serialized wrt itself, but not wrt another tasklets. If client needs some intertask synchronization, he makes it with spinlocks. -@@ -557,27 +558,36 @@ struct tasklet_struct name = { NULL, 0, +@@ -563,27 +564,36 @@ struct tasklet_struct name = { NULL, 0, enum { TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */ @@ -99,7 +99,7 @@ Signed-off-by: Thomas Gleixner #define tasklet_unlock_wait(t) do { } while (0) #define tasklet_unlock(t) do { } while (0) #endif -@@ -626,12 +636,7 @@ static inline void tasklet_disable(struc +@@ -632,12 +642,7 @@ static inline void tasklet_disable(struc smp_mb(); } diff --git a/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch b/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch index fe5359bf4..58204f0ab 100644 --- a/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch +++ b/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch @@ -1,7 +1,7 @@ From: Daniel Wagner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch b/debian/patches/features/all/rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch index e69eb8773..8bfcf37b1 100644 --- a/debian/patches/features/all/rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/timekeeping-split-jiffies-lock.patch b/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch index 091dc57d4..e9e1cbea4 100644 --- a/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch +++ b/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch @@ -1,7 +1,7 @@ Subject: timekeeping: Split jiffies seqlock From: Thomas Gleixner Date: Thu, 14 Feb 2013 22:36:59 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Replace jiffies_lock seqlock with a simple seqcounter and a rawlock so it can be taken in atomic context on RT. diff --git a/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch b/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch index e92e15828..1ce0986f9 100644 --- a/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch +++ b/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra Date: Fri, 21 Aug 2009 11:56:45 +0200 Subject: timer: delay waking softirqs from the jiffy tick -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz People were complaining about broken balancing with the recent -rt series. diff --git a/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch b/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch index 634133ea6..d21a9cc53 100644 --- a/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch +++ b/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch @@ -1,7 +1,7 @@ Subject: timer-fd: Prevent live lock From: Thomas Gleixner Date: Wed, 25 Jan 2012 11:08:40 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz If hrtimer_try_to_cancel() requires a retry, then depending on the priority setting te retry loop might prevent timer callback completion diff --git a/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch b/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch index 4e5d0eb74..104c666d2 100644 --- a/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch +++ b/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch @@ -1,7 +1,7 @@ From: Ingo Molnar 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 @@ -29,7 +29,7 @@ Signed-off-by: Thomas Gleixner # define del_timer_sync(t) del_timer(t) --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -523,11 +523,14 @@ void resched_cpu(int cpu) +@@ -522,11 +522,14 @@ void resched_cpu(int cpu) */ int get_nohz_timer_target(void) { @@ -46,7 +46,7 @@ Signed-off-by: Thomas Gleixner rcu_read_lock(); for_each_domain(cpu, sd) { -@@ -546,6 +549,8 @@ int get_nohz_timer_target(void) +@@ -545,6 +548,8 @@ int get_nohz_timer_target(void) cpu = housekeeping_any_cpu(); unlock: rcu_read_unlock(); diff --git a/debian/patches/features/all/rt/tpm_tis-fix-stall-after-iowrite-s.patch b/debian/patches/features/all/rt/tpm_tis-fix-stall-after-iowrite-s.patch index 8ede6d1d1..4f729043d 100644 --- a/debian/patches/features/all/rt/tpm_tis-fix-stall-after-iowrite-s.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch b/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch index 4f1cc7dce..90801c2b9 100644 --- a/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch +++ b/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Thu, 29 Sep 2011 12:24:30 -0500 Subject: tracing: Account for preempt off in preempt_schedule() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz The preempt_schedule() uses the preempt_disable_notrace() version because it can cause infinite recursion by the function tracer as @@ -28,7 +28,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -3605,7 +3605,16 @@ asmlinkage __visible void __sched notrac +@@ -3604,7 +3604,16 @@ asmlinkage __visible void __sched notrac * an infinite recursion. */ prev_ctx = exception_enter(); diff --git a/debian/patches/features/all/rt/tty-goldfish-Enable-earlycon-only-if-built-in.patch b/debian/patches/features/all/rt/tty-goldfish-Enable-earlycon-only-if-built-in.patch new file mode 100644 index 000000000..712022ae3 --- /dev/null +++ b/debian/patches/features/all/rt/tty-goldfish-Enable-earlycon-only-if-built-in.patch @@ -0,0 +1,66 @@ +From: Sebastian Andrzej Siewior +Date: Wed, 29 Nov 2017 16:32:20 +0100 +Subject: [PATCH] tty: goldfish: Enable 'earlycon' only if built-in +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz + +Commit 3840ed9548f7 ("tty: goldfish: Implement support for kernel +'earlycon' parameter") breaks an allmodconfig config on x86: +| LD vmlinux.o +| MODPOST vmlinux.o +|drivers/tty/serial/earlycon.o: In function `parse_options': +|drivers/tty/serial/earlycon.c:97: undefined reference to `uart_parse_earlycon' +|Makefile:1005: recipe for target 'vmlinux' failed + +earlycon.c::parse_options() invokes uart_parse_earlycon() from serial_core.c +which is compiled=m because GOLDFISH_TTY itself (and most others) are =m. +To avoid that, I'm adding the _CONSOLE config option which is selected if the +GOLDFISH module itself is =y since it doesn't need the early bits for the =m +case (other drivers do the same dance). +The alternative would be to move uart_parse_earlycon() from +serial_core.c to earlycon.c (we don't have that many users of that +function). + +Fixes: 3840ed9548f7 ("tty: goldfish: Implement support for kernel + 'earlycon' parameter") +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/tty/Kconfig | 6 +++++- + drivers/tty/goldfish.c | 2 ++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/tty/Kconfig ++++ b/drivers/tty/Kconfig +@@ -394,10 +394,14 @@ config GOLDFISH_TTY + depends on GOLDFISH + select SERIAL_CORE + select SERIAL_CORE_CONSOLE +- select SERIAL_EARLYCON + help + Console and system TTY driver for the Goldfish virtual platform. + ++config GOLDFISH_TTY_EARLY_CONSOLE ++ bool ++ default y if GOLDFISH_TTY=y ++ select SERIAL_EARLYCON ++ + config DA_TTY + bool "DA TTY" + depends on METAG_DA +--- a/drivers/tty/goldfish.c ++++ b/drivers/tty/goldfish.c +@@ -442,6 +442,7 @@ static int goldfish_tty_remove(struct pl + return 0; + } + ++#ifdef CONFIG_GOLDFISH_TTY_EARLY_CONSOLE + static void gf_early_console_putchar(struct uart_port *port, int ch) + { + __raw_writel(ch, port->membase); +@@ -465,6 +466,7 @@ static int __init gf_earlycon_setup(stru + } + + OF_EARLYCON_DECLARE(early_gf_tty, "google,goldfish-tty", gf_earlycon_setup); ++#endif + + static const struct of_device_id goldfish_tty_of_match[] = { + { .compatible = "google,goldfish-tty", }, diff --git a/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch b/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch index 9a2ca27fc..021a631c5 100644 --- a/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch +++ b/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz An oops with irqs off (panic() from irqsafe hrtimer like the watchdog timer) will lead to a lockdep warning on each invocation and as such @@ -15,7 +15,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -3214,10 +3214,8 @@ void serial8250_console_write(struct uar +@@ -3217,10 +3217,8 @@ void serial8250_console_write(struct uar serial8250_rpm_get(up); diff --git a/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch b/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch index 38af015d8..04100d440 100644 --- a/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch +++ b/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch @@ -1,7 +1,7 @@ Subject: net: Remove preemption disabling in netif_rx() From: Priyanka Jain Date: Thu, 17 May 2012 09:35:11 +0530 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/usb-use-_nort-in-giveback.patch b/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch index cb0749541..bd17c052e 100644 --- a/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch +++ b/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 8 Nov 2013 17:34:54 +0100 Subject: usb: Use _nort in giveback function -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Since commit 94dfd7ed ("USB: HCD: support giveback of URB in tasklet context") I see diff --git a/debian/patches/features/all/rt/user-use-local-irq-nort.patch b/debian/patches/features/all/rt/user-use-local-irq-nort.patch index 131117827..47b5f1402 100644 --- a/debian/patches/features/all/rt/user-use-local-irq-nort.patch +++ b/debian/patches/features/all/rt/user-use-local-irq-nort.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 21 Jul 2009 23:06:05 +0200 Subject: core: Do not disable interrupts on RT in kernel/users.c -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Use the local_irq_*_nort variants to reduce latencies in RT. The code is serialized by the locks. No need to disable interrupts. diff --git a/debian/patches/features/all/rt/wait.h-include-atomic.h.patch b/debian/patches/features/all/rt/wait.h-include-atomic.h.patch index ea6d8da8e..81b4fd257 100644 --- a/debian/patches/features/all/rt/wait.h-include-atomic.h.patch +++ b/debian/patches/features/all/rt/wait.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz | CC init/main.o |In file included from include/linux/mmzone.h:9:0, diff --git a/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch b/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch index 2f74c1360..f3f7e2eb8 100644 --- a/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch +++ b/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz An Intel i7 system regularly detected rcu_preempt stalls after the kernel was upgraded from 3.6-rt to 3.8-rt. When the stall happened, disk I/O was no diff --git a/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch b/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch index 23ebd9be2..63de2b74c 100644 --- a/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch +++ b/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch @@ -1,7 +1,7 @@ From: Daniel Wagner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Provides a framework for enqueuing callbacks from irq context PREEMPT_RT_FULL safe. The callbacks are executed in kthread context. diff --git a/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch b/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch index 86f193210..c9bd8be52 100644 --- a/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch +++ b/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch @@ -22,7 +22,7 @@ Cc: Jens Axboe 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz --- kernel/sched/core.c | 84 +++++++------------------------------------- @@ -32,7 +32,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -1716,10 +1716,6 @@ static inline void ttwu_activate(struct +@@ -1715,10 +1715,6 @@ static inline void ttwu_activate(struct { activate_task(rq, p, en_flags); p->on_rq = TASK_ON_RQ_QUEUED; @@ -43,7 +43,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 } /* -@@ -2160,56 +2156,6 @@ try_to_wake_up(struct task_struct *p, un +@@ -2159,56 +2155,6 @@ try_to_wake_up(struct task_struct *p, un } /** @@ -100,7 +100,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 * wake_up_process - Wake up a specific process * @p: The process to be woken up. * -@@ -3410,21 +3356,6 @@ static void __sched notrace __schedule(b +@@ -3409,21 +3355,6 @@ static void __sched notrace __schedule(b atomic_inc(&rq->nr_iowait); delayacct_blkio_start(); } @@ -122,7 +122,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 } switch_count = &prev->nvcsw; } -@@ -3500,6 +3431,14 @@ static inline void sched_submit_work(str +@@ -3499,6 +3430,14 @@ static inline void sched_submit_work(str { if (!tsk->state || tsk_is_pi_blocked(tsk)) return; @@ -137,7 +137,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 /* * If we are going to sleep and we have plugged IO queued, * make sure to submit it to avoid deadlocks. -@@ -3508,6 +3447,12 @@ static inline void sched_submit_work(str +@@ -3507,6 +3446,12 @@ static inline void sched_submit_work(str blk_schedule_flush_plug(tsk); } @@ -150,7 +150,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 asmlinkage __visible void __sched schedule(void) { struct task_struct *tsk = current; -@@ -3518,6 +3463,7 @@ asmlinkage __visible void __sched schedu +@@ -3517,6 +3462,7 @@ asmlinkage __visible void __sched schedu __schedule(false); sched_preempt_enable_no_resched(); } while (need_resched()); diff --git a/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch b/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch index a70baa3ea..8cc2f2606 100644 --- a/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch +++ b/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch @@ -1,7 +1,7 @@ Subject: workqueue: Prevent deadlock/stall on RT From: Thomas Gleixner Date: Fri, 27 Jun 2014 16:24:52 +0200 (CEST) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Austin reported a XFS deadlock/stall on RT where scheduled work gets never exececuted and tasks are waiting for each other for ever. @@ -44,7 +44,7 @@ Cc: Steven Rostedt --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -3475,9 +3475,8 @@ void __noreturn do_task_dead(void) +@@ -3474,9 +3474,8 @@ void __noreturn do_task_dead(void) static inline void sched_submit_work(struct task_struct *tsk) { @@ -55,7 +55,7 @@ Cc: Steven Rostedt /* * If a worker went to sleep, notify and ask workqueue whether * it wants to wake up a task to maintain concurrency. -@@ -3485,6 +3484,10 @@ static inline void sched_submit_work(str +@@ -3484,6 +3483,10 @@ static inline void sched_submit_work(str if (tsk->flags & PF_WQ_WORKER) wq_worker_sleeping(tsk); diff --git a/debian/patches/features/all/rt/workqueue-use-locallock.patch b/debian/patches/features/all/rt/workqueue-use-locallock.patch index e3a9c1bbe..32de1dcff 100644 --- a/debian/patches/features/all/rt/workqueue-use-locallock.patch +++ b/debian/patches/features/all/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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/workqueue-use-rcu.patch b/debian/patches/features/all/rt/workqueue-use-rcu.patch index ac3649896..8be35f682 100644 --- a/debian/patches/features/all/rt/workqueue-use-rcu.patch +++ b/debian/patches/features/all/rt/workqueue-use-rcu.patch @@ -1,7 +1,7 @@ Subject: workqueue: Use normal rcu From: Thomas Gleixner Date: Wed, 24 Jul 2013 15:26:54 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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/features/all/rt/x86-UV-raw_spinlock-conversion.patch b/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch index a23f3f2b0..c0c794340 100644 --- a/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch +++ b/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sun, 2 Nov 2014 08:31:37 +0100 Subject: x86: UV: raw_spinlock conversion -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Shrug. Lots of hobbyists have a beast in their basement, right? diff --git a/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch b/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch index 8ad5ab1ea..4812e645e 100644 --- a/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch +++ b/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch @@ -1,7 +1,7 @@ Subject: x86: crypto: Reduce preempt disabled regions From: Peter Zijlstra Date: Mon, 14 Nov 2011 18:19:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Restrict the preempt disabled regions to the actual floating point operations and enable preemption for the administrative actions. diff --git a/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch b/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch index 5a2441601..bfbc3efaa 100644 --- a/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch +++ b/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz This is a copy from kmap_atomic_prot(). diff --git a/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch b/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch index 16767686d..d9263356a 100644 --- a/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch +++ b/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:27 -0500 Subject: x86/ioapic: Do not unmask io_apic when interrupt is in progress -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz With threaded interrupts we might see an interrupt in progress on migration. Do not unmask it when this is the case. diff --git a/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch b/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch index 22ddb60d6..f82eb6e91 100644 --- a/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch +++ b/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch @@ -1,7 +1,7 @@ Subject: x86: kvm Require const tsc for RT From: Thomas Gleixner Date: Sun, 06 Nov 2011 12:26:18 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.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 -@@ -6133,6 +6133,13 @@ int kvm_arch_init(void *opaque) +@@ -6138,6 +6138,13 @@ int kvm_arch_init(void *opaque) goto out; } diff --git a/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch b/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch index 7500debf7..957a6c5d8 100644 --- a/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch +++ b/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Mon, 13 Dec 2010 16:33:39 +0100 Subject: x86: Convert mce timer to hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz mce_timer is started in atomic contexts of cpu bringup. This results in might_sleep() warnings on RT. Convert mce_timer to a hrtimer to diff --git a/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch b/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch index 8ec178a6c..dd403dcd3 100644 --- a/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch +++ b/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch @@ -1,7 +1,7 @@ Subject: x86/mce: use swait queue for mce wakeups From: Steven Rostedt Date: Fri, 27 Feb 2015 15:20:37 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz We had a customer report a lockup on a 3.0-rt kernel that had the following backtrace: diff --git a/debian/patches/features/all/rt/x86-preempt-lazy.patch b/debian/patches/features/all/rt/x86-preempt-lazy.patch index 408cd1b96..8467ca52d 100644 --- a/debian/patches/features/all/rt/x86-preempt-lazy.patch +++ b/debian/patches/features/all/rt/x86-preempt-lazy.patch @@ -1,7 +1,7 @@ Subject: x86: Support for lazy preemption From: Thomas Gleixner Date: Thu, 01 Nov 2012 11:03:47 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Implement the x86 pieces for lazy preempt. diff --git a/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch b/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch index 18d10deff..3058fb5c8 100644 --- a/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch +++ b/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch @@ -1,7 +1,7 @@ From: Yang Shi 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz When running some ptrace single step tests on x86-32 machine, the below problem is triggered: diff --git a/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch b/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch index 85fdda69a..fcda60888 100644 --- a/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch +++ b/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz CPU bringup calls into the random pool to initialize the stack canary. During boot that works nicely even on RT as the might sleep diff --git a/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch b/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch index e054e9f20..e2cfe7733 100644 --- a/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch +++ b/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner 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.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz Simplifies the separation of anon_rw_semaphores and rw_semaphores for -rt. diff --git a/debian/patches/features/all/rt/xen-9pfs-don-t-inclide-rwlock.h-directly.patch b/debian/patches/features/all/rt/xen-9pfs-don-t-inclide-rwlock.h-directly.patch index c2f1a6683..363d3bce6 100644 --- a/debian/patches/features/all/rt/xen-9pfs-don-t-inclide-rwlock.h-directly.patch +++ b/debian/patches/features/all/rt/xen-9pfs-don-t-inclide-rwlock.h-directly.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 5 Oct 2017 14:38:52 +0200 Subject: [PATCH] xen/9pfs: don't inclide rwlock.h directly. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz rwlock.h should not be included directly. Instead linux/splinlock.h should be included. One thing it does is to break the RT build. diff --git a/debian/patches/series-rt b/debian/patches/series-rt index 473aa73dd..64795c933 100644 --- a/debian/patches/series-rt +++ b/debian/patches/series-rt @@ -52,6 +52,7 @@ features/all/rt/0033-softirq-Remove-tasklet_hrtimer.patch features/all/rt/0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch features/all/rt/0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch features/all/rt/0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch +features/all/rt/hrtimer-account-for-migrated-timers.patch # Those two should vanish soon (not use PIT during bootup) features/all/rt/at91_dont_enable_disable_clock.patch @@ -69,6 +70,7 @@ features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch features/all/rt/rxrpc-remove-unused-static-variables.patch features/all/rt/mfd-syscon-atmel-smc-include-string.h.patch +features/all/rt/sched-swait-include-wait.h.patch # Wants a different fix for upstream features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -80,6 +82,9 @@ features/all/rt/Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch features/all/rt/iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch features/all/rt/greybus-audio-don-t-inclide-rwlock.h-directly.patch features/all/rt/xen-9pfs-don-t-inclide-rwlock.h-directly.patch +features/all/rt/crypto-mcryptd-protect-the-per-CPU-queue-with-a-lock.patch +features/all/rt/tty-goldfish-Enable-earlycon-only-if-built-in.patch +features/all/rt/drm-i915-properly-init-lockdep-class.patch # SPARC part of erly printk consolidation features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch @@ -128,7 +133,7 @@ features/all/rt/0006-tracing-Make-traceprobe-parsing-code-reusable.patch features/all/rt/0007-tracing-Clean-up-hist_field_flags-enum.patch features/all/rt/0008-tracing-Add-hist_field_name-accessor.patch features/all/rt/0009-tracing-Reimplement-log2.patch -# v6 tracing: Inter-event (e.g. latency) support | 2017-11-17 +# v7 tracing: Inter-event (e.g. latency) support | 2017-12-06 features/all/rt/0001-tracing-Move-hist-trigger-Documentation-to-histogram.patch features/all/rt/0002-tracing-Add-Documentation-for-log2-modifier.patch features/all/rt/0003-tracing-Add-support-to-detect-and-avoid-duplicates.patch @@ -226,6 +231,7 @@ features/all/rt/x86-io-apic-migra-no-unmask.patch ##################################################### # Stuff which should go mainline, but wants some care ##################################################### +features/all/rt/rcu-segcblist-include-rcupdate.h.patch # SEQLOCK @@ -312,6 +318,7 @@ features/all/rt/mm-bounce-local-irq-save-nort.patch # MM SLxB features/all/rt/mm-disable-sloub-rt.patch features/all/rt/mm-enable-slub.patch +features/all/rt/mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch features/all/rt/slub-enable-irqs-for-no-wait.patch features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch @@ -334,12 +341,20 @@ features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch # KVM require constant freq TSC (smp function call -> cpufreq) features/all/rt/x86-kvm-require-const-tsc-for-rt.patch +# +# SIMPLE WAITQUEUE +features/all/rt/wait.h-include-atomic.h.patch +features/all/rt/work-simple-Simple-work-queue-implemenation.patch +features/all/rt/completion-use-simple-wait-queues.patch +features/all/rt/fs-aio-simple-simple-work.patch +features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch # HRTIMERS features/all/rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch features/all/rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch features/all/rt/hrtimers-prepare-full-preemption.patch features/all/rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch +features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch features/all/rt/timer-fd-avoid-live-lock.patch # POSIX-CPU-TIMERS @@ -432,14 +447,6 @@ features/all/rt/drivers-tty-pl011-irq-disable-madness.patch features/all/rt/rt-serial-warn-fix.patch features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch -# SIMPLE WAITQUEUE -features/all/rt/wait.h-include-atomic.h.patch -features/all/rt/work-simple-Simple-work-queue-implemenation.patch -features/all/rt/completion-use-simple-wait-queues.patch -features/all/rt/fs-aio-simple-simple-work.patch -features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch -features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch - # FS features/all/rt/peterz-percpu-rwsem-rt.patch features/all/rt/fs-namespace-preemption-fix.patch @@ -566,9 +573,11 @@ features/all/rt/arm-enable-highmem-for-rt.patch features/all/rt/scsi-fcoe-rt-aware.patch features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch -# X86 crypto +# crypto drivers features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch +features/all/rt/crypto-limit-more-FPU-enabled-sections.patch +features/all/rt/arm-disable-NEON-in-kernel-mode.patch # Device mapper features/all/rt/dm-make-rt-aware.patch @@ -612,7 +621,6 @@ features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch features/all/rt/srcu-use-cpu_online-instead-custom-check.patch features/all/rt/srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch features/all/rt/srcu-replace-local_irqsave-with-a-locallock.patch -features/all/rt/rcu-segcblist-include-rcupdate.h.patch features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch @@ -642,7 +650,6 @@ features/all/rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch # I915 features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch -features/all/rt/drm-i915-init-spinlock-properly-on-RT.patch # CGROUPS features/all/rt/cgroups-use-simple-wait-in-css_release.patch