diff --git a/debian/changelog b/debian/changelog index 9bc4df7dc..b8eb0c391 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ linux (4.14.2-1~exp1) UNRELEASED; urgency=medium * SCSI: Enable SCSI_MQ_DEFAULT. This can be reverted using the kernel parameter: scsi_mod.use_blk_mq=n * [rt] Add new signing subkey for Steven Rostedt + * [rt] Update to 4.14.1-rt3 -- Ben Hutchings Mon, 20 Nov 2017 14:16:28 +0000 diff --git a/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-and-nohz_a.patch b/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch similarity index 91% rename from debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-and-nohz_a.patch rename to debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch index ee7e2bc30..907f361bf 100644 --- a/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-and-nohz_a.patch +++ b/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch @@ -1,24 +1,28 @@ From: Thomas Gleixner -Date: Mon, 13 Nov 2017 20:23:44 +0100 -Subject: [PATCH 01/36] timers: Use static keys for migrate_enable and - nohz_active -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +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 -The migration_enabled and nohz_active will be later moved into the bitfield. In -the bitfield a change to one bit causes RMW operation and without holding a -lock it might happen that a concurrent change on a second CPU might cause the -loss of the an update. -To avoid that and since both fields are changed to static_branch. +The members migrate_enable and nohz_active in the timer/hrtimer per CPU +bases have been introduced to avoid accessing global variables for these +decisions. + +Still that results in a (cache hot) load and conditional branch, which can +be avoided by using static keys. + +Implement it with static keys and optimize for the most critical case of +high performance networking which tends to disable the timer migration +functionality. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 4 - kernel/time/hrtimer.c | 17 ++------ - kernel/time/tick-internal.h | 21 +++++++--- + kernel/time/tick-internal.h | 19 +++++---- kernel/time/tick-sched.c | 2 kernel/time/timer.c | 91 ++++++++++++++++++++++---------------------- - 5 files changed, 69 insertions(+), 66 deletions(-) + 5 files changed, 65 insertions(+), 68 deletions(-) --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -81,34 +85,30 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_reprogram(timer, new_base); --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h -@@ -150,14 +150,25 @@ static inline void tick_nohz_init(void) +@@ -150,14 +150,19 @@ static inline void tick_nohz_init(void) #ifdef CONFIG_NO_HZ_COMMON extern unsigned long tick_nohz_active; +-#else +extern void timers_update_nohz(void); +extern struct static_key_false timers_nohz_active; -+ +static inline bool is_timers_nohz_active(void) +{ + return static_branch_unlikely(&timers_nohz_active); +} -+ -+#ifdef CONFIG_SMP ++# ifdef CONFIG_SMP +extern struct static_key_false timers_migration_enabled; -+#endif - #else ++# endif ++#else /* CONFIG_NO_HZ_COMMON */ +static inline void timers_update_nohz(void) { } #define tick_nohz_active (0) -#endif - +- -#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) -extern void timers_update_migration(bool update_nohz); -#else -static inline void timers_update_migration(bool update_nohz) { } -+static inline bool is_timers_nohz_active(void) -+{ -+ return false; -+} ++static inline bool is_timers_nohz_active(void) { return false; } #endif DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases); 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 new file mode 100644 index 000000000..2747a45b0 --- /dev/null +++ b/debian/patches/features/all/rt/0001-tracing-Move-hist-trigger-Documentation-to-histogram.patch @@ -0,0 +1,3142 @@ +From: Tom Zanussi +Date: Fri, 17 Nov 2017 14:32:40 -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 + +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. + +Signed-off-by: Tom Zanussi +Signed-off-by: Sebastian Andrzej Siewior +--- + Documentation/trace/events.txt | 1548 ------------------------------------- + Documentation/trace/histogram.txt | 1568 ++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1569 insertions(+), 1547 deletions(-) + create mode 100644 Documentation/trace/histogram.txt + +--- a/Documentation/trace/events.txt ++++ b/Documentation/trace/events.txt +@@ -517,1550 +517,4 @@ triggers (you have to use '!' for each o + totals derived from one or more trace event format fields and/or + event counts (hitcount). + +- The format of a hist trigger is as follows: +- +- hist:keys=[:values=] +- [:sort=][:size=#entries][:pause][:continue] +- [:clear][:name=histname1] [if ] +- +- When a matching event is hit, an entry is added to a hash table +- using the key(s) and value(s) named. Keys and values correspond to +- fields in the event's format description. Values must correspond to +- numeric fields - on an event hit, the value(s) will be added to a +- sum kept for that field. The special string 'hitcount' can be used +- in place of an explicit value field - this is simply a count of +- event hits. If 'values' isn't specified, an implicit 'hitcount' +- value will be automatically created and used as the only value. +- Keys can be any field, or the special string 'stacktrace', which +- will use the event's kernel stacktrace as the key. The keywords +- 'keys' or 'key' can be used to specify keys, and the keywords +- 'values', 'vals', or 'val' can be used to specify values. Compound +- keys consisting of up to two fields can be specified by the 'keys' +- keyword. Hashing a compound key produces a unique entry in the +- table for each unique combination of component keys, and can be +- useful for providing more fine-grained summaries of event data. +- Additionally, sort keys consisting of up to two fields can be +- specified by the 'sort' keyword. If more than one field is +- specified, the result will be a 'sort within a sort': the first key +- is taken to be the primary sort key and the second the secondary +- key. If a hist trigger is given a name using the 'name' parameter, +- its histogram data will be shared with other triggers of the same +- name, and trigger hits will update this common data. Only triggers +- with 'compatible' fields can be combined in this way; triggers are +- 'compatible' if the fields named in the trigger share the same +- number and type of fields and those fields also have the same names. +- Note that any two events always share the compatible 'hitcount' and +- 'stacktrace' fields and can therefore be combined using those +- fields, however pointless that may be. +- +- 'hist' triggers add a 'hist' file to each event's subdirectory. +- Reading the 'hist' file for the event will dump the hash table in +- its entirety to stdout. If there are multiple hist triggers +- attached to an event, there will be a table for each trigger in the +- output. The table displayed for a named trigger will be the same as +- any other instance having the same name. Each printed hash table +- entry is a simple list of the keys and values comprising the entry; +- keys are printed first and are delineated by curly braces, and are +- followed by the set of value fields for the entry. By default, +- numeric fields are displayed as base-10 integers. This can be +- modified by appending any of the following modifiers to the field +- name: +- +- .hex display a number as a hex value +- .sym display an address as a symbol +- .sym-offset display an address as a symbol and offset +- .syscall display a syscall id as a system call name +- .execname display a common_pid as a program name +- +- Note that in general the semantics of a given field aren't +- interpreted when applying a modifier to it, but there are some +- restrictions to be aware of in this regard: +- +- - only the 'hex' modifier can be used for values (because values +- are essentially sums, and the other modifiers don't make sense +- in that context). +- - the 'execname' modifier can only be used on a 'common_pid'. The +- reason for this is that the execname is simply the 'comm' value +- saved for the 'current' process when an event was triggered, +- which is the same as the common_pid value saved by the event +- tracing code. Trying to apply that comm value to other pid +- values wouldn't be correct, and typically events that care save +- pid-specific comm fields in the event itself. +- +- A typical usage scenario would be the following to enable a hist +- trigger, read its current contents, and then turn it off: +- +- # echo 'hist:keys=skbaddr.hex:vals=len' > \ +- /sys/kernel/debug/tracing/events/net/netif_rx/trigger +- +- # cat /sys/kernel/debug/tracing/events/net/netif_rx/hist +- +- # echo '!hist:keys=skbaddr.hex:vals=len' > \ +- /sys/kernel/debug/tracing/events/net/netif_rx/trigger +- +- The trigger file itself can be read to show the details of the +- currently attached hist trigger. This information is also displayed +- at the top of the 'hist' file when read. +- +- By default, the size of the hash table is 2048 entries. The 'size' +- parameter can be used to specify more or fewer than that. The units +- are in terms of hashtable entries - if a run uses more entries than +- specified, the results will show the number of 'drops', the number +- of hits that were ignored. The size should be a power of 2 between +- 128 and 131072 (any non- power-of-2 number specified will be rounded +- up). +- +- The 'sort' parameter can be used to specify a value field to sort +- on. The default if unspecified is 'hitcount' and the default sort +- order is 'ascending'. To sort in the opposite direction, append +- .descending' to the sort key. +- +- The 'pause' parameter can be used to pause an existing hist trigger +- or to start a hist trigger but not log any events until told to do +- so. 'continue' or 'cont' can be used to start or restart a paused +- hist trigger. +- +- The 'clear' parameter will clear the contents of a running hist +- trigger and leave its current paused/active state. +- +- Note that the 'pause', 'cont', and 'clear' parameters should be +- applied using 'append' shell operator ('>>') if applied to an +- existing trigger, rather than via the '>' operator, which will cause +- the trigger to be removed through truncation. +- +-- enable_hist/disable_hist +- +- The enable_hist and disable_hist triggers can be used to have one +- event conditionally start and stop another event's already-attached +- hist trigger. Any number of enable_hist and disable_hist triggers +- can be attached to a given event, allowing that event to kick off +- and stop aggregations on a host of other events. +- +- The format is very similar to the enable/disable_event triggers: +- +- enable_hist::[:count] +- disable_hist::[:count] +- +- Instead of enabling or disabling the tracing of the target event +- into the trace buffer as the enable/disable_event triggers do, the +- enable/disable_hist triggers enable or disable the aggregation of +- the target event into a hash table. +- +- A typical usage scenario for the enable_hist/disable_hist triggers +- would be to first set up a paused hist trigger on some event, +- followed by an enable_hist/disable_hist pair that turns the hist +- aggregation on and off when conditions of interest are hit: +- +- # echo 'hist:keys=skbaddr.hex:vals=len:pause' > \ +- /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger +- +- # echo 'enable_hist:net:netif_receive_skb if filename==/usr/bin/wget' > \ +- /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger +- +- # echo 'disable_hist:net:netif_receive_skb if comm==wget' > \ +- /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger +- +- The above sets up an initially paused hist trigger which is unpaused +- and starts aggregating events when a given program is executed, and +- which stops aggregating when the process exits and the hist trigger +- is paused again. +- +- The examples below provide a more concrete illustration of the +- concepts and typical usage patterns discussed above. +- +- +-6.2 'hist' trigger examples +---------------------------- +- +- The first set of examples creates aggregations using the kmalloc +- event. The fields that can be used for the hist trigger are listed +- in the kmalloc event's format file: +- +- # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/format +- name: kmalloc +- ID: 374 +- format: +- field:unsigned short common_type; offset:0; size:2; signed:0; +- field:unsigned char common_flags; offset:2; size:1; signed:0; +- field:unsigned char common_preempt_count; offset:3; size:1; signed:0; +- field:int common_pid; offset:4; size:4; signed:1; +- +- field:unsigned long call_site; offset:8; size:8; signed:0; +- field:const void * ptr; offset:16; size:8; signed:0; +- field:size_t bytes_req; offset:24; size:8; signed:0; +- field:size_t bytes_alloc; offset:32; size:8; signed:0; +- field:gfp_t gfp_flags; offset:40; size:4; signed:0; +- +- We'll start by creating a hist trigger that generates a simple table +- that lists the total number of bytes requested for each function in +- the kernel that made one or more calls to kmalloc: +- +- # echo 'hist:key=call_site:val=bytes_req' > \ +- /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger +- +- This tells the tracing system to create a 'hist' trigger using the +- call_site field of the kmalloc event as the key for the table, which +- just means that each unique call_site address will have an entry +- created for it in the table. The 'val=bytes_req' parameter tells +- the hist trigger that for each unique entry (call_site) in the +- table, it should keep a running total of the number of bytes +- requested by that call_site. +- +- We'll let it run for awhile and then dump the contents of the 'hist' +- file in the kmalloc event's subdirectory (for readability, a number +- of entries have been omitted): +- +- # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist +- # trigger info: hist:keys=call_site:vals=bytes_req:sort=hitcount:size=2048 [active] +- +- { call_site: 18446744072106379007 } hitcount: 1 bytes_req: 176 +- { call_site: 18446744071579557049 } hitcount: 1 bytes_req: 1024 +- { call_site: 18446744071580608289 } hitcount: 1 bytes_req: 16384 +- { call_site: 18446744071581827654 } hitcount: 1 bytes_req: 24 +- { call_site: 18446744071580700980 } hitcount: 1 bytes_req: 8 +- { call_site: 18446744071579359876 } hitcount: 1 bytes_req: 152 +- { call_site: 18446744071580795365 } hitcount: 3 bytes_req: 144 +- { call_site: 18446744071581303129 } hitcount: 3 bytes_req: 144 +- { call_site: 18446744071580713234 } hitcount: 4 bytes_req: 2560 +- { call_site: 18446744071580933750 } hitcount: 4 bytes_req: 736 +- . +- . +- . +- { call_site: 18446744072106047046 } hitcount: 69 bytes_req: 5576 +- { call_site: 18446744071582116407 } hitcount: 73 bytes_req: 2336 +- { call_site: 18446744072106054684 } hitcount: 136 bytes_req: 140504 +- { call_site: 18446744072106224230 } hitcount: 136 bytes_req: 19584 +- { call_site: 18446744072106078074 } hitcount: 153 bytes_req: 2448 +- { call_site: 18446744072106062406 } hitcount: 153 bytes_req: 36720 +- { call_site: 18446744071582507929 } hitcount: 153 bytes_req: 37088 +- { call_site: 18446744072102520590 } hitcount: 273 bytes_req: 10920 +- { call_site: 18446744071582143559 } hitcount: 358 bytes_req: 716 +- { call_site: 18446744072106465852 } hitcount: 417 bytes_req: 56712 +- { call_site: 18446744072102523378 } hitcount: 485 bytes_req: 27160 +- { call_site: 18446744072099568646 } hitcount: 1676 bytes_req: 33520 +- +- Totals: +- Hits: 4610 +- Entries: 45 +- Dropped: 0 +- +- The output displays a line for each entry, beginning with the key +- specified in the trigger, followed by the value(s) also specified in +- the trigger. At the beginning of the output is a line that displays +- the trigger info, which can also be displayed by reading the +- 'trigger' file: +- +- # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger +- hist:keys=call_site:vals=bytes_req:sort=hitcount:size=2048 [active] +- +- At the end of the output are a few lines that display the overall +- totals for the run. The 'Hits' field shows the total number of +- times the event trigger was hit, the 'Entries' field shows the total +- number of used entries in the hash table, and the 'Dropped' field +- shows the number of hits that were dropped because the number of +- used entries for the run exceeded the maximum number of entries +- allowed for the table (normally 0, but if not a hint that you may +- want to increase the size of the table using the 'size' parameter). +- +- Notice in the above output that there's an extra field, 'hitcount', +- which wasn't specified in the trigger. Also notice that in the +- trigger info output, there's a parameter, 'sort=hitcount', which +- wasn't specified in the trigger either. The reason for that is that +- every trigger implicitly keeps a count of the total number of hits +- attributed to a given entry, called the 'hitcount'. That hitcount +- information is explicitly displayed in the output, and in the +- absence of a user-specified sort parameter, is used as the default +- sort field. +- +- The value 'hitcount' can be used in place of an explicit value in +- the 'values' parameter if you don't really need to have any +- particular field summed and are mainly interested in hit +- frequencies. +- +- To turn the hist trigger off, simply call up the trigger in the +- command history and re-execute it with a '!' prepended: +- +- # echo '!hist:key=call_site:val=bytes_req' > \ +- /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger +- +- Finally, notice that the call_site as displayed in the output above +- isn't really very useful. It's an address, but normally addresses +- are displayed in hex. To have a numeric field displayed as a hex +- value, simply append '.hex' to the field name in the trigger: +- +- # echo 'hist:key=call_site.hex:val=bytes_req' > \ +- /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger +- +- # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist +- # trigger info: hist:keys=call_site.hex:vals=bytes_req:sort=hitcount:size=2048 [active] +- +- { call_site: ffffffffa026b291 } hitcount: 1 bytes_req: 433 +- { call_site: ffffffffa07186ff } hitcount: 1 bytes_req: 176 +- { call_site: ffffffff811ae721 } hitcount: 1 bytes_req: 16384 +- { call_site: ffffffff811c5134 } hitcount: 1 bytes_req: 8 +- { call_site: ffffffffa04a9ebb } hitcount: 1 bytes_req: 511 +- { call_site: ffffffff8122e0a6 } hitcount: 1 bytes_req: 12 +- { call_site: ffffffff8107da84 } hitcount: 1 bytes_req: 152 +- { call_site: ffffffff812d8246 } hitcount: 1 bytes_req: 24 +- { call_site: ffffffff811dc1e5 } hitcount: 3 bytes_req: 144 +- { call_site: ffffffffa02515e8 } hitcount: 3 bytes_req: 648 +- { call_site: ffffffff81258159 } hitcount: 3 bytes_req: 144 +- { call_site: ffffffff811c80f4 } hitcount: 4 bytes_req: 544 +- . +- . +- . +- { call_site: ffffffffa06c7646 } hitcount: 106 bytes_req: 8024 +- { call_site: ffffffffa06cb246 } hitcount: 132 bytes_req: 31680 +- { call_site: ffffffffa06cef7a } hitcount: 132 bytes_req: 2112 +- { call_site: ffffffff8137e399 } hitcount: 132 bytes_req: 23232 +- { call_site: ffffffffa06c941c } hitcount: 185 bytes_req: 171360 +- { call_site: ffffffffa06f2a66 } hitcount: 185 bytes_req: 26640 +- { call_site: ffffffffa036a70e } hitcount: 265 bytes_req: 10600 +- { call_site: ffffffff81325447 } hitcount: 292 bytes_req: 584 +- { call_site: ffffffffa072da3c } hitcount: 446 bytes_req: 60656 +- { call_site: ffffffffa036b1f2 } hitcount: 526 bytes_req: 29456 +- { call_site: ffffffffa0099c06 } hitcount: 1780 bytes_req: 35600 +- +- Totals: +- Hits: 4775 +- Entries: 46 +- Dropped: 0 +- +- Even that's only marginally more useful - while hex values do look +- more like addresses, what users are typically more interested in +- when looking at text addresses are the corresponding symbols +- instead. To have an address displayed as symbolic value instead, +- simply append '.sym' or '.sym-offset' to the field name in the +- trigger: +- +- # echo 'hist:key=call_site.sym:val=bytes_req' > \ +- /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger +- +- # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist +- # trigger info: hist:keys=call_site.sym:vals=bytes_req:sort=hitcount:size=2048 [active] +- +- { call_site: [ffffffff810adcb9] syslog_print_all } hitcount: 1 bytes_req: 1024 +- { call_site: [ffffffff8154bc62] usb_control_msg } hitcount: 1 bytes_req: 8 +- { call_site: [ffffffffa00bf6fe] hidraw_send_report [hid] } hitcount: 1 bytes_req: 7 +- { call_site: [ffffffff8154acbe] usb_alloc_urb } hitcount: 1 bytes_req: 192 +- { call_site: [ffffffffa00bf1ca] hidraw_report_event [hid] } hitcount: 1 bytes_req: 7 +- { call_site: [ffffffff811e3a25] __seq_open_private } hitcount: 1 bytes_req: 40 +- { call_site: [ffffffff8109524a] alloc_fair_sched_group } hitcount: 2 bytes_req: 128 +- { call_site: [ffffffff811febd5] fsnotify_alloc_group } hitcount: 2 bytes_req: 528 +- { call_site: [ffffffff81440f58] __tty_buffer_request_room } hitcount: 2 bytes_req: 2624 +- { call_site: [ffffffff81200ba6] inotify_new_group } hitcount: 2 bytes_req: 96 +- { call_site: [ffffffffa05e19af] ieee80211_start_tx_ba_session [mac80211] } hitcount: 2 bytes_req: 464 +- { call_site: [ffffffff81672406] tcp_get_metrics } hitcount: 2 bytes_req: 304 +- { call_site: [ffffffff81097ec2] alloc_rt_sched_group } hitcount: 2 bytes_req: 128 +- { call_site: [ffffffff81089b05] sched_create_group } hitcount: 2 bytes_req: 1424 +- . +- . +- . +- { call_site: [ffffffffa04a580c] intel_crtc_page_flip [i915] } hitcount: 1185 bytes_req: 123240 +- { call_site: [ffffffffa0287592] drm_mode_page_flip_ioctl [drm] } hitcount: 1185 bytes_req: 104280 +- { call_site: [ffffffffa04c4a3c] intel_plane_duplicate_state [i915] } hitcount: 1402 bytes_req: 190672 +- { call_site: [ffffffff812891ca] ext4_find_extent } hitcount: 1518 bytes_req: 146208 +- { call_site: [ffffffffa029070e] drm_vma_node_allow [drm] } hitcount: 1746 bytes_req: 69840 +- { call_site: [ffffffffa045e7c4] i915_gem_do_execbuffer.isra.23 [i915] } hitcount: 2021 bytes_req: 792312 +- { call_site: [ffffffffa02911f2] drm_modeset_lock_crtc [drm] } hitcount: 2592 bytes_req: 145152 +- { call_site: [ffffffffa0489a66] intel_ring_begin [i915] } hitcount: 2629 bytes_req: 378576 +- { call_site: [ffffffffa046041c] i915_gem_execbuffer2 [i915] } hitcount: 2629 bytes_req: 3783248 +- { call_site: [ffffffff81325607] apparmor_file_alloc_security } hitcount: 5192 bytes_req: 10384 +- { call_site: [ffffffffa00b7c06] hid_report_raw_event [hid] } hitcount: 5529 bytes_req: 110584 +- { call_site: [ffffffff8131ebf7] aa_alloc_task_context } hitcount: 21943 bytes_req: 702176 +- { call_site: [ffffffff8125847d] ext4_htree_store_dirent } hitcount: 55759 bytes_req: 5074265 +- +- Totals: +- Hits: 109928 +- Entries: 71 +- Dropped: 0 +- +- Because the default sort key above is 'hitcount', the above shows a +- the list of call_sites by increasing hitcount, so that at the bottom +- we see the functions that made the most kmalloc calls during the +- run. If instead we we wanted to see the top kmalloc callers in +- terms of the number of bytes requested rather than the number of +- calls, and we wanted the top caller to appear at the top, we can use +- the 'sort' parameter, along with the 'descending' modifier: +- +- # echo 'hist:key=call_site.sym:val=bytes_req:sort=bytes_req.descending' > \ +- /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger +- +- # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist +- # trigger info: hist:keys=call_site.sym:vals=bytes_req:sort=bytes_req.descending:size=2048 [active] +- +- { call_site: [ffffffffa046041c] i915_gem_execbuffer2 [i915] } hitcount: 2186 bytes_req: 3397464 +- { call_site: [ffffffffa045e7c4] i915_gem_do_execbuffer.isra.23 [i915] } hitcount: 1790 bytes_req: 712176 +- { call_site: [ffffffff8125847d] ext4_htree_store_dirent } hitcount: 8132 bytes_req: 513135 +- { call_site: [ffffffff811e2a1b] seq_buf_alloc } hitcount: 106 bytes_req: 440128 +- { call_site: [ffffffffa0489a66] intel_ring_begin [i915] } hitcount: 2186 bytes_req: 314784 +- { call_site: [ffffffff812891ca] ext4_find_extent } hitcount: 2174 bytes_req: 208992 +- { call_site: [ffffffff811ae8e1] __kmalloc } hitcount: 8 bytes_req: 131072 +- { call_site: [ffffffffa04c4a3c] intel_plane_duplicate_state [i915] } hitcount: 859 bytes_req: 116824 +- { call_site: [ffffffffa02911f2] drm_modeset_lock_crtc [drm] } hitcount: 1834 bytes_req: 102704 +- { call_site: [ffffffffa04a580c] intel_crtc_page_flip [i915] } hitcount: 972 bytes_req: 101088 +- { call_site: [ffffffffa0287592] drm_mode_page_flip_ioctl [drm] } hitcount: 972 bytes_req: 85536 +- { call_site: [ffffffffa00b7c06] hid_report_raw_event [hid] } hitcount: 3333 bytes_req: 66664 +- { call_site: [ffffffff8137e559] sg_kmalloc } hitcount: 209 bytes_req: 61632 +- . +- . +- . +- { call_site: [ffffffff81095225] alloc_fair_sched_group } hitcount: 2 bytes_req: 128 +- { call_site: [ffffffff81097ec2] alloc_rt_sched_group } hitcount: 2 bytes_req: 128 +- { call_site: [ffffffff812d8406] copy_semundo } hitcount: 2 bytes_req: 48 +- { call_site: [ffffffff81200ba6] inotify_new_group } hitcount: 1 bytes_req: 48 +- { call_site: [ffffffffa027121a] drm_getmagic [drm] } hitcount: 1 bytes_req: 48 +- { call_site: [ffffffff811e3a25] __seq_open_private } hitcount: 1 bytes_req: 40 +- { call_site: [ffffffff811c52f4] bprm_change_interp } hitcount: 2 bytes_req: 16 +- { call_site: [ffffffff8154bc62] usb_control_msg } hitcount: 1 bytes_req: 8 +- { call_site: [ffffffffa00bf1ca] hidraw_report_event [hid] } hitcount: 1 bytes_req: 7 +- { call_site: [ffffffffa00bf6fe] hidraw_send_report [hid] } hitcount: 1 bytes_req: 7 +- +- Totals: +- Hits: 32133 +- Entries: 81 +- Dropped: 0 +- +- To display the offset and size information in addition to the symbol +- name, just use 'sym-offset' instead: +- +- # echo 'hist:key=call_site.sym-offset:val=bytes_req:sort=bytes_req.descending' > \ +- /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger +- +- # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist +- # trigger info: hist:keys=call_site.sym-offset:vals=bytes_req:sort=bytes_req.descending:size=2048 [active] +- +- { call_site: [ffffffffa046041c] i915_gem_execbuffer2+0x6c/0x2c0 [i915] } hitcount: 4569 bytes_req: 3163720 +- { call_site: [ffffffffa0489a66] intel_ring_begin+0xc6/0x1f0 [i915] } hitcount: 4569 bytes_req: 657936 +- { call_site: [ffffffffa045e7c4] i915_gem_do_execbuffer.isra.23+0x694/0x1020 [i915] } hitcount: 1519 bytes_req: 472936 +- { call_site: [ffffffffa045e646] i915_gem_do_execbuffer.isra.23+0x516/0x1020 [i915] } hitcount: 3050 bytes_req: 211832 +- { call_site: [ffffffff811e2a1b] seq_buf_alloc+0x1b/0x50 } hitcount: 34 bytes_req: 148384 +- { call_site: [ffffffffa04a580c] intel_crtc_page_flip+0xbc/0x870 [i915] } hitcount: 1385 bytes_req: 144040 +- { call_site: [ffffffff811ae8e1] __kmalloc+0x191/0x1b0 } hitcount: 8 bytes_req: 131072 +- { call_site: [ffffffffa0287592] drm_mode_page_flip_ioctl+0x282/0x360 [drm] } hitcount: 1385 bytes_req: 121880 +- { call_site: [ffffffffa02911f2] drm_modeset_lock_crtc+0x32/0x100 [drm] } hitcount: 1848 bytes_req: 103488 +- { call_site: [ffffffffa04c4a3c] intel_plane_duplicate_state+0x2c/0xa0 [i915] } hitcount: 461 bytes_req: 62696 +- { call_site: [ffffffffa029070e] drm_vma_node_allow+0x2e/0xd0 [drm] } hitcount: 1541 bytes_req: 61640 +- { call_site: [ffffffff815f8d7b] sk_prot_alloc+0xcb/0x1b0 } hitcount: 57 bytes_req: 57456 +- . +- . +- . +- { call_site: [ffffffff8109524a] alloc_fair_sched_group+0x5a/0x1a0 } hitcount: 2 bytes_req: 128 +- { call_site: [ffffffffa027b921] drm_vm_open_locked+0x31/0xa0 [drm] } hitcount: 3 bytes_req: 96 +- { call_site: [ffffffff8122e266] proc_self_follow_link+0x76/0xb0 } hitcount: 8 bytes_req: 96 +- { call_site: [ffffffff81213e80] load_elf_binary+0x240/0x1650 } hitcount: 3 bytes_req: 84 +- { call_site: [ffffffff8154bc62] usb_control_msg+0x42/0x110 } hitcount: 1 bytes_req: 8 +- { call_site: [ffffffffa00bf6fe] hidraw_send_report+0x7e/0x1a0 [hid] } hitcount: 1 bytes_req: 7 +- { call_site: [ffffffffa00bf1ca] hidraw_report_event+0x8a/0x120 [hid] } hitcount: 1 bytes_req: 7 +- +- Totals: +- Hits: 26098 +- Entries: 64 +- Dropped: 0 +- +- We can also add multiple fields to the 'values' parameter. For +- example, we might want to see the total number of bytes allocated +- alongside bytes requested, and display the result sorted by bytes +- allocated in a descending order: +- +- # echo 'hist:keys=call_site.sym:values=bytes_req,bytes_alloc:sort=bytes_alloc.descending' > \ +- /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger +- +- # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist +- # trigger info: hist:keys=call_site.sym:vals=bytes_req,bytes_alloc:sort=bytes_alloc.descending:size=2048 [active] +- +- { call_site: [ffffffffa046041c] i915_gem_execbuffer2 [i915] } hitcount: 7403 bytes_req: 4084360 bytes_alloc: 5958016 +- { call_site: [ffffffff811e2a1b] seq_buf_alloc } hitcount: 541 bytes_req: 2213968 bytes_alloc: 2228224 +- { call_site: [ffffffffa0489a66] intel_ring_begin [i915] } hitcount: 7404 bytes_req: 1066176 bytes_alloc: 1421568 +- { call_site: [ffffffffa045e7c4] i915_gem_do_execbuffer.isra.23 [i915] } hitcount: 1565 bytes_req: 557368 bytes_alloc: 1037760 +- { call_site: [ffffffff8125847d] ext4_htree_store_dirent } hitcount: 9557 bytes_req: 595778 bytes_alloc: 695744 +- { call_site: [ffffffffa045e646] i915_gem_do_execbuffer.isra.23 [i915] } hitcount: 5839 bytes_req: 430680 bytes_alloc: 470400 +- { call_site: [ffffffffa04c4a3c] intel_plane_duplicate_state [i915] } hitcount: 2388 bytes_req: 324768 bytes_alloc: 458496 +- { call_site: [ffffffffa02911f2] drm_modeset_lock_crtc [drm] } hitcount: 3911 bytes_req: 219016 bytes_alloc: 250304 +- { call_site: [ffffffff815f8d7b] sk_prot_alloc } hitcount: 235 bytes_req: 236880 bytes_alloc: 240640 +- { call_site: [ffffffff8137e559] sg_kmalloc } hitcount: 557 bytes_req: 169024 bytes_alloc: 221760 +- { call_site: [ffffffffa00b7c06] hid_report_raw_event [hid] } hitcount: 9378 bytes_req: 187548 bytes_alloc: 206312 +- { call_site: [ffffffffa04a580c] intel_crtc_page_flip [i915] } hitcount: 1519 bytes_req: 157976 bytes_alloc: 194432 +- . +- . +- . +- { call_site: [ffffffff8109bd3b] sched_autogroup_create_attach } hitcount: 2 bytes_req: 144 bytes_alloc: 192 +- { call_site: [ffffffff81097ee8] alloc_rt_sched_group } hitcount: 2 bytes_req: 128 bytes_alloc: 128 +- { call_site: [ffffffff8109524a] alloc_fair_sched_group } hitcount: 2 bytes_req: 128 bytes_alloc: 128 +- { call_site: [ffffffff81095225] alloc_fair_sched_group } hitcount: 2 bytes_req: 128 bytes_alloc: 128 +- { call_site: [ffffffff81097ec2] alloc_rt_sched_group } hitcount: 2 bytes_req: 128 bytes_alloc: 128 +- { call_site: [ffffffff81213e80] load_elf_binary } hitcount: 3 bytes_req: 84 bytes_alloc: 96 +- { call_site: [ffffffff81079a2e] kthread_create_on_node } hitcount: 1 bytes_req: 56 bytes_alloc: 64 +- { call_site: [ffffffffa00bf6fe] hidraw_send_report [hid] } hitcount: 1 bytes_req: 7 bytes_alloc: 8 +- { call_site: [ffffffff8154bc62] usb_control_msg } hitcount: 1 bytes_req: 8 bytes_alloc: 8 +- { call_site: [ffffffffa00bf1ca] hidraw_report_event [hid] } hitcount: 1 bytes_req: 7 bytes_alloc: 8 +- +- Totals: +- Hits: 66598 +- Entries: 65 +- Dropped: 0 +- +- Finally, to finish off our kmalloc example, instead of simply having +- the hist trigger display symbolic call_sites, we can have the hist +- trigger additionally display the complete set of kernel stack traces +- that led to each call_site. To do that, we simply use the special +- value 'stacktrace' for the key parameter: +- +- # echo 'hist:keys=stacktrace:values=bytes_req,bytes_alloc:sort=bytes_alloc' > \ +- /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger +- +- The above trigger will use the kernel stack trace in effect when an +- event is triggered as the key for the hash table. This allows the +- enumeration of every kernel callpath that led up to a particular +- event, along with a running total of any of the event fields for +- that event. Here we tally bytes requested and bytes allocated for +- every callpath in the system that led up to a kmalloc (in this case +- every callpath to a kmalloc for a kernel compile): +- +- # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist +- # trigger info: hist:keys=stacktrace:vals=bytes_req,bytes_alloc:sort=bytes_alloc:size=2048 [active] +- +- { stacktrace: +- __kmalloc_track_caller+0x10b/0x1a0 +- kmemdup+0x20/0x50 +- hidraw_report_event+0x8a/0x120 [hid] +- hid_report_raw_event+0x3ea/0x440 [hid] +- hid_input_report+0x112/0x190 [hid] +- hid_irq_in+0xc2/0x260 [usbhid] +- __usb_hcd_giveback_urb+0x72/0x120 +- usb_giveback_urb_bh+0x9e/0xe0 +- tasklet_hi_action+0xf8/0x100 +- __do_softirq+0x114/0x2c0 +- irq_exit+0xa5/0xb0 +- do_IRQ+0x5a/0xf0 +- ret_from_intr+0x0/0x30 +- cpuidle_enter+0x17/0x20 +- cpu_startup_entry+0x315/0x3e0 +- rest_init+0x7c/0x80 +- } hitcount: 3 bytes_req: 21 bytes_alloc: 24 +- { stacktrace: +- __kmalloc_track_caller+0x10b/0x1a0 +- kmemdup+0x20/0x50 +- hidraw_report_event+0x8a/0x120 [hid] +- hid_report_raw_event+0x3ea/0x440 [hid] +- hid_input_report+0x112/0x190 [hid] +- hid_irq_in+0xc2/0x260 [usbhid] +- __usb_hcd_giveback_urb+0x72/0x120 +- usb_giveback_urb_bh+0x9e/0xe0 +- tasklet_hi_action+0xf8/0x100 +- __do_softirq+0x114/0x2c0 +- irq_exit+0xa5/0xb0 +- do_IRQ+0x5a/0xf0 +- ret_from_intr+0x0/0x30 +- } hitcount: 3 bytes_req: 21 bytes_alloc: 24 +- { stacktrace: +- kmem_cache_alloc_trace+0xeb/0x150 +- aa_alloc_task_context+0x27/0x40 +- apparmor_cred_prepare+0x1f/0x50 +- security_prepare_creds+0x16/0x20 +- prepare_creds+0xdf/0x1a0 +- SyS_capset+0xb5/0x200 +- system_call_fastpath+0x12/0x6a +- } hitcount: 1 bytes_req: 32 bytes_alloc: 32 +- . +- . +- . +- { stacktrace: +- __kmalloc+0x11b/0x1b0 +- i915_gem_execbuffer2+0x6c/0x2c0 [i915] +- drm_ioctl+0x349/0x670 [drm] +- do_vfs_ioctl+0x2f0/0x4f0 +- SyS_ioctl+0x81/0xa0 +- system_call_fastpath+0x12/0x6a +- } hitcount: 17726 bytes_req: 13944120 bytes_alloc: 19593808 +- { stacktrace: +- __kmalloc+0x11b/0x1b0 +- load_elf_phdrs+0x76/0xa0 +- load_elf_binary+0x102/0x1650 +- search_binary_handler+0x97/0x1d0 +- do_execveat_common.isra.34+0x551/0x6e0 +- SyS_execve+0x3a/0x50 +- return_from_execve+0x0/0x23 +- } hitcount: 33348 bytes_req: 17152128 bytes_alloc: 20226048 +- { stacktrace: +- kmem_cache_alloc_trace+0xeb/0x150 +- apparmor_file_alloc_security+0x27/0x40 +- security_file_alloc+0x16/0x20 +- get_empty_filp+0x93/0x1c0 +- path_openat+0x31/0x5f0 +- do_filp_open+0x3a/0x90 +- do_sys_open+0x128/0x220 +- SyS_open+0x1e/0x20 +- system_call_fastpath+0x12/0x6a +- } hitcount: 4766422 bytes_req: 9532844 bytes_alloc: 38131376 +- { stacktrace: +- __kmalloc+0x11b/0x1b0 +- seq_buf_alloc+0x1b/0x50 +- seq_read+0x2cc/0x370 +- proc_reg_read+0x3d/0x80 +- __vfs_read+0x28/0xe0 +- vfs_read+0x86/0x140 +- SyS_read+0x46/0xb0 +- system_call_fastpath+0x12/0x6a +- } hitcount: 19133 bytes_req: 78368768 bytes_alloc: 78368768 +- +- Totals: +- Hits: 6085872 +- Entries: 253 +- Dropped: 0 +- +- If you key a hist trigger on common_pid, in order for example to +- gather and display sorted totals for each process, you can use the +- special .execname modifier to display the executable names for the +- processes in the table rather than raw pids. The example below +- keeps a per-process sum of total bytes read: +- +- # echo 'hist:key=common_pid.execname:val=count:sort=count.descending' > \ +- /sys/kernel/debug/tracing/events/syscalls/sys_enter_read/trigger +- +- # cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_read/hist +- # trigger info: hist:keys=common_pid.execname:vals=count:sort=count.descending:size=2048 [active] +- +- { common_pid: gnome-terminal [ 3196] } hitcount: 280 count: 1093512 +- { common_pid: Xorg [ 1309] } hitcount: 525 count: 256640 +- { common_pid: compiz [ 2889] } hitcount: 59 count: 254400 +- { common_pid: bash [ 8710] } hitcount: 3 count: 66369 +- { common_pid: dbus-daemon-lau [ 8703] } hitcount: 49 count: 47739 +- { common_pid: irqbalance [ 1252] } hitcount: 27 count: 27648 +- { common_pid: 01ifupdown [ 8705] } hitcount: 3 count: 17216 +- { common_pid: dbus-daemon [ 772] } hitcount: 10 count: 12396 +- { common_pid: Socket Thread [ 8342] } hitcount: 11 count: 11264 +- { common_pid: nm-dhcp-client. [ 8701] } hitcount: 6 count: 7424 +- { common_pid: gmain [ 1315] } hitcount: 18 count: 6336 +- . +- . +- . +- { common_pid: postgres [ 1892] } hitcount: 2 count: 32 +- { common_pid: postgres [ 1891] } hitcount: 2 count: 32 +- { common_pid: gmain [ 8704] } hitcount: 2 count: 32 +- { common_pid: upstart-dbus-br [ 2740] } hitcount: 21 count: 21 +- { common_pid: nm-dispatcher.a [ 8696] } hitcount: 1 count: 16 +- { common_pid: indicator-datet [ 2904] } hitcount: 1 count: 16 +- { common_pid: gdbus [ 2998] } hitcount: 1 count: 16 +- { common_pid: rtkit-daemon [ 2052] } hitcount: 1 count: 8 +- { common_pid: init [ 1] } hitcount: 2 count: 2 +- +- Totals: +- Hits: 2116 +- Entries: 51 +- Dropped: 0 +- +- Similarly, if you key a hist trigger on syscall id, for example to +- gather and display a list of systemwide syscall hits, you can use +- the special .syscall modifier to display the syscall names rather +- than raw ids. The example below keeps a running total of syscall +- counts for the system during the run: +- +- # echo 'hist:key=id.syscall:val=hitcount' > \ +- /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger +- +- # cat /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/hist +- # trigger info: hist:keys=id.syscall:vals=hitcount:sort=hitcount:size=2048 [active] +- +- { id: sys_fsync [ 74] } hitcount: 1 +- { id: sys_newuname [ 63] } hitcount: 1 +- { id: sys_prctl [157] } hitcount: 1 +- { id: sys_statfs [137] } hitcount: 1 +- { id: sys_symlink [ 88] } hitcount: 1 +- { id: sys_sendmmsg [307] } hitcount: 1 +- { id: sys_semctl [ 66] } hitcount: 1 +- { id: sys_readlink [ 89] } hitcount: 3 +- { id: sys_bind [ 49] } hitcount: 3 +- { id: sys_getsockname [ 51] } hitcount: 3 +- { id: sys_unlink [ 87] } hitcount: 3 +- { id: sys_rename [ 82] } hitcount: 4 +- { id: unknown_syscall [ 58] } hitcount: 4 +- { id: sys_connect [ 42] } hitcount: 4 +- { id: sys_getpid [ 39] } hitcount: 4 +- . +- . +- . +- { id: sys_rt_sigprocmask [ 14] } hitcount: 952 +- { id: sys_futex [202] } hitcount: 1534 +- { id: sys_write [ 1] } hitcount: 2689 +- { id: sys_setitimer [ 38] } hitcount: 2797 +- { id: sys_read [ 0] } hitcount: 3202 +- { id: sys_select [ 23] } hitcount: 3773 +- { id: sys_writev [ 20] } hitcount: 4531 +- { id: sys_poll [ 7] } hitcount: 8314 +- { id: sys_recvmsg [ 47] } hitcount: 13738 +- { id: sys_ioctl [ 16] } hitcount: 21843 +- +- Totals: +- Hits: 67612 +- Entries: 72 +- Dropped: 0 +- +- The syscall counts above provide a rough overall picture of system +- call activity on the system; we can see for example that the most +- popular system call on this system was the 'sys_ioctl' system call. +- +- We can use 'compound' keys to refine that number and provide some +- further insight as to which processes exactly contribute to the +- overall ioctl count. +- +- The command below keeps a hitcount for every unique combination of +- system call id and pid - the end result is essentially a table +- that keeps a per-pid sum of system call hits. The results are +- sorted using the system call id as the primary key, and the +- hitcount sum as the secondary key: +- +- # echo 'hist:key=id.syscall,common_pid.execname:val=hitcount:sort=id,hitcount' > \ +- /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger +- +- # cat /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/hist +- # trigger info: hist:keys=id.syscall,common_pid.execname:vals=hitcount:sort=id.syscall,hitcount:size=2048 [active] +- +- { id: sys_read [ 0], common_pid: rtkit-daemon [ 1877] } hitcount: 1 +- { id: sys_read [ 0], common_pid: gdbus [ 2976] } hitcount: 1 +- { id: sys_read [ 0], common_pid: console-kit-dae [ 3400] } hitcount: 1 +- { id: sys_read [ 0], common_pid: postgres [ 1865] } hitcount: 1 +- { id: sys_read [ 0], common_pid: deja-dup-monito [ 3543] } hitcount: 2 +- { id: sys_read [ 0], common_pid: NetworkManager [ 890] } hitcount: 2 +- { id: sys_read [ 0], common_pid: evolution-calen [ 3048] } hitcount: 2 +- { id: sys_read [ 0], common_pid: postgres [ 1864] } hitcount: 2 +- { id: sys_read [ 0], common_pid: nm-applet [ 3022] } hitcount: 2 +- { id: sys_read [ 0], common_pid: whoopsie [ 1212] } hitcount: 2 +- . +- . +- . +- { id: sys_ioctl [ 16], common_pid: bash [ 8479] } hitcount: 1 +- { id: sys_ioctl [ 16], common_pid: bash [ 3472] } hitcount: 12 +- { id: sys_ioctl [ 16], common_pid: gnome-terminal [ 3199] } hitcount: 16 +- { id: sys_ioctl [ 16], common_pid: Xorg [ 1267] } hitcount: 1808 +- { id: sys_ioctl [ 16], common_pid: compiz [ 2994] } hitcount: 5580 +- . +- . +- . +- { id: sys_waitid [247], common_pid: upstart-dbus-br [ 2690] } hitcount: 3 +- { id: sys_waitid [247], common_pid: upstart-dbus-br [ 2688] } hitcount: 16 +- { id: sys_inotify_add_watch [254], common_pid: gmain [ 975] } hitcount: 2 +- { id: sys_inotify_add_watch [254], common_pid: gmain [ 3204] } hitcount: 4 +- { id: sys_inotify_add_watch [254], common_pid: gmain [ 2888] } hitcount: 4 +- { id: sys_inotify_add_watch [254], common_pid: gmain [ 3003] } hitcount: 4 +- { id: sys_inotify_add_watch [254], common_pid: gmain [ 2873] } hitcount: 4 +- { id: sys_inotify_add_watch [254], common_pid: gmain [ 3196] } hitcount: 6 +- { id: sys_openat [257], common_pid: java [ 2623] } hitcount: 2 +- { id: sys_eventfd2 [290], common_pid: ibus-ui-gtk3 [ 2760] } hitcount: 4 +- { id: sys_eventfd2 [290], common_pid: compiz [ 2994] } hitcount: 6 +- +- Totals: +- Hits: 31536 +- Entries: 323 +- Dropped: 0 +- +- The above list does give us a breakdown of the ioctl syscall by +- pid, but it also gives us quite a bit more than that, which we +- don't really care about at the moment. Since we know the syscall +- id for sys_ioctl (16, displayed next to the sys_ioctl name), we +- can use that to filter out all the other syscalls: +- +- # echo 'hist:key=id.syscall,common_pid.execname:val=hitcount:sort=id,hitcount if id == 16' > \ +- /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger +- +- # cat /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/hist +- # trigger info: hist:keys=id.syscall,common_pid.execname:vals=hitcount:sort=id.syscall,hitcount:size=2048 if id == 16 [active] +- +- { id: sys_ioctl [ 16], common_pid: gmain [ 2769] } hitcount: 1 +- { id: sys_ioctl [ 16], common_pid: evolution-addre [ 8571] } hitcount: 1 +- { id: sys_ioctl [ 16], common_pid: gmain [ 3003] } hitcount: 1 +- { id: sys_ioctl [ 16], common_pid: gmain [ 2781] } hitcount: 1 +- { id: sys_ioctl [ 16], common_pid: gmain [ 2829] } hitcount: 1 +- { id: sys_ioctl [ 16], common_pid: bash [ 8726] } hitcount: 1 +- { id: sys_ioctl [ 16], common_pid: bash [ 8508] } hitcount: 1 +- { id: sys_ioctl [ 16], common_pid: gmain [ 2970] } hitcount: 1 +- { id: sys_ioctl [ 16], common_pid: gmain [ 2768] } hitcount: 1 +- . +- . +- . +- { id: sys_ioctl [ 16], common_pid: pool [ 8559] } hitcount: 45 +- { id: sys_ioctl [ 16], common_pid: pool [ 8555] } hitcount: 48 +- { id: sys_ioctl [ 16], common_pid: pool [ 8551] } hitcount: 48 +- { id: sys_ioctl [ 16], common_pid: avahi-daemon [ 896] } hitcount: 66 +- { id: sys_ioctl [ 16], common_pid: Xorg [ 1267] } hitcount: 26674 +- { id: sys_ioctl [ 16], common_pid: compiz [ 2994] } hitcount: 73443 +- +- Totals: +- Hits: 101162 +- Entries: 103 +- Dropped: 0 +- +- The above output shows that 'compiz' and 'Xorg' are far and away +- the heaviest ioctl callers (which might lead to questions about +- whether they really need to be making all those calls and to +- possible avenues for further investigation.) +- +- The compound key examples used a key and a sum value (hitcount) to +- sort the output, but we can just as easily use two keys instead. +- Here's an example where we use a compound key composed of the the +- common_pid and size event fields. Sorting with pid as the primary +- key and 'size' as the secondary key allows us to display an +- ordered summary of the recvfrom sizes, with counts, received by +- each process: +- +- # echo 'hist:key=common_pid.execname,size:val=hitcount:sort=common_pid,size' > \ +- /sys/kernel/debug/tracing/events/syscalls/sys_enter_recvfrom/trigger +- +- # cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_recvfrom/hist +- # trigger info: hist:keys=common_pid.execname,size:vals=hitcount:sort=common_pid.execname,size:size=2048 [active] +- +- { common_pid: smbd [ 784], size: 4 } hitcount: 1 +- { common_pid: dnsmasq [ 1412], size: 4096 } hitcount: 672 +- { common_pid: postgres [ 1796], size: 1000 } hitcount: 6 +- { common_pid: postgres [ 1867], size: 1000 } hitcount: 10 +- { common_pid: bamfdaemon [ 2787], size: 28 } hitcount: 2 +- { common_pid: bamfdaemon [ 2787], size: 14360 } hitcount: 1 +- { common_pid: compiz [ 2994], size: 8 } hitcount: 1 +- { common_pid: compiz [ 2994], size: 20 } hitcount: 11 +- { common_pid: gnome-terminal [ 3199], size: 4 } hitcount: 2 +- { common_pid: firefox [ 8817], size: 4 } hitcount: 1 +- { common_pid: firefox [ 8817], size: 8 } hitcount: 5 +- { common_pid: firefox [ 8817], size: 588 } hitcount: 2 +- { common_pid: firefox [ 8817], size: 628 } hitcount: 1 +- { common_pid: firefox [ 8817], size: 6944 } hitcount: 1 +- { common_pid: firefox [ 8817], size: 408880 } hitcount: 2 +- { common_pid: firefox [ 8822], size: 8 } hitcount: 2 +- { common_pid: firefox [ 8822], size: 160 } hitcount: 2 +- { common_pid: firefox [ 8822], size: 320 } hitcount: 2 +- { common_pid: firefox [ 8822], size: 352 } hitcount: 1 +- . +- . +- . +- { common_pid: pool [ 8923], size: 1960 } hitcount: 10 +- { common_pid: pool [ 8923], size: 2048 } hitcount: 10 +- { common_pid: pool [ 8924], size: 1960 } hitcount: 10 +- { common_pid: pool [ 8924], size: 2048 } hitcount: 10 +- { common_pid: pool [ 8928], size: 1964 } hitcount: 4 +- { common_pid: pool [ 8928], size: 1965 } hitcount: 2 +- { common_pid: pool [ 8928], size: 2048 } hitcount: 6 +- { common_pid: pool [ 8929], size: 1982 } hitcount: 1 +- { common_pid: pool [ 8929], size: 2048 } hitcount: 1 +- +- Totals: +- Hits: 2016 +- Entries: 224 +- Dropped: 0 +- +- The above example also illustrates the fact that although a compound +- key is treated as a single entity for hashing purposes, the sub-keys +- it's composed of can be accessed independently. +- +- The next example uses a string field as the hash key and +- demonstrates how you can manually pause and continue a hist trigger. +- In this example, we'll aggregate fork counts and don't expect a +- large number of entries in the hash table, so we'll drop it to a +- much smaller number, say 256: +- +- # echo 'hist:key=child_comm:val=hitcount:size=256' > \ +- /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger +- +- # cat /sys/kernel/debug/tracing/events/sched/sched_process_fork/hist +- # trigger info: hist:keys=child_comm:vals=hitcount:sort=hitcount:size=256 [active] +- +- { child_comm: dconf worker } hitcount: 1 +- { child_comm: ibus-daemon } hitcount: 1 +- { child_comm: whoopsie } hitcount: 1 +- { child_comm: smbd } hitcount: 1 +- { child_comm: gdbus } hitcount: 1 +- { child_comm: kthreadd } hitcount: 1 +- { child_comm: dconf worker } hitcount: 1 +- { child_comm: evolution-alarm } hitcount: 2 +- { child_comm: Socket Thread } hitcount: 2 +- { child_comm: postgres } hitcount: 2 +- { child_comm: bash } hitcount: 3 +- { child_comm: compiz } hitcount: 3 +- { child_comm: evolution-sourc } hitcount: 4 +- { child_comm: dhclient } hitcount: 4 +- { child_comm: pool } hitcount: 5 +- { child_comm: nm-dispatcher.a } hitcount: 8 +- { child_comm: firefox } hitcount: 8 +- { child_comm: dbus-daemon } hitcount: 8 +- { child_comm: glib-pacrunner } hitcount: 10 +- { child_comm: evolution } hitcount: 23 +- +- Totals: +- Hits: 89 +- Entries: 20 +- Dropped: 0 +- +- If we want to pause the hist trigger, we can simply append :pause to +- the command that started the trigger. Notice that the trigger info +- displays as [paused]: +- +- # echo 'hist:key=child_comm:val=hitcount:size=256:pause' >> \ +- /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger +- +- # cat /sys/kernel/debug/tracing/events/sched/sched_process_fork/hist +- # trigger info: hist:keys=child_comm:vals=hitcount:sort=hitcount:size=256 [paused] +- +- { child_comm: dconf worker } hitcount: 1 +- { child_comm: kthreadd } hitcount: 1 +- { child_comm: dconf worker } hitcount: 1 +- { child_comm: gdbus } hitcount: 1 +- { child_comm: ibus-daemon } hitcount: 1 +- { child_comm: Socket Thread } hitcount: 2 +- { child_comm: evolution-alarm } hitcount: 2 +- { child_comm: smbd } hitcount: 2 +- { child_comm: bash } hitcount: 3 +- { child_comm: whoopsie } hitcount: 3 +- { child_comm: compiz } hitcount: 3 +- { child_comm: evolution-sourc } hitcount: 4 +- { child_comm: pool } hitcount: 5 +- { child_comm: postgres } hitcount: 6 +- { child_comm: firefox } hitcount: 8 +- { child_comm: dhclient } hitcount: 10 +- { child_comm: emacs } hitcount: 12 +- { child_comm: dbus-daemon } hitcount: 20 +- { child_comm: nm-dispatcher.a } hitcount: 20 +- { child_comm: evolution } hitcount: 35 +- { child_comm: glib-pacrunner } hitcount: 59 +- +- Totals: +- Hits: 199 +- Entries: 21 +- Dropped: 0 +- +- To manually continue having the trigger aggregate events, append +- :cont instead. Notice that the trigger info displays as [active] +- again, and the data has changed: +- +- # echo 'hist:key=child_comm:val=hitcount:size=256:cont' >> \ +- /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger +- +- # cat /sys/kernel/debug/tracing/events/sched/sched_process_fork/hist +- # trigger info: hist:keys=child_comm:vals=hitcount:sort=hitcount:size=256 [active] +- +- { child_comm: dconf worker } hitcount: 1 +- { child_comm: dconf worker } hitcount: 1 +- { child_comm: kthreadd } hitcount: 1 +- { child_comm: gdbus } hitcount: 1 +- { child_comm: ibus-daemon } hitcount: 1 +- { child_comm: Socket Thread } hitcount: 2 +- { child_comm: evolution-alarm } hitcount: 2 +- { child_comm: smbd } hitcount: 2 +- { child_comm: whoopsie } hitcount: 3 +- { child_comm: compiz } hitcount: 3 +- { child_comm: evolution-sourc } hitcount: 4 +- { child_comm: bash } hitcount: 5 +- { child_comm: pool } hitcount: 5 +- { child_comm: postgres } hitcount: 6 +- { child_comm: firefox } hitcount: 8 +- { child_comm: dhclient } hitcount: 11 +- { child_comm: emacs } hitcount: 12 +- { child_comm: dbus-daemon } hitcount: 22 +- { child_comm: nm-dispatcher.a } hitcount: 22 +- { child_comm: evolution } hitcount: 35 +- { child_comm: glib-pacrunner } hitcount: 59 +- +- Totals: +- Hits: 206 +- Entries: 21 +- Dropped: 0 +- +- The previous example showed how to start and stop a hist trigger by +- appending 'pause' and 'continue' to the hist trigger command. A +- hist trigger can also be started in a paused state by initially +- starting the trigger with ':pause' appended. This allows you to +- start the trigger only when you're ready to start collecting data +- and not before. For example, you could start the trigger in a +- paused state, then unpause it and do something you want to measure, +- then pause the trigger again when done. +- +- Of course, doing this manually can be difficult and error-prone, but +- it is possible to automatically start and stop a hist trigger based +- on some condition, via the enable_hist and disable_hist triggers. +- +- For example, suppose we wanted to take a look at the relative +- weights in terms of skb length for each callpath that leads to a +- netif_receieve_skb event when downloading a decent-sized file using +- wget. +- +- First we set up an initially paused stacktrace trigger on the +- netif_receive_skb event: +- +- # echo 'hist:key=stacktrace:vals=len:pause' > \ +- /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger +- +- Next, we set up an 'enable_hist' trigger on the sched_process_exec +- event, with an 'if filename==/usr/bin/wget' filter. The effect of +- this new trigger is that it will 'unpause' the hist trigger we just +- set up on netif_receive_skb if and only if it sees a +- sched_process_exec event with a filename of '/usr/bin/wget'. When +- that happens, all netif_receive_skb events are aggregated into a +- hash table keyed on stacktrace: +- +- # echo 'enable_hist:net:netif_receive_skb if filename==/usr/bin/wget' > \ +- /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger +- +- The aggregation continues until the netif_receive_skb is paused +- again, which is what the following disable_hist event does by +- creating a similar setup on the sched_process_exit event, using the +- filter 'comm==wget': +- +- # echo 'disable_hist:net:netif_receive_skb if comm==wget' > \ +- /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger +- +- Whenever a process exits and the comm field of the disable_hist +- trigger filter matches 'comm==wget', the netif_receive_skb hist +- trigger is disabled. +- +- The overall effect is that netif_receive_skb events are aggregated +- into the hash table for only the duration of the wget. Executing a +- wget command and then listing the 'hist' file will display the +- output generated by the wget command: +- +- $ wget https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.19.xz +- +- # cat /sys/kernel/debug/tracing/events/net/netif_receive_skb/hist +- # trigger info: hist:keys=stacktrace:vals=len:sort=hitcount:size=2048 [paused] +- +- { stacktrace: +- __netif_receive_skb_core+0x46d/0x990 +- __netif_receive_skb+0x18/0x60 +- netif_receive_skb_internal+0x23/0x90 +- napi_gro_receive+0xc8/0x100 +- ieee80211_deliver_skb+0xd6/0x270 [mac80211] +- ieee80211_rx_handlers+0xccf/0x22f0 [mac80211] +- ieee80211_prepare_and_rx_handle+0x4e7/0xc40 [mac80211] +- ieee80211_rx+0x31d/0x900 [mac80211] +- iwlagn_rx_reply_rx+0x3db/0x6f0 [iwldvm] +- iwl_rx_dispatch+0x8e/0xf0 [iwldvm] +- iwl_pcie_irq_handler+0xe3c/0x12f0 [iwlwifi] +- irq_thread_fn+0x20/0x50 +- irq_thread+0x11f/0x150 +- kthread+0xd2/0xf0 +- ret_from_fork+0x42/0x70 +- } hitcount: 85 len: 28884 +- { stacktrace: +- __netif_receive_skb_core+0x46d/0x990 +- __netif_receive_skb+0x18/0x60 +- netif_receive_skb_internal+0x23/0x90 +- napi_gro_complete+0xa4/0xe0 +- dev_gro_receive+0x23a/0x360 +- napi_gro_receive+0x30/0x100 +- ieee80211_deliver_skb+0xd6/0x270 [mac80211] +- ieee80211_rx_handlers+0xccf/0x22f0 [mac80211] +- ieee80211_prepare_and_rx_handle+0x4e7/0xc40 [mac80211] +- ieee80211_rx+0x31d/0x900 [mac80211] +- iwlagn_rx_reply_rx+0x3db/0x6f0 [iwldvm] +- iwl_rx_dispatch+0x8e/0xf0 [iwldvm] +- iwl_pcie_irq_handler+0xe3c/0x12f0 [iwlwifi] +- irq_thread_fn+0x20/0x50 +- irq_thread+0x11f/0x150 +- kthread+0xd2/0xf0 +- } hitcount: 98 len: 664329 +- { stacktrace: +- __netif_receive_skb_core+0x46d/0x990 +- __netif_receive_skb+0x18/0x60 +- process_backlog+0xa8/0x150 +- net_rx_action+0x15d/0x340 +- __do_softirq+0x114/0x2c0 +- do_softirq_own_stack+0x1c/0x30 +- do_softirq+0x65/0x70 +- __local_bh_enable_ip+0xb5/0xc0 +- ip_finish_output+0x1f4/0x840 +- ip_output+0x6b/0xc0 +- ip_local_out_sk+0x31/0x40 +- ip_send_skb+0x1a/0x50 +- udp_send_skb+0x173/0x2a0 +- udp_sendmsg+0x2bf/0x9f0 +- inet_sendmsg+0x64/0xa0 +- sock_sendmsg+0x3d/0x50 +- } hitcount: 115 len: 13030 +- { stacktrace: +- __netif_receive_skb_core+0x46d/0x990 +- __netif_receive_skb+0x18/0x60 +- netif_receive_skb_internal+0x23/0x90 +- napi_gro_complete+0xa4/0xe0 +- napi_gro_flush+0x6d/0x90 +- iwl_pcie_irq_handler+0x92a/0x12f0 [iwlwifi] +- irq_thread_fn+0x20/0x50 +- irq_thread+0x11f/0x150 +- kthread+0xd2/0xf0 +- ret_from_fork+0x42/0x70 +- } hitcount: 934 len: 5512212 +- +- Totals: +- Hits: 1232 +- Entries: 4 +- Dropped: 0 +- +- The above shows all the netif_receive_skb callpaths and their total +- lengths for the duration of the wget command. +- +- The 'clear' hist trigger param can be used to clear the hash table. +- Suppose we wanted to try another run of the previous example but +- this time also wanted to see the complete list of events that went +- into the histogram. In order to avoid having to set everything up +- again, we can just clear the histogram first: +- +- # echo 'hist:key=stacktrace:vals=len:clear' >> \ +- /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger +- +- Just to verify that it is in fact cleared, here's what we now see in +- the hist file: +- +- # cat /sys/kernel/debug/tracing/events/net/netif_receive_skb/hist +- # trigger info: hist:keys=stacktrace:vals=len:sort=hitcount:size=2048 [paused] +- +- Totals: +- Hits: 0 +- Entries: 0 +- Dropped: 0 +- +- Since we want to see the detailed list of every netif_receive_skb +- event occurring during the new run, which are in fact the same +- events being aggregated into the hash table, we add some additional +- 'enable_event' events to the triggering sched_process_exec and +- sched_process_exit events as such: +- +- # echo 'enable_event:net:netif_receive_skb if filename==/usr/bin/wget' > \ +- /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger +- +- # echo 'disable_event:net:netif_receive_skb if comm==wget' > \ +- /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger +- +- If you read the trigger files for the sched_process_exec and +- sched_process_exit triggers, you should see two triggers for each: +- one enabling/disabling the hist aggregation and the other +- enabling/disabling the logging of events: +- +- # cat /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger +- enable_event:net:netif_receive_skb:unlimited if filename==/usr/bin/wget +- enable_hist:net:netif_receive_skb:unlimited if filename==/usr/bin/wget +- +- # cat /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger +- enable_event:net:netif_receive_skb:unlimited if comm==wget +- disable_hist:net:netif_receive_skb:unlimited if comm==wget +- +- In other words, whenever either of the sched_process_exec or +- sched_process_exit events is hit and matches 'wget', it enables or +- disables both the histogram and the event log, and what you end up +- with is a hash table and set of events just covering the specified +- duration. Run the wget command again: +- +- $ wget https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.19.xz +- +- Displaying the 'hist' file should show something similar to what you +- saw in the last run, but this time you should also see the +- individual events in the trace file: +- +- # cat /sys/kernel/debug/tracing/trace +- +- # tracer: nop +- # +- # entries-in-buffer/entries-written: 183/1426 #P:4 +- # +- # _-----=> irqs-off +- # / _----=> need-resched +- # | / _---=> hardirq/softirq +- # || / _--=> preempt-depth +- # ||| / delay +- # TASK-PID CPU# |||| TIMESTAMP FUNCTION +- # | | | |||| | | +- wget-15108 [000] ..s1 31769.606929: netif_receive_skb: dev=lo skbaddr=ffff88009c353100 len=60 +- wget-15108 [000] ..s1 31769.606999: netif_receive_skb: dev=lo skbaddr=ffff88009c353200 len=60 +- dnsmasq-1382 [000] ..s1 31769.677652: netif_receive_skb: dev=lo skbaddr=ffff88009c352b00 len=130 +- dnsmasq-1382 [000] ..s1 31769.685917: netif_receive_skb: dev=lo skbaddr=ffff88009c352200 len=138 +- ##### CPU 2 buffer started #### +- irq/29-iwlwifi-559 [002] ..s. 31772.031529: netif_receive_skb: dev=wlan0 skbaddr=ffff88009d433d00 len=2948 +- irq/29-iwlwifi-559 [002] ..s. 31772.031572: netif_receive_skb: dev=wlan0 skbaddr=ffff88009d432200 len=1500 +- irq/29-iwlwifi-559 [002] ..s. 31772.032196: netif_receive_skb: dev=wlan0 skbaddr=ffff88009d433100 len=2948 +- irq/29-iwlwifi-559 [002] ..s. 31772.032761: netif_receive_skb: dev=wlan0 skbaddr=ffff88009d433000 len=2948 +- irq/29-iwlwifi-559 [002] ..s. 31772.033220: netif_receive_skb: dev=wlan0 skbaddr=ffff88009d432e00 len=1500 +- . +- . +- . +- +- The following example demonstrates how multiple hist triggers can be +- attached to a given event. This capability can be useful for +- creating a set of different summaries derived from the same set of +- events, or for comparing the effects of different filters, among +- other things. +- +- # echo 'hist:keys=skbaddr.hex:vals=len if len < 0' >> \ +- /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger +- # echo 'hist:keys=skbaddr.hex:vals=len if len > 4096' >> \ +- /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger +- # echo 'hist:keys=skbaddr.hex:vals=len if len == 256' >> \ +- /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger +- # echo 'hist:keys=skbaddr.hex:vals=len' >> \ +- /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger +- # echo 'hist:keys=len:vals=common_preempt_count' >> \ +- /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger +- +- The above set of commands create four triggers differing only in +- their filters, along with a completely different though fairly +- nonsensical trigger. Note that in order to append multiple hist +- triggers to the same file, you should use the '>>' operator to +- append them ('>' will also add the new hist trigger, but will remove +- any existing hist triggers beforehand). +- +- Displaying the contents of the 'hist' file for the event shows the +- contents of all five histograms: +- +- # cat /sys/kernel/debug/tracing/events/net/netif_receive_skb/hist +- +- # event histogram +- # +- # trigger info: hist:keys=len:vals=hitcount,common_preempt_count:sort=hitcount:size=2048 [active] +- # +- +- { len: 176 } hitcount: 1 common_preempt_count: 0 +- { len: 223 } hitcount: 1 common_preempt_count: 0 +- { len: 4854 } hitcount: 1 common_preempt_count: 0 +- { len: 395 } hitcount: 1 common_preempt_count: 0 +- { len: 177 } hitcount: 1 common_preempt_count: 0 +- { len: 446 } hitcount: 1 common_preempt_count: 0 +- { len: 1601 } hitcount: 1 common_preempt_count: 0 +- . +- . +- . +- { len: 1280 } hitcount: 66 common_preempt_count: 0 +- { len: 116 } hitcount: 81 common_preempt_count: 40 +- { len: 708 } hitcount: 112 common_preempt_count: 0 +- { len: 46 } hitcount: 221 common_preempt_count: 0 +- { len: 1264 } hitcount: 458 common_preempt_count: 0 +- +- Totals: +- Hits: 1428 +- Entries: 147 +- Dropped: 0 +- +- +- # event histogram +- # +- # trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 [active] +- # +- +- { skbaddr: ffff8800baee5e00 } hitcount: 1 len: 130 +- { skbaddr: ffff88005f3d5600 } hitcount: 1 len: 1280 +- { skbaddr: ffff88005f3d4900 } hitcount: 1 len: 1280 +- { skbaddr: ffff88009fed6300 } hitcount: 1 len: 115 +- { skbaddr: ffff88009fe0ad00 } hitcount: 1 len: 115 +- { skbaddr: ffff88008cdb1900 } hitcount: 1 len: 46 +- { skbaddr: ffff880064b5ef00 } hitcount: 1 len: 118 +- { skbaddr: ffff880044e3c700 } hitcount: 1 len: 60 +- { skbaddr: ffff880100065900 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d46bd500 } hitcount: 1 len: 116 +- { skbaddr: ffff88005f3d5f00 } hitcount: 1 len: 1280 +- { skbaddr: ffff880100064700 } hitcount: 1 len: 365 +- { skbaddr: ffff8800badb6f00 } hitcount: 1 len: 60 +- . +- . +- . +- { skbaddr: ffff88009fe0be00 } hitcount: 27 len: 24677 +- { skbaddr: ffff88009fe0a400 } hitcount: 27 len: 23052 +- { skbaddr: ffff88009fe0b700 } hitcount: 31 len: 25589 +- { skbaddr: ffff88009fe0b600 } hitcount: 32 len: 27326 +- { skbaddr: ffff88006a462800 } hitcount: 68 len: 71678 +- { skbaddr: ffff88006a463700 } hitcount: 70 len: 72678 +- { skbaddr: ffff88006a462b00 } hitcount: 71 len: 77589 +- { skbaddr: ffff88006a463600 } hitcount: 73 len: 71307 +- { skbaddr: ffff88006a462200 } hitcount: 81 len: 81032 +- +- Totals: +- Hits: 1451 +- Entries: 318 +- Dropped: 0 +- +- +- # event histogram +- # +- # trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 if len == 256 [active] +- # +- +- +- Totals: +- Hits: 0 +- Entries: 0 +- Dropped: 0 +- +- +- # event histogram +- # +- # trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 if len > 4096 [active] +- # +- +- { skbaddr: ffff88009fd2c300 } hitcount: 1 len: 7212 +- { skbaddr: ffff8800d2bcce00 } hitcount: 1 len: 7212 +- { skbaddr: ffff8800d2bcd700 } hitcount: 1 len: 7212 +- { skbaddr: ffff8800d2bcda00 } hitcount: 1 len: 21492 +- { skbaddr: ffff8800ae2e2d00 } hitcount: 1 len: 7212 +- { skbaddr: ffff8800d2bcdb00 } hitcount: 1 len: 7212 +- { skbaddr: ffff88006a4df500 } hitcount: 1 len: 4854 +- { skbaddr: ffff88008ce47b00 } hitcount: 1 len: 18636 +- { skbaddr: ffff8800ae2e2200 } hitcount: 1 len: 12924 +- { skbaddr: ffff88005f3e1000 } hitcount: 1 len: 4356 +- { skbaddr: ffff8800d2bcdc00 } hitcount: 2 len: 24420 +- { skbaddr: ffff8800d2bcc200 } hitcount: 2 len: 12996 +- +- Totals: +- Hits: 14 +- Entries: 12 +- Dropped: 0 +- +- +- # event histogram +- # +- # trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 if len < 0 [active] +- # +- +- +- Totals: +- Hits: 0 +- Entries: 0 +- Dropped: 0 +- +- Named triggers can be used to have triggers share a common set of +- histogram data. This capability is mostly useful for combining the +- output of events generated by tracepoints contained inside inline +- functions, but names can be used in a hist trigger on any event. +- For example, these two triggers when hit will update the same 'len' +- field in the shared 'foo' histogram data: +- +- # echo 'hist:name=foo:keys=skbaddr.hex:vals=len' > \ +- /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger +- # echo 'hist:name=foo:keys=skbaddr.hex:vals=len' > \ +- /sys/kernel/debug/tracing/events/net/netif_rx/trigger +- +- You can see that they're updating common histogram data by reading +- each event's hist files at the same time: +- +- # cat /sys/kernel/debug/tracing/events/net/netif_receive_skb/hist; +- cat /sys/kernel/debug/tracing/events/net/netif_rx/hist +- +- # event histogram +- # +- # trigger info: hist:name=foo:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 [active] +- # +- +- { skbaddr: ffff88000ad53500 } hitcount: 1 len: 46 +- { skbaddr: ffff8800af5a1500 } hitcount: 1 len: 76 +- { skbaddr: ffff8800d62a1900 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d2bccb00 } hitcount: 1 len: 468 +- { skbaddr: ffff8800d3c69900 } hitcount: 1 len: 46 +- { skbaddr: ffff88009ff09100 } hitcount: 1 len: 52 +- { skbaddr: ffff88010f13ab00 } hitcount: 1 len: 168 +- { skbaddr: ffff88006a54f400 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d2bcc500 } hitcount: 1 len: 260 +- { skbaddr: ffff880064505000 } hitcount: 1 len: 46 +- { skbaddr: ffff8800baf24e00 } hitcount: 1 len: 32 +- { skbaddr: ffff88009fe0ad00 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d3edff00 } hitcount: 1 len: 44 +- { skbaddr: ffff88009fe0b400 } hitcount: 1 len: 168 +- { skbaddr: ffff8800a1c55a00 } hitcount: 1 len: 40 +- { skbaddr: ffff8800d2bcd100 } hitcount: 1 len: 40 +- { skbaddr: ffff880064505f00 } hitcount: 1 len: 174 +- { skbaddr: ffff8800a8bff200 } hitcount: 1 len: 160 +- { skbaddr: ffff880044e3cc00 } hitcount: 1 len: 76 +- { skbaddr: ffff8800a8bfe700 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d2bcdc00 } hitcount: 1 len: 32 +- { skbaddr: ffff8800a1f64800 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d2bcde00 } hitcount: 1 len: 988 +- { skbaddr: ffff88006a5dea00 } hitcount: 1 len: 46 +- { skbaddr: ffff88002e37a200 } hitcount: 1 len: 44 +- { skbaddr: ffff8800a1f32c00 } hitcount: 2 len: 676 +- { skbaddr: ffff88000ad52600 } hitcount: 2 len: 107 +- { skbaddr: ffff8800a1f91e00 } hitcount: 2 len: 92 +- { skbaddr: ffff8800af5a0200 } hitcount: 2 len: 142 +- { skbaddr: ffff8800d2bcc600 } hitcount: 2 len: 220 +- { skbaddr: ffff8800ba36f500 } hitcount: 2 len: 92 +- { skbaddr: ffff8800d021f800 } hitcount: 2 len: 92 +- { skbaddr: ffff8800a1f33600 } hitcount: 2 len: 675 +- { skbaddr: ffff8800a8bfff00 } hitcount: 3 len: 138 +- { skbaddr: ffff8800d62a1300 } hitcount: 3 len: 138 +- { skbaddr: ffff88002e37a100 } hitcount: 4 len: 184 +- { skbaddr: ffff880064504400 } hitcount: 4 len: 184 +- { skbaddr: ffff8800a8bfec00 } hitcount: 4 len: 184 +- { skbaddr: ffff88000ad53700 } hitcount: 5 len: 230 +- { skbaddr: ffff8800d2bcdb00 } hitcount: 5 len: 196 +- { skbaddr: ffff8800a1f90000 } hitcount: 6 len: 276 +- { skbaddr: ffff88006a54f900 } hitcount: 6 len: 276 +- +- Totals: +- Hits: 81 +- Entries: 42 +- Dropped: 0 +- # event histogram +- # +- # trigger info: hist:name=foo:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 [active] +- # +- +- { skbaddr: ffff88000ad53500 } hitcount: 1 len: 46 +- { skbaddr: ffff8800af5a1500 } hitcount: 1 len: 76 +- { skbaddr: ffff8800d62a1900 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d2bccb00 } hitcount: 1 len: 468 +- { skbaddr: ffff8800d3c69900 } hitcount: 1 len: 46 +- { skbaddr: ffff88009ff09100 } hitcount: 1 len: 52 +- { skbaddr: ffff88010f13ab00 } hitcount: 1 len: 168 +- { skbaddr: ffff88006a54f400 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d2bcc500 } hitcount: 1 len: 260 +- { skbaddr: ffff880064505000 } hitcount: 1 len: 46 +- { skbaddr: ffff8800baf24e00 } hitcount: 1 len: 32 +- { skbaddr: ffff88009fe0ad00 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d3edff00 } hitcount: 1 len: 44 +- { skbaddr: ffff88009fe0b400 } hitcount: 1 len: 168 +- { skbaddr: ffff8800a1c55a00 } hitcount: 1 len: 40 +- { skbaddr: ffff8800d2bcd100 } hitcount: 1 len: 40 +- { skbaddr: ffff880064505f00 } hitcount: 1 len: 174 +- { skbaddr: ffff8800a8bff200 } hitcount: 1 len: 160 +- { skbaddr: ffff880044e3cc00 } hitcount: 1 len: 76 +- { skbaddr: ffff8800a8bfe700 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d2bcdc00 } hitcount: 1 len: 32 +- { skbaddr: ffff8800a1f64800 } hitcount: 1 len: 46 +- { skbaddr: ffff8800d2bcde00 } hitcount: 1 len: 988 +- { skbaddr: ffff88006a5dea00 } hitcount: 1 len: 46 +- { skbaddr: ffff88002e37a200 } hitcount: 1 len: 44 +- { skbaddr: ffff8800a1f32c00 } hitcount: 2 len: 676 +- { skbaddr: ffff88000ad52600 } hitcount: 2 len: 107 +- { skbaddr: ffff8800a1f91e00 } hitcount: 2 len: 92 +- { skbaddr: ffff8800af5a0200 } hitcount: 2 len: 142 +- { skbaddr: ffff8800d2bcc600 } hitcount: 2 len: 220 +- { skbaddr: ffff8800ba36f500 } hitcount: 2 len: 92 +- { skbaddr: ffff8800d021f800 } hitcount: 2 len: 92 +- { skbaddr: ffff8800a1f33600 } hitcount: 2 len: 675 +- { skbaddr: ffff8800a8bfff00 } hitcount: 3 len: 138 +- { skbaddr: ffff8800d62a1300 } hitcount: 3 len: 138 +- { skbaddr: ffff88002e37a100 } hitcount: 4 len: 184 +- { skbaddr: ffff880064504400 } hitcount: 4 len: 184 +- { skbaddr: ffff8800a8bfec00 } hitcount: 4 len: 184 +- { skbaddr: ffff88000ad53700 } hitcount: 5 len: 230 +- { skbaddr: ffff8800d2bcdb00 } hitcount: 5 len: 196 +- { skbaddr: ffff8800a1f90000 } hitcount: 6 len: 276 +- { skbaddr: ffff88006a54f900 } hitcount: 6 len: 276 +- +- Totals: +- Hits: 81 +- Entries: 42 +- Dropped: 0 +- +- And here's an example that shows how to combine histogram data from +- any two events even if they don't share any 'compatible' fields +- other than 'hitcount' and 'stacktrace'. These commands create a +- couple of triggers named 'bar' using those fields: +- +- # echo 'hist:name=bar:key=stacktrace:val=hitcount' > \ +- /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger +- # echo 'hist:name=bar:key=stacktrace:val=hitcount' > \ +- /sys/kernel/debug/tracing/events/net/netif_rx/trigger +- +- And displaying the output of either shows some interesting if +- somewhat confusing output: +- +- # cat /sys/kernel/debug/tracing/events/sched/sched_process_fork/hist +- # cat /sys/kernel/debug/tracing/events/net/netif_rx/hist +- +- # event histogram +- # +- # trigger info: hist:name=bar:keys=stacktrace:vals=hitcount:sort=hitcount:size=2048 [active] +- # +- +- { stacktrace: +- _do_fork+0x18e/0x330 +- kernel_thread+0x29/0x30 +- kthreadd+0x154/0x1b0 +- ret_from_fork+0x3f/0x70 +- } hitcount: 1 +- { stacktrace: +- netif_rx_internal+0xb2/0xd0 +- netif_rx_ni+0x20/0x70 +- dev_loopback_xmit+0xaa/0xd0 +- ip_mc_output+0x126/0x240 +- ip_local_out_sk+0x31/0x40 +- igmp_send_report+0x1e9/0x230 +- igmp_timer_expire+0xe9/0x120 +- call_timer_fn+0x39/0xf0 +- run_timer_softirq+0x1e1/0x290 +- __do_softirq+0xfd/0x290 +- irq_exit+0x98/0xb0 +- smp_apic_timer_interrupt+0x4a/0x60 +- apic_timer_interrupt+0x6d/0x80 +- cpuidle_enter+0x17/0x20 +- call_cpuidle+0x3b/0x60 +- cpu_startup_entry+0x22d/0x310 +- } hitcount: 1 +- { stacktrace: +- netif_rx_internal+0xb2/0xd0 +- netif_rx_ni+0x20/0x70 +- dev_loopback_xmit+0xaa/0xd0 +- ip_mc_output+0x17f/0x240 +- ip_local_out_sk+0x31/0x40 +- ip_send_skb+0x1a/0x50 +- udp_send_skb+0x13e/0x270 +- udp_sendmsg+0x2bf/0x980 +- inet_sendmsg+0x67/0xa0 +- sock_sendmsg+0x38/0x50 +- SYSC_sendto+0xef/0x170 +- SyS_sendto+0xe/0x10 +- entry_SYSCALL_64_fastpath+0x12/0x6a +- } hitcount: 2 +- { stacktrace: +- netif_rx_internal+0xb2/0xd0 +- netif_rx+0x1c/0x60 +- loopback_xmit+0x6c/0xb0 +- dev_hard_start_xmit+0x219/0x3a0 +- __dev_queue_xmit+0x415/0x4f0 +- dev_queue_xmit_sk+0x13/0x20 +- ip_finish_output2+0x237/0x340 +- ip_finish_output+0x113/0x1d0 +- ip_output+0x66/0xc0 +- ip_local_out_sk+0x31/0x40 +- ip_send_skb+0x1a/0x50 +- udp_send_skb+0x16d/0x270 +- udp_sendmsg+0x2bf/0x980 +- inet_sendmsg+0x67/0xa0 +- sock_sendmsg+0x38/0x50 +- ___sys_sendmsg+0x14e/0x270 +- } hitcount: 76 +- { stacktrace: +- netif_rx_internal+0xb2/0xd0 +- netif_rx+0x1c/0x60 +- loopback_xmit+0x6c/0xb0 +- dev_hard_start_xmit+0x219/0x3a0 +- __dev_queue_xmit+0x415/0x4f0 +- dev_queue_xmit_sk+0x13/0x20 +- ip_finish_output2+0x237/0x340 +- ip_finish_output+0x113/0x1d0 +- ip_output+0x66/0xc0 +- ip_local_out_sk+0x31/0x40 +- ip_send_skb+0x1a/0x50 +- udp_send_skb+0x16d/0x270 +- udp_sendmsg+0x2bf/0x980 +- inet_sendmsg+0x67/0xa0 +- sock_sendmsg+0x38/0x50 +- ___sys_sendmsg+0x269/0x270 +- } hitcount: 77 +- { stacktrace: +- netif_rx_internal+0xb2/0xd0 +- netif_rx+0x1c/0x60 +- loopback_xmit+0x6c/0xb0 +- dev_hard_start_xmit+0x219/0x3a0 +- __dev_queue_xmit+0x415/0x4f0 +- dev_queue_xmit_sk+0x13/0x20 +- ip_finish_output2+0x237/0x340 +- ip_finish_output+0x113/0x1d0 +- ip_output+0x66/0xc0 +- ip_local_out_sk+0x31/0x40 +- ip_send_skb+0x1a/0x50 +- udp_send_skb+0x16d/0x270 +- udp_sendmsg+0x2bf/0x980 +- inet_sendmsg+0x67/0xa0 +- sock_sendmsg+0x38/0x50 +- SYSC_sendto+0xef/0x170 +- } hitcount: 88 +- { stacktrace: +- _do_fork+0x18e/0x330 +- SyS_clone+0x19/0x20 +- entry_SYSCALL_64_fastpath+0x12/0x6a +- } hitcount: 244 +- +- Totals: +- Hits: 489 +- Entries: 7 +- Dropped: 0 ++ See Documentation/trace/histogram.txt for details and examples. +--- /dev/null ++++ b/Documentation/trace/histogram.txt +@@ -0,0 +1,1568 @@ ++ Event Histograms ++ ++ Documentation written by Tom Zanussi ++ ++1. Introduction ++=============== ++ ++ Histogram triggers are special event triggers that can be used to ++ aggregate trace event data into histograms. For information on ++ trace events and event triggers, see Documentation/trace/events.txt. ++ ++ ++2. Histogram Trigger Command ++============================ ++ ++ A histogram trigger command is an event trigger command that ++ aggregates event hits into a hash table keyed on one or more trace ++ event format fields (or stacktrace) and a set of running totals ++ derived from one or more trace event format fields and/or event ++ counts (hitcount). ++ ++ The format of a hist trigger is as follows: ++ ++ hist:keys=[:values=] ++ [:sort=][:size=#entries][:pause][:continue] ++ [:clear][:name=histname1] [if ] ++ ++ When a matching event is hit, an entry is added to a hash table ++ using the key(s) and value(s) named. Keys and values correspond to ++ fields in the event's format description. Values must correspond to ++ numeric fields - on an event hit, the value(s) will be added to a ++ sum kept for that field. The special string 'hitcount' can be used ++ in place of an explicit value field - this is simply a count of ++ event hits. If 'values' isn't specified, an implicit 'hitcount' ++ value will be automatically created and used as the only value. ++ Keys can be any field, or the special string 'stacktrace', which ++ will use the event's kernel stacktrace as the key. The keywords ++ 'keys' or 'key' can be used to specify keys, and the keywords ++ 'values', 'vals', or 'val' can be used to specify values. Compound ++ keys consisting of up to two fields can be specified by the 'keys' ++ keyword. Hashing a compound key produces a unique entry in the ++ table for each unique combination of component keys, and can be ++ useful for providing more fine-grained summaries of event data. ++ Additionally, sort keys consisting of up to two fields can be ++ specified by the 'sort' keyword. If more than one field is ++ specified, the result will be a 'sort within a sort': the first key ++ is taken to be the primary sort key and the second the secondary ++ key. If a hist trigger is given a name using the 'name' parameter, ++ its histogram data will be shared with other triggers of the same ++ name, and trigger hits will update this common data. Only triggers ++ with 'compatible' fields can be combined in this way; triggers are ++ 'compatible' if the fields named in the trigger share the same ++ number and type of fields and those fields also have the same names. ++ Note that any two events always share the compatible 'hitcount' and ++ 'stacktrace' fields and can therefore be combined using those ++ fields, however pointless that may be. ++ ++ 'hist' triggers add a 'hist' file to each event's subdirectory. ++ Reading the 'hist' file for the event will dump the hash table in ++ its entirety to stdout. If there are multiple hist triggers ++ attached to an event, there will be a table for each trigger in the ++ output. The table displayed for a named trigger will be the same as ++ any other instance having the same name. Each printed hash table ++ entry is a simple list of the keys and values comprising the entry; ++ keys are printed first and are delineated by curly braces, and are ++ followed by the set of value fields for the entry. By default, ++ numeric fields are displayed as base-10 integers. This can be ++ modified by appending any of the following modifiers to the field ++ name: ++ ++ .hex display a number as a hex value ++ .sym display an address as a symbol ++ .sym-offset display an address as a symbol and offset ++ .syscall display a syscall id as a system call name ++ .execname display a common_pid as a program name ++ ++ Note that in general the semantics of a given field aren't ++ interpreted when applying a modifier to it, but there are some ++ restrictions to be aware of in this regard: ++ ++ - only the 'hex' modifier can be used for values (because values ++ are essentially sums, and the other modifiers don't make sense ++ in that context). ++ - the 'execname' modifier can only be used on a 'common_pid'. The ++ reason for this is that the execname is simply the 'comm' value ++ saved for the 'current' process when an event was triggered, ++ which is the same as the common_pid value saved by the event ++ tracing code. Trying to apply that comm value to other pid ++ values wouldn't be correct, and typically events that care save ++ pid-specific comm fields in the event itself. ++ ++ A typical usage scenario would be the following to enable a hist ++ trigger, read its current contents, and then turn it off: ++ ++ # echo 'hist:keys=skbaddr.hex:vals=len' > \ ++ /sys/kernel/debug/tracing/events/net/netif_rx/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/net/netif_rx/hist ++ ++ # echo '!hist:keys=skbaddr.hex:vals=len' > \ ++ /sys/kernel/debug/tracing/events/net/netif_rx/trigger ++ ++ The trigger file itself can be read to show the details of the ++ currently attached hist trigger. This information is also displayed ++ at the top of the 'hist' file when read. ++ ++ By default, the size of the hash table is 2048 entries. The 'size' ++ parameter can be used to specify more or fewer than that. The units ++ are in terms of hashtable entries - if a run uses more entries than ++ specified, the results will show the number of 'drops', the number ++ of hits that were ignored. The size should be a power of 2 between ++ 128 and 131072 (any non- power-of-2 number specified will be rounded ++ up). ++ ++ The 'sort' parameter can be used to specify a value field to sort ++ on. The default if unspecified is 'hitcount' and the default sort ++ order is 'ascending'. To sort in the opposite direction, append ++ .descending' to the sort key. ++ ++ The 'pause' parameter can be used to pause an existing hist trigger ++ or to start a hist trigger but not log any events until told to do ++ so. 'continue' or 'cont' can be used to start or restart a paused ++ hist trigger. ++ ++ The 'clear' parameter will clear the contents of a running hist ++ trigger and leave its current paused/active state. ++ ++ Note that the 'pause', 'cont', and 'clear' parameters should be ++ applied using 'append' shell operator ('>>') if applied to an ++ existing trigger, rather than via the '>' operator, which will cause ++ the trigger to be removed through truncation. ++ ++- enable_hist/disable_hist ++ ++ The enable_hist and disable_hist triggers can be used to have one ++ event conditionally start and stop another event's already-attached ++ hist trigger. Any number of enable_hist and disable_hist triggers ++ can be attached to a given event, allowing that event to kick off ++ and stop aggregations on a host of other events. ++ ++ The format is very similar to the enable/disable_event triggers: ++ ++ enable_hist::[:count] ++ disable_hist::[:count] ++ ++ Instead of enabling or disabling the tracing of the target event ++ into the trace buffer as the enable/disable_event triggers do, the ++ enable/disable_hist triggers enable or disable the aggregation of ++ the target event into a hash table. ++ ++ A typical usage scenario for the enable_hist/disable_hist triggers ++ would be to first set up a paused hist trigger on some event, ++ followed by an enable_hist/disable_hist pair that turns the hist ++ aggregation on and off when conditions of interest are hit: ++ ++ # echo 'hist:keys=skbaddr.hex:vals=len:pause' > \ ++ /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger ++ ++ # echo 'enable_hist:net:netif_receive_skb if filename==/usr/bin/wget' > \ ++ /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger ++ ++ # echo 'disable_hist:net:netif_receive_skb if comm==wget' > \ ++ /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger ++ ++ The above sets up an initially paused hist trigger which is unpaused ++ and starts aggregating events when a given program is executed, and ++ which stops aggregating when the process exits and the hist trigger ++ is paused again. ++ ++ The examples below provide a more concrete illustration of the ++ concepts and typical usage patterns discussed above. ++ ++ ++6.2 'hist' trigger examples ++--------------------------- ++ ++ The first set of examples creates aggregations using the kmalloc ++ event. The fields that can be used for the hist trigger are listed ++ in the kmalloc event's format file: ++ ++ # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/format ++ name: kmalloc ++ ID: 374 ++ format: ++ field:unsigned short common_type; offset:0; size:2; signed:0; ++ field:unsigned char common_flags; offset:2; size:1; signed:0; ++ field:unsigned char common_preempt_count; offset:3; size:1; signed:0; ++ field:int common_pid; offset:4; size:4; signed:1; ++ ++ field:unsigned long call_site; offset:8; size:8; signed:0; ++ field:const void * ptr; offset:16; size:8; signed:0; ++ field:size_t bytes_req; offset:24; size:8; signed:0; ++ field:size_t bytes_alloc; offset:32; size:8; signed:0; ++ field:gfp_t gfp_flags; offset:40; size:4; signed:0; ++ ++ We'll start by creating a hist trigger that generates a simple table ++ that lists the total number of bytes requested for each function in ++ the kernel that made one or more calls to kmalloc: ++ ++ # echo 'hist:key=call_site:val=bytes_req' > \ ++ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger ++ ++ This tells the tracing system to create a 'hist' trigger using the ++ call_site field of the kmalloc event as the key for the table, which ++ just means that each unique call_site address will have an entry ++ created for it in the table. The 'val=bytes_req' parameter tells ++ the hist trigger that for each unique entry (call_site) in the ++ table, it should keep a running total of the number of bytes ++ requested by that call_site. ++ ++ We'll let it run for awhile and then dump the contents of the 'hist' ++ file in the kmalloc event's subdirectory (for readability, a number ++ of entries have been omitted): ++ ++ # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist ++ # trigger info: hist:keys=call_site:vals=bytes_req:sort=hitcount:size=2048 [active] ++ ++ { call_site: 18446744072106379007 } hitcount: 1 bytes_req: 176 ++ { call_site: 18446744071579557049 } hitcount: 1 bytes_req: 1024 ++ { call_site: 18446744071580608289 } hitcount: 1 bytes_req: 16384 ++ { call_site: 18446744071581827654 } hitcount: 1 bytes_req: 24 ++ { call_site: 18446744071580700980 } hitcount: 1 bytes_req: 8 ++ { call_site: 18446744071579359876 } hitcount: 1 bytes_req: 152 ++ { call_site: 18446744071580795365 } hitcount: 3 bytes_req: 144 ++ { call_site: 18446744071581303129 } hitcount: 3 bytes_req: 144 ++ { call_site: 18446744071580713234 } hitcount: 4 bytes_req: 2560 ++ { call_site: 18446744071580933750 } hitcount: 4 bytes_req: 736 ++ . ++ . ++ . ++ { call_site: 18446744072106047046 } hitcount: 69 bytes_req: 5576 ++ { call_site: 18446744071582116407 } hitcount: 73 bytes_req: 2336 ++ { call_site: 18446744072106054684 } hitcount: 136 bytes_req: 140504 ++ { call_site: 18446744072106224230 } hitcount: 136 bytes_req: 19584 ++ { call_site: 18446744072106078074 } hitcount: 153 bytes_req: 2448 ++ { call_site: 18446744072106062406 } hitcount: 153 bytes_req: 36720 ++ { call_site: 18446744071582507929 } hitcount: 153 bytes_req: 37088 ++ { call_site: 18446744072102520590 } hitcount: 273 bytes_req: 10920 ++ { call_site: 18446744071582143559 } hitcount: 358 bytes_req: 716 ++ { call_site: 18446744072106465852 } hitcount: 417 bytes_req: 56712 ++ { call_site: 18446744072102523378 } hitcount: 485 bytes_req: 27160 ++ { call_site: 18446744072099568646 } hitcount: 1676 bytes_req: 33520 ++ ++ Totals: ++ Hits: 4610 ++ Entries: 45 ++ Dropped: 0 ++ ++ The output displays a line for each entry, beginning with the key ++ specified in the trigger, followed by the value(s) also specified in ++ the trigger. At the beginning of the output is a line that displays ++ the trigger info, which can also be displayed by reading the ++ 'trigger' file: ++ ++ # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger ++ hist:keys=call_site:vals=bytes_req:sort=hitcount:size=2048 [active] ++ ++ At the end of the output are a few lines that display the overall ++ totals for the run. The 'Hits' field shows the total number of ++ times the event trigger was hit, the 'Entries' field shows the total ++ number of used entries in the hash table, and the 'Dropped' field ++ shows the number of hits that were dropped because the number of ++ used entries for the run exceeded the maximum number of entries ++ allowed for the table (normally 0, but if not a hint that you may ++ want to increase the size of the table using the 'size' parameter). ++ ++ Notice in the above output that there's an extra field, 'hitcount', ++ which wasn't specified in the trigger. Also notice that in the ++ trigger info output, there's a parameter, 'sort=hitcount', which ++ wasn't specified in the trigger either. The reason for that is that ++ every trigger implicitly keeps a count of the total number of hits ++ attributed to a given entry, called the 'hitcount'. That hitcount ++ information is explicitly displayed in the output, and in the ++ absence of a user-specified sort parameter, is used as the default ++ sort field. ++ ++ The value 'hitcount' can be used in place of an explicit value in ++ the 'values' parameter if you don't really need to have any ++ particular field summed and are mainly interested in hit ++ frequencies. ++ ++ To turn the hist trigger off, simply call up the trigger in the ++ command history and re-execute it with a '!' prepended: ++ ++ # echo '!hist:key=call_site:val=bytes_req' > \ ++ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger ++ ++ Finally, notice that the call_site as displayed in the output above ++ isn't really very useful. It's an address, but normally addresses ++ are displayed in hex. To have a numeric field displayed as a hex ++ value, simply append '.hex' to the field name in the trigger: ++ ++ # echo 'hist:key=call_site.hex:val=bytes_req' > \ ++ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist ++ # trigger info: hist:keys=call_site.hex:vals=bytes_req:sort=hitcount:size=2048 [active] ++ ++ { call_site: ffffffffa026b291 } hitcount: 1 bytes_req: 433 ++ { call_site: ffffffffa07186ff } hitcount: 1 bytes_req: 176 ++ { call_site: ffffffff811ae721 } hitcount: 1 bytes_req: 16384 ++ { call_site: ffffffff811c5134 } hitcount: 1 bytes_req: 8 ++ { call_site: ffffffffa04a9ebb } hitcount: 1 bytes_req: 511 ++ { call_site: ffffffff8122e0a6 } hitcount: 1 bytes_req: 12 ++ { call_site: ffffffff8107da84 } hitcount: 1 bytes_req: 152 ++ { call_site: ffffffff812d8246 } hitcount: 1 bytes_req: 24 ++ { call_site: ffffffff811dc1e5 } hitcount: 3 bytes_req: 144 ++ { call_site: ffffffffa02515e8 } hitcount: 3 bytes_req: 648 ++ { call_site: ffffffff81258159 } hitcount: 3 bytes_req: 144 ++ { call_site: ffffffff811c80f4 } hitcount: 4 bytes_req: 544 ++ . ++ . ++ . ++ { call_site: ffffffffa06c7646 } hitcount: 106 bytes_req: 8024 ++ { call_site: ffffffffa06cb246 } hitcount: 132 bytes_req: 31680 ++ { call_site: ffffffffa06cef7a } hitcount: 132 bytes_req: 2112 ++ { call_site: ffffffff8137e399 } hitcount: 132 bytes_req: 23232 ++ { call_site: ffffffffa06c941c } hitcount: 185 bytes_req: 171360 ++ { call_site: ffffffffa06f2a66 } hitcount: 185 bytes_req: 26640 ++ { call_site: ffffffffa036a70e } hitcount: 265 bytes_req: 10600 ++ { call_site: ffffffff81325447 } hitcount: 292 bytes_req: 584 ++ { call_site: ffffffffa072da3c } hitcount: 446 bytes_req: 60656 ++ { call_site: ffffffffa036b1f2 } hitcount: 526 bytes_req: 29456 ++ { call_site: ffffffffa0099c06 } hitcount: 1780 bytes_req: 35600 ++ ++ Totals: ++ Hits: 4775 ++ Entries: 46 ++ Dropped: 0 ++ ++ Even that's only marginally more useful - while hex values do look ++ more like addresses, what users are typically more interested in ++ when looking at text addresses are the corresponding symbols ++ instead. To have an address displayed as symbolic value instead, ++ simply append '.sym' or '.sym-offset' to the field name in the ++ trigger: ++ ++ # echo 'hist:key=call_site.sym:val=bytes_req' > \ ++ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist ++ # trigger info: hist:keys=call_site.sym:vals=bytes_req:sort=hitcount:size=2048 [active] ++ ++ { call_site: [ffffffff810adcb9] syslog_print_all } hitcount: 1 bytes_req: 1024 ++ { call_site: [ffffffff8154bc62] usb_control_msg } hitcount: 1 bytes_req: 8 ++ { call_site: [ffffffffa00bf6fe] hidraw_send_report [hid] } hitcount: 1 bytes_req: 7 ++ { call_site: [ffffffff8154acbe] usb_alloc_urb } hitcount: 1 bytes_req: 192 ++ { call_site: [ffffffffa00bf1ca] hidraw_report_event [hid] } hitcount: 1 bytes_req: 7 ++ { call_site: [ffffffff811e3a25] __seq_open_private } hitcount: 1 bytes_req: 40 ++ { call_site: [ffffffff8109524a] alloc_fair_sched_group } hitcount: 2 bytes_req: 128 ++ { call_site: [ffffffff811febd5] fsnotify_alloc_group } hitcount: 2 bytes_req: 528 ++ { call_site: [ffffffff81440f58] __tty_buffer_request_room } hitcount: 2 bytes_req: 2624 ++ { call_site: [ffffffff81200ba6] inotify_new_group } hitcount: 2 bytes_req: 96 ++ { call_site: [ffffffffa05e19af] ieee80211_start_tx_ba_session [mac80211] } hitcount: 2 bytes_req: 464 ++ { call_site: [ffffffff81672406] tcp_get_metrics } hitcount: 2 bytes_req: 304 ++ { call_site: [ffffffff81097ec2] alloc_rt_sched_group } hitcount: 2 bytes_req: 128 ++ { call_site: [ffffffff81089b05] sched_create_group } hitcount: 2 bytes_req: 1424 ++ . ++ . ++ . ++ { call_site: [ffffffffa04a580c] intel_crtc_page_flip [i915] } hitcount: 1185 bytes_req: 123240 ++ { call_site: [ffffffffa0287592] drm_mode_page_flip_ioctl [drm] } hitcount: 1185 bytes_req: 104280 ++ { call_site: [ffffffffa04c4a3c] intel_plane_duplicate_state [i915] } hitcount: 1402 bytes_req: 190672 ++ { call_site: [ffffffff812891ca] ext4_find_extent } hitcount: 1518 bytes_req: 146208 ++ { call_site: [ffffffffa029070e] drm_vma_node_allow [drm] } hitcount: 1746 bytes_req: 69840 ++ { call_site: [ffffffffa045e7c4] i915_gem_do_execbuffer.isra.23 [i915] } hitcount: 2021 bytes_req: 792312 ++ { call_site: [ffffffffa02911f2] drm_modeset_lock_crtc [drm] } hitcount: 2592 bytes_req: 145152 ++ { call_site: [ffffffffa0489a66] intel_ring_begin [i915] } hitcount: 2629 bytes_req: 378576 ++ { call_site: [ffffffffa046041c] i915_gem_execbuffer2 [i915] } hitcount: 2629 bytes_req: 3783248 ++ { call_site: [ffffffff81325607] apparmor_file_alloc_security } hitcount: 5192 bytes_req: 10384 ++ { call_site: [ffffffffa00b7c06] hid_report_raw_event [hid] } hitcount: 5529 bytes_req: 110584 ++ { call_site: [ffffffff8131ebf7] aa_alloc_task_context } hitcount: 21943 bytes_req: 702176 ++ { call_site: [ffffffff8125847d] ext4_htree_store_dirent } hitcount: 55759 bytes_req: 5074265 ++ ++ Totals: ++ Hits: 109928 ++ Entries: 71 ++ Dropped: 0 ++ ++ Because the default sort key above is 'hitcount', the above shows a ++ the list of call_sites by increasing hitcount, so that at the bottom ++ we see the functions that made the most kmalloc calls during the ++ run. If instead we we wanted to see the top kmalloc callers in ++ terms of the number of bytes requested rather than the number of ++ calls, and we wanted the top caller to appear at the top, we can use ++ the 'sort' parameter, along with the 'descending' modifier: ++ ++ # echo 'hist:key=call_site.sym:val=bytes_req:sort=bytes_req.descending' > \ ++ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist ++ # trigger info: hist:keys=call_site.sym:vals=bytes_req:sort=bytes_req.descending:size=2048 [active] ++ ++ { call_site: [ffffffffa046041c] i915_gem_execbuffer2 [i915] } hitcount: 2186 bytes_req: 3397464 ++ { call_site: [ffffffffa045e7c4] i915_gem_do_execbuffer.isra.23 [i915] } hitcount: 1790 bytes_req: 712176 ++ { call_site: [ffffffff8125847d] ext4_htree_store_dirent } hitcount: 8132 bytes_req: 513135 ++ { call_site: [ffffffff811e2a1b] seq_buf_alloc } hitcount: 106 bytes_req: 440128 ++ { call_site: [ffffffffa0489a66] intel_ring_begin [i915] } hitcount: 2186 bytes_req: 314784 ++ { call_site: [ffffffff812891ca] ext4_find_extent } hitcount: 2174 bytes_req: 208992 ++ { call_site: [ffffffff811ae8e1] __kmalloc } hitcount: 8 bytes_req: 131072 ++ { call_site: [ffffffffa04c4a3c] intel_plane_duplicate_state [i915] } hitcount: 859 bytes_req: 116824 ++ { call_site: [ffffffffa02911f2] drm_modeset_lock_crtc [drm] } hitcount: 1834 bytes_req: 102704 ++ { call_site: [ffffffffa04a580c] intel_crtc_page_flip [i915] } hitcount: 972 bytes_req: 101088 ++ { call_site: [ffffffffa0287592] drm_mode_page_flip_ioctl [drm] } hitcount: 972 bytes_req: 85536 ++ { call_site: [ffffffffa00b7c06] hid_report_raw_event [hid] } hitcount: 3333 bytes_req: 66664 ++ { call_site: [ffffffff8137e559] sg_kmalloc } hitcount: 209 bytes_req: 61632 ++ . ++ . ++ . ++ { call_site: [ffffffff81095225] alloc_fair_sched_group } hitcount: 2 bytes_req: 128 ++ { call_site: [ffffffff81097ec2] alloc_rt_sched_group } hitcount: 2 bytes_req: 128 ++ { call_site: [ffffffff812d8406] copy_semundo } hitcount: 2 bytes_req: 48 ++ { call_site: [ffffffff81200ba6] inotify_new_group } hitcount: 1 bytes_req: 48 ++ { call_site: [ffffffffa027121a] drm_getmagic [drm] } hitcount: 1 bytes_req: 48 ++ { call_site: [ffffffff811e3a25] __seq_open_private } hitcount: 1 bytes_req: 40 ++ { call_site: [ffffffff811c52f4] bprm_change_interp } hitcount: 2 bytes_req: 16 ++ { call_site: [ffffffff8154bc62] usb_control_msg } hitcount: 1 bytes_req: 8 ++ { call_site: [ffffffffa00bf1ca] hidraw_report_event [hid] } hitcount: 1 bytes_req: 7 ++ { call_site: [ffffffffa00bf6fe] hidraw_send_report [hid] } hitcount: 1 bytes_req: 7 ++ ++ Totals: ++ Hits: 32133 ++ Entries: 81 ++ Dropped: 0 ++ ++ To display the offset and size information in addition to the symbol ++ name, just use 'sym-offset' instead: ++ ++ # echo 'hist:key=call_site.sym-offset:val=bytes_req:sort=bytes_req.descending' > \ ++ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist ++ # trigger info: hist:keys=call_site.sym-offset:vals=bytes_req:sort=bytes_req.descending:size=2048 [active] ++ ++ { call_site: [ffffffffa046041c] i915_gem_execbuffer2+0x6c/0x2c0 [i915] } hitcount: 4569 bytes_req: 3163720 ++ { call_site: [ffffffffa0489a66] intel_ring_begin+0xc6/0x1f0 [i915] } hitcount: 4569 bytes_req: 657936 ++ { call_site: [ffffffffa045e7c4] i915_gem_do_execbuffer.isra.23+0x694/0x1020 [i915] } hitcount: 1519 bytes_req: 472936 ++ { call_site: [ffffffffa045e646] i915_gem_do_execbuffer.isra.23+0x516/0x1020 [i915] } hitcount: 3050 bytes_req: 211832 ++ { call_site: [ffffffff811e2a1b] seq_buf_alloc+0x1b/0x50 } hitcount: 34 bytes_req: 148384 ++ { call_site: [ffffffffa04a580c] intel_crtc_page_flip+0xbc/0x870 [i915] } hitcount: 1385 bytes_req: 144040 ++ { call_site: [ffffffff811ae8e1] __kmalloc+0x191/0x1b0 } hitcount: 8 bytes_req: 131072 ++ { call_site: [ffffffffa0287592] drm_mode_page_flip_ioctl+0x282/0x360 [drm] } hitcount: 1385 bytes_req: 121880 ++ { call_site: [ffffffffa02911f2] drm_modeset_lock_crtc+0x32/0x100 [drm] } hitcount: 1848 bytes_req: 103488 ++ { call_site: [ffffffffa04c4a3c] intel_plane_duplicate_state+0x2c/0xa0 [i915] } hitcount: 461 bytes_req: 62696 ++ { call_site: [ffffffffa029070e] drm_vma_node_allow+0x2e/0xd0 [drm] } hitcount: 1541 bytes_req: 61640 ++ { call_site: [ffffffff815f8d7b] sk_prot_alloc+0xcb/0x1b0 } hitcount: 57 bytes_req: 57456 ++ . ++ . ++ . ++ { call_site: [ffffffff8109524a] alloc_fair_sched_group+0x5a/0x1a0 } hitcount: 2 bytes_req: 128 ++ { call_site: [ffffffffa027b921] drm_vm_open_locked+0x31/0xa0 [drm] } hitcount: 3 bytes_req: 96 ++ { call_site: [ffffffff8122e266] proc_self_follow_link+0x76/0xb0 } hitcount: 8 bytes_req: 96 ++ { call_site: [ffffffff81213e80] load_elf_binary+0x240/0x1650 } hitcount: 3 bytes_req: 84 ++ { call_site: [ffffffff8154bc62] usb_control_msg+0x42/0x110 } hitcount: 1 bytes_req: 8 ++ { call_site: [ffffffffa00bf6fe] hidraw_send_report+0x7e/0x1a0 [hid] } hitcount: 1 bytes_req: 7 ++ { call_site: [ffffffffa00bf1ca] hidraw_report_event+0x8a/0x120 [hid] } hitcount: 1 bytes_req: 7 ++ ++ Totals: ++ Hits: 26098 ++ Entries: 64 ++ Dropped: 0 ++ ++ We can also add multiple fields to the 'values' parameter. For ++ example, we might want to see the total number of bytes allocated ++ alongside bytes requested, and display the result sorted by bytes ++ allocated in a descending order: ++ ++ # echo 'hist:keys=call_site.sym:values=bytes_req,bytes_alloc:sort=bytes_alloc.descending' > \ ++ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist ++ # trigger info: hist:keys=call_site.sym:vals=bytes_req,bytes_alloc:sort=bytes_alloc.descending:size=2048 [active] ++ ++ { call_site: [ffffffffa046041c] i915_gem_execbuffer2 [i915] } hitcount: 7403 bytes_req: 4084360 bytes_alloc: 5958016 ++ { call_site: [ffffffff811e2a1b] seq_buf_alloc } hitcount: 541 bytes_req: 2213968 bytes_alloc: 2228224 ++ { call_site: [ffffffffa0489a66] intel_ring_begin [i915] } hitcount: 7404 bytes_req: 1066176 bytes_alloc: 1421568 ++ { call_site: [ffffffffa045e7c4] i915_gem_do_execbuffer.isra.23 [i915] } hitcount: 1565 bytes_req: 557368 bytes_alloc: 1037760 ++ { call_site: [ffffffff8125847d] ext4_htree_store_dirent } hitcount: 9557 bytes_req: 595778 bytes_alloc: 695744 ++ { call_site: [ffffffffa045e646] i915_gem_do_execbuffer.isra.23 [i915] } hitcount: 5839 bytes_req: 430680 bytes_alloc: 470400 ++ { call_site: [ffffffffa04c4a3c] intel_plane_duplicate_state [i915] } hitcount: 2388 bytes_req: 324768 bytes_alloc: 458496 ++ { call_site: [ffffffffa02911f2] drm_modeset_lock_crtc [drm] } hitcount: 3911 bytes_req: 219016 bytes_alloc: 250304 ++ { call_site: [ffffffff815f8d7b] sk_prot_alloc } hitcount: 235 bytes_req: 236880 bytes_alloc: 240640 ++ { call_site: [ffffffff8137e559] sg_kmalloc } hitcount: 557 bytes_req: 169024 bytes_alloc: 221760 ++ { call_site: [ffffffffa00b7c06] hid_report_raw_event [hid] } hitcount: 9378 bytes_req: 187548 bytes_alloc: 206312 ++ { call_site: [ffffffffa04a580c] intel_crtc_page_flip [i915] } hitcount: 1519 bytes_req: 157976 bytes_alloc: 194432 ++ . ++ . ++ . ++ { call_site: [ffffffff8109bd3b] sched_autogroup_create_attach } hitcount: 2 bytes_req: 144 bytes_alloc: 192 ++ { call_site: [ffffffff81097ee8] alloc_rt_sched_group } hitcount: 2 bytes_req: 128 bytes_alloc: 128 ++ { call_site: [ffffffff8109524a] alloc_fair_sched_group } hitcount: 2 bytes_req: 128 bytes_alloc: 128 ++ { call_site: [ffffffff81095225] alloc_fair_sched_group } hitcount: 2 bytes_req: 128 bytes_alloc: 128 ++ { call_site: [ffffffff81097ec2] alloc_rt_sched_group } hitcount: 2 bytes_req: 128 bytes_alloc: 128 ++ { call_site: [ffffffff81213e80] load_elf_binary } hitcount: 3 bytes_req: 84 bytes_alloc: 96 ++ { call_site: [ffffffff81079a2e] kthread_create_on_node } hitcount: 1 bytes_req: 56 bytes_alloc: 64 ++ { call_site: [ffffffffa00bf6fe] hidraw_send_report [hid] } hitcount: 1 bytes_req: 7 bytes_alloc: 8 ++ { call_site: [ffffffff8154bc62] usb_control_msg } hitcount: 1 bytes_req: 8 bytes_alloc: 8 ++ { call_site: [ffffffffa00bf1ca] hidraw_report_event [hid] } hitcount: 1 bytes_req: 7 bytes_alloc: 8 ++ ++ Totals: ++ Hits: 66598 ++ Entries: 65 ++ Dropped: 0 ++ ++ Finally, to finish off our kmalloc example, instead of simply having ++ the hist trigger display symbolic call_sites, we can have the hist ++ trigger additionally display the complete set of kernel stack traces ++ that led to each call_site. To do that, we simply use the special ++ value 'stacktrace' for the key parameter: ++ ++ # echo 'hist:keys=stacktrace:values=bytes_req,bytes_alloc:sort=bytes_alloc' > \ ++ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger ++ ++ The above trigger will use the kernel stack trace in effect when an ++ event is triggered as the key for the hash table. This allows the ++ enumeration of every kernel callpath that led up to a particular ++ event, along with a running total of any of the event fields for ++ that event. Here we tally bytes requested and bytes allocated for ++ every callpath in the system that led up to a kmalloc (in this case ++ every callpath to a kmalloc for a kernel compile): ++ ++ # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/hist ++ # trigger info: hist:keys=stacktrace:vals=bytes_req,bytes_alloc:sort=bytes_alloc:size=2048 [active] ++ ++ { stacktrace: ++ __kmalloc_track_caller+0x10b/0x1a0 ++ kmemdup+0x20/0x50 ++ hidraw_report_event+0x8a/0x120 [hid] ++ hid_report_raw_event+0x3ea/0x440 [hid] ++ hid_input_report+0x112/0x190 [hid] ++ hid_irq_in+0xc2/0x260 [usbhid] ++ __usb_hcd_giveback_urb+0x72/0x120 ++ usb_giveback_urb_bh+0x9e/0xe0 ++ tasklet_hi_action+0xf8/0x100 ++ __do_softirq+0x114/0x2c0 ++ irq_exit+0xa5/0xb0 ++ do_IRQ+0x5a/0xf0 ++ ret_from_intr+0x0/0x30 ++ cpuidle_enter+0x17/0x20 ++ cpu_startup_entry+0x315/0x3e0 ++ rest_init+0x7c/0x80 ++ } hitcount: 3 bytes_req: 21 bytes_alloc: 24 ++ { stacktrace: ++ __kmalloc_track_caller+0x10b/0x1a0 ++ kmemdup+0x20/0x50 ++ hidraw_report_event+0x8a/0x120 [hid] ++ hid_report_raw_event+0x3ea/0x440 [hid] ++ hid_input_report+0x112/0x190 [hid] ++ hid_irq_in+0xc2/0x260 [usbhid] ++ __usb_hcd_giveback_urb+0x72/0x120 ++ usb_giveback_urb_bh+0x9e/0xe0 ++ tasklet_hi_action+0xf8/0x100 ++ __do_softirq+0x114/0x2c0 ++ irq_exit+0xa5/0xb0 ++ do_IRQ+0x5a/0xf0 ++ ret_from_intr+0x0/0x30 ++ } hitcount: 3 bytes_req: 21 bytes_alloc: 24 ++ { stacktrace: ++ kmem_cache_alloc_trace+0xeb/0x150 ++ aa_alloc_task_context+0x27/0x40 ++ apparmor_cred_prepare+0x1f/0x50 ++ security_prepare_creds+0x16/0x20 ++ prepare_creds+0xdf/0x1a0 ++ SyS_capset+0xb5/0x200 ++ system_call_fastpath+0x12/0x6a ++ } hitcount: 1 bytes_req: 32 bytes_alloc: 32 ++ . ++ . ++ . ++ { stacktrace: ++ __kmalloc+0x11b/0x1b0 ++ i915_gem_execbuffer2+0x6c/0x2c0 [i915] ++ drm_ioctl+0x349/0x670 [drm] ++ do_vfs_ioctl+0x2f0/0x4f0 ++ SyS_ioctl+0x81/0xa0 ++ system_call_fastpath+0x12/0x6a ++ } hitcount: 17726 bytes_req: 13944120 bytes_alloc: 19593808 ++ { stacktrace: ++ __kmalloc+0x11b/0x1b0 ++ load_elf_phdrs+0x76/0xa0 ++ load_elf_binary+0x102/0x1650 ++ search_binary_handler+0x97/0x1d0 ++ do_execveat_common.isra.34+0x551/0x6e0 ++ SyS_execve+0x3a/0x50 ++ return_from_execve+0x0/0x23 ++ } hitcount: 33348 bytes_req: 17152128 bytes_alloc: 20226048 ++ { stacktrace: ++ kmem_cache_alloc_trace+0xeb/0x150 ++ apparmor_file_alloc_security+0x27/0x40 ++ security_file_alloc+0x16/0x20 ++ get_empty_filp+0x93/0x1c0 ++ path_openat+0x31/0x5f0 ++ do_filp_open+0x3a/0x90 ++ do_sys_open+0x128/0x220 ++ SyS_open+0x1e/0x20 ++ system_call_fastpath+0x12/0x6a ++ } hitcount: 4766422 bytes_req: 9532844 bytes_alloc: 38131376 ++ { stacktrace: ++ __kmalloc+0x11b/0x1b0 ++ seq_buf_alloc+0x1b/0x50 ++ seq_read+0x2cc/0x370 ++ proc_reg_read+0x3d/0x80 ++ __vfs_read+0x28/0xe0 ++ vfs_read+0x86/0x140 ++ SyS_read+0x46/0xb0 ++ system_call_fastpath+0x12/0x6a ++ } hitcount: 19133 bytes_req: 78368768 bytes_alloc: 78368768 ++ ++ Totals: ++ Hits: 6085872 ++ Entries: 253 ++ Dropped: 0 ++ ++ If you key a hist trigger on common_pid, in order for example to ++ gather and display sorted totals for each process, you can use the ++ special .execname modifier to display the executable names for the ++ processes in the table rather than raw pids. The example below ++ keeps a per-process sum of total bytes read: ++ ++ # echo 'hist:key=common_pid.execname:val=count:sort=count.descending' > \ ++ /sys/kernel/debug/tracing/events/syscalls/sys_enter_read/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_read/hist ++ # trigger info: hist:keys=common_pid.execname:vals=count:sort=count.descending:size=2048 [active] ++ ++ { common_pid: gnome-terminal [ 3196] } hitcount: 280 count: 1093512 ++ { common_pid: Xorg [ 1309] } hitcount: 525 count: 256640 ++ { common_pid: compiz [ 2889] } hitcount: 59 count: 254400 ++ { common_pid: bash [ 8710] } hitcount: 3 count: 66369 ++ { common_pid: dbus-daemon-lau [ 8703] } hitcount: 49 count: 47739 ++ { common_pid: irqbalance [ 1252] } hitcount: 27 count: 27648 ++ { common_pid: 01ifupdown [ 8705] } hitcount: 3 count: 17216 ++ { common_pid: dbus-daemon [ 772] } hitcount: 10 count: 12396 ++ { common_pid: Socket Thread [ 8342] } hitcount: 11 count: 11264 ++ { common_pid: nm-dhcp-client. [ 8701] } hitcount: 6 count: 7424 ++ { common_pid: gmain [ 1315] } hitcount: 18 count: 6336 ++ . ++ . ++ . ++ { common_pid: postgres [ 1892] } hitcount: 2 count: 32 ++ { common_pid: postgres [ 1891] } hitcount: 2 count: 32 ++ { common_pid: gmain [ 8704] } hitcount: 2 count: 32 ++ { common_pid: upstart-dbus-br [ 2740] } hitcount: 21 count: 21 ++ { common_pid: nm-dispatcher.a [ 8696] } hitcount: 1 count: 16 ++ { common_pid: indicator-datet [ 2904] } hitcount: 1 count: 16 ++ { common_pid: gdbus [ 2998] } hitcount: 1 count: 16 ++ { common_pid: rtkit-daemon [ 2052] } hitcount: 1 count: 8 ++ { common_pid: init [ 1] } hitcount: 2 count: 2 ++ ++ Totals: ++ Hits: 2116 ++ Entries: 51 ++ Dropped: 0 ++ ++ Similarly, if you key a hist trigger on syscall id, for example to ++ gather and display a list of systemwide syscall hits, you can use ++ the special .syscall modifier to display the syscall names rather ++ than raw ids. The example below keeps a running total of syscall ++ counts for the system during the run: ++ ++ # echo 'hist:key=id.syscall:val=hitcount' > \ ++ /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/hist ++ # trigger info: hist:keys=id.syscall:vals=hitcount:sort=hitcount:size=2048 [active] ++ ++ { id: sys_fsync [ 74] } hitcount: 1 ++ { id: sys_newuname [ 63] } hitcount: 1 ++ { id: sys_prctl [157] } hitcount: 1 ++ { id: sys_statfs [137] } hitcount: 1 ++ { id: sys_symlink [ 88] } hitcount: 1 ++ { id: sys_sendmmsg [307] } hitcount: 1 ++ { id: sys_semctl [ 66] } hitcount: 1 ++ { id: sys_readlink [ 89] } hitcount: 3 ++ { id: sys_bind [ 49] } hitcount: 3 ++ { id: sys_getsockname [ 51] } hitcount: 3 ++ { id: sys_unlink [ 87] } hitcount: 3 ++ { id: sys_rename [ 82] } hitcount: 4 ++ { id: unknown_syscall [ 58] } hitcount: 4 ++ { id: sys_connect [ 42] } hitcount: 4 ++ { id: sys_getpid [ 39] } hitcount: 4 ++ . ++ . ++ . ++ { id: sys_rt_sigprocmask [ 14] } hitcount: 952 ++ { id: sys_futex [202] } hitcount: 1534 ++ { id: sys_write [ 1] } hitcount: 2689 ++ { id: sys_setitimer [ 38] } hitcount: 2797 ++ { id: sys_read [ 0] } hitcount: 3202 ++ { id: sys_select [ 23] } hitcount: 3773 ++ { id: sys_writev [ 20] } hitcount: 4531 ++ { id: sys_poll [ 7] } hitcount: 8314 ++ { id: sys_recvmsg [ 47] } hitcount: 13738 ++ { id: sys_ioctl [ 16] } hitcount: 21843 ++ ++ Totals: ++ Hits: 67612 ++ Entries: 72 ++ Dropped: 0 ++ ++ The syscall counts above provide a rough overall picture of system ++ call activity on the system; we can see for example that the most ++ popular system call on this system was the 'sys_ioctl' system call. ++ ++ We can use 'compound' keys to refine that number and provide some ++ further insight as to which processes exactly contribute to the ++ overall ioctl count. ++ ++ The command below keeps a hitcount for every unique combination of ++ system call id and pid - the end result is essentially a table ++ that keeps a per-pid sum of system call hits. The results are ++ sorted using the system call id as the primary key, and the ++ hitcount sum as the secondary key: ++ ++ # echo 'hist:key=id.syscall,common_pid.execname:val=hitcount:sort=id,hitcount' > \ ++ /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/hist ++ # trigger info: hist:keys=id.syscall,common_pid.execname:vals=hitcount:sort=id.syscall,hitcount:size=2048 [active] ++ ++ { id: sys_read [ 0], common_pid: rtkit-daemon [ 1877] } hitcount: 1 ++ { id: sys_read [ 0], common_pid: gdbus [ 2976] } hitcount: 1 ++ { id: sys_read [ 0], common_pid: console-kit-dae [ 3400] } hitcount: 1 ++ { id: sys_read [ 0], common_pid: postgres [ 1865] } hitcount: 1 ++ { id: sys_read [ 0], common_pid: deja-dup-monito [ 3543] } hitcount: 2 ++ { id: sys_read [ 0], common_pid: NetworkManager [ 890] } hitcount: 2 ++ { id: sys_read [ 0], common_pid: evolution-calen [ 3048] } hitcount: 2 ++ { id: sys_read [ 0], common_pid: postgres [ 1864] } hitcount: 2 ++ { id: sys_read [ 0], common_pid: nm-applet [ 3022] } hitcount: 2 ++ { id: sys_read [ 0], common_pid: whoopsie [ 1212] } hitcount: 2 ++ . ++ . ++ . ++ { id: sys_ioctl [ 16], common_pid: bash [ 8479] } hitcount: 1 ++ { id: sys_ioctl [ 16], common_pid: bash [ 3472] } hitcount: 12 ++ { id: sys_ioctl [ 16], common_pid: gnome-terminal [ 3199] } hitcount: 16 ++ { id: sys_ioctl [ 16], common_pid: Xorg [ 1267] } hitcount: 1808 ++ { id: sys_ioctl [ 16], common_pid: compiz [ 2994] } hitcount: 5580 ++ . ++ . ++ . ++ { id: sys_waitid [247], common_pid: upstart-dbus-br [ 2690] } hitcount: 3 ++ { id: sys_waitid [247], common_pid: upstart-dbus-br [ 2688] } hitcount: 16 ++ { id: sys_inotify_add_watch [254], common_pid: gmain [ 975] } hitcount: 2 ++ { id: sys_inotify_add_watch [254], common_pid: gmain [ 3204] } hitcount: 4 ++ { id: sys_inotify_add_watch [254], common_pid: gmain [ 2888] } hitcount: 4 ++ { id: sys_inotify_add_watch [254], common_pid: gmain [ 3003] } hitcount: 4 ++ { id: sys_inotify_add_watch [254], common_pid: gmain [ 2873] } hitcount: 4 ++ { id: sys_inotify_add_watch [254], common_pid: gmain [ 3196] } hitcount: 6 ++ { id: sys_openat [257], common_pid: java [ 2623] } hitcount: 2 ++ { id: sys_eventfd2 [290], common_pid: ibus-ui-gtk3 [ 2760] } hitcount: 4 ++ { id: sys_eventfd2 [290], common_pid: compiz [ 2994] } hitcount: 6 ++ ++ Totals: ++ Hits: 31536 ++ Entries: 323 ++ Dropped: 0 ++ ++ The above list does give us a breakdown of the ioctl syscall by ++ pid, but it also gives us quite a bit more than that, which we ++ don't really care about at the moment. Since we know the syscall ++ id for sys_ioctl (16, displayed next to the sys_ioctl name), we ++ can use that to filter out all the other syscalls: ++ ++ # echo 'hist:key=id.syscall,common_pid.execname:val=hitcount:sort=id,hitcount if id == 16' > \ ++ /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/hist ++ # trigger info: hist:keys=id.syscall,common_pid.execname:vals=hitcount:sort=id.syscall,hitcount:size=2048 if id == 16 [active] ++ ++ { id: sys_ioctl [ 16], common_pid: gmain [ 2769] } hitcount: 1 ++ { id: sys_ioctl [ 16], common_pid: evolution-addre [ 8571] } hitcount: 1 ++ { id: sys_ioctl [ 16], common_pid: gmain [ 3003] } hitcount: 1 ++ { id: sys_ioctl [ 16], common_pid: gmain [ 2781] } hitcount: 1 ++ { id: sys_ioctl [ 16], common_pid: gmain [ 2829] } hitcount: 1 ++ { id: sys_ioctl [ 16], common_pid: bash [ 8726] } hitcount: 1 ++ { id: sys_ioctl [ 16], common_pid: bash [ 8508] } hitcount: 1 ++ { id: sys_ioctl [ 16], common_pid: gmain [ 2970] } hitcount: 1 ++ { id: sys_ioctl [ 16], common_pid: gmain [ 2768] } hitcount: 1 ++ . ++ . ++ . ++ { id: sys_ioctl [ 16], common_pid: pool [ 8559] } hitcount: 45 ++ { id: sys_ioctl [ 16], common_pid: pool [ 8555] } hitcount: 48 ++ { id: sys_ioctl [ 16], common_pid: pool [ 8551] } hitcount: 48 ++ { id: sys_ioctl [ 16], common_pid: avahi-daemon [ 896] } hitcount: 66 ++ { id: sys_ioctl [ 16], common_pid: Xorg [ 1267] } hitcount: 26674 ++ { id: sys_ioctl [ 16], common_pid: compiz [ 2994] } hitcount: 73443 ++ ++ Totals: ++ Hits: 101162 ++ Entries: 103 ++ Dropped: 0 ++ ++ The above output shows that 'compiz' and 'Xorg' are far and away ++ the heaviest ioctl callers (which might lead to questions about ++ whether they really need to be making all those calls and to ++ possible avenues for further investigation.) ++ ++ The compound key examples used a key and a sum value (hitcount) to ++ sort the output, but we can just as easily use two keys instead. ++ Here's an example where we use a compound key composed of the the ++ common_pid and size event fields. Sorting with pid as the primary ++ key and 'size' as the secondary key allows us to display an ++ ordered summary of the recvfrom sizes, with counts, received by ++ each process: ++ ++ # echo 'hist:key=common_pid.execname,size:val=hitcount:sort=common_pid,size' > \ ++ /sys/kernel/debug/tracing/events/syscalls/sys_enter_recvfrom/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_recvfrom/hist ++ # trigger info: hist:keys=common_pid.execname,size:vals=hitcount:sort=common_pid.execname,size:size=2048 [active] ++ ++ { common_pid: smbd [ 784], size: 4 } hitcount: 1 ++ { common_pid: dnsmasq [ 1412], size: 4096 } hitcount: 672 ++ { common_pid: postgres [ 1796], size: 1000 } hitcount: 6 ++ { common_pid: postgres [ 1867], size: 1000 } hitcount: 10 ++ { common_pid: bamfdaemon [ 2787], size: 28 } hitcount: 2 ++ { common_pid: bamfdaemon [ 2787], size: 14360 } hitcount: 1 ++ { common_pid: compiz [ 2994], size: 8 } hitcount: 1 ++ { common_pid: compiz [ 2994], size: 20 } hitcount: 11 ++ { common_pid: gnome-terminal [ 3199], size: 4 } hitcount: 2 ++ { common_pid: firefox [ 8817], size: 4 } hitcount: 1 ++ { common_pid: firefox [ 8817], size: 8 } hitcount: 5 ++ { common_pid: firefox [ 8817], size: 588 } hitcount: 2 ++ { common_pid: firefox [ 8817], size: 628 } hitcount: 1 ++ { common_pid: firefox [ 8817], size: 6944 } hitcount: 1 ++ { common_pid: firefox [ 8817], size: 408880 } hitcount: 2 ++ { common_pid: firefox [ 8822], size: 8 } hitcount: 2 ++ { common_pid: firefox [ 8822], size: 160 } hitcount: 2 ++ { common_pid: firefox [ 8822], size: 320 } hitcount: 2 ++ { common_pid: firefox [ 8822], size: 352 } hitcount: 1 ++ . ++ . ++ . ++ { common_pid: pool [ 8923], size: 1960 } hitcount: 10 ++ { common_pid: pool [ 8923], size: 2048 } hitcount: 10 ++ { common_pid: pool [ 8924], size: 1960 } hitcount: 10 ++ { common_pid: pool [ 8924], size: 2048 } hitcount: 10 ++ { common_pid: pool [ 8928], size: 1964 } hitcount: 4 ++ { common_pid: pool [ 8928], size: 1965 } hitcount: 2 ++ { common_pid: pool [ 8928], size: 2048 } hitcount: 6 ++ { common_pid: pool [ 8929], size: 1982 } hitcount: 1 ++ { common_pid: pool [ 8929], size: 2048 } hitcount: 1 ++ ++ Totals: ++ Hits: 2016 ++ Entries: 224 ++ Dropped: 0 ++ ++ The above example also illustrates the fact that although a compound ++ key is treated as a single entity for hashing purposes, the sub-keys ++ it's composed of can be accessed independently. ++ ++ The next example uses a string field as the hash key and ++ demonstrates how you can manually pause and continue a hist trigger. ++ In this example, we'll aggregate fork counts and don't expect a ++ large number of entries in the hash table, so we'll drop it to a ++ much smaller number, say 256: ++ ++ # echo 'hist:key=child_comm:val=hitcount:size=256' > \ ++ /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/sched/sched_process_fork/hist ++ # trigger info: hist:keys=child_comm:vals=hitcount:sort=hitcount:size=256 [active] ++ ++ { child_comm: dconf worker } hitcount: 1 ++ { child_comm: ibus-daemon } hitcount: 1 ++ { child_comm: whoopsie } hitcount: 1 ++ { child_comm: smbd } hitcount: 1 ++ { child_comm: gdbus } hitcount: 1 ++ { child_comm: kthreadd } hitcount: 1 ++ { child_comm: dconf worker } hitcount: 1 ++ { child_comm: evolution-alarm } hitcount: 2 ++ { child_comm: Socket Thread } hitcount: 2 ++ { child_comm: postgres } hitcount: 2 ++ { child_comm: bash } hitcount: 3 ++ { child_comm: compiz } hitcount: 3 ++ { child_comm: evolution-sourc } hitcount: 4 ++ { child_comm: dhclient } hitcount: 4 ++ { child_comm: pool } hitcount: 5 ++ { child_comm: nm-dispatcher.a } hitcount: 8 ++ { child_comm: firefox } hitcount: 8 ++ { child_comm: dbus-daemon } hitcount: 8 ++ { child_comm: glib-pacrunner } hitcount: 10 ++ { child_comm: evolution } hitcount: 23 ++ ++ Totals: ++ Hits: 89 ++ Entries: 20 ++ Dropped: 0 ++ ++ If we want to pause the hist trigger, we can simply append :pause to ++ the command that started the trigger. Notice that the trigger info ++ displays as [paused]: ++ ++ # echo 'hist:key=child_comm:val=hitcount:size=256:pause' >> \ ++ /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/sched/sched_process_fork/hist ++ # trigger info: hist:keys=child_comm:vals=hitcount:sort=hitcount:size=256 [paused] ++ ++ { child_comm: dconf worker } hitcount: 1 ++ { child_comm: kthreadd } hitcount: 1 ++ { child_comm: dconf worker } hitcount: 1 ++ { child_comm: gdbus } hitcount: 1 ++ { child_comm: ibus-daemon } hitcount: 1 ++ { child_comm: Socket Thread } hitcount: 2 ++ { child_comm: evolution-alarm } hitcount: 2 ++ { child_comm: smbd } hitcount: 2 ++ { child_comm: bash } hitcount: 3 ++ { child_comm: whoopsie } hitcount: 3 ++ { child_comm: compiz } hitcount: 3 ++ { child_comm: evolution-sourc } hitcount: 4 ++ { child_comm: pool } hitcount: 5 ++ { child_comm: postgres } hitcount: 6 ++ { child_comm: firefox } hitcount: 8 ++ { child_comm: dhclient } hitcount: 10 ++ { child_comm: emacs } hitcount: 12 ++ { child_comm: dbus-daemon } hitcount: 20 ++ { child_comm: nm-dispatcher.a } hitcount: 20 ++ { child_comm: evolution } hitcount: 35 ++ { child_comm: glib-pacrunner } hitcount: 59 ++ ++ Totals: ++ Hits: 199 ++ Entries: 21 ++ Dropped: 0 ++ ++ To manually continue having the trigger aggregate events, append ++ :cont instead. Notice that the trigger info displays as [active] ++ again, and the data has changed: ++ ++ # echo 'hist:key=child_comm:val=hitcount:size=256:cont' >> \ ++ /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger ++ ++ # cat /sys/kernel/debug/tracing/events/sched/sched_process_fork/hist ++ # trigger info: hist:keys=child_comm:vals=hitcount:sort=hitcount:size=256 [active] ++ ++ { child_comm: dconf worker } hitcount: 1 ++ { child_comm: dconf worker } hitcount: 1 ++ { child_comm: kthreadd } hitcount: 1 ++ { child_comm: gdbus } hitcount: 1 ++ { child_comm: ibus-daemon } hitcount: 1 ++ { child_comm: Socket Thread } hitcount: 2 ++ { child_comm: evolution-alarm } hitcount: 2 ++ { child_comm: smbd } hitcount: 2 ++ { child_comm: whoopsie } hitcount: 3 ++ { child_comm: compiz } hitcount: 3 ++ { child_comm: evolution-sourc } hitcount: 4 ++ { child_comm: bash } hitcount: 5 ++ { child_comm: pool } hitcount: 5 ++ { child_comm: postgres } hitcount: 6 ++ { child_comm: firefox } hitcount: 8 ++ { child_comm: dhclient } hitcount: 11 ++ { child_comm: emacs } hitcount: 12 ++ { child_comm: dbus-daemon } hitcount: 22 ++ { child_comm: nm-dispatcher.a } hitcount: 22 ++ { child_comm: evolution } hitcount: 35 ++ { child_comm: glib-pacrunner } hitcount: 59 ++ ++ Totals: ++ Hits: 206 ++ Entries: 21 ++ Dropped: 0 ++ ++ The previous example showed how to start and stop a hist trigger by ++ appending 'pause' and 'continue' to the hist trigger command. A ++ hist trigger can also be started in a paused state by initially ++ starting the trigger with ':pause' appended. This allows you to ++ start the trigger only when you're ready to start collecting data ++ and not before. For example, you could start the trigger in a ++ paused state, then unpause it and do something you want to measure, ++ then pause the trigger again when done. ++ ++ Of course, doing this manually can be difficult and error-prone, but ++ it is possible to automatically start and stop a hist trigger based ++ on some condition, via the enable_hist and disable_hist triggers. ++ ++ For example, suppose we wanted to take a look at the relative ++ weights in terms of skb length for each callpath that leads to a ++ netif_receieve_skb event when downloading a decent-sized file using ++ wget. ++ ++ First we set up an initially paused stacktrace trigger on the ++ netif_receive_skb event: ++ ++ # echo 'hist:key=stacktrace:vals=len:pause' > \ ++ /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger ++ ++ Next, we set up an 'enable_hist' trigger on the sched_process_exec ++ event, with an 'if filename==/usr/bin/wget' filter. The effect of ++ this new trigger is that it will 'unpause' the hist trigger we just ++ set up on netif_receive_skb if and only if it sees a ++ sched_process_exec event with a filename of '/usr/bin/wget'. When ++ that happens, all netif_receive_skb events are aggregated into a ++ hash table keyed on stacktrace: ++ ++ # echo 'enable_hist:net:netif_receive_skb if filename==/usr/bin/wget' > \ ++ /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger ++ ++ The aggregation continues until the netif_receive_skb is paused ++ again, which is what the following disable_hist event does by ++ creating a similar setup on the sched_process_exit event, using the ++ filter 'comm==wget': ++ ++ # echo 'disable_hist:net:netif_receive_skb if comm==wget' > \ ++ /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger ++ ++ Whenever a process exits and the comm field of the disable_hist ++ trigger filter matches 'comm==wget', the netif_receive_skb hist ++ trigger is disabled. ++ ++ The overall effect is that netif_receive_skb events are aggregated ++ into the hash table for only the duration of the wget. Executing a ++ wget command and then listing the 'hist' file will display the ++ output generated by the wget command: ++ ++ $ wget https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.19.xz ++ ++ # cat /sys/kernel/debug/tracing/events/net/netif_receive_skb/hist ++ # trigger info: hist:keys=stacktrace:vals=len:sort=hitcount:size=2048 [paused] ++ ++ { stacktrace: ++ __netif_receive_skb_core+0x46d/0x990 ++ __netif_receive_skb+0x18/0x60 ++ netif_receive_skb_internal+0x23/0x90 ++ napi_gro_receive+0xc8/0x100 ++ ieee80211_deliver_skb+0xd6/0x270 [mac80211] ++ ieee80211_rx_handlers+0xccf/0x22f0 [mac80211] ++ ieee80211_prepare_and_rx_handle+0x4e7/0xc40 [mac80211] ++ ieee80211_rx+0x31d/0x900 [mac80211] ++ iwlagn_rx_reply_rx+0x3db/0x6f0 [iwldvm] ++ iwl_rx_dispatch+0x8e/0xf0 [iwldvm] ++ iwl_pcie_irq_handler+0xe3c/0x12f0 [iwlwifi] ++ irq_thread_fn+0x20/0x50 ++ irq_thread+0x11f/0x150 ++ kthread+0xd2/0xf0 ++ ret_from_fork+0x42/0x70 ++ } hitcount: 85 len: 28884 ++ { stacktrace: ++ __netif_receive_skb_core+0x46d/0x990 ++ __netif_receive_skb+0x18/0x60 ++ netif_receive_skb_internal+0x23/0x90 ++ napi_gro_complete+0xa4/0xe0 ++ dev_gro_receive+0x23a/0x360 ++ napi_gro_receive+0x30/0x100 ++ ieee80211_deliver_skb+0xd6/0x270 [mac80211] ++ ieee80211_rx_handlers+0xccf/0x22f0 [mac80211] ++ ieee80211_prepare_and_rx_handle+0x4e7/0xc40 [mac80211] ++ ieee80211_rx+0x31d/0x900 [mac80211] ++ iwlagn_rx_reply_rx+0x3db/0x6f0 [iwldvm] ++ iwl_rx_dispatch+0x8e/0xf0 [iwldvm] ++ iwl_pcie_irq_handler+0xe3c/0x12f0 [iwlwifi] ++ irq_thread_fn+0x20/0x50 ++ irq_thread+0x11f/0x150 ++ kthread+0xd2/0xf0 ++ } hitcount: 98 len: 664329 ++ { stacktrace: ++ __netif_receive_skb_core+0x46d/0x990 ++ __netif_receive_skb+0x18/0x60 ++ process_backlog+0xa8/0x150 ++ net_rx_action+0x15d/0x340 ++ __do_softirq+0x114/0x2c0 ++ do_softirq_own_stack+0x1c/0x30 ++ do_softirq+0x65/0x70 ++ __local_bh_enable_ip+0xb5/0xc0 ++ ip_finish_output+0x1f4/0x840 ++ ip_output+0x6b/0xc0 ++ ip_local_out_sk+0x31/0x40 ++ ip_send_skb+0x1a/0x50 ++ udp_send_skb+0x173/0x2a0 ++ udp_sendmsg+0x2bf/0x9f0 ++ inet_sendmsg+0x64/0xa0 ++ sock_sendmsg+0x3d/0x50 ++ } hitcount: 115 len: 13030 ++ { stacktrace: ++ __netif_receive_skb_core+0x46d/0x990 ++ __netif_receive_skb+0x18/0x60 ++ netif_receive_skb_internal+0x23/0x90 ++ napi_gro_complete+0xa4/0xe0 ++ napi_gro_flush+0x6d/0x90 ++ iwl_pcie_irq_handler+0x92a/0x12f0 [iwlwifi] ++ irq_thread_fn+0x20/0x50 ++ irq_thread+0x11f/0x150 ++ kthread+0xd2/0xf0 ++ ret_from_fork+0x42/0x70 ++ } hitcount: 934 len: 5512212 ++ ++ Totals: ++ Hits: 1232 ++ Entries: 4 ++ Dropped: 0 ++ ++ The above shows all the netif_receive_skb callpaths and their total ++ lengths for the duration of the wget command. ++ ++ The 'clear' hist trigger param can be used to clear the hash table. ++ Suppose we wanted to try another run of the previous example but ++ this time also wanted to see the complete list of events that went ++ into the histogram. In order to avoid having to set everything up ++ again, we can just clear the histogram first: ++ ++ # echo 'hist:key=stacktrace:vals=len:clear' >> \ ++ /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger ++ ++ Just to verify that it is in fact cleared, here's what we now see in ++ the hist file: ++ ++ # cat /sys/kernel/debug/tracing/events/net/netif_receive_skb/hist ++ # trigger info: hist:keys=stacktrace:vals=len:sort=hitcount:size=2048 [paused] ++ ++ Totals: ++ Hits: 0 ++ Entries: 0 ++ Dropped: 0 ++ ++ Since we want to see the detailed list of every netif_receive_skb ++ event occurring during the new run, which are in fact the same ++ events being aggregated into the hash table, we add some additional ++ 'enable_event' events to the triggering sched_process_exec and ++ sched_process_exit events as such: ++ ++ # echo 'enable_event:net:netif_receive_skb if filename==/usr/bin/wget' > \ ++ /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger ++ ++ # echo 'disable_event:net:netif_receive_skb if comm==wget' > \ ++ /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger ++ ++ If you read the trigger files for the sched_process_exec and ++ sched_process_exit triggers, you should see two triggers for each: ++ one enabling/disabling the hist aggregation and the other ++ enabling/disabling the logging of events: ++ ++ # cat /sys/kernel/debug/tracing/events/sched/sched_process_exec/trigger ++ enable_event:net:netif_receive_skb:unlimited if filename==/usr/bin/wget ++ enable_hist:net:netif_receive_skb:unlimited if filename==/usr/bin/wget ++ ++ # cat /sys/kernel/debug/tracing/events/sched/sched_process_exit/trigger ++ enable_event:net:netif_receive_skb:unlimited if comm==wget ++ disable_hist:net:netif_receive_skb:unlimited if comm==wget ++ ++ In other words, whenever either of the sched_process_exec or ++ sched_process_exit events is hit and matches 'wget', it enables or ++ disables both the histogram and the event log, and what you end up ++ with is a hash table and set of events just covering the specified ++ duration. Run the wget command again: ++ ++ $ wget https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.19.xz ++ ++ Displaying the 'hist' file should show something similar to what you ++ saw in the last run, but this time you should also see the ++ individual events in the trace file: ++ ++ # cat /sys/kernel/debug/tracing/trace ++ ++ # tracer: nop ++ # ++ # entries-in-buffer/entries-written: 183/1426 #P:4 ++ # ++ # _-----=> irqs-off ++ # / _----=> need-resched ++ # | / _---=> hardirq/softirq ++ # || / _--=> preempt-depth ++ # ||| / delay ++ # TASK-PID CPU# |||| TIMESTAMP FUNCTION ++ # | | | |||| | | ++ wget-15108 [000] ..s1 31769.606929: netif_receive_skb: dev=lo skbaddr=ffff88009c353100 len=60 ++ wget-15108 [000] ..s1 31769.606999: netif_receive_skb: dev=lo skbaddr=ffff88009c353200 len=60 ++ dnsmasq-1382 [000] ..s1 31769.677652: netif_receive_skb: dev=lo skbaddr=ffff88009c352b00 len=130 ++ dnsmasq-1382 [000] ..s1 31769.685917: netif_receive_skb: dev=lo skbaddr=ffff88009c352200 len=138 ++ ##### CPU 2 buffer started #### ++ irq/29-iwlwifi-559 [002] ..s. 31772.031529: netif_receive_skb: dev=wlan0 skbaddr=ffff88009d433d00 len=2948 ++ irq/29-iwlwifi-559 [002] ..s. 31772.031572: netif_receive_skb: dev=wlan0 skbaddr=ffff88009d432200 len=1500 ++ irq/29-iwlwifi-559 [002] ..s. 31772.032196: netif_receive_skb: dev=wlan0 skbaddr=ffff88009d433100 len=2948 ++ irq/29-iwlwifi-559 [002] ..s. 31772.032761: netif_receive_skb: dev=wlan0 skbaddr=ffff88009d433000 len=2948 ++ irq/29-iwlwifi-559 [002] ..s. 31772.033220: netif_receive_skb: dev=wlan0 skbaddr=ffff88009d432e00 len=1500 ++ . ++ . ++ . ++ ++ The following example demonstrates how multiple hist triggers can be ++ attached to a given event. This capability can be useful for ++ creating a set of different summaries derived from the same set of ++ events, or for comparing the effects of different filters, among ++ other things. ++ ++ # echo 'hist:keys=skbaddr.hex:vals=len if len < 0' >> \ ++ /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger ++ # echo 'hist:keys=skbaddr.hex:vals=len if len > 4096' >> \ ++ /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger ++ # echo 'hist:keys=skbaddr.hex:vals=len if len == 256' >> \ ++ /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger ++ # echo 'hist:keys=skbaddr.hex:vals=len' >> \ ++ /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger ++ # echo 'hist:keys=len:vals=common_preempt_count' >> \ ++ /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger ++ ++ The above set of commands create four triggers differing only in ++ their filters, along with a completely different though fairly ++ nonsensical trigger. Note that in order to append multiple hist ++ triggers to the same file, you should use the '>>' operator to ++ append them ('>' will also add the new hist trigger, but will remove ++ any existing hist triggers beforehand). ++ ++ Displaying the contents of the 'hist' file for the event shows the ++ contents of all five histograms: ++ ++ # cat /sys/kernel/debug/tracing/events/net/netif_receive_skb/hist ++ ++ # event histogram ++ # ++ # trigger info: hist:keys=len:vals=hitcount,common_preempt_count:sort=hitcount:size=2048 [active] ++ # ++ ++ { len: 176 } hitcount: 1 common_preempt_count: 0 ++ { len: 223 } hitcount: 1 common_preempt_count: 0 ++ { len: 4854 } hitcount: 1 common_preempt_count: 0 ++ { len: 395 } hitcount: 1 common_preempt_count: 0 ++ { len: 177 } hitcount: 1 common_preempt_count: 0 ++ { len: 446 } hitcount: 1 common_preempt_count: 0 ++ { len: 1601 } hitcount: 1 common_preempt_count: 0 ++ . ++ . ++ . ++ { len: 1280 } hitcount: 66 common_preempt_count: 0 ++ { len: 116 } hitcount: 81 common_preempt_count: 40 ++ { len: 708 } hitcount: 112 common_preempt_count: 0 ++ { len: 46 } hitcount: 221 common_preempt_count: 0 ++ { len: 1264 } hitcount: 458 common_preempt_count: 0 ++ ++ Totals: ++ Hits: 1428 ++ Entries: 147 ++ Dropped: 0 ++ ++ ++ # event histogram ++ # ++ # trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 [active] ++ # ++ ++ { skbaddr: ffff8800baee5e00 } hitcount: 1 len: 130 ++ { skbaddr: ffff88005f3d5600 } hitcount: 1 len: 1280 ++ { skbaddr: ffff88005f3d4900 } hitcount: 1 len: 1280 ++ { skbaddr: ffff88009fed6300 } hitcount: 1 len: 115 ++ { skbaddr: ffff88009fe0ad00 } hitcount: 1 len: 115 ++ { skbaddr: ffff88008cdb1900 } hitcount: 1 len: 46 ++ { skbaddr: ffff880064b5ef00 } hitcount: 1 len: 118 ++ { skbaddr: ffff880044e3c700 } hitcount: 1 len: 60 ++ { skbaddr: ffff880100065900 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d46bd500 } hitcount: 1 len: 116 ++ { skbaddr: ffff88005f3d5f00 } hitcount: 1 len: 1280 ++ { skbaddr: ffff880100064700 } hitcount: 1 len: 365 ++ { skbaddr: ffff8800badb6f00 } hitcount: 1 len: 60 ++ . ++ . ++ . ++ { skbaddr: ffff88009fe0be00 } hitcount: 27 len: 24677 ++ { skbaddr: ffff88009fe0a400 } hitcount: 27 len: 23052 ++ { skbaddr: ffff88009fe0b700 } hitcount: 31 len: 25589 ++ { skbaddr: ffff88009fe0b600 } hitcount: 32 len: 27326 ++ { skbaddr: ffff88006a462800 } hitcount: 68 len: 71678 ++ { skbaddr: ffff88006a463700 } hitcount: 70 len: 72678 ++ { skbaddr: ffff88006a462b00 } hitcount: 71 len: 77589 ++ { skbaddr: ffff88006a463600 } hitcount: 73 len: 71307 ++ { skbaddr: ffff88006a462200 } hitcount: 81 len: 81032 ++ ++ Totals: ++ Hits: 1451 ++ Entries: 318 ++ Dropped: 0 ++ ++ ++ # event histogram ++ # ++ # trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 if len == 256 [active] ++ # ++ ++ ++ Totals: ++ Hits: 0 ++ Entries: 0 ++ Dropped: 0 ++ ++ ++ # event histogram ++ # ++ # trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 if len > 4096 [active] ++ # ++ ++ { skbaddr: ffff88009fd2c300 } hitcount: 1 len: 7212 ++ { skbaddr: ffff8800d2bcce00 } hitcount: 1 len: 7212 ++ { skbaddr: ffff8800d2bcd700 } hitcount: 1 len: 7212 ++ { skbaddr: ffff8800d2bcda00 } hitcount: 1 len: 21492 ++ { skbaddr: ffff8800ae2e2d00 } hitcount: 1 len: 7212 ++ { skbaddr: ffff8800d2bcdb00 } hitcount: 1 len: 7212 ++ { skbaddr: ffff88006a4df500 } hitcount: 1 len: 4854 ++ { skbaddr: ffff88008ce47b00 } hitcount: 1 len: 18636 ++ { skbaddr: ffff8800ae2e2200 } hitcount: 1 len: 12924 ++ { skbaddr: ffff88005f3e1000 } hitcount: 1 len: 4356 ++ { skbaddr: ffff8800d2bcdc00 } hitcount: 2 len: 24420 ++ { skbaddr: ffff8800d2bcc200 } hitcount: 2 len: 12996 ++ ++ Totals: ++ Hits: 14 ++ Entries: 12 ++ Dropped: 0 ++ ++ ++ # event histogram ++ # ++ # trigger info: hist:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 if len < 0 [active] ++ # ++ ++ ++ Totals: ++ Hits: 0 ++ Entries: 0 ++ Dropped: 0 ++ ++ Named triggers can be used to have triggers share a common set of ++ histogram data. This capability is mostly useful for combining the ++ output of events generated by tracepoints contained inside inline ++ functions, but names can be used in a hist trigger on any event. ++ For example, these two triggers when hit will update the same 'len' ++ field in the shared 'foo' histogram data: ++ ++ # echo 'hist:name=foo:keys=skbaddr.hex:vals=len' > \ ++ /sys/kernel/debug/tracing/events/net/netif_receive_skb/trigger ++ # echo 'hist:name=foo:keys=skbaddr.hex:vals=len' > \ ++ /sys/kernel/debug/tracing/events/net/netif_rx/trigger ++ ++ You can see that they're updating common histogram data by reading ++ each event's hist files at the same time: ++ ++ # cat /sys/kernel/debug/tracing/events/net/netif_receive_skb/hist; ++ cat /sys/kernel/debug/tracing/events/net/netif_rx/hist ++ ++ # event histogram ++ # ++ # trigger info: hist:name=foo:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 [active] ++ # ++ ++ { skbaddr: ffff88000ad53500 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800af5a1500 } hitcount: 1 len: 76 ++ { skbaddr: ffff8800d62a1900 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d2bccb00 } hitcount: 1 len: 468 ++ { skbaddr: ffff8800d3c69900 } hitcount: 1 len: 46 ++ { skbaddr: ffff88009ff09100 } hitcount: 1 len: 52 ++ { skbaddr: ffff88010f13ab00 } hitcount: 1 len: 168 ++ { skbaddr: ffff88006a54f400 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d2bcc500 } hitcount: 1 len: 260 ++ { skbaddr: ffff880064505000 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800baf24e00 } hitcount: 1 len: 32 ++ { skbaddr: ffff88009fe0ad00 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d3edff00 } hitcount: 1 len: 44 ++ { skbaddr: ffff88009fe0b400 } hitcount: 1 len: 168 ++ { skbaddr: ffff8800a1c55a00 } hitcount: 1 len: 40 ++ { skbaddr: ffff8800d2bcd100 } hitcount: 1 len: 40 ++ { skbaddr: ffff880064505f00 } hitcount: 1 len: 174 ++ { skbaddr: ffff8800a8bff200 } hitcount: 1 len: 160 ++ { skbaddr: ffff880044e3cc00 } hitcount: 1 len: 76 ++ { skbaddr: ffff8800a8bfe700 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d2bcdc00 } hitcount: 1 len: 32 ++ { skbaddr: ffff8800a1f64800 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d2bcde00 } hitcount: 1 len: 988 ++ { skbaddr: ffff88006a5dea00 } hitcount: 1 len: 46 ++ { skbaddr: ffff88002e37a200 } hitcount: 1 len: 44 ++ { skbaddr: ffff8800a1f32c00 } hitcount: 2 len: 676 ++ { skbaddr: ffff88000ad52600 } hitcount: 2 len: 107 ++ { skbaddr: ffff8800a1f91e00 } hitcount: 2 len: 92 ++ { skbaddr: ffff8800af5a0200 } hitcount: 2 len: 142 ++ { skbaddr: ffff8800d2bcc600 } hitcount: 2 len: 220 ++ { skbaddr: ffff8800ba36f500 } hitcount: 2 len: 92 ++ { skbaddr: ffff8800d021f800 } hitcount: 2 len: 92 ++ { skbaddr: ffff8800a1f33600 } hitcount: 2 len: 675 ++ { skbaddr: ffff8800a8bfff00 } hitcount: 3 len: 138 ++ { skbaddr: ffff8800d62a1300 } hitcount: 3 len: 138 ++ { skbaddr: ffff88002e37a100 } hitcount: 4 len: 184 ++ { skbaddr: ffff880064504400 } hitcount: 4 len: 184 ++ { skbaddr: ffff8800a8bfec00 } hitcount: 4 len: 184 ++ { skbaddr: ffff88000ad53700 } hitcount: 5 len: 230 ++ { skbaddr: ffff8800d2bcdb00 } hitcount: 5 len: 196 ++ { skbaddr: ffff8800a1f90000 } hitcount: 6 len: 276 ++ { skbaddr: ffff88006a54f900 } hitcount: 6 len: 276 ++ ++ Totals: ++ Hits: 81 ++ Entries: 42 ++ Dropped: 0 ++ # event histogram ++ # ++ # trigger info: hist:name=foo:keys=skbaddr.hex:vals=hitcount,len:sort=hitcount:size=2048 [active] ++ # ++ ++ { skbaddr: ffff88000ad53500 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800af5a1500 } hitcount: 1 len: 76 ++ { skbaddr: ffff8800d62a1900 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d2bccb00 } hitcount: 1 len: 468 ++ { skbaddr: ffff8800d3c69900 } hitcount: 1 len: 46 ++ { skbaddr: ffff88009ff09100 } hitcount: 1 len: 52 ++ { skbaddr: ffff88010f13ab00 } hitcount: 1 len: 168 ++ { skbaddr: ffff88006a54f400 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d2bcc500 } hitcount: 1 len: 260 ++ { skbaddr: ffff880064505000 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800baf24e00 } hitcount: 1 len: 32 ++ { skbaddr: ffff88009fe0ad00 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d3edff00 } hitcount: 1 len: 44 ++ { skbaddr: ffff88009fe0b400 } hitcount: 1 len: 168 ++ { skbaddr: ffff8800a1c55a00 } hitcount: 1 len: 40 ++ { skbaddr: ffff8800d2bcd100 } hitcount: 1 len: 40 ++ { skbaddr: ffff880064505f00 } hitcount: 1 len: 174 ++ { skbaddr: ffff8800a8bff200 } hitcount: 1 len: 160 ++ { skbaddr: ffff880044e3cc00 } hitcount: 1 len: 76 ++ { skbaddr: ffff8800a8bfe700 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d2bcdc00 } hitcount: 1 len: 32 ++ { skbaddr: ffff8800a1f64800 } hitcount: 1 len: 46 ++ { skbaddr: ffff8800d2bcde00 } hitcount: 1 len: 988 ++ { skbaddr: ffff88006a5dea00 } hitcount: 1 len: 46 ++ { skbaddr: ffff88002e37a200 } hitcount: 1 len: 44 ++ { skbaddr: ffff8800a1f32c00 } hitcount: 2 len: 676 ++ { skbaddr: ffff88000ad52600 } hitcount: 2 len: 107 ++ { skbaddr: ffff8800a1f91e00 } hitcount: 2 len: 92 ++ { skbaddr: ffff8800af5a0200 } hitcount: 2 len: 142 ++ { skbaddr: ffff8800d2bcc600 } hitcount: 2 len: 220 ++ { skbaddr: ffff8800ba36f500 } hitcount: 2 len: 92 ++ { skbaddr: ffff8800d021f800 } hitcount: 2 len: 92 ++ { skbaddr: ffff8800a1f33600 } hitcount: 2 len: 675 ++ { skbaddr: ffff8800a8bfff00 } hitcount: 3 len: 138 ++ { skbaddr: ffff8800d62a1300 } hitcount: 3 len: 138 ++ { skbaddr: ffff88002e37a100 } hitcount: 4 len: 184 ++ { skbaddr: ffff880064504400 } hitcount: 4 len: 184 ++ { skbaddr: ffff8800a8bfec00 } hitcount: 4 len: 184 ++ { skbaddr: ffff88000ad53700 } hitcount: 5 len: 230 ++ { skbaddr: ffff8800d2bcdb00 } hitcount: 5 len: 196 ++ { skbaddr: ffff8800a1f90000 } hitcount: 6 len: 276 ++ { skbaddr: ffff88006a54f900 } hitcount: 6 len: 276 ++ ++ Totals: ++ Hits: 81 ++ Entries: 42 ++ Dropped: 0 ++ ++ And here's an example that shows how to combine histogram data from ++ any two events even if they don't share any 'compatible' fields ++ other than 'hitcount' and 'stacktrace'. These commands create a ++ couple of triggers named 'bar' using those fields: ++ ++ # echo 'hist:name=bar:key=stacktrace:val=hitcount' > \ ++ /sys/kernel/debug/tracing/events/sched/sched_process_fork/trigger ++ # echo 'hist:name=bar:key=stacktrace:val=hitcount' > \ ++ /sys/kernel/debug/tracing/events/net/netif_rx/trigger ++ ++ And displaying the output of either shows some interesting if ++ somewhat confusing output: ++ ++ # cat /sys/kernel/debug/tracing/events/sched/sched_process_fork/hist ++ # cat /sys/kernel/debug/tracing/events/net/netif_rx/hist ++ ++ # event histogram ++ # ++ # trigger info: hist:name=bar:keys=stacktrace:vals=hitcount:sort=hitcount:size=2048 [active] ++ # ++ ++ { stacktrace: ++ _do_fork+0x18e/0x330 ++ kernel_thread+0x29/0x30 ++ kthreadd+0x154/0x1b0 ++ ret_from_fork+0x3f/0x70 ++ } hitcount: 1 ++ { stacktrace: ++ netif_rx_internal+0xb2/0xd0 ++ netif_rx_ni+0x20/0x70 ++ dev_loopback_xmit+0xaa/0xd0 ++ ip_mc_output+0x126/0x240 ++ ip_local_out_sk+0x31/0x40 ++ igmp_send_report+0x1e9/0x230 ++ igmp_timer_expire+0xe9/0x120 ++ call_timer_fn+0x39/0xf0 ++ run_timer_softirq+0x1e1/0x290 ++ __do_softirq+0xfd/0x290 ++ irq_exit+0x98/0xb0 ++ smp_apic_timer_interrupt+0x4a/0x60 ++ apic_timer_interrupt+0x6d/0x80 ++ cpuidle_enter+0x17/0x20 ++ call_cpuidle+0x3b/0x60 ++ cpu_startup_entry+0x22d/0x310 ++ } hitcount: 1 ++ { stacktrace: ++ netif_rx_internal+0xb2/0xd0 ++ netif_rx_ni+0x20/0x70 ++ dev_loopback_xmit+0xaa/0xd0 ++ ip_mc_output+0x17f/0x240 ++ ip_local_out_sk+0x31/0x40 ++ ip_send_skb+0x1a/0x50 ++ udp_send_skb+0x13e/0x270 ++ udp_sendmsg+0x2bf/0x980 ++ inet_sendmsg+0x67/0xa0 ++ sock_sendmsg+0x38/0x50 ++ SYSC_sendto+0xef/0x170 ++ SyS_sendto+0xe/0x10 ++ entry_SYSCALL_64_fastpath+0x12/0x6a ++ } hitcount: 2 ++ { stacktrace: ++ netif_rx_internal+0xb2/0xd0 ++ netif_rx+0x1c/0x60 ++ loopback_xmit+0x6c/0xb0 ++ dev_hard_start_xmit+0x219/0x3a0 ++ __dev_queue_xmit+0x415/0x4f0 ++ dev_queue_xmit_sk+0x13/0x20 ++ ip_finish_output2+0x237/0x340 ++ ip_finish_output+0x113/0x1d0 ++ ip_output+0x66/0xc0 ++ ip_local_out_sk+0x31/0x40 ++ ip_send_skb+0x1a/0x50 ++ udp_send_skb+0x16d/0x270 ++ udp_sendmsg+0x2bf/0x980 ++ inet_sendmsg+0x67/0xa0 ++ sock_sendmsg+0x38/0x50 ++ ___sys_sendmsg+0x14e/0x270 ++ } hitcount: 76 ++ { stacktrace: ++ netif_rx_internal+0xb2/0xd0 ++ netif_rx+0x1c/0x60 ++ loopback_xmit+0x6c/0xb0 ++ dev_hard_start_xmit+0x219/0x3a0 ++ __dev_queue_xmit+0x415/0x4f0 ++ dev_queue_xmit_sk+0x13/0x20 ++ ip_finish_output2+0x237/0x340 ++ ip_finish_output+0x113/0x1d0 ++ ip_output+0x66/0xc0 ++ ip_local_out_sk+0x31/0x40 ++ ip_send_skb+0x1a/0x50 ++ udp_send_skb+0x16d/0x270 ++ udp_sendmsg+0x2bf/0x980 ++ inet_sendmsg+0x67/0xa0 ++ sock_sendmsg+0x38/0x50 ++ ___sys_sendmsg+0x269/0x270 ++ } hitcount: 77 ++ { stacktrace: ++ netif_rx_internal+0xb2/0xd0 ++ netif_rx+0x1c/0x60 ++ loopback_xmit+0x6c/0xb0 ++ dev_hard_start_xmit+0x219/0x3a0 ++ __dev_queue_xmit+0x415/0x4f0 ++ dev_queue_xmit_sk+0x13/0x20 ++ ip_finish_output2+0x237/0x340 ++ ip_finish_output+0x113/0x1d0 ++ ip_output+0x66/0xc0 ++ ip_local_out_sk+0x31/0x40 ++ ip_send_skb+0x1a/0x50 ++ udp_send_skb+0x16d/0x270 ++ udp_sendmsg+0x2bf/0x980 ++ inet_sendmsg+0x67/0xa0 ++ sock_sendmsg+0x38/0x50 ++ SYSC_sendto+0xef/0x170 ++ } hitcount: 88 ++ { stacktrace: ++ _do_fork+0x18e/0x330 ++ SyS_clone+0x19/0x20 ++ entry_SYSCALL_64_fastpath+0x12/0x6a ++ } hitcount: 244 ++ ++ Totals: ++ Hits: 489 ++ Entries: 7 ++ Dropped: 0 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 775fd2613..aca441c6c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 c7fd1a9b7..271e261db 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: Sun, 22 Oct 2017 23:39:39 +0200 +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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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. @@ -14,7 +14,6 @@ callback is running. Reported-by: Anna-Maria Gleixner Signed-off-by: Thomas Gleixner -Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 6 +++--- 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 new file mode 100644 index 000000000..8e12ef1f5 --- /dev/null +++ b/debian/patches/features/all/rt/0002-tracing-Add-Documentation-for-log2-modifier.patch @@ -0,0 +1,24 @@ +From: Tom Zanussi +Date: Fri, 17 Nov 2017 14:32:41 -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 + +Add a line for the log2 modifier, to keep it aligned with +tracing/README. + +Signed-off-by: Tom Zanussi +Signed-off-by: Sebastian Andrzej Siewior +--- + Documentation/trace/histogram.txt | 1 + + 1 file changed, 1 insertion(+) + +--- a/Documentation/trace/histogram.txt ++++ b/Documentation/trace/histogram.txt +@@ -73,6 +73,7 @@ + .sym-offset display an address as a symbol and offset + .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 + + Note that in general the semantics of a given field aren't + interpreted when applying a modifier to it, but there are some 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 7856309b5..f9b0925e3 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 ae156cadb..ee3501703 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -9,6 +9,7 @@ members to the struct definition and document the purpose of expires_next more precisely. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 8 ++++---- diff --git a/debian/patches/features/all/rt/0010-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 similarity index 95% rename from debian/patches/features/all/rt/0010-tracing-Add-support-to-detect-and-avoid-duplicates.patch rename to debian/patches/features/all/rt/0003-tracing-Add-support-to-detect-and-avoid-duplicates.patch index 35c142e5a..85e8ad5e8 100644 --- a/debian/patches/features/all/rt/0010-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, 22 Sep 2017 14:59:41 -0500 -Subject: [PATCH 10/42] tracing: Add support to detect and avoid duplicates -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:42 -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 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 @@ -42,6 +42,7 @@ had the same key. [1] http://lkml.kernel.org/r/cover.1498510759.git.tom.zanussi@linux.intel.com Signed-off-by: Vedang Patel +Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- kernel/trace/tracing_map.c | 41 ++++++++++++++++++++++++++++++++++++----- 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 74ad78151..2d483dbf4 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 247a8bd0c..873045b81 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -17,6 +17,7 @@ schedule_hrtimeout_range_clock(). No functional change. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 2 +- diff --git a/debian/patches/features/all/rt/0011-tracing-Remove-code-which-merges-duplicates.patch b/debian/patches/features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch similarity index 96% rename from debian/patches/features/all/rt/0011-tracing-Remove-code-which-merges-duplicates.patch rename to debian/patches/features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch index 48f677f79..6044bc4e3 100644 --- a/debian/patches/features/all/rt/0011-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, 22 Sep 2017 14:59:42 -0500 -Subject: [PATCH 11/42] tracing: Remove code which merges duplicates -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:43 -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 We now have the logic to detect and remove duplicates in the tracing_map hash table. The code which merges duplicates in the @@ -11,6 +11,7 @@ that any rare race condition which might cause duplicates does not go unnoticed. Signed-off-by: Vedang Patel +Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- kernel/trace/trace_events_hist.c | 11 ----- 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 63bf44800..463888660 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 3223e8b2c..1f6fe340b 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,13 +1,14 @@ 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 is not considered, when a hrtimer is initialized. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 6 +++--- diff --git a/debian/patches/features/all/rt/0012-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 similarity index 84% rename from debian/patches/features/all/rt/0012-ring-buffer-Add-interface-for-setting-absolute-time-.patch rename to debian/patches/features/all/rt/0005-ring-buffer-Add-interface-for-setting-absolute-time-.patch index cd94a6d1d..34697198f 100644 --- a/debian/patches/features/all/rt/0012-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,16 +1,13 @@ From: Tom Zanussi -Date: Fri, 22 Sep 2017 14:59:43 -0500 -Subject: [PATCH 12/42] ring-buffer: Add interface for setting absolute time +Date: Fri, 17 Nov 2017 14:32:44 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 deltas for a trace array. -This resets the buffer to prevent a mix of time deltas and absolute -timestamps. - Only the interface is added here; a subsequent patch will add the underlying implementation. @@ -20,9 +17,9 @@ Signed-off-by: Sebastian Andrzej Siewior --- include/linux/ring_buffer.h | 2 ++ kernel/trace/ring_buffer.c | 11 +++++++++++ - kernel/trace/trace.c | 40 +++++++++++++++++++++++++++++++++++++++- + kernel/trace/trace.c | 33 ++++++++++++++++++++++++++++++++- kernel/trace/trace.h | 3 +++ - 4 files changed, 55 insertions(+), 1 deletion(-) + 4 files changed, 48 insertions(+), 1 deletion(-) --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h @@ -73,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior (EVENT_FILE_FL_SOFT_DISABLED | EVENT_FILE_FL_FILTERED)) && (entry = this_cpu_read(trace_buffered_event))) { /* Try to use the per cpu buffer first */ -@@ -6297,6 +6297,44 @@ static int tracing_clock_open(struct ino +@@ -6297,6 +6297,37 @@ static int tracing_clock_open(struct ino return ret; } @@ -99,16 +96,9 @@ Signed-off-by: Sebastian Andrzej Siewior + + ring_buffer_set_time_stamp_abs(tr->trace_buffer.buffer, abs); + -+ /* -+ * New timestamps may not be consistent with the previous setting. -+ * Reset the buffer so that it doesn't have incomparable timestamps. -+ */ -+ tracing_reset_online_cpus(&tr->trace_buffer); -+ +#ifdef CONFIG_TRACER_MAX_TRACE + if (tr->max_buffer.buffer) + ring_buffer_set_time_stamp_abs(tr->max_buffer.buffer, abs); -+ tracing_reset_online_cpus(&tr->max_buffer); +#endif + out: + mutex_unlock(&trace_types_lock); 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 b7f91f0db..10bcee88d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 938a0ecdb..58d83ce7d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz POSIX specification defines, that relative CLOCK_REALTIME timers are not affected by clock modifications. Those timers have to use CLOCK_MONOTONIC @@ -17,8 +17,8 @@ Check whether the mode has the HRTIMER_MODE_REL bit set instead of comparing with HRTIMER_MODE_ABS. Fixes: 597d0275736d ("timers: Framework for identifying pinned timers") - Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 7 ++++++- diff --git a/debian/patches/features/all/rt/0013-ring-buffer-Redefine-the-unimplemented-RINGBUF_TIME_.patch b/debian/patches/features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch similarity index 86% rename from debian/patches/features/all/rt/0013-ring-buffer-Redefine-the-unimplemented-RINGBUF_TIME_.patch rename to debian/patches/features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch index e71f87c02..4ebcca750 100644 --- a/debian/patches/features/all/rt/0013-ring-buffer-Redefine-the-unimplemented-RINGBUF_TIME_.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, 22 Sep 2017 14:59:44 -0500 -Subject: [PATCH 13/42] ring-buffer: Redefine the unimplemented - RINGBUF_TIME_TIME_STAMP -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:45 -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 RINGBUF_TYPE_TIME_STAMP is defined but not used, and from what I can gather was reserved for something like an absolute timestamp feature @@ -25,8 +25,8 @@ Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- include/linux/ring_buffer.h | 12 ++--- - kernel/trace/ring_buffer.c | 105 +++++++++++++++++++++++++++++++------------- - 2 files changed, 83 insertions(+), 34 deletions(-) + kernel/trace/ring_buffer.c | 104 ++++++++++++++++++++++++++++++++------------ + 2 files changed, 83 insertions(+), 33 deletions(-) --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h @@ -144,13 +144,11 @@ Signed-off-by: Sebastian Andrzej Siewior /* Flag when events were overwritten */ #define RB_MISSED_EVENTS (1 << 31) /* Missed count stored at end */ -@@ -2220,13 +2246,16 @@ rb_move_tail(struct ring_buffer_per_cpu - } +@@ -2221,12 +2247,15 @@ rb_move_tail(struct ring_buffer_per_cpu /* Slow path, do not inline */ --static noinline struct ring_buffer_event * + static noinline struct ring_buffer_event * -rb_add_time_stamp(struct ring_buffer_event *event, u64 delta) -+static struct noinline ring_buffer_event * +rb_add_time_stamp(struct ring_buffer_event *event, u64 delta, bool abs) { - event->type_len = RINGBUF_TYPE_TIME_EXTEND; @@ -186,18 +184,7 @@ Signed-off-by: Sebastian Andrzej Siewior event = skip_time_extend(event); /* array[0] holds the actual length for the discarded event */ -@@ -2488,6 +2519,10 @@ rb_update_write_stamp(struct ring_buffer - { - u64 delta; - -+ /* In TIME_STAMP mode, write_stamp is unused, nothing to do */ -+ if (event->type_len == RINGBUF_TYPE_TIME_STAMP) -+ return; -+ - /* - * The event first in the commit queue updates the - * time stamp. -@@ -2501,9 +2536,7 @@ rb_update_write_stamp(struct ring_buffer +@@ -2501,10 +2532,11 @@ rb_update_write_stamp(struct ring_buffer cpu_buffer->write_stamp = cpu_buffer->commit_page->page->time_stamp; else if (event->type_len == RINGBUF_TYPE_TIME_EXTEND) { @@ -206,9 +193,13 @@ Signed-off-by: Sebastian Andrzej Siewior - delta += event->time_delta; + delta = ring_buffer_event_time_stamp(event); cpu_buffer->write_stamp += delta; ++ } else if (event->type_len == RINGBUF_TYPE_TIME_STAMP) { ++ delta = ring_buffer_event_time_stamp(event); ++ cpu_buffer->write_stamp = delta; } else cpu_buffer->write_stamp += event->time_delta; -@@ -2657,7 +2690,7 @@ static struct ring_buffer_event * + } +@@ -2657,7 +2689,7 @@ static struct ring_buffer_event * * If this is the first commit on the page, then it has the same * timestamp as the page itself. */ @@ -217,7 +208,7 @@ Signed-off-by: Sebastian Andrzej Siewior info->delta = 0; /* See if we shot pass the end of this buffer page */ -@@ -2735,8 +2768,11 @@ rb_reserve_next_event(struct ring_buffer +@@ -2735,8 +2767,11 @@ rb_reserve_next_event(struct ring_buffer /* make sure this diff is calculated here */ barrier(); @@ -231,7 +222,7 @@ Signed-off-by: Sebastian Andrzej Siewior info.delta = diff; if (unlikely(test_time_stamp(info.delta))) rb_handle_timestamp(cpu_buffer, &info); -@@ -3418,14 +3454,12 @@ rb_update_read_stamp(struct ring_buffer_ +@@ -3418,14 +3453,13 @@ rb_update_read_stamp(struct ring_buffer_ return; case RINGBUF_TYPE_TIME_EXTEND: @@ -244,11 +235,12 @@ Signed-off-by: Sebastian Andrzej Siewior case RINGBUF_TYPE_TIME_STAMP: - /* FIXME: not implemented */ -+ /* In TIME_STAMP mode, write_stamp is unused, nothing to do */ ++ delta = ring_buffer_event_time_stamp(event); ++ cpu_buffer->read_stamp = delta; return; case RINGBUF_TYPE_DATA: -@@ -3449,14 +3483,12 @@ rb_update_iter_read_stamp(struct ring_bu +@@ -3449,14 +3483,13 @@ rb_update_iter_read_stamp(struct ring_bu return; case RINGBUF_TYPE_TIME_EXTEND: @@ -261,11 +253,12 @@ Signed-off-by: Sebastian Andrzej Siewior case RINGBUF_TYPE_TIME_STAMP: - /* FIXME: not implemented */ -+ /* In TIME_STAMP mode, write_stamp is unused, nothing to do */ ++ delta = ring_buffer_event_time_stamp(event); ++ iter->read_stamp = delta; return; case RINGBUF_TYPE_DATA: -@@ -3680,6 +3712,8 @@ rb_buffer_peek(struct ring_buffer_per_cp +@@ -3680,6 +3713,8 @@ rb_buffer_peek(struct ring_buffer_per_cp struct buffer_page *reader; int nr_loops = 0; @@ -274,7 +267,7 @@ Signed-off-by: Sebastian Andrzej Siewior again: /* * We repeat when a time extend is encountered. -@@ -3716,12 +3750,17 @@ rb_buffer_peek(struct ring_buffer_per_cp +@@ -3716,12 +3751,17 @@ rb_buffer_peek(struct ring_buffer_per_cp goto again; case RINGBUF_TYPE_TIME_STAMP: @@ -294,7 +287,7 @@ Signed-off-by: Sebastian Andrzej Siewior *ts = cpu_buffer->read_stamp + event->time_delta; ring_buffer_normalize_time_stamp(cpu_buffer->buffer, cpu_buffer->cpu, ts); -@@ -3746,6 +3785,9 @@ rb_iter_peek(struct ring_buffer_iter *it +@@ -3746,6 +3786,9 @@ rb_iter_peek(struct ring_buffer_iter *it struct ring_buffer_event *event; int nr_loops = 0; @@ -304,7 +297,7 @@ Signed-off-by: Sebastian Andrzej Siewior cpu_buffer = iter->cpu_buffer; buffer = cpu_buffer->buffer; -@@ -3798,12 +3840,17 @@ rb_iter_peek(struct ring_buffer_iter *it +@@ -3798,12 +3841,17 @@ rb_iter_peek(struct ring_buffer_iter *it goto again; case RINGBUF_TYPE_TIME_STAMP: 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 a9fb914e3..4b9cb2385 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4182a36bb..7384c9dbc 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz It's not obvious that the HRTIMER_MODE variants are bit combinations because all modes are hard coded constants. @@ -12,6 +12,7 @@ modes which combine bits. While at it get rid of the ugly tail comments. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 16 +++++++++++----- 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 new file mode 100644 index 000000000..c83d6c08b --- /dev/null +++ b/debian/patches/features/all/rt/0007-tracing-Add-timestamp_mode-trace-file.patch @@ -0,0 +1,134 @@ +From: Tom Zanussi +Date: Fri, 17 Nov 2017 14:32:46 -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 + +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 +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 +the ring buffer is in absolute mode, timestamps written while absolute +mode is in effect take up more space in the buffer, and are not as +efficient). + +Signed-off-by: Tom Zanussi +Signed-off-by: Sebastian Andrzej Siewior +--- + Documentation/trace/ftrace.txt | 24 ++++++++++++++++++++ + kernel/trace/trace.c | 47 +++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 71 insertions(+) + +--- a/Documentation/trace/ftrace.txt ++++ b/Documentation/trace/ftrace.txt +@@ -539,6 +539,30 @@ After mounting tracefs you will have acc + + See events.txt for more information. + ++ timestamp_mode: ++ ++ Certain tracers may change the timestamp mode used when ++ logging trace events into the event buffer. Events with ++ different modes can coexist within a buffer but the mode in ++ effect when an event is logged determines which timestamp mode ++ is used for that event. The default timestamp mode is ++ 'delta'. ++ ++ Usual timestamp modes for tracing: ++ ++ # cat timestamp_mode ++ [delta] absolute ++ ++ The timestamp mode with the square brackets around it is the ++ one in effect. ++ ++ delta: Default timestamp mode - timestamp is a delta against ++ a per-buffer timestamp. ++ ++ absolute: The timestamp is a full timestamp, not a delta ++ against some other value. As such it takes up more ++ space and is less efficient. ++ + hwlat_detector: + + Directory for the Hardware Latency Detector. +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -4531,6 +4531,9 @@ static const char readme_msg[] = + #ifdef CONFIG_X86_64 + " x86-tsc: TSC cycle counter\n" + #endif ++ "\n timestamp_mode\t-view the mode used to timestamp events\n" ++ " delta: Delta difference against a buffer-wide timestamp\n" ++ " absolute: Absolute (standalone) timestamp\n" + "\n trace_marker\t\t- Writes into this file writes into the kernel buffer\n" + "\n trace_marker_raw\t\t- Writes into this file writes binary data into the kernel buffer\n" + " tracing_cpumask\t- Limit which CPUs to trace\n" +@@ -6298,6 +6301,40 @@ static int tracing_clock_open(struct ino + return ret; + } + ++static int tracing_time_stamp_mode_show(struct seq_file *m, void *v) ++{ ++ struct trace_array *tr = m->private; ++ ++ mutex_lock(&trace_types_lock); ++ ++ if (ring_buffer_time_stamp_abs(tr->trace_buffer.buffer)) ++ seq_puts(m, "delta [absolute]\n"); ++ else ++ seq_puts(m, "[delta] absolute\n"); ++ ++ mutex_unlock(&trace_types_lock); ++ ++ return 0; ++} ++ ++static int tracing_time_stamp_mode_open(struct inode *inode, struct file *file) ++{ ++ struct trace_array *tr = inode->i_private; ++ int ret; ++ ++ if (tracing_disabled) ++ return -ENODEV; ++ ++ if (trace_array_get(tr)) ++ return -ENODEV; ++ ++ ret = single_open(file, tracing_time_stamp_mode_show, inode->i_private); ++ if (ret < 0) ++ trace_array_put(tr); ++ ++ return ret; ++} ++ + int tracing_set_time_stamp_abs(struct trace_array *tr, bool abs) + { + int ret = 0; +@@ -6576,6 +6613,13 @@ static const struct file_operations trac + .write = tracing_clock_write, + }; + ++static const struct file_operations trace_time_stamp_mode_fops = { ++ .open = tracing_time_stamp_mode_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = tracing_single_release_tr, ++}; ++ + #ifdef CONFIG_TRACER_SNAPSHOT + static const struct file_operations snapshot_fops = { + .open = tracing_snapshot_open, +@@ -7903,6 +7947,9 @@ init_tracer_tracefs(struct trace_array * + trace_create_file("tracing_on", 0644, d_tracer, + tr, &rb_simple_fops); + ++ trace_create_file("timestamp_mode", 0444, d_tracer, tr, ++ &trace_time_stamp_mode_fops); ++ + create_trace_options_dir(tr); + + #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) 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 8c78a6867..6ccf6c8a5 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 3c370ac51..e7458eaea 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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/0014-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 similarity index 98% rename from debian/patches/features/all/rt/0014-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch rename to debian/patches/features/all/rt/0008-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch index 73db74f05..aad06ebca 100644 --- a/debian/patches/features/all/rt/0014-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, 22 Sep 2017 14:59:45 -0500 -Subject: [PATCH 14/42] tracing: Give event triggers access to +Date: Fri, 17 Nov 2017 14:32:47 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 7d30bd54e..736bd0453 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 @@ -1,8 +1,8 @@ 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 +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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -13,6 +13,7 @@ HRTIMER_MODE_PINNED is not evaluated in hrtimer_init() call. But for the sake of completeness print all given modes. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/trace/events/timer.h | 20 ++++++++++++++++---- diff --git a/debian/patches/features/all/rt/0015-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 similarity index 97% rename from debian/patches/features/all/rt/0015-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch rename to debian/patches/features/all/rt/0009-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch index 2ca111e30..76013e6ff 100644 --- a/debian/patches/features/all/rt/0015-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, 22 Sep 2017 14:59:46 -0500 -Subject: [PATCH 15/42] tracing: Add ring buffer event param to hist field +Date: Fri, 17 Nov 2017 14:32:48 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 abceebb6a..d723eb483 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 1a5d61f94..8c81d8f3d 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 @@ -1,8 +1,8 @@ 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 +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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -11,6 +11,7 @@ PINNED to non PINNED. Add the mode information. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/trace/events/timer.h | 13 ++++++++----- 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 289027990..6241d1ed7 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Looping over all clock bases to find active bits is suboptimal if not all bases are active. @@ -12,6 +12,7 @@ Peter Zijlstra. Suggested-by: Peter Zijlstra Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 31 +++++++++++++++++++++---------- @@ -19,8 +20,8 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -457,20 +457,34 @@ static inline void hrtimer_update_next_t - #endif +@@ -448,6 +448,23 @@ static inline void debug_deactivate(stru + trace_hrtimer_cancel(timer); } +static struct hrtimer_clock_base * @@ -40,6 +41,11 @@ Signed-off-by: Sebastian Andrzej Siewior +#define for_each_active_base(base, cpu_base, active) \ + while ((base = __next_base((cpu_base), &(active)))) + + #if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS) + static inline void hrtimer_update_next_timer(struct hrtimer_cpu_base *cpu_base, + struct hrtimer *timer) +@@ -459,18 +476,15 @@ static inline void hrtimer_update_next_t + static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base) { - struct hrtimer_clock_base *base = cpu_base->clock_base; diff --git a/debian/patches/features/all/rt/0016-tracing-Break-out-hist-trigger-assignment-parsing.patch b/debian/patches/features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch similarity index 96% rename from debian/patches/features/all/rt/0016-tracing-Break-out-hist-trigger-assignment-parsing.patch rename to debian/patches/features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch index 4316cd4ac..da7f29d78 100644 --- a/debian/patches/features/all/rt/0016-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, 22 Sep 2017 14:59:47 -0500 -Subject: [PATCH 16/42] tracing: Break out hist trigger assignment parsing -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:49 -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 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 077c4568b..61c098115 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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. @@ -27,6 +27,7 @@ looking at the number of cache lines involved for the frequently used clocks. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 20 +++++++++----------- diff --git a/debian/patches/features/all/rt/0017-tracing-Add-hist-trigger-timestamp-support.patch b/debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch similarity index 87% rename from debian/patches/features/all/rt/0017-tracing-Add-hist-trigger-timestamp-support.patch rename to debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch index 13fda6e79..cdf367c67 100644 --- a/debian/patches/features/all/rt/0017-tracing-Add-hist-trigger-timestamp-support.patch +++ b/debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 22 Sep 2017 14:59:48 -0500 -Subject: [PATCH 17/42] tracing: Add hist trigger timestamp support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:50 -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 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 @@ -12,12 +12,12 @@ To make use of the timestamp field, users can specify 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 an bonafide +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). Note that the use of this field requires the ring buffer be put into -TIME_EXTEND_ABS mode, which saves the complete timestamp for each +'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. @@ -25,8 +25,8 @@ Signed-off-by: Tom Zanussi Signed-off-by: Baohong Liu Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 90 +++++++++++++++++++++++++++++---------- - 1 file changed, 67 insertions(+), 23 deletions(-) + kernel/trace/trace_events_hist.c | 94 +++++++++++++++++++++++++++++---------- + 1 file changed, 71 insertions(+), 23 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -212,7 +212,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,6 +1611,11 @@ static void hist_unregister_trigger(char +@@ -1572,19 +1611,28 @@ static void hist_unregister_trigger(char if (unregistered && test->ops->free) test->ops->free(test->ops, test); @@ -224,3 +224,20 @@ Signed-off-by: Sebastian Andrzej Siewior } static void hist_unreg_all(struct trace_event_file *file) + { + struct event_trigger_data *test, *n; ++ struct hist_trigger_data *hist_data; + + list_for_each_entry_safe(test, n, &file->triggers, list) { + if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { ++ hist_data = test->private_data; + 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); + } + } + } 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 ce05e2676..7e8b46d66 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -14,6 +14,7 @@ Make them unsigned short to create room for the new struct member. No functional change. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 4 ++-- diff --git a/debian/patches/features/all/rt/0018-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 similarity index 98% rename from debian/patches/features/all/rt/0018-tracing-Add-per-element-variable-support-to-tracing_.patch rename to debian/patches/features/all/rt/0012-tracing-Add-per-element-variable-support-to-tracing_.patch index 44c3822b0..51df05094 100644 --- a/debian/patches/features/all/rt/0018-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, 22 Sep 2017 14:59:49 -0500 -Subject: [PATCH 18/42] tracing: Add per-element variable support to +Date: Fri, 17 Nov 2017 14:32:51 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 6c0456cdd..970c0c959 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -16,6 +16,7 @@ conditionals into common functions, which ensures dead code elimination. Suggested-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 20 ++++++++------------ diff --git a/debian/patches/features/all/rt/0019-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 similarity index 95% rename from debian/patches/features/all/rt/0019-tracing-Add-hist_data-member-to-hist_field.patch rename to debian/patches/features/all/rt/0013-tracing-Add-hist_data-member-to-hist_field.patch index e8194ca69..c89606433 100644 --- a/debian/patches/features/all/rt/0019-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, 22 Sep 2017 14:59:50 -0500 -Subject: [PATCH 19/42] tracing: Add hist_data member to hist_field -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:52 -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 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 ac8a11829..24c4b2773 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz __hrtimer_hres_active() is now available unconditionally. Replace the direct access to hrtimer_cpu_base.hres_active. @@ -9,6 +9,7 @@ direct access to hrtimer_cpu_base.hres_active. No functional change. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 4 ++-- diff --git a/debian/patches/features/all/rt/0020-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 similarity index 67% rename from debian/patches/features/all/rt/0020-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch rename to debian/patches/features/all/rt/0014-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch index e16df1cb7..87f1c498d 100644 --- a/debian/patches/features/all/rt/0020-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,9 +1,9 @@ From: Tom Zanussi -Date: Fri, 22 Sep 2017 14:59:51 -0500 -Subject: [PATCH 20/42] tracing: Add usecs modifier for hist trigger timestamps -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:53 -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 -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: @@ -17,11 +17,22 @@ timestamp conversion. Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace.c | 8 ++++++++ - kernel/trace/trace.h | 2 ++ - kernel/trace/trace_events_hist.c | 28 ++++++++++++++++++++++------ - 3 files changed, 32 insertions(+), 6 deletions(-) + Documentation/trace/histogram.txt | 1 + + kernel/trace/trace.c | 13 +++++++++++-- + kernel/trace/trace.h | 2 ++ + kernel/trace/trace_events_hist.c | 28 ++++++++++++++++++++++------ + 4 files changed, 36 insertions(+), 8 deletions(-) +--- a/Documentation/trace/histogram.txt ++++ b/Documentation/trace/histogram.txt +@@ -74,6 +74,7 @@ + .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 + + Note that in general the semantics of a given field aren't + interpreted when applying a modifier to it, but there are some --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1170,6 +1170,14 @@ static struct { @@ -39,6 +50,18 @@ Signed-off-by: Sebastian Andrzej Siewior /* * trace_parser_get_init - gets the buffer for trace parser */ +@@ -4710,8 +4718,9 @@ static const char readme_msg[] = + "\t .sym display an address as a symbol\n" + "\t .sym-offset display an address as a symbol and offset\n" + "\t .execname display a common_pid as a program name\n" +- "\t .syscall display a syscall id as a syscall name\n\n" +- "\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 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" --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -289,6 +289,8 @@ extern void trace_array_put(struct trace 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 033656b9b..fad1851e5 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -22,6 +22,7 @@ hrtimer_cpu_base.expires_next yet. This will be changed with later patches which further reduce the #ifdef zoo in this code. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 6 +++--- diff --git a/debian/patches/features/all/rt/0021-tracing-Add-variable-support-to-hist-triggers.patch b/debian/patches/features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch similarity index 82% rename from debian/patches/features/all/rt/0021-tracing-Add-variable-support-to-hist-triggers.patch rename to debian/patches/features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch index 067aa309a..67c328675 100644 --- a/debian/patches/features/all/rt/0021-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, 22 Sep 2017 14:59:52 -0500 -Subject: [PATCH 21/42] tracing: Add variable support to hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:54 -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 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. @@ -37,8 +37,8 @@ Signed-off-by: Tom Zanussi Signed-off-by: Baohong Liu Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 374 ++++++++++++++++++++++++++++++++++----- - 1 file changed, 334 insertions(+), 40 deletions(-) + kernel/trace/trace_events_hist.c | 372 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 332 insertions(+), 40 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -64,12 +64,11 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_none(struct hist_field *field, void *event, -@@ -138,6 +146,14 @@ enum hist_field_flags { +@@ -138,6 +146,13 @@ enum hist_field_flags { HIST_FIELD_FL_LOG2 = 1 << 9, HIST_FIELD_FL_TIMESTAMP = 1 << 10, HIST_FIELD_FL_TIMESTAMP_USECS = 1 << 11, + HIST_FIELD_FL_VAR = 1 << 12, -+ HIST_FIELD_FL_VAR_ONLY = 1 << 13, +}; + +struct var_defs { @@ -79,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct hist_trigger_attrs { -@@ -150,13 +166,20 @@ struct hist_trigger_attrs { +@@ -150,13 +165,19 @@ struct hist_trigger_attrs { bool clear; bool ts_in_usecs; unsigned int map_bits; @@ -97,11 +96,10 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned int n_keys; unsigned int n_fields; + unsigned int n_vars; -+ unsigned int n_var_only; unsigned int key_size; struct tracing_map_sort_key sort_keys[TRACING_MAP_SORT_KEYS_MAX]; unsigned int n_sort_keys; -@@ -164,6 +187,7 @@ struct hist_trigger_data { +@@ -164,6 +185,7 @@ struct hist_trigger_data { struct hist_trigger_attrs *attrs; struct tracing_map *map; bool enable_timestamps; @@ -109,7 +107,56 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_timestamp(struct hist_field *hist_field, void *event, -@@ -262,9 +286,14 @@ static int parse_map_size(char *str) +@@ -180,6 +202,48 @@ static u64 hist_field_timestamp(struct h + return ts; + } + ++static struct hist_field *find_var_field(struct hist_trigger_data *hist_data, ++ const char *var_name) ++{ ++ struct hist_field *hist_field, *found = NULL; ++ int i; ++ ++ for_each_hist_field(i, hist_data) { ++ hist_field = hist_data->fields[i]; ++ if (hist_field && hist_field->flags & HIST_FIELD_FL_VAR && ++ strcmp(hist_field->var.name, var_name) == 0) { ++ found = hist_field; ++ break; ++ } ++ } ++ ++ return found; ++} ++ ++static struct hist_field *find_var(struct hist_trigger_data *hist_data, ++ struct trace_event_file *file, ++ const char *var_name) ++{ ++ struct hist_trigger_data *test_data; ++ struct event_trigger_data *test; ++ struct hist_field *hist_field; ++ ++ hist_field = find_var_field(hist_data, var_name); ++ if (hist_field) ++ return hist_field; ++ ++ list_for_each_entry_rcu(test, &file->triggers, list) { ++ if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { ++ test_data = test->private_data; ++ hist_field = find_var_field(test_data, var_name); ++ if (hist_field) ++ return hist_field; ++ } ++ } ++ ++ return NULL; ++} ++ + static const char *hist_field_name(struct hist_field *field, + unsigned int level) + { +@@ -262,9 +326,14 @@ static int parse_map_size(char *str) static void destroy_hist_trigger_attrs(struct hist_trigger_attrs *attrs) { @@ -124,7 +171,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(attrs->name); kfree(attrs->sort_key_str); kfree(attrs->keys_str); -@@ -311,8 +340,22 @@ static int parse_assignment(char *str, s +@@ -311,8 +380,22 @@ static int parse_assignment(char *str, s goto out; } attrs->map_bits = map_bits; @@ -149,7 +196,7 @@ Signed-off-by: Sebastian Andrzej Siewior out: return ret; } -@@ -428,12 +471,15 @@ static void destroy_hist_field(struct hi +@@ -428,12 +511,15 @@ static void destroy_hist_field(struct hi for (i = 0; i < HIST_FIELD_OPERANDS_MAX; i++) destroy_hist_field(hist_field->operands[i], level + 1); @@ -166,7 +213,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct hist_field *hist_field; -@@ -459,7 +505,7 @@ static struct hist_field *create_hist_fi +@@ -459,7 +545,7 @@ static struct hist_field *create_hist_fi if (flags & HIST_FIELD_FL_LOG2) { unsigned long fl = flags & ~HIST_FIELD_FL_LOG2; hist_field->fn = hist_field_log2; @@ -175,7 +222,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_field->size = hist_field->operands[0]->size; goto out; } -@@ -494,14 +540,23 @@ static struct hist_field *create_hist_fi +@@ -494,14 +580,23 @@ static struct hist_field *create_hist_fi hist_field->field = field; hist_field->flags = flags; @@ -200,7 +247,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_data->fields[i]) { destroy_hist_field(hist_data->fields[i], 0); hist_data->fields[i] = NULL; -@@ -512,11 +567,12 @@ static void destroy_hist_fields(struct h +@@ -512,11 +607,12 @@ static void destroy_hist_fields(struct h static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = @@ -214,7 +261,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON(hist_data->n_vals > TRACING_MAP_VALS_MAX)) return -EINVAL; -@@ -524,19 +580,53 @@ static int create_hitcount_val(struct hi +@@ -524,19 +620,16 @@ static int create_hitcount_val(struct hi return 0; } @@ -222,43 +269,6 @@ Signed-off-by: Sebastian Andrzej Siewior - unsigned int val_idx, - struct trace_event_file *file, - char *field_str) -+static struct hist_field *find_var_field(struct hist_trigger_data *hist_data, -+ const char *var_name) -+{ -+ struct hist_field *hist_field, *found = NULL; -+ int i; -+ -+ for_each_hist_field(i, hist_data) { -+ hist_field = hist_data->fields[i]; -+ if (hist_field && hist_field->flags & HIST_FIELD_FL_VAR && -+ strcmp(hist_field->var.name, var_name) == 0) { -+ found = hist_field; -+ break; -+ } -+ } -+ -+ return found; -+} -+ -+static struct hist_field *find_var(struct trace_event_file *file, -+ const char *var_name) -+{ -+ struct hist_trigger_data *hist_data; -+ struct event_trigger_data *test; -+ struct hist_field *hist_field; -+ -+ list_for_each_entry_rcu(test, &file->triggers, list) { -+ if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { -+ hist_data = test->private_data; -+ hist_field = find_var_field(hist_data, var_name); -+ if (hist_field) -+ return hist_field; -+ } -+ } -+ -+ return NULL; -+} -+ +static int __create_val_field(struct hist_trigger_data *hist_data, + unsigned int val_idx, + struct trace_event_file *file, @@ -276,7 +286,7 @@ Signed-off-by: Sebastian Andrzej Siewior field_name = strsep(&field_str, "."); if (field_str) { if (strcmp(field_str, "hex") == 0) -@@ -558,25 +648,65 @@ static int create_val_field(struct hist_ +@@ -558,25 +651,58 @@ static int create_val_field(struct hist_ } } @@ -291,9 +301,6 @@ Signed-off-by: Sebastian Andrzej Siewior + ++hist_data->n_fields; - if (WARN_ON(hist_data->n_vals > TRACING_MAP_VALS_MAX)) -+ if (hist_data->fields[val_idx]->flags & HIST_FIELD_FL_VAR_ONLY) -+ hist_data->n_var_only++; -+ + if (WARN_ON(hist_data->n_vals > TRACING_MAP_VALS_MAX + TRACING_MAP_VARS_MAX)) ret = -EINVAL; out: @@ -320,18 +327,14 @@ Signed-off-by: Sebastian Andrzej Siewior + + if (WARN_ON(val_idx >= TRACING_MAP_VALS_MAX + TRACING_MAP_VARS_MAX)) + return -EINVAL; -+ -+ if (find_var(file, var_name) && !hist_data->remove) { ++ if (find_var(hist_data, file, var_name) && !hist_data->remove) { + return -EINVAL; + } + + flags |= HIST_FIELD_FL_VAR; + hist_data->n_vars++; -+ if (hist_data->n_vars > TRACING_MAP_VARS_MAX) { ++ if (WARN_ON(hist_data->n_vars > TRACING_MAP_VARS_MAX)) + return -EINVAL; -+ } -+ -+ flags |= HIST_FIELD_FL_VAR_ONLY; + + return __create_val_field(hist_data, val_idx, file, var_name, expr_str, flags); +} @@ -345,7 +348,7 @@ Signed-off-by: Sebastian Andrzej Siewior int ret; ret = create_hitcount_val(hist_data); -@@ -596,12 +726,15 @@ static int create_val_fields(struct hist +@@ -596,12 +722,15 @@ static int create_val_fields(struct hist field_str = strsep(&fields_str, ","); if (!field_str) break; @@ -361,7 +364,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (fields_str && (strcmp(fields_str, "hitcount") != 0)) ret = -EINVAL; out: -@@ -615,11 +748,12 @@ static int create_key_field(struct hist_ +@@ -615,11 +744,12 @@ static int create_key_field(struct hist_ char *field_str) { struct ftrace_event_field *field = NULL; @@ -375,7 +378,7 @@ Signed-off-by: Sebastian Andrzej Siewior return -EINVAL; flags |= HIST_FIELD_FL_KEY; -@@ -627,6 +761,7 @@ static int create_key_field(struct hist_ +@@ -627,6 +757,7 @@ static int create_key_field(struct hist_ if (strcmp(field_str, "stacktrace") == 0) { flags |= HIST_FIELD_FL_STACKTRACE; key_size = sizeof(unsigned long) * HIST_STACKTRACE_DEPTH; @@ -383,7 +386,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else { char *field_name = strsep(&field_str, "."); -@@ -672,7 +807,7 @@ static int create_key_field(struct hist_ +@@ -672,7 +803,7 @@ static int create_key_field(struct hist_ } } @@ -392,7 +395,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!hist_data->fields[key_idx]) { ret = -ENOMEM; goto out; -@@ -688,6 +823,7 @@ static int create_key_field(struct hist_ +@@ -688,6 +819,7 @@ static int create_key_field(struct hist_ } hist_data->n_keys++; @@ -400,7 +403,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON(hist_data->n_keys > TRACING_MAP_KEYS_MAX)) return -EINVAL; -@@ -731,21 +867,108 @@ static int create_key_fields(struct hist +@@ -731,21 +863,111 @@ static int create_key_fields(struct hist return ret; } @@ -455,6 +458,11 @@ Signed-off-by: Sebastian Andrzej Siewior + goto free; + } + ++ if (n_vars == TRACING_MAP_VARS_MAX) { ++ ret = -EINVAL; ++ goto free; ++ } ++ + s = kstrdup(var_name, GFP_KERNEL); + if (!s) { + ret = -ENOMEM; @@ -464,15 +472,13 @@ Signed-off-by: Sebastian Andrzej Siewior + + s = kstrdup(field_str, GFP_KERNEL); + if (!s) { ++ kfree(hist_data->attrs->var_defs.name[n_vars]); + ret = -ENOMEM; + goto free; + } + hist_data->attrs->var_defs.expr[n_vars++] = s; + + hist_data->attrs->var_defs.n_vars = n_vars; -+ -+ if (n_vars == TRACING_MAP_VARS_MAX) -+ goto free; + } + } + @@ -511,7 +517,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -768,7 +991,7 @@ static int create_sort_keys(struct hist_ +@@ -768,7 +990,7 @@ static int create_sort_keys(struct hist_ char *fields_str = hist_data->attrs->sort_key_str; struct tracing_map_sort_key *sort_key; int descending, ret = 0; @@ -520,7 +526,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_data->n_sort_keys = 1; /* we always have at least one, hitcount */ -@@ -816,12 +1039,19 @@ static int create_sort_keys(struct hist_ +@@ -816,12 +1038,19 @@ static int create_sort_keys(struct hist_ continue; } @@ -529,7 +535,7 @@ Signed-off-by: Sebastian Andrzej Siewior + unsigned int idx; + hist_field = hist_data->fields[j]; -+ if (hist_field->flags & HIST_FIELD_FL_VAR_ONLY) ++ if (hist_field->flags & HIST_FIELD_FL_VAR) + continue; + + idx = k++; @@ -542,7 +548,7 @@ Signed-off-by: Sebastian Andrzej Siewior descending = is_descending(field_str); if (descending < 0) { ret = descending; -@@ -836,6 +1066,7 @@ static int create_sort_keys(struct hist_ +@@ -836,6 +1065,7 @@ static int create_sort_keys(struct hist_ break; } } @@ -550,7 +556,7 @@ Signed-off-by: Sebastian Andrzej Siewior hist_data->n_sort_keys = i; out: return ret; -@@ -876,12 +1107,19 @@ static int create_tracing_map_fields(str +@@ -876,12 +1106,19 @@ static int create_tracing_map_fields(str idx = tracing_map_add_key_field(map, hist_field->offset, cmp_fn); @@ -572,7 +578,7 @@ Signed-off-by: Sebastian Andrzej Siewior } return 0; -@@ -905,7 +1143,8 @@ static bool need_tracing_map_ops(struct +@@ -905,7 +1142,8 @@ static bool need_tracing_map_ops(struct static struct hist_trigger_data * create_hist_data(unsigned int map_bits, struct hist_trigger_attrs *attrs, @@ -582,7 +588,7 @@ Signed-off-by: Sebastian Andrzej Siewior { const struct tracing_map_ops *map_ops = NULL; struct hist_trigger_data *hist_data; -@@ -916,6 +1155,7 @@ create_hist_data(unsigned int map_bits, +@@ -916,6 +1154,7 @@ create_hist_data(unsigned int map_bits, return ERR_PTR(-ENOMEM); hist_data->attrs = attrs; @@ -590,7 +596,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = create_hist_fields(hist_data, file); if (ret) -@@ -962,14 +1202,29 @@ static void hist_trigger_elt_update(stru +@@ -962,14 +1201,28 @@ static void hist_trigger_elt_update(stru struct ring_buffer_event *rbe) { struct hist_field *hist_field; @@ -605,8 +611,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); -+ if (hist_field->flags & HIST_FIELD_FL_VAR_ONLY) -+ continue; ++ continue; + } tracing_map_update_sum(elt, i, hist_val); } @@ -622,7 +627,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline void add_to_key(char *compound_key, void *key, -@@ -1144,6 +1399,9 @@ hist_trigger_entry_print(struct seq_file +@@ -1144,6 +1397,9 @@ 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); @@ -632,7 +637,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_data->fields[i]->flags & HIST_FIELD_FL_HEX) { seq_printf(m, " %s: %10llx", field_name, tracing_map_read_sum(elt, i)); -@@ -1267,6 +1525,9 @@ static void hist_field_print(struct seq_ +@@ -1267,6 +1523,9 @@ static void hist_field_print(struct seq_ { const char *field_name = hist_field_name(hist_field, 0); @@ -642,17 +647,17 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) seq_puts(m, "$common_timestamp"); else if (field_name) -@@ -1285,7 +1546,8 @@ static int event_hist_trigger_print(stru +@@ -1285,7 +1544,8 @@ static int event_hist_trigger_print(stru struct event_trigger_data *data) { struct hist_trigger_data *hist_data = data->private_data; - struct hist_field *key_field; -+ bool have_var_only = false; + struct hist_field *field; ++ bool have_var = false; unsigned int i; seq_puts(m, "hist:"); -@@ -1296,25 +1558,47 @@ static int event_hist_trigger_print(stru +@@ -1296,25 +1556,47 @@ static int event_hist_trigger_print(stru seq_puts(m, "keys="); for_each_hist_key_field(i, hist_data) { @@ -674,8 +679,8 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_hist_val_field(i, hist_data) { + field = hist_data->fields[i]; -+ if (field->flags & HIST_FIELD_FL_VAR_ONLY) { -+ have_var_only = true; ++ if (field->flags & HIST_FIELD_FL_VAR) { ++ have_var = true; + continue; + } + @@ -688,7 +693,7 @@ Signed-off-by: Sebastian Andrzej Siewior + } + } + -+ if (have_var_only) { ++ if (have_var) { + unsigned int n = 0; + + seq_puts(m, ":"); @@ -696,7 +701,7 @@ Signed-off-by: Sebastian Andrzej Siewior + for_each_hist_val_field(i, hist_data) { + field = hist_data->fields[i]; + -+ if (field->flags & HIST_FIELD_FL_VAR_ONLY) { ++ if (field->flags & HIST_FIELD_FL_VAR) { + if (n++) + seq_puts(m, ","); + hist_field_print(m, field); @@ -704,32 +709,32 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -1322,7 +1606,10 @@ static int event_hist_trigger_print(stru +@@ -1322,7 +1604,10 @@ static int event_hist_trigger_print(stru for (i = 0; i < hist_data->n_sort_keys; i++) { struct tracing_map_sort_key *sort_key; - unsigned int idx; + unsigned int idx, first_key_idx; + -+ /* skip VAR_ONLY vals */ -+ first_key_idx = hist_data->n_vals - hist_data->n_var_only; ++ /* skip VAR vals */ ++ first_key_idx = hist_data->n_vals - hist_data->n_vars; sort_key = &hist_data->sort_keys[i]; idx = sort_key->field_idx; -@@ -1335,8 +1622,11 @@ static int event_hist_trigger_print(stru +@@ -1335,8 +1620,11 @@ static int event_hist_trigger_print(stru if (idx == HITCOUNT_IDX) seq_puts(m, "hitcount"); - else + else { + if (idx >= first_key_idx) -+ idx += hist_data->n_var_only; ++ idx += hist_data->n_vars; hist_field_print(m, hist_data->fields[idx]); + } if (sort_key->descending) seq_puts(m, ".descending"); -@@ -1633,7 +1923,7 @@ static void hist_unregister_trigger(char +@@ -1633,7 +1921,7 @@ static void hist_unregister_trigger(char test->ops->free(test->ops, test); if (hist_data->enable_timestamps) { @@ -738,7 +743,7 @@ Signed-off-by: Sebastian Andrzej Siewior tracing_set_time_stamp_abs(file->tr, false); } } -@@ -1662,12 +1952,16 @@ static int event_hist_trigger_func(struc +@@ -1666,12 +1954,16 @@ static int event_hist_trigger_func(struc struct hist_trigger_attrs *attrs; struct event_trigger_ops *trigger_ops; struct hist_trigger_data *hist_data; @@ -755,7 +760,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* separate the trigger from the filter (k:v [if filter]) */ trigger = strsep(¶m, " \t"); if (!trigger) -@@ -1680,7 +1974,7 @@ static int event_hist_trigger_func(struc +@@ -1684,7 +1976,7 @@ static int event_hist_trigger_func(struc if (attrs->map_bits) hist_trigger_bits = attrs->map_bits; @@ -764,7 +769,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (IS_ERR(hist_data)) { destroy_hist_trigger_attrs(attrs); return PTR_ERR(hist_data); -@@ -1709,7 +2003,7 @@ static int event_hist_trigger_func(struc +@@ -1713,7 +2005,7 @@ static int event_hist_trigger_func(struc goto out_free; } 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 082e3845b..44d3d94ee 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz hrtimer_cpu_base.next_timer stores the pointer to the next expiring timer in a cpu base. @@ -24,6 +24,7 @@ marginal as it's just a store on an already dirtied cacheline. No functional change. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 4 ++-- @@ -64,8 +65,8 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -442,14 +442,6 @@ static inline void debug_deactivate(stru - } +@@ -459,21 +459,13 @@ static struct hrtimer_clock_base * + while ((base = __next_base((cpu_base), &(active)))) #if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS) -static inline void hrtimer_update_next_timer(struct hrtimer_cpu_base *cpu_base, @@ -76,10 +77,9 @@ Signed-off-by: Sebastian Andrzej Siewior -#endif -} - - static struct hrtimer_clock_base * - __next_base(struct hrtimer_cpu_base *cpu_base, unsigned int *active) + static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base) { -@@ -473,7 +465,7 @@ static ktime_t __hrtimer_get_next_event( + struct hrtimer_clock_base *base; unsigned int active = cpu_base->active_bases; ktime_t expires, expires_next = KTIME_MAX; diff --git a/debian/patches/features/all/rt/0022-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 similarity index 82% rename from debian/patches/features/all/rt/0022-tracing-Account-for-variables-in-named-trigger-compa.patch rename to debian/patches/features/all/rt/0016-tracing-Account-for-variables-in-named-trigger-compa.patch index 5be846cb5..a5299cadb 100644 --- a/debian/patches/features/all/rt/0022-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, 22 Sep 2017 14:59:53 -0500 -Subject: [PATCH 22/42] tracing: Account for variables in named trigger +Date: Fri, 17 Nov 2017 14:32:55 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -1614,7 +1614,7 @@ static int event_hist_trigger_print(stru +@@ -1612,7 +1612,7 @@ static int event_hist_trigger_print(stru sort_key = &hist_data->sort_keys[i]; idx = sort_key->field_idx; @@ -28,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior return -EINVAL; if (i > 0) -@@ -1802,6 +1802,11 @@ static bool hist_trigger_match(struct ev +@@ -1800,6 +1800,11 @@ static bool hist_trigger_match(struct ev return false; if (key_field->is_signed != key_field_test->is_signed) return false; 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 647c2619e..1faf6c1a6 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz hrtimer_reprogram() needs to be available unconditionally for softirq based hrtimers. Move the function and all required struct members out of the @@ -13,6 +13,7 @@ increases the text size for the CONFIG_HIGH_RES_TIMERS=n case, but avoids replication of that code for the upcoming softirq based hrtimers support. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 6 +- diff --git a/debian/patches/features/all/rt/0023-tracing-Move-get_hist_field_flags.patch b/debian/patches/features/all/rt/0017-tracing-Move-get_hist_field_flags.patch similarity index 89% rename from debian/patches/features/all/rt/0023-tracing-Move-get_hist_field_flags.patch rename to debian/patches/features/all/rt/0017-tracing-Move-get_hist_field_flags.patch index 9d9ae5d3b..9e83719a0 100644 --- a/debian/patches/features/all/rt/0023-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, 22 Sep 2017 14:59:54 -0500 -Subject: [PATCH 23/42] tracing: Move get_hist_field_flags() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:56 -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 Move get_hist_field_flags() to make it more easily accessible for new code (and keep the move separate from new functionality). @@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -457,6 +457,28 @@ static const struct tracing_map_ops hist +@@ -497,6 +497,28 @@ static const struct tracing_map_ops hist .elt_init = hist_trigger_elt_comm_init, }; @@ -43,7 +43,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_hist_field(struct hist_field *hist_field, unsigned int level) { -@@ -1499,28 +1521,6 @@ const struct file_operations event_hist_ +@@ -1497,28 +1519,6 @@ const struct file_operations event_hist_ .release = single_release, }; diff --git a/debian/patches/features/all/rt/0018-hrtimer-Reduce-conditional-code-and-make-hrtimer_for.patch b/debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch similarity index 84% rename from debian/patches/features/all/rt/0018-hrtimer-Reduce-conditional-code-and-make-hrtimer_for.patch rename to debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch index 4549f5afe..e240d3761 100644 --- a/debian/patches/features/all/rt/0018-hrtimer-Reduce-conditional-code-and-make-hrtimer_for.patch +++ b/debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch @@ -1,22 +1,24 @@ From: Anna-Maria Gleixner Date: Sun, 22 Oct 2017 23:39:56 +0200 -Subject: [PATCH 18/36] hrtimer: Reduce conditional code and make - hrtimer_force_reprogramm() unconditional -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +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 hrtimer_force_reprogram() needs to be available unconditionally for softirq based hrtimers. Move the function and all required struct members out of the CONFIG_HIGH_RES_TIMERS #ifdef. -There is no functional change because hrtimer_force_reprogram() is -only invoked when hrtimer_cpu_base.hres_active is true and -CONFIG_HIGH_RES_TIMERS=y. Making it unconditional increases the text -size for the CONFIG_HIGH_RES_TIMERS=n case slightly, but avoids -replication of that code for the upcoming softirq based hrtimers -support. Most of the code gets eliminated in the -CONFIG_HIGH_RES_TIMERS=n case by the compiler. +There is no functional change because hrtimer_force_reprogram() is only +invoked when hrtimer_cpu_base.hres_active is true and +CONFIG_HIGH_RES_TIMERS=y. + +Making it unconditional increases the text size for the +CONFIG_HIGH_RES_TIMERS=n case slightly, but avoids replication of that code +for the upcoming softirq based hrtimers support. Most of the code gets +eliminated in the CONFIG_HIGH_RES_TIMERS=n case by the compiler. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 58 ++++++++++++++++++++++++-------------------------- diff --git a/debian/patches/features/all/rt/0024-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 similarity index 85% rename from debian/patches/features/all/rt/0024-tracing-Add-simple-expression-support-to-hist-trigge.patch rename to debian/patches/features/all/rt/0018-tracing-Add-simple-expression-support-to-hist-trigge.patch index 1aa5aaee7..21e28f26e 100644 --- a/debian/patches/features/all/rt/0024-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, 22 Sep 2017 14:59:55 -0500 -Subject: [PATCH 24/42] tracing: Add simple expression support to hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:57 -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 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 | 514 +++++++++++++++++++++++++++++++++------ - 1 file changed, 440 insertions(+), 74 deletions(-) + kernel/trace/trace_events_hist.c | 513 +++++++++++++++++++++++++++++++++------ + 1 file changed, 440 insertions(+), 73 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -87,15 +87,15 @@ Signed-off-by: Sebastian Andrzej Siewior #define DEFINE_HIST_FIELD_FN(type) \ static u64 hist_field_##type(struct hist_field *hist_field, \ void *event, \ -@@ -148,6 +192,7 @@ enum hist_field_flags { +@@ -147,6 +191,7 @@ enum hist_field_flags { + HIST_FIELD_FL_TIMESTAMP = 1 << 10, HIST_FIELD_FL_TIMESTAMP_USECS = 1 << 11, HIST_FIELD_FL_VAR = 1 << 12, - HIST_FIELD_FL_VAR_ONLY = 1 << 13, -+ HIST_FIELD_FL_EXPR = 1 << 14, ++ HIST_FIELD_FL_EXPR = 1 << 13, }; struct var_defs { -@@ -218,6 +263,8 @@ static const char *hist_field_name(struc +@@ -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"; @@ -104,7 +104,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (field_name == NULL) field_name = ""; -@@ -479,6 +526,93 @@ static const char *get_hist_field_flags( +@@ -519,6 +566,93 @@ static const char *get_hist_field_flags( return flags_str; } @@ -198,7 +198,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_hist_field(struct hist_field *hist_field, unsigned int level) { -@@ -494,6 +628,7 @@ static void destroy_hist_field(struct hi +@@ -534,6 +668,7 @@ static void destroy_hist_field(struct hi destroy_hist_field(hist_field->operands[i], level + 1); kfree(hist_field->var.name); @@ -206,7 +206,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_field); } -@@ -514,6 +649,9 @@ static struct hist_field *create_hist_fi +@@ -554,6 +689,9 @@ static struct hist_field *create_hist_fi hist_field->hist_data = hist_data; @@ -216,19 +216,28 @@ Signed-off-by: Sebastian Andrzej Siewior if (flags & HIST_FIELD_FL_HITCOUNT) { hist_field->fn = hist_field_counter; goto out; -@@ -586,6 +724,289 @@ static void destroy_hist_fields(struct h +@@ -626,59 +764,323 @@ 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)) @@ -236,10 +245,16 @@ Signed-off-by: Sebastian Andrzej Siewior + 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) +{ @@ -251,10 +266,16 @@ 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) -+{ -+ struct ftrace_event_field *field = NULL; + { + struct ftrace_event_field *field = NULL; +- char *field_name; +- int ret = 0; + 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); @@ -276,24 +297,27 @@ Signed-off-by: Sebastian Andrzej Siewior + *flags |= HIST_FIELD_FL_LOG2; + else if (strcmp(modifier, "usecs") == 0) + *flags |= HIST_FIELD_FL_TIMESTAMP_USECS; -+ else { + else { +- ret = -EINVAL; + field = ERR_PTR(-EINVAL); -+ goto out; -+ } -+ } -+ -+ if (strcmp(field_name, "$common_timestamp") == 0) { + goto out; + } + } + + if (strcmp(field_name, "$common_timestamp") == 0) { +- flags |= HIST_FIELD_FL_TIMESTAMP; + *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) { + } else { + field = trace_find_event_field(file->event_call, field_name); + if (!field || !field->size) { +- ret = -EINVAL; + field = ERR_PTR(-EINVAL); -+ goto out; -+ } -+ } + goto out; + } + } + out: + kfree(str); + @@ -318,13 +342,15 @@ Signed-off-by: Sebastian Andrzej Siewior + 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); @@ -397,6 +423,7 @@ Signed-off-by: Sebastian Andrzej Siewior + + return expr; + free: ++ destroy_hist_field(expr, 0); + return ERR_PTR(ret); +} + @@ -503,59 +530,43 @@ 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] = -@@ -645,41 +1066,21 @@ 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; ++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) ++{ + struct hist_field *hist_field; - 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; ++ int ret = 0; ++ + 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; -- if (hist_data->fields[val_idx]->flags & HIST_FIELD_FL_VAR_ONLY) -+ if (hist_field->flags & HIST_FIELD_FL_VAR_ONLY) - hist_data->n_var_only++; - - if (WARN_ON(hist_data->n_vals > TRACING_MAP_VALS_MAX + TRACING_MAP_VARS_MAX)) -@@ -769,8 +1170,8 @@ static int create_key_field(struct hist_ +@@ -765,8 +1167,8 @@ static int create_key_field(struct hist_ struct trace_event_file *file, char *field_str) { @@ -565,7 +576,7 @@ Signed-off-by: Sebastian Andrzej Siewior unsigned long flags = 0; unsigned int key_size; int ret = 0; -@@ -785,60 +1186,24 @@ static int create_key_field(struct hist_ +@@ -781,60 +1183,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 { @@ -635,7 +646,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (hist_data->key_size > HIST_KEY_SIZE_MAX) { ret = -EINVAL; goto out; -@@ -1421,7 +1786,8 @@ hist_trigger_entry_print(struct seq_file +@@ -1419,7 +1785,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 4fb577446..51a1b424e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz When the first hrtimer on the current CPU is removed, hrtimer_force_reprogram() is invoked but only when @@ -35,6 +35,7 @@ except the effective reprogramming part, which gets eliminated by the compiler in the CONFIG_HIGH_RES_TIMERS=n case. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 10 ++++------ diff --git a/debian/patches/features/all/rt/0025-tracing-Generalize-per-element-hist-trigger-data.patch b/debian/patches/features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch similarity index 88% rename from debian/patches/features/all/rt/0025-tracing-Generalize-per-element-hist-trigger-data.patch rename to debian/patches/features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch index 64fbc192f..4e030d3df 100644 --- a/debian/patches/features/all/rt/0025-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, 22 Sep 2017 14:59:56 -0500 -Subject: [PATCH 25/42] tracing: Generalize per-element hist trigger data -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:32:58 -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 Up until now, hist triggers only needed per-element support for saving 'comm' data, which was saved directly as a private data pointer. @@ -13,13 +13,13 @@ new hist_elt_data struct for the purpose, and switch the current Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 71 ++++++++++++++++++++------------------- - 1 file changed, 38 insertions(+), 33 deletions(-) + kernel/trace/trace_events_hist.c | 76 ++++++++++++++++++++++----------------- + 1 file changed, 43 insertions(+), 33 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -249,6 +249,10 @@ static u64 hist_field_timestamp(struct h - return ts; +@@ -289,6 +289,10 @@ static struct hist_field *find_var(struc + return NULL; } +struct hist_elt_data { @@ -29,7 +29,7 @@ Signed-off-by: Sebastian Andrzej Siewior static const char *hist_field_name(struct hist_field *field, unsigned int level) { -@@ -463,45 +467,61 @@ static inline void save_comm(char *comm, +@@ -503,45 +507,61 @@ static inline void save_comm(char *comm, memcpy(comm, task->comm, TASK_COMM_LEN); } @@ -138,13 +138,18 @@ Signed-off-by: Sebastian Andrzej Siewior hist_data->map = tracing_map_create(map_bits, hist_data->key_size, map_ops, hist_data); -@@ -1742,7 +1746,8 @@ hist_trigger_entry_print(struct seq_file +@@ -1741,7 +1745,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) { - char *comm = elt->private_data; + struct hist_elt_data *elt_data = elt->private_data; -+ char *comm = elt_data->comm; ++ char *comm; ++ ++ if (WARN_ON_ONCE(!elt_data)) ++ return; ++ ++ comm = elt_data->comm; uval = *(u64 *)(key + key_field->offset); seq_printf(m, "%s: %-16s[%10llu]", field_name, 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 5d29ae4be..9a3fb6c47 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz hrtimer_reprogram() is conditionally invoked from hrtimer_start_range_ns() when hrtimer_cpu_base.hres_active is true. @@ -43,13 +43,17 @@ To unify this the following changes are required: 3) Remove the remote wakeup special case for the !high_res && nohz_active case. +Confine the timers_nohz_active static key to timer.c which is the only user +now. + Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 18 ++++++------------ - kernel/time/tick-internal.h | 11 ----------- - kernel/time/timer.c | 15 ++++++++++++++- - 3 files changed, 20 insertions(+), 24 deletions(-) + kernel/time/tick-internal.h | 6 ------ + kernel/time/timer.c | 9 ++++++++- + 3 files changed, 14 insertions(+), 19 deletions(-) --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -100,28 +104,22 @@ Signed-off-by: Sebastian Andrzej Siewior } --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h -@@ -151,12 +151,6 @@ static inline void tick_nohz_init(void) +@@ -151,18 +151,12 @@ static inline void tick_nohz_init(void) #ifdef CONFIG_NO_HZ_COMMON extern unsigned long tick_nohz_active; extern void timers_update_nohz(void); -extern struct static_key_false timers_nohz_active; -- -static inline bool is_timers_nohz_active(void) -{ - return static_branch_unlikely(&timers_nohz_active); -} - - #ifdef CONFIG_SMP + # ifdef CONFIG_SMP extern struct static_key_false timers_migration_enabled; -@@ -164,11 +158,6 @@ extern struct static_key_false timers_mi - #else + # endif + #else /* CONFIG_NO_HZ_COMMON */ static inline void timers_update_nohz(void) { } #define tick_nohz_active (0) -- --static inline bool is_timers_nohz_active(void) --{ -- return false; --} +-static inline bool is_timers_nohz_active(void) { return false; } #endif DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases); @@ -136,7 +134,7 @@ Signed-off-by: Sebastian Andrzej Siewior static DEFINE_MUTEX(timer_keys_mutex); static void timer_update_keys(struct work_struct *work); -@@ -260,6 +260,19 @@ int timer_migration_handler(struct ctl_t +@@ -260,6 +260,13 @@ int timer_migration_handler(struct ctl_t mutex_unlock(&timer_keys_mutex); return ret; } @@ -145,14 +143,8 @@ Signed-off-by: Sebastian Andrzej Siewior +{ + return static_branch_unlikely(&timers_nohz_active); +} -+ +#else -+ -+static inline bool is_timers_nohz_active(void) -+{ -+ return false; -+} -+ ++static inline bool is_timers_nohz_active(void) { return false; } #endif /* NO_HZ_COMMON */ static unsigned long round_jiffies_common(unsigned long j, int cpu, diff --git a/debian/patches/features/all/rt/0026-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 similarity index 95% rename from debian/patches/features/all/rt/0026-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch rename to debian/patches/features/all/rt/0020-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch index 80d9e9983..6fb95ed92 100644 --- a/debian/patches/features/all/rt/0026-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, 22 Sep 2017 14:59:57 -0500 -Subject: [PATCH 26/42] tracing: Pass tracing_map_elt to hist_field accessor +Date: Fri, 17 Nov 2017 14:32:59 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Some accessor functions, such as for variable references, require access to a corrsponding tracing_map_elt. @@ -169,7 +169,7 @@ Signed-off-by: Sebastian Andrzej Siewior { \ type *addr = (type *)(event + hist_field->field->offset); \ \ -@@ -235,8 +256,10 @@ struct hist_trigger_data { +@@ -233,8 +254,10 @@ struct hist_trigger_data { bool remove; }; @@ -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); -@@ -1611,7 +1634,7 @@ static void hist_trigger_elt_update(stru +@@ -1610,7 +1633,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); } -@@ -1649,9 +1672,9 @@ static void event_hist_trigger(struct ev +@@ -1648,9 +1671,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; -@@ -1672,7 +1695,7 @@ static void event_hist_trigger(struct ev +@@ -1671,7 +1694,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 93b9483ba..70c42007e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz The current decision whether a timer can be queued on a remote CPU checks for timer->expiry <= remote_cpu_base.expires_next. @@ -14,6 +14,7 @@ So its safe to allow enqueuing timers with the same expiry time as the first expiring timer on a remote CPU base. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 2 +- diff --git a/debian/patches/features/all/rt/0027-tracing-Add-hist_field-type-field.patch b/debian/patches/features/all/rt/0021-tracing-Add-hist_field-type-field.patch similarity index 83% rename from debian/patches/features/all/rt/0027-tracing-Add-hist_field-type-field.patch rename to debian/patches/features/all/rt/0021-tracing-Add-hist_field-type-field.patch index 6110ffc56..e18df7a69 100644 --- a/debian/patches/features/all/rt/0027-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, 22 Sep 2017 14:59:58 -0500 -Subject: [PATCH 27/42] tracing: Add hist_field 'type' field -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:33:00 -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 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; -@@ -672,6 +673,7 @@ static void destroy_hist_field(struct hi +@@ -712,6 +713,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); } -@@ -697,6 +699,10 @@ static struct hist_field *create_hist_fi +@@ -737,6 +739,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; } -@@ -710,12 +716,18 @@ static struct hist_field *create_hist_fi +@@ -750,12 +756,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; } -@@ -725,6 +737,11 @@ static struct hist_field *create_hist_fi +@@ -765,6 +777,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) -@@ -732,6 +749,12 @@ static struct hist_field *create_hist_fi +@@ -772,6 +789,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) { -@@ -941,6 +964,11 @@ static struct hist_field *parse_unary(st +@@ -981,6 +1004,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: -@@ -1029,6 +1057,11 @@ static struct hist_field *parse_expr(str +@@ -1070,6 +1098,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 5649bd822..95aaa97a0 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -19,6 +19,7 @@ Instead of handing in timer and timer->base as an argument remove the base argument from hrtimer_reprogram() and retrieve the clock base internally. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 6 +++--- diff --git a/debian/patches/features/all/rt/0028-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 similarity index 74% rename from debian/patches/features/all/rt/0028-tracing-Add-variable-reference-handling-to-hist-trig.patch rename to debian/patches/features/all/rt/0022-tracing-Add-variable-reference-handling-to-hist-trig.patch index da23fe146..08a9d4d58 100644 --- a/debian/patches/features/all/rt/0028-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, 22 Sep 2017 14:59:59 -0500 -Subject: [PATCH 28/42] tracing: Add variable reference handling to hist +Date: Fri, 17 Nov 2017 14:33:01 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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,13 +27,13 @@ Signed-off-by: Sebastian Andrzej Siewior --- kernel/trace/trace.c | 2 kernel/trace/trace.h | 3 - kernel/trace/trace_events_hist.c | 613 ++++++++++++++++++++++++++++++++---- + kernel/trace/trace_events_hist.c | 632 ++++++++++++++++++++++++++++++++++-- kernel/trace/trace_events_trigger.c | 6 - 4 files changed, 568 insertions(+), 56 deletions(-) + 4 files changed, 623 insertions(+), 20 deletions(-) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -7766,6 +7766,7 @@ static int instance_mkdir(const char *na +@@ -7804,6 +7804,7 @@ static int instance_mkdir(const char *na INIT_LIST_HEAD(&tr->systems); INIT_LIST_HEAD(&tr->events); @@ -41,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (allocate_trace_buffers(tr, trace_buf_size) < 0) goto out_free_tr; -@@ -8513,6 +8514,7 @@ ssize_t trace_parse_run_command(struct f +@@ -8554,6 +8555,7 @@ ssize_t trace_parse_run_command(struct f INIT_LIST_HEAD(&global_trace.systems); INIT_LIST_HEAD(&global_trace.events); @@ -70,9 +70,12 @@ Signed-off-by: Sebastian Andrzej Siewior extern int register_trigger_hist_enable_disable_cmds(void); --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -60,6 +60,9 @@ struct hist_field { +@@ -59,7 +59,12 @@ struct hist_field { + struct hist_trigger_data *hist_data; struct hist_var var; enum field_op_id operator; ++ char *system; ++ char *event_name; char *name; + unsigned int var_idx; + unsigned int var_ref_idx; @@ -80,15 +83,15 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_none(struct hist_field *field, -@@ -215,6 +218,7 @@ enum hist_field_flags { +@@ -214,6 +219,7 @@ enum hist_field_flags { + HIST_FIELD_FL_TIMESTAMP_USECS = 1 << 11, HIST_FIELD_FL_VAR = 1 << 12, - HIST_FIELD_FL_VAR_ONLY = 1 << 13, - HIST_FIELD_FL_EXPR = 1 << 14, -+ HIST_FIELD_FL_VAR_REF = 1 << 15, + HIST_FIELD_FL_EXPR = 1 << 13, ++ HIST_FIELD_FL_VAR_REF = 1 << 14, }; struct var_defs { -@@ -255,6 +259,8 @@ struct hist_trigger_data { +@@ -253,6 +259,8 @@ struct hist_trigger_data { struct tracing_map *map; bool enable_timestamps; bool remove; @@ -97,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_timestamp(struct hist_field *hist_field, -@@ -273,10 +279,344 @@ static u64 hist_field_timestamp(struct h +@@ -271,6 +279,216 @@ static u64 hist_field_timestamp(struct h return ts; } @@ -106,9 +109,10 @@ Signed-off-by: Sebastian Andrzej Siewior + struct hist_trigger_data *hist_data; +}; + -+static struct hist_field *check_var_ref(struct hist_field *hist_field, -+ struct hist_trigger_data *var_data, -+ unsigned int var_idx) ++static struct hist_field * ++check_field_for_var_ref(struct hist_field *hist_field, ++ struct hist_trigger_data *var_data, ++ unsigned int var_idx) +{ + struct hist_field *found = NULL; + @@ -122,27 +126,52 @@ Signed-off-by: Sebastian Andrzej Siewior + return found; +} + ++static struct hist_field * ++check_field_for_var_refs(struct hist_trigger_data *hist_data, ++ struct hist_field *hist_field, ++ struct hist_trigger_data *var_data, ++ unsigned int var_idx, ++ unsigned int level) ++{ ++ struct hist_field *found = NULL; ++ unsigned int i; ++ ++ if (level > 2) ++ return found; ++ ++ if (!hist_field) ++ return found; ++ ++ found = check_field_for_var_ref(hist_field, var_data, var_idx); ++ if (found) ++ return found; ++ ++ for (i = 0; i < HIST_FIELD_OPERANDS_MAX; i++) { ++ struct hist_field *operand; ++ ++ operand = hist_field->operands[i]; ++ found = check_field_for_var_refs(hist_data, operand, var_data, ++ var_idx, level + 1); ++ if (found) ++ return found; ++ } ++ ++ return found; ++} ++ +static struct hist_field *find_var_ref(struct hist_trigger_data *hist_data, + struct hist_trigger_data *var_data, + unsigned int var_idx) +{ + struct hist_field *hist_field, *found = NULL; -+ unsigned int i, j; ++ unsigned int i; + + for_each_hist_field(i, hist_data) { + hist_field = hist_data->fields[i]; -+ found = check_var_ref(hist_field, var_data, var_idx); ++ found = check_field_for_var_refs(hist_data, hist_field, ++ var_data, var_idx, 0); + if (found) + return found; -+ -+ for (j = 0; j < HIST_FIELD_OPERANDS_MAX; j++) { -+ struct hist_field *operand; -+ -+ operand = hist_field->operands[j]; -+ found = check_var_ref(operand, var_data, var_idx); -+ if (found) -+ return found; -+ } + } + + return found; @@ -155,6 +184,10 @@ 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) { + found = find_var_ref(var_data->hist_data, hist_data, var_idx); + if (found) @@ -198,27 +231,41 @@ Signed-off-by: Sebastian Andrzej Siewior + return found; +} + ++static bool field_has_hist_vars(struct hist_field *hist_field, ++ unsigned int level) ++{ ++ int i; ++ ++ if (level > 2) ++ return false; ++ ++ if (!hist_field) ++ return false; ++ ++ if (hist_field->flags & HIST_FIELD_FL_VAR || ++ hist_field->flags & HIST_FIELD_FL_VAR_REF) ++ return true; ++ ++ for (i = 0; i < HIST_FIELD_OPERANDS_MAX; i++) { ++ struct hist_field *operand; ++ ++ operand = hist_field->operands[i]; ++ if (field_has_hist_vars(operand, level + 1)) ++ return true; ++ } ++ ++ return false; ++} ++ +static bool has_hist_vars(struct hist_trigger_data *hist_data) +{ + struct hist_field *hist_field; -+ int i, j; ++ int i; + + for_each_hist_field(i, hist_data) { + hist_field = hist_data->fields[i]; -+ if (hist_field && -+ (hist_field->flags & HIST_FIELD_FL_VAR || -+ hist_field->flags & HIST_FIELD_FL_VAR_REF)) ++ if (field_has_hist_vars(hist_field, 0)) + return true; -+ -+ for (j = 0; j < HIST_FIELD_OPERANDS_MAX; j++) { -+ struct hist_field *operand; -+ -+ operand = hist_field->operands[j]; -+ if (operand && -+ (operand->flags & HIST_FIELD_FL_VAR || -+ operand->flags & HIST_FIELD_FL_VAR_REF)) -+ return true; -+ } + } + + return false; @@ -267,52 +314,22 @@ Signed-off-by: Sebastian Andrzej Siewior + trace_array_put(tr); +} + -+static struct hist_field *find_var_field(struct hist_trigger_data *hist_data, -+ const char *var_name) -+{ -+ struct hist_field *hist_field, *found = NULL; -+ int i; -+ -+ for_each_hist_field(i, hist_data) { -+ hist_field = hist_data->fields[i]; -+ if (hist_field && hist_field->flags & HIST_FIELD_FL_VAR && -+ strcmp(hist_field->var.name, var_name) == 0) { -+ found = hist_field; -+ break; -+ } -+ } -+ -+ return found; -+} -+ -+static struct hist_field *find_var(struct trace_event_file *file, -+ const char *var_name) -+{ -+ struct hist_trigger_data *hist_data; -+ struct event_trigger_data *test; -+ struct hist_field *hist_field; -+ -+ list_for_each_entry_rcu(test, &file->triggers, list) { -+ if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { -+ hist_data = test->private_data; -+ hist_field = find_var_field(hist_data, var_name); -+ if (hist_field) -+ return hist_field; -+ } -+ } -+ -+ return NULL; -+} -+ + 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 + return NULL; + } + +static struct trace_event_file *find_var_file(struct trace_array *tr, -+ const char *system, -+ const char *event_name, -+ const char *var_name) ++ char *system, ++ char *event_name, ++ char *var_name) +{ + struct hist_trigger_data *var_hist_data; + struct hist_var_data *var_data; + struct trace_event_call *call; -+ struct trace_event_file *file; ++ struct trace_event_file *file, *found = NULL; + const char *name; + + list_for_each_entry(var_data, &tr->hist_vars, list) { @@ -322,8 +339,13 @@ Signed-off-by: Sebastian Andrzej Siewior + name = trace_event_name(call); + + if (!system || !event_name) { -+ if (find_var(file, var_name)) -+ return file; ++ if (find_var(var_hist_data, file, var_name)) { ++ if (found) { ++ return NULL; ++ } ++ ++ found = file; ++ } + continue; + } + @@ -332,10 +354,11 @@ Signed-off-by: Sebastian Andrzej Siewior + if (strcmp(system, call->class->system) != 0) + continue; + -+ return file; ++ found = file; ++ break; + } + -+ return NULL; ++ return found; +} + +static struct hist_field *find_file_var(struct trace_event_file *file, @@ -357,11 +380,12 @@ Signed-off-by: Sebastian Andrzej Siewior + return NULL; +} + -+static struct hist_field *find_event_var(struct trace_array *tr, -+ const char *system, -+ const char *event_name, -+ const char *var_name) ++static struct hist_field *find_event_var(struct hist_trigger_data *hist_data, ++ char *system, ++ char *event_name, ++ char *var_name) +{ ++ struct trace_array *tr = hist_data->event_file->tr; + struct hist_field *hist_field = NULL; + struct trace_event_file *file; + @@ -442,17 +466,30 @@ Signed-off-by: Sebastian Andrzej Siewior static const char *hist_field_name(struct hist_field *field, unsigned int level) { -@@ -291,7 +631,8 @@ static const char *hist_field_name(struc +@@ -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"; - else if (field->flags & HIST_FIELD_FL_EXPR) +- field_name = field->name; + else if (field->flags & HIST_FIELD_FL_EXPR || -+ field->flags & HIST_FIELD_FL_VAR_REF) - field_name = field->name; ++ field->flags & HIST_FIELD_FL_VAR_REF) { ++ if (field->system) { ++ static char full_name[MAX_FILTER_STR_VAL]; ++ ++ strcat(full_name, field->system); ++ strcat(full_name, "."); ++ strcat(full_name, field->event_name); ++ strcat(full_name, "."); ++ strcat(full_name, field->name); ++ field_name = full_name; ++ } else ++ field_name = field->name; ++ } if (field_name == NULL) -@@ -596,6 +937,8 @@ static char *expr_str(struct hist_field + field_name = ""; +@@ -636,6 +1004,8 @@ static char *expr_str(struct hist_field return expr; } @@ -461,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]); -@@ -618,6 +961,8 @@ static char *expr_str(struct hist_field +@@ -658,6 +1028,8 @@ static char *expr_str(struct hist_field return NULL; } @@ -470,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]); -@@ -697,6 +1042,11 @@ static struct hist_field *create_hist_fi +@@ -737,6 +1109,11 @@ static struct hist_field *create_hist_fi if (flags & HIST_FIELD_FL_EXPR) goto out; /* caller will populate */ @@ -482,39 +519,65 @@ Signed-off-by: Sebastian Andrzej Siewior if (flags & HIST_FIELD_FL_HITCOUNT) { hist_field->fn = hist_field_counter; hist_field->size = sizeof(u64); -@@ -790,6 +1140,51 @@ static void destroy_hist_fields(struct h +@@ -830,6 +1207,77 @@ static void destroy_hist_fields(struct h } } +static int init_var_ref(struct hist_field *ref_field, -+ struct hist_field *var_field) ++ struct hist_field *var_field, ++ char *system, char *event_name) +{ ++ int err = 0; ++ + ref_field->var.idx = var_field->var.idx; + ref_field->var.hist_data = var_field->hist_data; + ref_field->size = var_field->size; + ref_field->is_signed = var_field->is_signed; + ++ if (system) { ++ ref_field->system = kstrdup(system, GFP_KERNEL); ++ if (!ref_field->system) ++ return -ENOMEM; ++ } ++ ++ if (event_name) { ++ ref_field->event_name = kstrdup(event_name, GFP_KERNEL); ++ if (!ref_field->event_name) { ++ err = -ENOMEM; ++ goto free; ++ } ++ } ++ + ref_field->name = kstrdup(var_field->var.name, GFP_KERNEL); -+ if (!ref_field->name) -+ return -ENOMEM; ++ if (!ref_field->name) { ++ err = -ENOMEM; ++ goto free; ++ } + + ref_field->type = kstrdup(var_field->type, GFP_KERNEL); + if (!ref_field->type) { -+ kfree(ref_field->name); -+ return -ENOMEM; ++ err = -ENOMEM; ++ goto free; + } ++ out: ++ return err; ++ free: ++ kfree(ref_field->system); ++ kfree(ref_field->event_name); ++ kfree(ref_field->name); + -+ return 0; ++ goto out; +} + -+static struct hist_field *create_var_ref(struct hist_field *var_field) ++static struct hist_field *create_var_ref(struct hist_field *var_field, ++ char *system, char *event_name) +{ + unsigned long flags = HIST_FIELD_FL_VAR_REF; + struct hist_field *ref_field; + + ref_field = create_hist_field(var_field->hist_data, NULL, flags, NULL); + if (ref_field) { -+ if (init_var_ref(ref_field, var_field)) { ++ if (init_var_ref(ref_field, var_field, system, event_name)) { + destroy_hist_field(ref_field, 0); + return NULL; + } @@ -534,7 +597,7 @@ Signed-off-by: Sebastian Andrzej Siewior static char *field_name_from_var(struct hist_trigger_data *hist_data, char *var_name) { -@@ -801,7 +1196,7 @@ static char *field_name_from_var(struct +@@ -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]; @@ -543,7 +606,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; return field; } -@@ -813,11 +1208,32 @@ static char *field_name_from_var(struct +@@ -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) { @@ -555,7 +618,7 @@ Signed-off-by: Sebastian Andrzej Siewior return field_name_from_var(hist_data, var_name); } -+static struct hist_field *parse_var_ref(struct trace_array *tr, ++static struct hist_field *parse_var_ref(struct hist_trigger_data *hist_data, + char *system, char *event_name, + char *var_name) +{ @@ -566,9 +629,9 @@ Signed-off-by: Sebastian Andrzej Siewior + + var_name++; + -+ var_field = find_event_var(tr, system, event_name, var_name); ++ var_field = find_event_var(hist_data, system, event_name, var_name); + if (var_field) -+ ref_field = create_var_ref(var_field); ++ ref_field = create_var_ref(var_field, system, event_name); + + return ref_field; +} @@ -576,13 +639,12 @@ 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) -@@ -874,13 +1290,39 @@ struct hist_field *parse_atom(struct his +@@ -914,13 +1383,38 @@ 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 trace_array *tr = hist_data->event_file->tr; struct ftrace_event_field *field = NULL; struct hist_field *hist_field = NULL; int ret = 0; @@ -609,7 +671,7 @@ Signed-off-by: Sebastian Andrzej Siewior + + s = local_field_var_ref(hist_data, ref_var); + if (!s) { -+ hist_field = parse_var_ref(tr, ref_system, ref_event, ref_var); ++ hist_field = parse_var_ref(hist_data, ref_system, ref_event, ref_var); + if (hist_field) { + hist_data->var_refs[hist_data->n_var_refs] = hist_field; + hist_field->var_ref_idx = hist_data->n_var_refs++; @@ -619,7 +681,7 @@ Signed-off-by: Sebastian Andrzej Siewior str = s; field = parse_field(hist_data, file, str, flags); -@@ -1053,6 +1495,9 @@ static struct hist_field *parse_expr(str +@@ -1094,6 +1588,9 @@ static struct hist_field *parse_expr(str goto free; } @@ -629,51 +691,7 @@ Signed-off-by: Sebastian Andrzej Siewior expr->operands[0] = operand1; expr->operands[1] = operand2; expr->operator = field_op; -@@ -1099,43 +1544,6 @@ static int create_hitcount_val(struct hi - return 0; - } - --static struct hist_field *find_var_field(struct hist_trigger_data *hist_data, -- const char *var_name) --{ -- struct hist_field *hist_field, *found = NULL; -- int i; -- -- for_each_hist_field(i, hist_data) { -- hist_field = hist_data->fields[i]; -- if (hist_field && hist_field->flags & HIST_FIELD_FL_VAR && -- strcmp(hist_field->var.name, var_name) == 0) { -- found = hist_field; -- break; -- } -- } -- -- return found; --} -- --static struct hist_field *find_var(struct trace_event_file *file, -- const char *var_name) --{ -- struct hist_trigger_data *hist_data; -- struct event_trigger_data *test; -- struct hist_field *hist_field; -- -- list_for_each_entry_rcu(test, &file->triggers, list) { -- if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { -- hist_data = test->private_data; -- hist_field = find_var_field(hist_data, var_name); -- if (hist_field) -- return hist_field; -- } -- } -- -- return NULL; --} -- - static int __create_val_field(struct hist_trigger_data *hist_data, - unsigned int val_idx, - struct trace_event_file *file, -@@ -1269,6 +1677,12 @@ static int create_key_field(struct hist_ +@@ -1266,6 +1763,12 @@ static int create_key_field(struct hist_ goto out; } @@ -686,7 +704,7 @@ Signed-off-by: Sebastian Andrzej Siewior key_size = hist_field->size; } -@@ -1604,6 +2018,7 @@ create_hist_data(unsigned int map_bits, +@@ -1604,6 +2107,7 @@ create_hist_data(unsigned int map_bits, hist_data->attrs = attrs; hist_data->remove = remove; @@ -694,7 +712,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = create_hist_fields(hist_data, file); if (ret) -@@ -1626,12 +2041,6 @@ create_hist_data(unsigned int map_bits, +@@ -1626,12 +2130,6 @@ create_hist_data(unsigned int map_bits, ret = create_tracing_map_fields(hist_data); if (ret) goto free; @@ -707,7 +725,7 @@ Signed-off-by: Sebastian Andrzej Siewior out: return hist_data; free: -@@ -1646,12 +2055,17 @@ create_hist_data(unsigned int map_bits, +@@ -1646,12 +2144,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, @@ -726,7 +744,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); -@@ -1704,6 +2118,7 @@ static void event_hist_trigger(struct ev +@@ -1703,6 +2206,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]; @@ -734,7 +752,7 @@ Signed-off-by: Sebastian Andrzej Siewior char compound_key[HIST_KEY_SIZE_MAX]; struct tracing_map_elt *elt = NULL; struct stack_trace stacktrace; -@@ -1743,9 +2158,15 @@ static void event_hist_trigger(struct ev +@@ -1742,9 +2246,15 @@ static void event_hist_trigger(struct ev if (use_compound_key) key = compound_key; @@ -752,17 +770,20 @@ Signed-off-by: Sebastian Andrzej Siewior } static void hist_trigger_stacktrace_print(struct seq_file *m, -@@ -1848,7 +2269,8 @@ hist_trigger_entry_print(struct seq_file - field_name = hist_field_name(hist_data->fields[i], 0); +@@ -1961,8 +2471,11 @@ static void hist_field_print(struct seq_ - if (hist_data->fields[i]->flags & HIST_FIELD_FL_VAR || -- hist_data->fields[i]->flags & HIST_FIELD_FL_EXPR) -+ hist_data->fields[i]->flags & HIST_FIELD_FL_EXPR || -+ hist_data->fields[i]->flags & HIST_FIELD_FL_VAR_REF) - continue; + if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) + seq_puts(m, "$common_timestamp"); +- else if (field_name) ++ else if (field_name) { ++ if (hist_field->flags & HIST_FIELD_FL_VAR_REF) ++ seq_putc(m, '$'); + seq_printf(m, "%s", field_name); ++ } - if (hist_data->fields[i]->flags & HIST_FIELD_FL_HEX) { -@@ -2098,7 +2520,11 @@ static void event_hist_trigger_free(stru + 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 if (!data->ref) { if (data->name) del_named_trigger(data); @@ -774,7 +795,7 @@ Signed-off-by: Sebastian Andrzej Siewior destroy_hist_data(hist_data); } } -@@ -2311,23 +2737,55 @@ static int hist_register_trigger(char *g +@@ -2315,23 +2832,55 @@ static int hist_register_trigger(char *g goto out; } @@ -794,7 +815,7 @@ Signed-off-by: Sebastian Andrzej Siewior +{ + int ret = 0; + -+ list_add_rcu(&data->list, &file->triggers); ++ list_add_tail_rcu(&data->list, &file->triggers); + + update_cond_flag(file); @@ -834,7 +855,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) -@@ -2360,10 +2818,29 @@ static void hist_unregister_trigger(char +@@ -2364,11 +2913,30 @@ static void hist_unregister_trigger(char } } @@ -857,14 +878,15 @@ Signed-off-by: Sebastian Andrzej Siewior static void hist_unreg_all(struct trace_event_file *file) { struct event_trigger_data *test, *n; + struct hist_trigger_data *hist_data; + if (hist_file_check_refs(file)) + return; + list_for_each_entry_safe(test, n, &file->triggers, list) { if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { - list_del_rcu(&test->list); -@@ -2436,6 +2913,11 @@ static int event_hist_trigger_func(struc + hist_data = test->private_data; +@@ -2444,6 +3012,11 @@ static int event_hist_trigger_func(struc } if (remove) { @@ -876,7 +898,7 @@ Signed-off-by: Sebastian Andrzej Siewior cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file); ret = 0; goto out_free; -@@ -2453,14 +2935,33 @@ static int event_hist_trigger_func(struc +@@ -2461,14 +3034,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 2c02f137a..921b62feb 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,12 +1,13 @@ 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Preparatory patch for softirq based hrtimers to avoid code duplication. No functional change. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 44 ++++++++++++++++++++++++-------------------- diff --git a/debian/patches/features/all/rt/0029-tracing-Add-hist-trigger-action-hook.patch b/debian/patches/features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch similarity index 77% rename from debian/patches/features/all/rt/0029-tracing-Add-hist-trigger-action-hook.patch rename to debian/patches/features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch index 92c91b486..b71a54acb 100644 --- a/debian/patches/features/all/rt/0029-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, 22 Sep 2017 15:00:00 -0500 -Subject: [PATCH 29/42] tracing: Add hist trigger action hook -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:33:02 -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 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 | 91 +++++++++++++++++++++++++++++++++++++-- - 1 file changed, 88 insertions(+), 3 deletions(-) + kernel/trace/trace_events_hist.c | 108 +++++++++++++++++++++++++++++++++++++-- + 1 file changed, 105 insertions(+), 3 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -30,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior enum field_op_id { FIELD_OP_NONE, -@@ -241,6 +242,9 @@ struct hist_trigger_attrs { +@@ -242,6 +243,9 @@ struct hist_trigger_attrs { char *assignment_str[TRACING_MAP_VARS_MAX]; unsigned int n_assignments; @@ -62,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_timestamp(struct hist_field *hist_field, -@@ -710,6 +729,9 @@ static void destroy_hist_trigger_attrs(s +@@ -777,6 +796,9 @@ static void destroy_hist_trigger_attrs(s for (i = 0; i < attrs->n_assignments; i++) kfree(attrs->assignment_str[i]); @@ -72,7 +72,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(attrs->name); kfree(attrs->sort_key_str); kfree(attrs->keys_str); -@@ -717,6 +739,16 @@ static void destroy_hist_trigger_attrs(s +@@ -784,6 +806,16 @@ static void destroy_hist_trigger_attrs(s kfree(attrs); } @@ -89,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int parse_assignment(char *str, struct hist_trigger_attrs *attrs) { int ret = 0; -@@ -800,8 +832,9 @@ static struct hist_trigger_attrs *parse_ +@@ -867,8 +899,9 @@ static struct hist_trigger_attrs *parse_ else if (strcmp(str, "clear") == 0) attrs->clear = true; else { @@ -101,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -1949,11 +1982,42 @@ static int create_sort_keys(struct hist_ +@@ -2038,11 +2071,55 @@ static int create_sort_keys(struct hist_ return ret; } @@ -116,8 +116,7 @@ Signed-off-by: Sebastian Andrzej Siewior + } +} + -+static int create_actions(struct hist_trigger_data *hist_data, -+ struct trace_event_file *file) ++static int parse_actions(struct hist_trigger_data *hist_data) +{ + unsigned int i; + int ret = 0; @@ -129,6 +128,20 @@ Signed-off-by: Sebastian Andrzej Siewior + + return ret; +} ++ ++static int create_actions(struct hist_trigger_data *hist_data, ++ struct trace_event_file *file) ++{ ++ struct action_data *data; ++ unsigned int i; ++ int ret = 0; ++ ++ for (i = 0; i < hist_data->attrs->n_actions; i++) { ++ data = hist_data->actions[i]; ++ } ++ ++ return ret; ++} + static void destroy_hist_data(struct hist_trigger_data *hist_data) { @@ -144,7 +157,18 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_data); } -@@ -2112,6 +2176,20 @@ static inline void add_to_key(char *comp +@@ -2109,6 +2186,10 @@ create_hist_data(unsigned int map_bits, + hist_data->remove = remove; + hist_data->event_file = file; + ++ ret = parse_actions(hist_data); ++ if (ret) ++ goto free; ++ + ret = create_hist_fields(hist_data, file); + if (ret) + goto free; +@@ -2200,6 +2281,20 @@ static inline void add_to_key(char *comp memcpy(compound_key + key_field->offset, key, size); } @@ -165,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) { -@@ -2167,6 +2245,9 @@ static void event_hist_trigger(struct ev +@@ -2255,6 +2350,9 @@ static void event_hist_trigger(struct ev return; hist_trigger_elt_update(hist_data, elt, rec, rbe, var_ref_vals); @@ -175,7 +199,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void hist_trigger_stacktrace_print(struct seq_file *m, -@@ -2942,6 +3023,10 @@ static int event_hist_trigger_func(struc +@@ -3041,6 +3139,10 @@ static int event_hist_trigger_func(struc if (has_hist_vars(hist_data)) save_hist_vars(hist_data); @@ -186,7 +210,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = tracing_map_init(hist_data->map); if (ret) goto out_unreg; -@@ -2963,8 +3048,8 @@ static int event_hist_trigger_func(struc +@@ -3062,8 +3164,8 @@ static int event_hist_trigger_func(struc remove_hist_vars(hist_data); kfree(trigger_data); 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 3eb74f769..5e4687fc8 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,12 +1,13 @@ 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Preparatory patch for softirq based hrtimers to avoid code duplication. No functional change. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 20 ++++++++++++++++---- @@ -15,9 +16,9 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -459,13 +459,13 @@ static struct hrtimer_clock_base * - #define for_each_active_base(base, cpu_base, active) \ while ((base = __next_base((cpu_base), &(active)))) + #if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS) -static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base) +static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base, + unsigned int active, diff --git a/debian/patches/features/all/rt/0030-tracing-Add-support-for-synthetic-events.patch b/debian/patches/features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch similarity index 83% rename from debian/patches/features/all/rt/0030-tracing-Add-support-for-synthetic-events.patch rename to debian/patches/features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch index 07fca5a2d..53eb79ea2 100644 --- a/debian/patches/features/all/rt/0030-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, 22 Sep 2017 15:00:01 -0500 -Subject: [PATCH 30/42] tracing: Add support for 'synthetic' events -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:33:03 -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 Synthetic events are user-defined events generated from hist trigger variables saved from one or more other events. @@ -46,10 +46,12 @@ How this can be automatically hooked up via a hist trigger 'action' is discussed in a subsequent patch. Signed-off-by: Tom Zanussi +[fix noderef.cocci warnings, sizeof pointer for kcalloc of event->fields] +Signed-off-by: Fengguang Wu Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 865 +++++++++++++++++++++++++++++++++++++++ - 1 file changed, 865 insertions(+) + kernel/trace/trace_events_hist.c | 908 ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 906 insertions(+), 2 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -97,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,800 @@ struct action_data { +@@ -282,6 +308,803 @@ struct action_data { unsigned int var_ref_idx; }; @@ -265,7 +267,7 @@ Signed-off-by: Sebastian Andrzej Siewior + fmt = "%lu"; + else if (strcmp(type, "pid_t") == 0) + fmt = "%d"; -+ else if (strstr(type, "[") == 0) ++ else if (strchr(type, '[') != NULL) + fmt = "%s"; + + return fmt; @@ -549,7 +551,6 @@ Signed-off-by: Sebastian Andrzej Siewior + return NULL; +} + -+/* This function releases synth_event_mutex */ +static int register_synth_event(struct synth_event *event) +{ + struct trace_event_call *call = &event->call; @@ -584,14 +585,7 @@ Signed-off-by: Sebastian Andrzej Siewior + call->data = event; + call->tp = event->tp; + -+ /* -+ * trace_add_event_call() grabs event_mutex, but that can -+ * deadlock with a hist trigger cmd already holding it that -+ * can grab synth_event_mutex -+ */ -+ mutex_unlock(&synth_event_mutex); + ret = trace_add_event_call(call); -+ mutex_lock(&synth_event_mutex); + if (ret) { + pr_warn("Failed to register synthetic event: %s\n", + trace_event_name(call)); @@ -600,9 +594,7 @@ Signed-off-by: Sebastian Andrzej Siewior + + ret = set_synth_event_print_fmt(call); + if (ret < 0) { -+ mutex_unlock(&synth_event_mutex); + trace_remove_event_call(call); -+ mutex_lock(&synth_event_mutex); + goto err; + } + out: @@ -612,42 +604,16 @@ Signed-off-by: Sebastian Andrzej Siewior + goto out; +} + -+/* This function releases synth_event_mutex */ +static int unregister_synth_event(struct synth_event *event) +{ + struct trace_event_call *call = &event->call; + int ret; + -+ mutex_unlock(&synth_event_mutex); + ret = trace_remove_event_call(call); -+ mutex_lock(&synth_event_mutex); + + return ret; +} + -+static int remove_synth_event(struct synth_event *event) -+{ -+ int ret = unregister_synth_event(event); -+ -+ if (!ret) -+ list_del(&event->list); -+ -+ return ret; -+} -+ -+static int add_synth_event(struct synth_event *event) -+{ -+ int ret; -+ -+ ret = register_synth_event(event); -+ if (ret) -+ return ret; -+ -+ list_add(&event->list, &synth_event_list); -+ -+ return 0; -+} -+ +static void free_synth_event(struct synth_event *event) +{ + unsigned int i; @@ -685,7 +651,7 @@ Signed-off-by: Sebastian Andrzej Siewior + goto out; + } + -+ event->fields = kcalloc(n_fields, sizeof(event->fields), GFP_KERNEL); ++ event->fields = kcalloc(n_fields, sizeof(*event->fields), GFP_KERNEL); + if (!event->fields) { + free_synth_event(event); + event = ERR_PTR(-ENOMEM); @@ -700,7 +666,6 @@ Signed-off-by: Sebastian Andrzej Siewior + return event; +} + -+/* This function releases synth_event_mutex */ +static int create_synth_event(int argc, char **argv) +{ + struct synth_field *field, *fields[SYNTH_FIELDS_MAX]; @@ -732,20 +697,18 @@ Signed-off-by: Sebastian Andrzej Siewior + if (event) { + if (delete_event) { + if (event->ref) { ++ event = NULL; + ret = -EBUSY; + goto out; + } -+ ret = remove_synth_event(event); -+ if (!ret) -+ free_synth_event(event); ++ list_del(&event->list); + goto out; + } ++ event = NULL; + ret = -EEXIST; + goto out; -+ } else if (delete_event) { -+ ret = -EINVAL; ++ } else if (delete_event) + goto out; -+ } + + if (argc < 2) { + ret = -EINVAL; @@ -780,43 +743,85 @@ Signed-off-by: Sebastian Andrzej Siewior + event = NULL; + goto err; + } -+ -+ add_synth_event(event); + out: + mutex_unlock(&synth_event_mutex); + ++ 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); ++ } ++ } 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); ++ } ++ } ++ + return ret; + err: ++ mutex_unlock(&synth_event_mutex); ++ + for (i = 0; i < n_fields; i++) + free_synth_field(fields[i]); + free_synth_event(event); + -+ goto out; ++ return ret; +} + -+/* This function releases synth_event_mutex */ +static int release_all_synth_events(void) +{ ++ struct list_head release_events; + struct synth_event *event, *e; -+ int ret = 0; ++ int ret = 0, err = 0; ++ ++ INIT_LIST_HEAD(&release_events); + + mutex_lock(&synth_event_mutex); + + list_for_each_entry(event, &synth_event_list, list) { + if (event->ref) { -+ ret = -EBUSY; -+ goto out; ++ mutex_unlock(&synth_event_mutex); ++ return -EBUSY; + } + } + + list_for_each_entry_safe(event, e, &synth_event_list, list) { -+ ret = remove_synth_event(event); -+ if (!ret) -+ free_synth_event(event); ++ list_del(&event->list); ++ list_add(&event->list, &release_events); + } -+ out: ++ + mutex_unlock(&synth_event_mutex); + ++ list_for_each_entry_safe(event, e, &release_events, list) { ++ 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); ++ } ++ } ++ ++ if (err) ++ ret = err; ++ + return ret; +} + @@ -898,7 +903,60 @@ 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, -@@ -2942,6 +3762,8 @@ static int event_hist_trigger_func(struc +@@ -2956,6 +3779,28 @@ static int hist_trigger_enable(struct ev + return ret; + } + ++static bool have_hist_trigger_match(struct event_trigger_data *data, ++ struct trace_event_file *file) ++{ ++ struct hist_trigger_data *hist_data = data->private_data; ++ struct event_trigger_data *test, *named_data = NULL; ++ bool match = false; ++ ++ if (hist_data->attrs->name) ++ named_data = find_named_trigger(hist_data->attrs->name); ++ ++ list_for_each_entry_rcu(test, &file->triggers, list) { ++ if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) { ++ if (hist_trigger_match(data, test, named_data, false)) { ++ match = true; ++ break; ++ } ++ } ++ } ++ ++ return match; ++} ++ + 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_ + { + struct event_trigger_data *test, *n; + struct hist_trigger_data *hist_data; ++ struct synth_event *se; ++ const char *se_name; + + if (hist_file_check_refs(file)) + return; +@@ -3040,6 +3887,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); ++ ++ mutex_lock(&synth_event_mutex); ++ se_name = trace_event_name(file->event_call); ++ se = find_synth_event(se_name); ++ if (se) ++ se->ref--; ++ 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 struct hist_trigger_attrs *attrs; struct event_trigger_ops *trigger_ops; struct hist_trigger_data *hist_data; @@ -907,7 +965,30 @@ Signed-off-by: Sebastian Andrzej Siewior bool remove = false; char *trigger; int ret = 0; -@@ -3000,6 +3822,14 @@ static int event_hist_trigger_func(struc +@@ -3088,10 +3945,11 @@ static int event_hist_trigger_func(struc + + trigger_ops = cmd_ops->get_trigger_ops(cmd, trigger); + +- ret = -ENOMEM; + trigger_data = kzalloc(sizeof(*trigger_data), GFP_KERNEL); +- if (!trigger_data) ++ if (!trigger_data) { ++ ret = -ENOMEM; + goto out_free; ++ } + + trigger_data->count = -1; + trigger_data->ops = trigger_ops; +@@ -3110,12 +3968,23 @@ static int event_hist_trigger_func(struc + } + + if (remove) { ++ if (!have_hist_trigger_match(trigger_data, file)) ++ goto out_free; ++ + if (hist_trigger_check_refs(trigger_data, file)) { + ret = -EBUSY; + goto out_free; } cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file); @@ -922,9 +1003,9 @@ Signed-off-by: Sebastian Andrzej Siewior ret = 0; goto out_free; } -@@ -3017,6 +3847,13 @@ static int event_hist_trigger_func(struc - } else if (ret < 0) - goto out_free; +@@ -3151,6 +4020,13 @@ static int event_hist_trigger_func(struc + if (ret) + goto out_unreg; + mutex_lock(&synth_event_mutex); + se_name = trace_event_name(file->event_call); @@ -933,10 +1014,10 @@ Signed-off-by: Sebastian Andrzej Siewior + se->ref++; + mutex_unlock(&synth_event_mutex); + - if (get_named_trigger_data(trigger_data)) - goto enable; - -@@ -3207,3 +4044,31 @@ static __init void unregister_trigger_hi + /* Just return zero, not the number of registered triggers */ + ret = 0; + out: +@@ -3323,3 +4199,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 487bbff26..403d1a5b9 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -18,6 +18,7 @@ interrupt enabled state when called from softirq context. Suggested-by: Peter Zijlstra Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 31 ++++++++++++++++++------------- diff --git a/debian/patches/features/all/rt/0031-tracing-Add-support-for-field-variables.patch b/debian/patches/features/all/rt/0025-tracing-Add-support-for-field-variables.patch similarity index 70% rename from debian/patches/features/all/rt/0031-tracing-Add-support-for-field-variables.patch rename to debian/patches/features/all/rt/0025-tracing-Add-support-for-field-variables.patch index 2379f9978..30d571933 100644 --- a/debian/patches/features/all/rt/0031-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, 22 Sep 2017 15:00:02 -0500 -Subject: [PATCH 31/42] tracing: Add support for 'field variables' -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:33:04 -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 Users should be able to directly specify event fields in hist trigger 'actions' rather than being forced to explicitly create a variable for @@ -25,7 +25,7 @@ sched_switch, and prio is a normal field on sched_waking. Since the mechanism works on variables, those two normal fields just have 'invisible' variables created internally for them. In the case of 'prio', which is on another event, we actually need to create an -additional hist trigger and define the invisible event on that, since +additional hist trigger and define the invisible variable on that, since once a hist trigger is defined, variables can't be added to it later. echo 'wakeup_latency u64 lat; pid_t pid; int prio' >> @@ -41,12 +41,12 @@ echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0: Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 450 ++++++++++++++++++++++++++++++++++++++- - 1 file changed, 449 insertions(+), 1 deletion(-) + kernel/trace/trace_events_hist.c | 536 ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 535 insertions(+), 1 deletion(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -254,6 +254,16 @@ struct hist_trigger_attrs { +@@ -255,6 +255,16 @@ struct hist_trigger_attrs { struct var_defs var_defs; }; @@ -78,7 +78,16 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct synth_field { -@@ -1394,6 +1412,7 @@ static struct hist_field *find_event_var +@@ -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 struct hist_elt_data { char *comm; u64 *var_ref_vals; @@ -86,7 +95,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static u64 hist_field_var_ref(struct hist_field *hist_field, -@@ -1687,6 +1706,11 @@ static inline void save_comm(char *comm, +@@ -1757,6 +1778,11 @@ static inline void save_comm(char *comm, static void hist_elt_data_free(struct hist_elt_data *elt_data) { @@ -98,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(elt_data->comm); kfree(elt_data); } -@@ -1704,7 +1728,7 @@ static int hist_trigger_elt_data_alloc(s +@@ -1774,7 +1800,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; @@ -107,7 +116,7 @@ Signed-off-by: Sebastian Andrzej Siewior elt_data = kzalloc(sizeof(*elt_data), GFP_KERNEL); if (!elt_data) -@@ -1723,6 +1747,18 @@ static int hist_trigger_elt_data_alloc(s +@@ -1793,6 +1819,18 @@ static int hist_trigger_elt_data_alloc(s } } @@ -126,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior elt->private_data = elt_data; return 0; -@@ -2381,6 +2417,387 @@ static struct hist_field *parse_expr(str +@@ -2477,6 +2515,471 @@ static struct hist_field *parse_expr(str return ERR_PTR(ret); } @@ -165,7 +174,7 @@ Signed-off-by: Sebastian Andrzej Siewior + + for (n = 0; n < n_keys; n++) { + hist_field = hist_data->fields[i + n]; -+ target_hist_field = hist_data->fields[j + n]; ++ target_hist_field = target_hist_data->fields[j + n]; + + if (strcmp(hist_field->type, target_hist_field->type) != 0) + return false; @@ -213,8 +222,54 @@ Signed-off-by: Sebastian Andrzej Siewior +} + +static struct hist_field * ++find_synthetic_field_var(struct hist_trigger_data *target_hist_data, ++ char *system, char *event_name, char *field_name) ++{ ++ struct hist_field *event_var; ++ char *synthetic_name; ++ ++ synthetic_name = kzalloc(MAX_FILTER_STR_VAL, GFP_KERNEL); ++ if (!synthetic_name) ++ return ERR_PTR(-ENOMEM); ++ ++ strcpy(synthetic_name, "synthetic_"); ++ strcat(synthetic_name, field_name); ++ ++ event_var = find_event_var(target_hist_data, system, event_name, synthetic_name); ++ ++ kfree(synthetic_name); ++ ++ return event_var; ++} ++ ++/** ++ * create_field_var_hist - Automatically create a histogram and var for a field ++ * @target_hist_data: The target hist trigger ++ * @subsys_name: Optional subsystem name ++ * @event_name: Optional event name ++ * @field_name: The name of the field (and the resulting variable) ++ * ++ * Hist trigger actions fetch data from variables, not directly from ++ * events. However, for convenience, users are allowed to directly ++ * specify an event field in an action, which will be automatically ++ * converted into a variable on their behalf. ++ ++ * If a user specifies a field on an event that isn't the event the ++ * histogram currently being defined (the target event histogram), the ++ * only way that can be accomplished is if a new hist trigger is ++ * created and the field variable defined on that. ++ * ++ * This function creates a new histogram compatible with the target ++ * event (meaning a histogram with the same key as the target ++ * histogram), and creates a variable for the specified field, but ++ * with 'synthetic_' prepended to the variable name in order to avoid ++ * collision with normal field variables. ++ * ++ * Return: The variable created for the field. ++ */ ++struct hist_field * +create_field_var_hist(struct hist_trigger_data *target_hist_data, -+ char *system, char *event_name, char *field_name) ++ char *subsys_name, char *event_name, char *field_name) +{ + struct trace_array *tr = target_hist_data->event_file->tr; + struct hist_field *event_var = ERR_PTR(-EINVAL); @@ -230,17 +285,29 @@ Signed-off-by: Sebastian Andrzej Siewior + if (target_hist_data->n_field_var_hists >= SYNTH_FIELDS_MAX) + return ERR_PTR(-EINVAL); + -+ file = event_file(tr, system, event_name); ++ file = event_file(tr, subsys_name, event_name); + + if (IS_ERR(file)) { + ret = PTR_ERR(file); + return ERR_PTR(ret); + } + ++ /* ++ * Look for a histogram compatible with target. We'll use the ++ * found histogram specification to create a new matching ++ * histogram with our variable on it. target_hist_data is not ++ * yet a registered histogram so we can't use that. ++ */ + hist_data = find_compatible_hist(target_hist_data, file); + if (!hist_data) + return ERR_PTR(-EINVAL); + ++ /* 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)) ++ return event_var; ++ + var_hist = kzalloc(sizeof(*var_hist), GFP_KERNEL); + if (!var_hist) + return ERR_PTR(-ENOMEM); @@ -251,6 +318,7 @@ Signed-off-by: Sebastian Andrzej Siewior + return ERR_PTR(-ENOMEM); + } + ++ /* Use the same keys as the compatible histogram */ + strcat(cmd, "keys="); + + for_each_hist_key_field(i, hist_data) { @@ -261,11 +329,13 @@ Signed-off-by: Sebastian Andrzej Siewior + first = false; + } + ++ /* Create the synthetic field variable specification */ + strcat(cmd, ":synthetic_"); + strcat(cmd, field_name); + strcat(cmd, "="); + strcat(cmd, field_name); + ++ /* Use the same filter as the compatible histogram */ + saved_filter = find_trigger_filter(hist_data, file); + if (saved_filter) { + strcat(cmd, " if "); @@ -279,8 +349,10 @@ Signed-off-by: Sebastian Andrzej Siewior + return ERR_PTR(-ENOMEM); + } + ++ /* Save the compatible histogram information */ + var_hist->hist_data = hist_data; + ++ /* Create the new histogram with our variable */ + ret = event_hist_trigger_func(&trigger_hist_cmd, file, + "", "hist", cmd); + if (ret) { @@ -290,11 +362,12 @@ Signed-off-by: Sebastian Andrzej Siewior + return ERR_PTR(ret); + } + -+ strcpy(cmd, "synthetic_"); -+ strcat(cmd, field_name); ++ kfree(cmd); + -+ event_var = find_event_var(tr, system, event_name, cmd); -+ if (!event_var) { ++ /* 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); + kfree(var_hist->cmd); + kfree(var_hist); @@ -308,14 +381,14 @@ Signed-off-by: Sebastian Andrzej Siewior + return event_var; +} + -+static struct hist_field * ++struct hist_field * +find_target_event_var(struct hist_trigger_data *hist_data, -+ char *system, char *event_name, char *var_name) ++ char *subsys_name, char *event_name, char *var_name) +{ + struct trace_event_file *file = hist_data->event_file; + struct hist_field *hist_field = NULL; + -+ if (system) { ++ if (subsys_name) { + struct trace_event_call *call; + + if (!event_name) @@ -323,7 +396,7 @@ Signed-off-by: Sebastian Andrzej Siewior + + call = file->event_call; + -+ if (strcmp(system, call->class->system) != 0) ++ if (strcmp(subsys_name, call->class->system) != 0) + return NULL; + + if (strcmp(event_name, trace_event_name(call)) != 0) @@ -381,7 +454,7 @@ Signed-off-by: Sebastian Andrzej Siewior + struct hist_field *var; + int idx; + -+ if (find_var(file, name) && !hist_data->remove) { ++ if (find_var(hist_data, file, name) && !hist_data->remove) { + var = ERR_PTR(-EINVAL); + goto out; + } @@ -459,13 +532,33 @@ Signed-off-by: Sebastian Andrzej Siewior + goto out; +} + -+static struct field_var * -+create_target_field_var(struct hist_trigger_data *hist_data, -+ char *system, char *event_name, char *var_name) -+{ -+ struct trace_event_file *file = hist_data->event_file; ++/** ++ * create_target_field_var - Automatically create a variable for a field ++ * @target_hist_data: The target hist trigger ++ * @subsys_name: Optional subsystem name ++ * @event_name: Optional event name ++ * @var_name: The name of the field (and the resulting variable) ++ * ++ * Hist trigger actions fetch data from variables, not directly from ++ * events. However, for convenience, users are allowed to directly ++ * specify an event field in an action, which will be automatically ++ * converted into a variable on their behalf. + -+ if (system) { ++ * This function creates a field variable with the name var_name on ++ * the hist trigger currently being defined on the target event. If ++ * subsys_name and event_name are specified, this function simply ++ * verifies that they do in fact match the target event subsystem and ++ * event name. ++ * ++ * Return: The variable created for the field. ++ */ ++struct field_var * ++create_target_field_var(struct hist_trigger_data *target_hist_data, ++ char *subsys_name, char *event_name, char *var_name) ++{ ++ struct trace_event_file *file = target_hist_data->event_file; ++ ++ if (subsys_name) { + struct trace_event_call *call; + + if (!event_name) @@ -473,14 +566,14 @@ Signed-off-by: Sebastian Andrzej Siewior + + call = file->event_call; + -+ if (strcmp(system, call->class->system) != 0) ++ if (strcmp(subsys_name, call->class->system) != 0) + return NULL; + + if (strcmp(event_name, trace_event_name(call)) != 0) + return NULL; + } + -+ return create_field_var(hist_data, file, var_name); ++ return create_field_var(target_hist_data, file, var_name); +} + +static void destroy_field_var(struct field_var *field_var) @@ -502,8 +595,8 @@ Signed-off-by: Sebastian Andrzej Siewior + destroy_field_var(hist_data->field_vars[i]); +} + -+static void save_field_var(struct hist_trigger_data *hist_data, -+ struct field_var *field_var) ++void save_field_var(struct hist_trigger_data *hist_data, ++ struct field_var *field_var) +{ + hist_data->field_vars[hist_data->n_field_vars++] = field_var; + @@ -514,7 +607,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = -@@ -2827,6 +3244,16 @@ static int create_actions(struct hist_tr +@@ -2932,6 +3435,16 @@ static int create_actions(struct hist_tr return ret; } @@ -531,7 +624,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_hist_data(struct hist_trigger_data *hist_data) { if (!hist_data) -@@ -2837,6 +3264,8 @@ static void destroy_hist_data(struct his +@@ -2942,6 +3455,8 @@ static void destroy_hist_data(struct his tracing_map_destroy(hist_data->map); destroy_actions(hist_data); @@ -540,7 +633,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_data); } -@@ -2970,6 +3399,8 @@ static void hist_trigger_elt_update(stru +@@ -3078,6 +3593,8 @@ static void hist_trigger_elt_update(stru tracing_map_set_var(elt, var_idx, hist_val); } } @@ -549,7 +642,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline void add_to_key(char *compound_key, void *key, -@@ -3687,6 +4118,21 @@ static bool hist_trigger_check_refs(stru +@@ -3824,6 +4341,21 @@ static bool hist_trigger_check_refs(stru return false; } @@ -571,7 +664,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) -@@ -3702,6 +4148,7 @@ static void hist_unregister_trigger(char +@@ -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; @@ -579,11 +672,11 @@ Signed-off-by: Sebastian Andrzej Siewior unregistered = true; list_del_rcu(&test->list); trace_event_trigger_enable_disable(file, 0); -@@ -3744,6 +4191,7 @@ static void hist_unreg_all(struct trace_ - +@@ -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) { -+ unregister_field_var_hists(test->private_data); + hist_data = test->private_data; ++ unregister_field_var_hists(hist_data); list_del_rcu(&test->list); trace_event_trigger_enable_disable(file, 0); - update_cond_flag(file); + 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 1d30d3ddd..5d00e3d27 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz hrtimer callback functions are always executed in hard interrupt context. Users of hrtimer which need their timer function to be executed @@ -18,6 +18,7 @@ HRTIMER_MODE_SOFT and the matching combinations with the ABS/REL/PINNED bits and update the decoding of hrtimer_mode in tracepoints. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 14 ++++++++++++++ diff --git a/debian/patches/features/all/rt/0032-tracing-Add-onmatch-hist-trigger-action-support.patch b/debian/patches/features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch similarity index 70% rename from debian/patches/features/all/rt/0032-tracing-Add-onmatch-hist-trigger-action-support.patch rename to debian/patches/features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch index c0125b934..98b7a9b94 100644 --- a/debian/patches/features/all/rt/0032-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, 22 Sep 2017 15:00:03 -0500 -Subject: [PATCH 32/42] tracing: Add 'onmatch' hist trigger action support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:33:05 -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 Add an 'onmatch(matching.event).(param list)' hist trigger action which is invoked with the set of variables or @@ -43,8 +43,8 @@ Signed-off-by: Tom Zanussi Signed-off-by: Rajvi Jingar Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 406 +++++++++++++++++++++++++++++++++++++-- - 1 file changed, 394 insertions(+), 12 deletions(-) + kernel/trace/trace_events_hist.c | 472 +++++++++++++++++++++++++++++++++++++-- + 1 file changed, 459 insertions(+), 13 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -68,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; static LIST_HEAD(synth_event_list); -@@ -925,6 +936,21 @@ static struct synth_event *alloc_synth_e +@@ -889,6 +900,21 @@ static struct synth_event *alloc_synth_e return event; } @@ -87,22 +87,10 @@ Signed-off-by: Sebastian Andrzej Siewior + struct hist_trigger_data *hist_data; +}; + - /* This function releases synth_event_mutex */ static int create_synth_event(int argc, char **argv) { -@@ -967,10 +993,8 @@ static int create_synth_event(int argc, - } - ret = -EEXIST; - goto out; -- } else if (delete_event) { -- ret = -EINVAL; -+ } else if (delete_event) - goto out; -- } - - if (argc < 2) { - ret = -EINVAL; -@@ -1136,11 +1160,6 @@ static u64 hist_field_timestamp(struct h + struct synth_field *field, *fields[SYNTH_FIELDS_MAX]; +@@ -1139,11 +1165,6 @@ static u64 hist_field_timestamp(struct h return ts; } @@ -111,10 +99,63 @@ Signed-off-by: Sebastian Andrzej Siewior - struct hist_trigger_data *hist_data; -}; - - static struct hist_field *check_var_ref(struct hist_field *hist_field, - struct hist_trigger_data *var_data, - unsigned int var_idx) -@@ -1580,11 +1599,21 @@ static void destroy_hist_trigger_attrs(s + 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( + return NULL; + } + ++static struct hist_field * ++find_match_var(struct hist_trigger_data *hist_data, char *var_name) ++{ ++ struct trace_array *tr = hist_data->event_file->tr; ++ struct hist_field *hist_field, *found = NULL; ++ struct trace_event_file *file; ++ unsigned int i; ++ ++ for (i = 0; i < hist_data->n_actions; i++) { ++ struct action_data *data = hist_data->actions[i]; ++ ++ if (data->fn == action_trace) { ++ char *system = data->onmatch.match_event_system; ++ char *event_name = data->onmatch.match_event; ++ ++ file = find_var_file(tr, system, event_name, var_name); ++ if (!file) ++ continue; ++ hist_field = find_file_var(file, var_name); ++ if (hist_field) { ++ if (found) { ++ return ERR_PTR(-EINVAL); ++ } ++ ++ found = hist_field; ++ } ++ } ++ } ++ return found; ++} ++ + 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 + struct hist_field *hist_field = NULL; + struct trace_event_file *file; + ++ if (!system || !event_name) { ++ hist_field = find_match_var(hist_data, var_name); ++ if (IS_ERR(hist_field)) ++ return NULL; ++ if (hist_field) ++ return hist_field; ++ } ++ + 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 static int parse_action(char *str, struct hist_trigger_attrs *attrs) { @@ -137,17 +178,35 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -2452,7 +2481,7 @@ static bool compatible_keys(struct hist_ +@@ -2643,7 +2713,7 @@ find_synthetic_field_var(struct hist_tri + * + * Return: The variable created for the field. + */ +-struct hist_field * ++static struct hist_field * + 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 + return event_var; + } - for (n = 0; n < n_keys; n++) { - hist_field = hist_data->fields[i + n]; -- target_hist_field = hist_data->fields[j + n]; -+ target_hist_field = target_hist_data->fields[j + n]; - - if (strcmp(hist_field->type, target_hist_field->type) != 0) - return false; -@@ -2770,6 +2799,27 @@ create_target_field_var(struct hist_trig - return create_field_var(hist_data, file, var_name); +-struct hist_field * ++static struct hist_field * + 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 + * + * Return: The variable created for the field. + */ +-struct field_var * ++static struct field_var * + 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 + return create_field_var(target_hist_data, file, var_name); } +static void onmatch_destroy(struct action_data *data) @@ -174,7 +233,18 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_field_var(struct field_var *field_var) { if (!field_var) -@@ -2798,6 +2848,283 @@ static void save_field_var(struct hist_t +@@ -2971,8 +3062,8 @@ static void destroy_field_vars(struct hi + destroy_field_var(hist_data->field_vars[i]); + } + +-void save_field_var(struct hist_trigger_data *hist_data, +- struct field_var *field_var) ++static void save_field_var(struct hist_trigger_data *hist_data, ++ struct field_var *field_var) + { + hist_data->field_vars[hist_data->n_field_vars++] = field_var; + +@@ -2980,6 +3071,298 @@ void save_field_var(struct hist_trigger_ hist_data->n_field_var_str++; } @@ -250,7 +320,6 @@ Signed-off-by: Sebastian Andrzej Siewior +onmatch_find_var(struct hist_trigger_data *hist_data, struct action_data *data, + char *system, char *event, char *var) +{ -+ struct trace_array *tr = hist_data->event_file->tr; + struct hist_field *hist_field; + + var++; /* skip '$' */ @@ -262,7 +331,7 @@ Signed-off-by: Sebastian Andrzej Siewior + event = data->onmatch.match_event; + } + -+ hist_field = find_event_var(tr, system, event, var); ++ hist_field = find_event_var(hist_data, system, event, var); + } + + return hist_field; @@ -276,19 +345,36 @@ Signed-off-by: Sebastian Andrzej Siewior + struct hist_field *hist_field = NULL; + struct field_var *field_var; + ++ /* ++ * First try to create a field var on the target event (the ++ * currently being defined). This will create a variable for ++ * unqualified fields on the target event, or if qualified, ++ * target fields that have qualified names matching the target. ++ */ + field_var = create_target_field_var(hist_data, system, event, var); -+ if (IS_ERR(field_var)) -+ goto out; + -+ if (field_var) { ++ if (field_var && !IS_ERR(field_var)) { + save_field_var(hist_data, field_var); + hist_field = field_var->var; + } else { ++ field_var = NULL; ++ /* ++ * If no explicit system.event is specfied, default to ++ * looking for fields on the onmatch(system.event.xxx) ++ * event. ++ */ + if (!system) { + system = data->onmatch.match_event_system; + event = data->onmatch.match_event; + } + ++ /* ++ * At this point, we're looking at a field on another ++ * event. Because we can't modify a hist trigger on ++ * another event to add a variable for a field, we need ++ * to create a new trigger on that event and create the ++ * variable at the same time. ++ */ + hist_field = create_field_var_hist(hist_data, system, event, var); + if (IS_ERR(hist_field)) + goto free; @@ -360,7 +446,7 @@ Signed-off-by: Sebastian Andrzej Siewior + } + + if (check_synth_field(event, hist_field, field_pos) == 0) { -+ var_ref = create_var_ref(hist_field); ++ var_ref = create_var_ref(hist_field, system, event_name); + if (!var_ref) { + kfree(p); + ret = -ENOMEM; @@ -386,7 +472,6 @@ Signed-off-by: Sebastian Andrzej Siewior + data->fn = action_trace; + data->onmatch.synth_event = event; + data->onmatch.var_ref_idx = var_ref_idx; -+ hist_data->actions[hist_data->n_actions++] = data; + event->ref++; + out: + return ret; @@ -458,7 +543,7 @@ Signed-off-by: Sebastian Andrzej Siewior static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = -@@ -3226,24 +3553,76 @@ static void destroy_actions(struct hist_ +@@ -3404,18 +3787,39 @@ static void destroy_actions(struct hist_ for (i = 0; i < hist_data->n_actions; i++) { struct action_data *data = hist_data->actions[i]; @@ -470,8 +555,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } - static int create_actions(struct hist_trigger_data *hist_data, - struct trace_event_file *file) + static int parse_actions(struct hist_trigger_data *hist_data) { + struct trace_array *tr = hist_data->event_file->tr; + struct action_data *data; @@ -486,14 +570,29 @@ Signed-off-by: Sebastian Andrzej Siewior + char *action_str = str + strlen("onmatch("); + + data = onmatch_parse(tr, action_str); -+ if (IS_ERR(data)) -+ return PTR_ERR(data); -+ -+ ret = onmatch_create(hist_data, file, data); -+ if (ret) { -+ onmatch_destroy(data); -+ return ret; ++ if (IS_ERR(data)) { ++ ret = PTR_ERR(data); ++ break; + } ++ data->fn = action_trace; ++ } else { ++ ret = -EINVAL; ++ break; ++ } ++ ++ hist_data->actions[hist_data->n_actions++] = data; + } + + return ret; +@@ -3430,11 +3834,50 @@ static int create_actions(struct hist_tr + + for (i = 0; i < hist_data->attrs->n_actions; i++) { + data = hist_data->actions[i]; ++ ++ if (data->fn == action_trace) { ++ ret = onmatch_create(hist_data, file, data); ++ if (ret) ++ return ret; + } } @@ -536,7 +635,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void destroy_field_var_hists(struct hist_trigger_data *hist_data) { unsigned int i; -@@ -3266,6 +3645,7 @@ static void destroy_hist_data(struct his +@@ -3457,6 +3900,7 @@ static void destroy_hist_data(struct his destroy_actions(hist_data); destroy_field_vars(hist_data); destroy_field_var_hists(hist_data); @@ -544,7 +643,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(hist_data); } -@@ -3814,6 +4194,8 @@ static int event_hist_trigger_print(stru +@@ -4015,6 +4459,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 6e9d89696..f67468db7 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz The softirq based hrtimer can utilize most of the existing hrtimers functions, but need to operate on a different data set. @@ -12,6 +12,7 @@ can be selected. Fixup the existing callers and hand in the ACTIVE_HARD mask. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 38 +++++++++++++++++++++++++++++--------- diff --git a/debian/patches/features/all/rt/0033-tracing-Add-onmax-hist-trigger-action-support.patch b/debian/patches/features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch similarity index 90% rename from debian/patches/features/all/rt/0033-tracing-Add-onmax-hist-trigger-action-support.patch rename to debian/patches/features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch index 0d13d5e49..875d4c0f5 100644 --- a/debian/patches/features/all/rt/0033-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, 22 Sep 2017 15:00:04 -0500 -Subject: [PATCH 33/42] tracing: Add 'onmax' hist trigger action support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:33:06 -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 Add an 'onmax(var).save(field,...)' hist trigger action which is invoked whenever an event exceeds the current maximum. @@ -55,8 +55,8 @@ fields: Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 332 ++++++++++++++++++++++++++++++++++----- - 1 file changed, 297 insertions(+), 35 deletions(-) + kernel/trace/trace_events_hist.c | 331 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 296 insertions(+), 35 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -86,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; }; -@@ -1604,7 +1616,8 @@ static int parse_action(char *str, struc +@@ -1717,7 +1729,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; -@@ -1776,7 +1789,7 @@ static int hist_trigger_elt_data_alloc(s +@@ -1889,7 +1902,7 @@ static int hist_trigger_elt_data_alloc(s } } @@ -105,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior size = STR_VAR_LEN_MAX; -@@ -2690,6 +2703,15 @@ static void update_field_vars(struct his +@@ -2893,6 +2906,15 @@ static void update_field_vars(struct his hist_data->n_field_vars, 0); } @@ -121,8 +121,8 @@ 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) -@@ -2799,6 +2821,229 @@ create_target_field_var(struct hist_trig - return create_field_var(hist_data, file, var_name); +@@ -3022,6 +3044,227 @@ create_target_field_var(struct hist_trig + return create_field_var(target_hist_data, file, var_name); } +static void onmax_print(struct seq_file *m, @@ -217,7 +217,7 @@ Signed-off-by: Sebastian Andrzej Siewior + if (!ref_field) + return -ENOMEM; + -+ if (init_var_ref(ref_field, var_field)) { ++ if (init_var_ref(ref_field, var_field, NULL, NULL)) { + destroy_hist_field(ref_field, 0); + ret = -ENOMEM; + goto out; @@ -255,8 +255,6 @@ Signed-off-by: Sebastian Andrzej Siewior + + kfree(param); + } -+ -+ hist_data->actions[hist_data->n_actions++] = data; + out: + return ret; +} @@ -351,7 +349,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void onmatch_destroy(struct action_data *data) { unsigned int i; -@@ -2883,39 +3128,6 @@ static int check_synth_field(struct synt +@@ -3106,39 +3349,6 @@ static int check_synth_field(struct synt return 0; } @@ -391,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) -@@ -3555,6 +3767,8 @@ static void destroy_actions(struct hist_ +@@ -3789,6 +3999,8 @@ static void destroy_actions(struct hist_ if (data->fn == action_trace) onmatch_destroy(data); @@ -400,22 +398,30 @@ Signed-off-by: Sebastian Andrzej Siewior else kfree(data); } -@@ -3584,12 +3798,56 @@ static int create_actions(struct hist_tr - onmatch_destroy(data); - return ret; +@@ -3814,6 +4026,15 @@ static int parse_actions(struct hist_tri + break; } + data->fn = action_trace; + } else if (strncmp(str, "onmax(", strlen("onmax(")) == 0) { + char *action_str = str + strlen("onmax("); + + data = onmax_parse(action_str); -+ if (IS_ERR(data)) -+ return PTR_ERR(data); -+ -+ ret = onmax_create(hist_data, data); -+ if (ret) { -+ onmax_destroy(data); -+ return ret; ++ if (IS_ERR(data)) { ++ ret = PTR_ERR(data); ++ break; + } ++ data->fn = onmax_save; + } else { + ret = -EINVAL; + break; +@@ -3839,12 +4060,48 @@ static int create_actions(struct hist_tr + ret = onmatch_create(hist_data, file, data); + if (ret) + return ret; ++ } else if (data->fn == onmax_save) { ++ ret = onmax_create(hist_data, data); ++ if (ret) ++ return ret; } } @@ -457,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) -@@ -3620,6 +3878,8 @@ static void print_actions_spec(struct se +@@ -3875,6 +4132,8 @@ static void print_actions_spec(struct se if (data->fn == action_trace) print_onmatch_spec(m, hist_data, data); @@ -466,7 +472,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } -@@ -3994,6 +4254,8 @@ hist_trigger_entry_print(struct seq_file +@@ -4256,6 +4515,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 9dab27c4f..a57d87139 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz hrtimer callbacks are always invoked in hard interrupt context. Several users in tree require soft interrupt context for their callbacks and @@ -32,15 +32,24 @@ processing the regular processing is resumed. Suggested-by: Thomas Gleixner Suggested-by: Peter Zijlstra Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- - include/linux/hrtimer.h | 20 +++- + include/linux/hrtimer.h | 21 +++-- kernel/time/hrtimer.c | 201 ++++++++++++++++++++++++++++++++++++++++-------- - 2 files changed, 185 insertions(+), 36 deletions(-) + 2 files changed, 186 insertions(+), 36 deletions(-) --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h -@@ -113,6 +113,7 @@ struct hrtimer { +@@ -103,6 +103,7 @@ enum hrtimer_restart { + * @base: pointer to the timer base (per cpu and per clock) + * @state: state information (See bit values above) + * @is_rel: Set if the timer was armed relative ++ * @is_soft: Set if hrtimer will be expired in soft interrupt context. + * + * The hrtimer structure must be initialized by hrtimer_init() + */ +@@ -113,6 +114,7 @@ struct hrtimer { struct hrtimer_clock_base *base; u8 state; u8 is_rel; @@ -48,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; /** -@@ -178,13 +179,18 @@ enum hrtimer_base_type { +@@ -178,13 +180,18 @@ enum hrtimer_base_type { * @hres_active: State of high resolution mode * @in_hrtirq: hrtimer_interrupt() is currently executing * @hang_detected: The last hrtimer interrupt detected a hang @@ -68,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior * @clock_base: array of clock bases for this cpu * * Note: next_timer is just an optimization for __remove_hrtimer(). -@@ -196,9 +202,10 @@ struct hrtimer_cpu_base { +@@ -196,9 +203,10 @@ struct hrtimer_cpu_base { unsigned int cpu; unsigned int active_bases; unsigned int clock_was_set_seq; @@ -82,7 +91,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_HIGH_RES_TIMERS unsigned int nr_events; unsigned short nr_retries; -@@ -207,6 +214,8 @@ struct hrtimer_cpu_base { +@@ -207,6 +215,8 @@ struct hrtimer_cpu_base { #endif ktime_t expires_next; struct hrtimer *next_timer; @@ -91,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; } ____cacheline_aligned; -@@ -379,7 +388,8 @@ extern void hrtimer_start_range_ns(struc +@@ -379,7 +389,8 @@ extern void hrtimer_start_range_ns(struc * @timer: the timer to be added * @tim: expiry time * @mode: timer mode: absolute (HRTIMER_MODE_ABS) or @@ -158,14 +167,14 @@ Signed-off-by: Sebastian Andrzej Siewior trace_hrtimer_start(timer, mode); } -@@ -470,7 +486,6 @@ static inline void debug_deactivate(stru - trace_hrtimer_cancel(timer); - } +@@ -487,7 +503,6 @@ static struct hrtimer_clock_base * + #define for_each_active_base(base, cpu_base, active) \ + while ((base = __next_base((cpu_base), &(active)))) -#if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS) - static struct hrtimer_clock_base * - __next_base(struct hrtimer_cpu_base *cpu_base, unsigned int *active) - { + static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base, + unsigned int active, + ktime_t expires_next) @@ -504,7 +519,10 @@ static ktime_t __hrtimer_next_event_base expires = ktime_sub(hrtimer_get_expires(timer), base->offset); if (expires < expires_next) { diff --git a/debian/patches/features/all/rt/0034-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 similarity index 60% rename from debian/patches/features/all/rt/0034-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch rename to debian/patches/features/all/rt/0028-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch index 3c3236684..84becd2e1 100644 --- a/debian/patches/features/all/rt/0034-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, 22 Sep 2017 15:00:05 -0500 -Subject: [PATCH 34/42] tracing: Allow whitespace to surround hist trigger +Date: Fri, 17 Nov 2017 14:33:07 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -14,12 +14,12 @@ in param lists. Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 24 +++++++++++++++++++----- - 1 file changed, 19 insertions(+), 5 deletions(-) + kernel/trace/trace_events_hist.c | 37 ++++++++++++++++++++++++++++++++----- + 1 file changed, 32 insertions(+), 5 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -4857,7 +4857,7 @@ static int event_hist_trigger_func(struc +@@ -5157,7 +5157,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) -@@ -4866,10 +4866,23 @@ static int event_hist_trigger_func(struc +@@ -5166,10 +5166,37 @@ static int event_hist_trigger_func(struc if (glob[0] == '!') remove = true; @@ -40,27 +40,33 @@ Signed-off-by: Sebastian Andrzej Siewior + * separate the trigger from the filter (k:v [if filter]) + * allowing for whitespace in the trigger + */ -+ trigger = param; -+ p = strstr(param, " if"); -+ if (!p) -+ p = strstr(param, "\tif"); -+ if (p) { -+ if (p == trigger) ++ p = trigger = param; ++ do { ++ p = strstr(p, "if"); ++ if (!p) ++ break; ++ if (p == param) + return -EINVAL; -+ param = p + 1; -+ param = strstrip(param); -+ *p = '\0'; -+ trigger = strstrip(trigger); -+ } else ++ if (*(p - 1) != ' ' && *(p - 1) != '\t') { ++ p++; ++ continue; ++ } ++ if (p >= param + strlen(param) - strlen("if") - 1) ++ return -EINVAL; ++ if (*(p + strlen("if")) != ' ' && *(p + strlen("if")) != '\t') { ++ p++; ++ continue; ++ } ++ break; ++ } while (p); ++ ++ if (!p) + param = NULL; ++ else { ++ *(p - 1) = '\0'; ++ param = strstrip(p); ++ trigger = strstrip(trigger); ++ } attrs = parse_hist_trigger_attrs(trigger); if (IS_ERR(attrs)) -@@ -4927,6 +4940,7 @@ static int event_hist_trigger_func(struc - } - - ret = cmd_ops->reg(glob, trigger_ops, trigger_data, file); -+ - /* - * The above returns on success the # of triggers registered, - * but if it didn't register any it returns zero. Consider no 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 138d4367b..e1101059f 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz All prerequisites to handle hrtimers for expiry in either hard or soft interrupt context are in place. @@ -10,6 +10,7 @@ Add the missing bit in hrtimer_init() which associates the timer to the hard or the soft irq clock base. Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 15 +++++++++++---- diff --git a/debian/patches/features/all/rt/0035-tracing-Add-cpu-field-for-hist-triggers.patch b/debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch similarity index 71% rename from debian/patches/features/all/rt/0035-tracing-Add-cpu-field-for-hist-triggers.patch rename to debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch index 1a0269f68..8d48422a1 100644 --- a/debian/patches/features/all/rt/0035-tracing-Add-cpu-field-for-hist-triggers.patch +++ b/debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch @@ -1,7 +1,7 @@ From: Tom Zanussi -Date: Fri, 22 Sep 2017 15:00:06 -0500 -Subject: [PATCH 35/42] tracing: Add cpu field for hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:33:08 -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 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 @@ -12,13 +12,13 @@ another name for the same thing. Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/events.txt | 18 ++++++++++++++++++ - kernel/trace/trace_events_hist.c | 28 +++++++++++++++++++++++++++- - 2 files changed, 45 insertions(+), 1 deletion(-) + Documentation/trace/histogram.txt | 17 +++++++++++++++++ + kernel/trace/trace_events_hist.c | 28 +++++++++++++++++++++++++++- + 2 files changed, 44 insertions(+), 1 deletion(-) ---- a/Documentation/trace/events.txt -+++ b/Documentation/trace/events.txt -@@ -668,6 +668,24 @@ triggers (you have to use '!' for each o +--- a/Documentation/trace/histogram.txt ++++ b/Documentation/trace/histogram.txt +@@ -172,6 +172,23 @@ The examples below provide a more concrete illustration of the concepts and typical usage patterns discussed above. @@ -39,21 +39,20 @@ Signed-off-by: Sebastian Andrzej Siewior + modified by .usecs to have timestamps + interpreted as microseconds. + cpu int - the cpu on which the event occurred. -+ 6.2 'hist' trigger examples --------------------------- --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -226,6 +226,7 @@ enum hist_field_flags { - HIST_FIELD_FL_VAR_ONLY = 1 << 13, - HIST_FIELD_FL_EXPR = 1 << 14, - HIST_FIELD_FL_VAR_REF = 1 << 15, -+ HIST_FIELD_FL_CPU = 1 << 16, +@@ -227,6 +227,7 @@ enum hist_field_flags { + HIST_FIELD_FL_VAR = 1 << 12, + HIST_FIELD_FL_EXPR = 1 << 13, + HIST_FIELD_FL_VAR_REF = 1 << 14, ++ HIST_FIELD_FL_CPU = 1 << 15, }; struct var_defs { -@@ -1172,6 +1173,16 @@ static u64 hist_field_timestamp(struct h +@@ -1177,6 +1178,16 @@ static u64 hist_field_timestamp(struct h return ts; } @@ -67,19 +66,19 @@ Signed-off-by: Sebastian Andrzej Siewior + return cpu; +} + - static struct hist_field *check_var_ref(struct hist_field *hist_field, - struct hist_trigger_data *var_data, - unsigned int var_idx) -@@ -1520,6 +1531,8 @@ static const char *hist_field_name(struc + 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 field_name = hist_field_name(field->operands[0], ++level); else if (field->flags & HIST_FIELD_FL_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) - field_name = field->name; -@@ -2012,6 +2025,15 @@ static struct hist_field *create_hist_fi + field->flags & HIST_FIELD_FL_VAR_REF) { + if (field->system) { +@@ -2125,6 +2138,15 @@ static struct hist_field *create_hist_fi goto out; } @@ -95,7 +94,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (WARN_ON_ONCE(!field)) goto out; -@@ -2204,7 +2226,9 @@ parse_field(struct hist_trigger_data *hi +@@ -2343,7 +2365,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; @@ -106,12 +105,12 @@ Signed-off-by: Sebastian Andrzej Siewior field = trace_find_event_field(file->event_call, field_name); if (!field || !field->size) { field = ERR_PTR(-EINVAL); -@@ -4353,6 +4377,8 @@ static void hist_field_print(struct seq_ +@@ -4614,6 +4638,8 @@ static void hist_field_print(struct seq_ if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) seq_puts(m, "$common_timestamp"); + else if (hist_field->flags & HIST_FIELD_FL_CPU) + seq_puts(m, "cpu"); - else if (field_name) - seq_printf(m, "%s", field_name); - + else if (field_name) { + if (hist_field->flags & HIST_FIELD_FL_VAR_REF) + seq_putc(m, '$'); 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 e8f1ade79..70b21d8a9 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 @@ -1,14 +1,15 @@ From: Thomas Gleixner -Date: Sun, 22 Oct 2017 23:40:08 +0200 +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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner +Signed-off-by: Thomas Gleixner Cc: Oliver Hartkopp Cc: Marc Kleine-Budde Cc: linux-can@vger.kernel.org diff --git a/debian/patches/features/all/rt/0036-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 similarity index 73% rename from debian/patches/features/all/rt/0036-tracing-Add-hist-trigger-support-for-variable-refere.patch rename to debian/patches/features/all/rt/0030-tracing-Add-hist-trigger-support-for-variable-refere.patch index 19b50416a..2b7ba886c 100644 --- a/debian/patches/features/all/rt/0036-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,11 +1,11 @@ From: Tom Zanussi -Date: Fri, 22 Sep 2017 15:00:07 -0500 -Subject: [PATCH 36/42] tracing: Add hist trigger support for variable +Date: Fri, 17 Nov 2017 14:33:09 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Add support for alias=$somevar where alias can be used as -onmatch($alias). +onmatch.xxx($alias). Aliases are a way of creating a new name for an existing variable, for flexibly in making naming more clear in certain cases. For example in @@ -24,20 +24,20 @@ uses that in the call instead: Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/trace/trace_events_hist.c | 61 +++++++++++++++++++++++++++++++++++++-- - 1 file changed, 58 insertions(+), 3 deletions(-) + kernel/trace/trace_events_hist.c | 58 ++++++++++++++++++++++++++++++++++++--- + 1 file changed, 55 insertions(+), 3 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -227,6 +227,7 @@ enum hist_field_flags { - HIST_FIELD_FL_EXPR = 1 << 14, - HIST_FIELD_FL_VAR_REF = 1 << 15, - HIST_FIELD_FL_CPU = 1 << 16, -+ HIST_FIELD_FL_ALIAS = 1 << 17, +@@ -228,6 +228,7 @@ enum hist_field_flags { + HIST_FIELD_FL_EXPR = 1 << 13, + HIST_FIELD_FL_VAR_REF = 1 << 14, + HIST_FIELD_FL_CPU = 1 << 15, ++ HIST_FIELD_FL_ALIAS = 1 << 16, }; struct var_defs { -@@ -1527,7 +1528,8 @@ static const char *hist_field_name(struc +@@ -1629,7 +1630,8 @@ static const char *hist_field_name(struc if (field->field) field_name = field->field->name; @@ -47,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior field_name = hist_field_name(field->operands[0], ++level); else if (field->flags & HIST_FIELD_FL_TIMESTAMP) field_name = "$common_timestamp"; -@@ -1983,7 +1985,7 @@ static struct hist_field *create_hist_fi +@@ -2096,7 +2098,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) { -@@ -2241,6 +2243,29 @@ parse_field(struct hist_trigger_data *hi +@@ -2380,6 +2382,28 @@ parse_field(struct hist_trigger_data *hi return field; } @@ -65,8 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior + char *var_name) +{ + struct hist_field *alias = NULL; -+ unsigned long flags = HIST_FIELD_FL_ALIAS | HIST_FIELD_FL_VAR | -+ HIST_FIELD_FL_VAR_ONLY; ++ unsigned long flags = HIST_FIELD_FL_ALIAS | HIST_FIELD_FL_VAR; + + alias = create_hist_field(hist_data, NULL, flags, var_name); + if (!alias) @@ -75,7 +74,7 @@ Signed-off-by: Sebastian Andrzej Siewior + alias->fn = var_ref->fn; + alias->operands[0] = var_ref; + -+ if (init_var_ref(alias, var_ref)) { ++ if (init_var_ref(alias, var_ref, var_ref->system, var_ref->event_name)) { + destroy_hist_field(alias, 0); + return NULL; + } @@ -86,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) -@@ -2275,6 +2300,13 @@ struct hist_field *parse_atom(struct his +@@ -2413,6 +2437,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++; @@ -100,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior return hist_field; } } else -@@ -2378,6 +2410,26 @@ static int check_expr_operands(struct hi +@@ -2517,6 +2548,26 @@ static int check_expr_operands(struct hi unsigned long operand1_flags = operand1->flags; unsigned long operand2_flags = operand2->flags; @@ -127,16 +126,13 @@ Signed-off-by: Sebastian Andrzej Siewior if ((operand1_flags & HIST_FIELD_FL_TIMESTAMP_USECS) != (operand2_flags & HIST_FIELD_FL_TIMESTAMP_USECS)) return -EINVAL; -@@ -4379,8 +4431,11 @@ static void hist_field_print(struct seq_ - seq_puts(m, "$common_timestamp"); +@@ -4641,7 +4692,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) -+ else if (field_name) { -+ if (hist_field->flags & HIST_FIELD_FL_ALIAS) -+ seq_putc(m, '$'); + else if (field_name) { +- if (hist_field->flags & HIST_FIELD_FL_VAR_REF) ++ if (hist_field->flags & HIST_FIELD_FL_VAR_REF || ++ hist_field->flags & HIST_FIELD_FL_ALIAS) + seq_putc(m, '$'); seq_printf(m, "%s", field_name); -+ } - - if (hist_field->flags) { - const char *flags_str = get_hist_field_flags(hist_field); + } 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 c05e3ffc4..ecf9f3467 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 @@ -1,17 +1,17 @@ From: Thomas Gleixner -Date: Sun, 22 Oct 2017 23:40:09 +0200 +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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner +Cc: linux-wireless@vger.kernel.org Cc: Johannes Berg Cc: Kalle Valo -Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/wireless/mac80211_hwsim.c | 44 +++++++++++++++------------------- diff --git a/debian/patches/features/all/rt/0037-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 similarity index 72% rename from debian/patches/features/all/rt/0037-tracing-Add-last-error-error-facility-for-hist-trigg.patch rename to debian/patches/features/all/rt/0031-tracing-Add-last-error-error-facility-for-hist-trigg.patch index bff03fa9e..c9341d21d 100644 --- a/debian/patches/features/all/rt/0037-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, 22 Sep 2017 15:00:08 -0500 -Subject: [PATCH 37/42] tracing: Add 'last error' error facility for hist +Date: Fri, 17 Nov 2017 14:33:10 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz With the addition of variables and actions, it's become necessary to provide more detailed error information to users about syntax errors. @@ -26,13 +26,13 @@ Also add specific error messages for variable and action errors. Signed-off-by: Tom Zanussi Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/events.txt | 19 ++++ - kernel/trace/trace_events_hist.c | 162 +++++++++++++++++++++++++++++++++++---- - 2 files changed, 168 insertions(+), 13 deletions(-) + Documentation/trace/histogram.txt | 20 ++++ + kernel/trace/trace_events_hist.c | 167 +++++++++++++++++++++++++++++++++++--- + 2 files changed, 174 insertions(+), 13 deletions(-) ---- a/Documentation/trace/events.txt -+++ b/Documentation/trace/events.txt -@@ -686,6 +686,25 @@ triggers (you have to use '!' for each o +--- a/Documentation/trace/histogram.txt ++++ b/Documentation/trace/histogram.txt +@@ -190,6 +190,26 @@ interpreted as microseconds. cpu int - the cpu on which the event occurred. @@ -55,9 +55,10 @@ Signed-off-by: Sebastian Andrzej Siewior + # cat /sys/kernel/debug/tracing/events/sched/sched_wakeup/hist + ERROR: Couldn't yyy: zzz + Last command: xxx - ++ 6.2 'hist' trigger examples --------------------------- + --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -351,6 +351,65 @@ struct action_data { @@ -126,7 +127,31 @@ Signed-off-by: Sebastian Andrzej Siewior static LIST_HEAD(synth_event_list); static DEFINE_MUTEX(synth_event_mutex); -@@ -2132,9 +2191,18 @@ static struct hist_field *create_var_ref +@@ -1458,6 +1517,7 @@ static struct trace_event_file *find_var + if (!system || !event_name) { + if (find_var(var_hist_data, file, var_name)) { + if (found) { ++ hist_err_event("Variable name not unique, need to use fully qualified name (subsys.event.var) for variable: ", system, event_name, var_name); + return NULL; + } + +@@ -1518,6 +1578,7 @@ find_match_var(struct hist_trigger_data + hist_field = find_file_var(file, var_name); + if (hist_field) { + if (found) { ++ hist_err_event("Variable name not unique, need to use fully qualified name (subsys.event.var) for variable: ", system, event_name, var_name); + return ERR_PTR(-EINVAL); + } + +@@ -1801,6 +1862,7 @@ static int parse_assignment(char *str, s + char *assignment; + + if (attrs->n_assignments == TRACING_MAP_VARS_MAX) { ++ hist_err("Too many variables defined: ", str); + ret = -EINVAL; + goto out; + } +@@ -2271,9 +2333,18 @@ static struct hist_field *create_var_ref return ref_field; } @@ -146,9 +171,9 @@ Signed-off-by: Sebastian Andrzej Siewior return false; return true; -@@ -2186,6 +2254,10 @@ static struct hist_field *parse_var_ref( +@@ -2325,6 +2396,10 @@ static struct hist_field *parse_var_ref( if (var_field) - ref_field = create_var_ref(var_field); + ref_field = create_var_ref(var_field, system, event_name); + if (!ref_field) + hist_err_event("Couldn't find variable: $", @@ -157,7 +182,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ref_field; } -@@ -2431,8 +2503,10 @@ static int check_expr_operands(struct hi +@@ -2569,8 +2644,10 @@ static int check_expr_operands(struct hi } if ((operand1_flags & HIST_FIELD_FL_TIMESTAMP_USECS) != @@ -169,55 +194,57 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -2632,19 +2706,27 @@ create_field_var_hist(struct hist_trigge +@@ -2816,12 +2893,17 @@ create_field_var_hist(struct hist_trigge char *cmd; int ret; - if (target_hist_data->n_field_var_hists >= SYNTH_FIELDS_MAX) + if (target_hist_data->n_field_var_hists >= SYNTH_FIELDS_MAX) { + hist_err_event("onmatch: Too many field variables defined: ", -+ system, event_name, field_name); ++ subsys_name, event_name, field_name); return ERR_PTR(-EINVAL); + } - file = event_file(tr, system, event_name); + file = event_file(tr, subsys_name, event_name); if (IS_ERR(file)) { + hist_err_event("onmatch: Event file not found: ", -+ system, event_name, field_name); ++ subsys_name, event_name, field_name); ret = PTR_ERR(file); return ERR_PTR(ret); } - +@@ -2833,8 +2915,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); - if (!hist_data) + if (!hist_data) { + hist_err_event("onmatch: Matching event histogram not found: ", -+ system, event_name, field_name); ++ subsys_name, event_name, field_name); return ERR_PTR(-EINVAL); + } - var_hist = kzalloc(sizeof(*var_hist), GFP_KERNEL); - if (!var_hist) -@@ -2692,6 +2774,8 @@ create_field_var_hist(struct hist_trigge + /* 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 kfree(cmd); kfree(var_hist->cmd); kfree(var_hist); + hist_err_event("onmatch: Couldn't create histogram for field: ", -+ system, event_name, field_name); ++ subsys_name, event_name, field_name); return ERR_PTR(ret); } -@@ -2703,6 +2787,8 @@ create_field_var_hist(struct hist_trigge +@@ -2905,6 +2992,8 @@ create_field_var_hist(struct hist_trigge kfree(cmd); kfree(var_hist->cmd); kfree(var_hist); + hist_err_event("onmatch: Couldn't find synthetic variable: ", -+ system, event_name, field_name); ++ subsys_name, event_name, field_name); return ERR_PTR(-EINVAL); } -@@ -2839,18 +2925,21 @@ static struct field_var *create_field_va +@@ -3041,18 +3130,21 @@ static struct field_var *create_field_va int ret = 0; if (hist_data->n_field_vars >= SYNTH_FIELDS_MAX) { @@ -239,7 +266,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(val); ret = PTR_ERR(var); goto err; -@@ -2975,14 +3064,18 @@ static int onmax_create(struct hist_trig +@@ -3197,14 +3289,18 @@ static int onmax_create(struct hist_trig int ret = 0; onmax_var_str = data->onmax.var_str; @@ -260,7 +287,7 @@ Signed-off-by: Sebastian Andrzej Siewior flags = HIST_FIELD_FL_VAR_REF; ref_field = create_hist_field(hist_data, NULL, flags, NULL); -@@ -3002,6 +3095,7 @@ static int onmax_create(struct hist_trig +@@ -3224,6 +3320,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)) { @@ -268,7 +295,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = PTR_ERR(max_var); goto out; } -@@ -3016,6 +3110,7 @@ static int onmax_create(struct hist_trig +@@ -3238,6 +3335,7 @@ static int onmax_create(struct hist_trig field_var = create_target_field_var(hist_data, NULL, NULL, param); if (IS_ERR(field_var)) { @@ -276,7 +303,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = PTR_ERR(field_var); kfree(param); goto out; -@@ -3050,6 +3145,7 @@ static int parse_action_params(char *par +@@ -3270,6 +3368,7 @@ static int parse_action_params(char *par param = strstrip(param); if (strlen(param) < 2) { @@ -284,8 +311,8 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto out; } -@@ -3223,6 +3319,9 @@ onmatch_find_var(struct hist_trigger_dat - hist_field = find_event_var(tr, system, event, var); +@@ -3442,6 +3541,9 @@ onmatch_find_var(struct hist_trigger_dat + hist_field = find_event_var(hist_data, system, event, var); } + if (!hist_field) @@ -294,7 +321,7 @@ Signed-off-by: Sebastian Andrzej Siewior return hist_field; } -@@ -3273,6 +3372,7 @@ static int onmatch_create(struct hist_tr +@@ -3509,6 +3611,7 @@ static int onmatch_create(struct hist_tr mutex_lock(&synth_event_mutex); event = find_synth_event(data->onmatch.synth_event_name); if (!event) { @@ -302,7 +329,7 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_unlock(&synth_event_mutex); return -EINVAL; } -@@ -3331,12 +3431,15 @@ static int onmatch_create(struct hist_tr +@@ -3567,12 +3670,15 @@ static int onmatch_create(struct hist_tr continue; } @@ -318,7 +345,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto out; } -@@ -3362,15 +3465,22 @@ static struct action_data *onmatch_parse +@@ -3597,15 +3703,22 @@ static struct action_data *onmatch_parse return ERR_PTR(-ENOMEM); match_event = strsep(&str, ")"); @@ -344,7 +371,7 @@ Signed-off-by: Sebastian Andrzej Siewior data->onmatch.match_event = kstrdup(match_event, GFP_KERNEL); if (!data->onmatch.match_event) { -@@ -3385,12 +3495,16 @@ static struct action_data *onmatch_parse +@@ -3620,12 +3733,16 @@ static struct action_data *onmatch_parse } strsep(&str, "."); @@ -363,7 +390,7 @@ Signed-off-by: Sebastian Andrzej Siewior data->onmatch.synth_event_name = kstrdup(synth_event_name, GFP_KERNEL); if (!data->onmatch.synth_event_name) { -@@ -3399,8 +3513,10 @@ static struct action_data *onmatch_parse +@@ -3634,8 +3751,10 @@ static struct action_data *onmatch_parse } params = strsep(&str, ")"); @@ -375,22 +402,25 @@ Signed-off-by: Sebastian Andrzej Siewior ret = parse_action_params(params, data); if (ret) -@@ -3480,12 +3596,14 @@ static int create_var_field(struct hist_ - return -EINVAL; +@@ -3710,7 +3829,9 @@ static int create_var_field(struct hist_ - if (find_var(file, var_name) && !hist_data->remove) { + if (WARN_ON(val_idx >= TRACING_MAP_VALS_MAX + TRACING_MAP_VARS_MAX)) + return -EINVAL; ++ + if (find_var(hist_data, file, var_name) && !hist_data->remove) { + hist_err("Variable already defined: ", var_name); return -EINVAL; } - flags |= HIST_FIELD_FL_VAR; - hist_data->n_vars++; - if (hist_data->n_vars > TRACING_MAP_VARS_MAX) { -+ hist_err("Too many variables defined: ", var_name); - return -EINVAL; - } +@@ -3791,6 +3912,7 @@ static int create_key_field(struct hist_ + } -@@ -3676,6 +3794,7 @@ static int parse_var_defs(struct hist_tr + if (hist_field->flags & HIST_FIELD_FL_VAR_REF) { ++ hist_err("Using variable references as keys not supported: ", field_str); + destroy_hist_field(hist_field, 0); + ret = -EINVAL; + goto out; +@@ -3904,11 +4026,13 @@ static int parse_var_defs(struct hist_tr var_name = strsep(&field_str, "="); if (!var_name || !field_str) { @@ -398,7 +428,13 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto free; } -@@ -4402,6 +4521,11 @@ static int hist_show(struct seq_file *m, + + if (n_vars == TRACING_MAP_VARS_MAX) { ++ hist_err("Too many variables defined: ", var_name); + ret = -EINVAL; + goto free; + } +@@ -4662,6 +4786,11 @@ static int hist_show(struct seq_file *m, hist_trigger_show(m, data, n++); } @@ -410,7 +446,7 @@ Signed-off-by: Sebastian Andrzej Siewior out_unlock: mutex_unlock(&event_mutex); -@@ -4748,6 +4872,7 @@ static int hist_register_trigger(char *g +@@ -5009,6 +5138,7 @@ static int hist_register_trigger(char *g if (named_data) { if (!hist_trigger_match(data, named_data, named_data, true)) { @@ -418,7 +454,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -EINVAL; goto out; } -@@ -4767,13 +4892,16 @@ static int hist_register_trigger(char *g +@@ -5028,13 +5158,16 @@ static int hist_register_trigger(char *g test->paused = false; else if (hist_data->attrs->clear) hist_clear(test); @@ -436,7 +472,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = -ENOENT; goto out; } -@@ -4941,6 +5069,11 @@ static int event_hist_trigger_func(struc +@@ -5238,6 +5371,11 @@ static int event_hist_trigger_func(struc char *trigger, *p; int ret = 0; @@ -448,7 +484,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!param) return -EINVAL; -@@ -5062,6 +5195,9 @@ static int event_hist_trigger_func(struc +@@ -5376,6 +5514,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/0038-tracing-Add-inter-event-hist-trigger-Documentation.patch b/debian/patches/features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch similarity index 92% rename from debian/patches/features/all/rt/0038-tracing-Add-inter-event-hist-trigger-Documentation.patch rename to debian/patches/features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch index ff3516359..06d91513c 100644 --- a/debian/patches/features/all/rt/0038-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, 22 Sep 2017 15:00:09 -0500 -Subject: [PATCH 38/42] tracing: Add inter-event hist trigger Documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:33:11 -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 Add background and details on inter-event hist triggers, including hist variables, synthetic events, and actions. @@ -10,25 +10,18 @@ Signed-off-by: Tom Zanussi Signed-off-by: Baohong Liu Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/events.txt | 385 +++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 385 insertions(+) + Documentation/trace/histogram.txt | 382 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 382 insertions(+) ---- a/Documentation/trace/events.txt -+++ b/Documentation/trace/events.txt -@@ -571,6 +571,7 @@ triggers (you have to use '!' for each o - .sym-offset display an address as a symbol and offset - .syscall display a syscall id as a system call name - .execname display a common_pid as a program name -+ .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 -@@ -2101,3 +2102,387 @@ triggers (you have to use '!' for each o +--- a/Documentation/trace/histogram.txt ++++ b/Documentation/trace/histogram.txt +@@ -1605,3 +1605,385 @@ Hits: 489 Entries: 7 Dropped: 0 + -+6.3 Inter-event hist triggers ++ ++2.2 Inter-event hist triggers +----------------------------- + +Inter-event hist triggers are hist triggers that combine values from @@ -39,13 +32,10 @@ Signed-off-by: Sebastian Andrzej Siewior + +The most important example of an inter-event quantity that can be used +in this manner is latency, which is simply a difference in timestamps -+between two events (although trace events don't have an externally -+visible timestamp field, the inter-event hist trigger support adds a -+pseudo-field to all events named '$common_timestamp' which can be used -+as if it were an actual event field). Although latency is the most -+important inter-event quantity, note that because the support is -+completely general across the trace event subsystem, any event field -+can be used in an inter-event quantity. ++between two events. Although latency is the most important ++inter-event quantity, note that because the support is completely ++general across the trace event subsystem, any event field can be used ++in an inter-event quantity. + +An example of a histogram that combines data from other histograms +into a useful chain would be a 'wakeupswitch latency' histogram that @@ -100,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior + +These features are decribed in more detail in the following sections. + -+6.3.1 Histogram Variables ++2.2.1 Histogram Variables +------------------------- + +Variables are simply named locations used for saving and retrieving @@ -187,7 +177,7 @@ Signed-off-by: Sebastian Andrzej Siewior + + # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ... >> event3/trigger + -+6.3.2 Synthetic Events ++2.2.2 Synthetic Events +---------------------- + +Synthetic events are user-defined events generated from hist trigger @@ -243,7 +233,7 @@ Signed-off-by: Sebastian Andrzej Siewior +Like any other event, once a histogram is enabled for the event, the +output can be displayed by reading the event's 'hist' file. + -+6.3.3 Hist trigger 'actions' ++2.2.3 Hist trigger 'actions' +---------------------------- + +A hist trigger 'action' is a function that's executed whenever a 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 d058c09b5..14d0867dd 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: Sun, 22 Oct 2017 23:40:10 +0200 +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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. @@ -9,9 +9,9 @@ callback in softirq context and remove the hrtimer_tasklet. Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner Cc: Steffen Klassert +Cc: netdev@vger.kernel.org Cc: Herbert Xu Cc: "David S. Miller" -Cc: netdev@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- include/net/xfrm.h | 2 +- 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 fb84e6859..5b9966d9e 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: Sun, 22 Oct 2017 23:40:11 +0200 +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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz There are no more tasklet_hrtimer users of this interface. Remove it. diff --git a/debian/patches/features/all/rt/0039-tracing-Make-tracing_set_clock-non-static.patch b/debian/patches/features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch similarity index 85% rename from debian/patches/features/all/rt/0039-tracing-Make-tracing_set_clock-non-static.patch rename to debian/patches/features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch index 7e799eb76..b45308236 100644 --- a/debian/patches/features/all/rt/0039-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, 22 Sep 2017 15:00:10 -0500 -Subject: [PATCH 39/42] tracing: Make tracing_set_clock() non-static -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:33:12 -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 Allow tracing code outside of trace.c to access tracing_set_clock(). @@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -6226,7 +6226,7 @@ static int tracing_clock_show(struct seq +@@ -6230,7 +6230,7 @@ static int tracing_clock_show(struct seq return 0; } 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 9f855fc66..19a91aad6 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: Sun, 22 Oct 2017 23:40:12 +0200 +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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -9,12 +9,13 @@ callback in softirq context as well which renders the tasklet useless. [o-takashi: avoid stall due to a call of hrtimer_cancel() on a callback of hrtimer] + Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner -Cc: Jaroslav Kysela -Cc: Takashi Iwai -Cc: Takashi Sakamoto Cc: alsa-devel@alsa-project.org +Cc: Takashi Sakamoto +Cc: Takashi Iwai +Cc: Jaroslav Kysela Link: http://lkml.kernel.org/r/20170905161820.jtysvxtfleunbbmf@breakpoint.cc Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches/features/all/rt/0040-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 similarity index 72% rename from debian/patches/features/all/rt/0040-tracing-Add-a-clock-attribute-for-hist-triggers.patch rename to debian/patches/features/all/rt/0034-tracing-Add-a-clock-attribute-for-hist-triggers.patch index 7a8284d09..e3dceee22 100644 --- a/debian/patches/features/all/rt/0040-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, 22 Sep 2017 15:00:11 -0500 -Subject: [PATCH 40/42] tracing: Add a clock attribute for hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Date: Fri, 17 Nov 2017 14:33:13 -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 The default clock if timestamps are used in a histogram is "global". If timestamps aren't used, the clock is irrelevant. @@ -13,16 +13,17 @@ Signed-off-by: Tom Zanussi Signed-off-by: Rajvi Jingar Signed-off-by: Sebastian Andrzej Siewior --- - Documentation/trace/events.txt | 9 +++++++++ - kernel/trace/trace_events_hist.c | 38 ++++++++++++++++++++++++++++++++++++-- - 2 files changed, 45 insertions(+), 2 deletions(-) + Documentation/trace/histogram.txt | 11 ++++++++++- + kernel/trace/trace_events_hist.c | 38 ++++++++++++++++++++++++++++++++++++-- + 2 files changed, 46 insertions(+), 3 deletions(-) ---- a/Documentation/trace/events.txt -+++ b/Documentation/trace/events.txt -@@ -2173,6 +2173,15 @@ specification. In support of this overa +--- 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 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 +histogram, the trace buffer is automatically switched over to using +absolute timestamps and the "global" trace clock, in order to avoid @@ -32,12 +33,13 @@ Signed-off-by: Sebastian Andrzej Siewior +where XXX is any of the clocks listed in the tracing/trace_clock +pseudo-file. + - These features are decribed in more detail in the following sections. ++These features are described in more detail in the following sections. - 6.3.1 Histogram Variables + 2.2.1 Histogram Variables + ------------------------- --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c -@@ -241,6 +241,7 @@ struct hist_trigger_attrs { +@@ -242,6 +242,7 @@ struct hist_trigger_attrs { char *vals_str; char *sort_key_str; char *name; @@ -45,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior bool pause; bool cont; bool clear; -@@ -1680,6 +1681,7 @@ static void destroy_hist_trigger_attrs(s +@@ -1795,6 +1796,7 @@ static void destroy_hist_trigger_attrs(s kfree(attrs->sort_key_str); kfree(attrs->keys_str); kfree(attrs->vals_str); @@ -53,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior kfree(attrs); } -@@ -1735,6 +1737,19 @@ static int parse_assignment(char *str, s +@@ -1850,6 +1852,19 @@ static int parse_assignment(char *str, s ret = -ENOMEM; goto out; } @@ -73,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else if (strncmp(str, "size=", strlen("size=")) == 0) { int map_bits = parse_map_size(str); -@@ -1798,6 +1813,14 @@ static struct hist_trigger_attrs *parse_ +@@ -1914,6 +1929,14 @@ static struct hist_trigger_attrs *parse_ goto free; } @@ -88,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior return attrs; free: destroy_hist_trigger_attrs(attrs); -@@ -4660,6 +4683,8 @@ static int event_hist_trigger_print(stru +@@ -4926,6 +4949,8 @@ static int event_hist_trigger_print(stru seq_puts(m, ".descending"); } seq_printf(m, ":size=%u", (1 << hist_data->map->map_bits)); @@ -97,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior print_actions_spec(m, hist_data); -@@ -4922,10 +4947,19 @@ static int hist_register_trigger(char *g +@@ -5188,10 +5213,19 @@ static int hist_register_trigger(char *g goto out; } diff --git a/debian/patches/features/all/rt/0041-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 similarity index 88% rename from debian/patches/features/all/rt/0041-tracing-Increase-trace_recursive_lock-limit-for-synt.patch rename to debian/patches/features/all/rt/0035-tracing-Increase-trace_recursive_lock-limit-for-synt.patch index 659504f5e..8d8b31434 100644 --- a/debian/patches/features/all/rt/0041-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, 22 Sep 2017 15:00:12 -0500 -Subject: [PATCH 41/42] tracing: Increase trace_recursive_lock() limit for +Date: Fri, 17 Nov 2017 14:33:14 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -20,7 +20,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c -@@ -2590,16 +2590,16 @@ rb_wakeups(struct ring_buffer *buffer, s +@@ -2589,16 +2589,16 @@ rb_wakeups(struct ring_buffer *buffer, s * IRQ context * NMI context * 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 270f81788..aa91494a9 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: Sun, 22 Oct 2017 23:40:14 +0200 +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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 1078560ab..b122591eb 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: Sun, 22 Oct 2017 23:40:15 +0200 +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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -9,9 +9,9 @@ the tasklet but with HRTIMER_MODE_SOFT as hrtimer mode. Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner -Cc: "David S. Miller" Cc: Thomas Petazzoni Cc: netdev@vger.kernel.org +Cc: "David S. Miller" Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/marvell/mvpp2.c | 62 ++++++++++++++--------------------- diff --git a/debian/patches/features/all/rt/0042-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 similarity index 86% rename from debian/patches/features/all/rt/0042-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch rename to debian/patches/features/all/rt/0036-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch index acb77cd9b..30c04991e 100644 --- a/debian/patches/features/all/rt/0042-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, 22 Sep 2017 15:00:13 -0500 -Subject: [PATCH 42/42] tracing: Add inter-event blurb to HIST_TRIGGERS config +Date: Fri, 17 Nov 2017 14:33:15 -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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 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 new file mode 100644 index 000000000..604fc66ef --- /dev/null +++ b/debian/patches/features/all/rt/0037-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch @@ -0,0 +1,439 @@ +From: Rajvi Jingar +Date: Fri, 17 Nov 2017 14:33:16 -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 + + This adds inter-event hist triggers testcases which covers following: + - create/remove synthetic event + - disable histogram for synthetic event + - extended error support + - field variable support + - histogram variables + - histogram trigger onmatch action + - histogram trigger onmax action + - histogram trigger onmatch-onmax action + - simple expression support + - combined histogram + + Here is the test result. + === Ftrace unit tests === + [1] event trigger - test extended error support [PASS] + [2] event trigger - test field variable support [PASS] + [3] event trigger - test inter-event combined histogram trigger [PASS] + [4] event trigger - test inter-event histogram trigger onmatch action [PASS] + [5] event trigger - test inter-event histogram trigger onmatch-onmax action [PASS] + [6] event trigger - test inter-event histogram trigger onmax action [PASS] + [7] event trigger - test synthetic event create remove [PASS] + +Signed-off-by: Rajvi Jingar +Signed-off-by: Tom Zanussi +Signed-off-by: Sebastian Andrzej Siewior +--- + tools/testing/selftests/ftrace/test.d/functions | 7 + + tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc | 39 ++++++ + tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc | 54 +++++++++ + tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc | 58 ++++++++++ + tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc | 50 ++++++++ + tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc | 50 ++++++++ + tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc | 48 ++++++++ + tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc | 54 +++++++++ + 8 files changed, 360 insertions(+) + create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc + create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc + create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc + create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc + create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc + create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc + create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc + +--- a/tools/testing/selftests/ftrace/test.d/functions ++++ b/tools/testing/selftests/ftrace/test.d/functions +@@ -55,6 +55,13 @@ disable_events() { + echo 0 > events/enable + } + ++clear_synthetic_events() { # reset all current synthetic events ++ grep -v ^# synthetic_events | ++ while read line; do ++ echo "!$line" >> synthetic_events ++ done ++} ++ + initialize_ftrace() { # Reset ftrace to initial-state + # As the initial state, ftrace will be set to nop tracer, + # no events, no triggers, no filters, no function filters, +--- /dev/null ++++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc +@@ -0,0 +1,39 @@ ++#!/bin/sh ++# description: event trigger - test extended error support ++ ++ ++do_reset() { ++ reset_trigger ++ echo > set_event ++ clear_trace ++} ++ ++fail() { #msg ++ do_reset ++ echo $1 ++ exit_fail ++} ++ ++if [ ! -f set_event ]; then ++ echo "event tracing is not supported" ++ exit_unsupported ++fi ++ ++if [ ! -f synthetic_events ]; then ++ echo "synthetic event is not supported" ++ exit_unsupported ++fi ++ ++reset_tracer ++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 ++if ! grep -q "ERROR:" events/sched/sched_wakeup/hist; then ++ fail "Failed to generate extended error in histogram" ++fi ++ ++do_reset ++ ++exit 0 +--- /dev/null ++++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc +@@ -0,0 +1,54 @@ ++#!/bin/sh ++# description: event trigger - test field variable support ++ ++do_reset() { ++ reset_trigger ++ echo > set_event ++ clear_trace ++} ++ ++fail() { #msg ++ do_reset ++ echo $1 ++ exit_fail ++} ++ ++if [ ! -f set_event ]; then ++ echo "event tracing is not supported" ++ exit_unsupported ++fi ++ ++if [ ! -f synthetic_events ]; then ++ echo "synthetic event is not supported" ++ exit_unsupported ++fi ++ ++clear_synthetic_events ++reset_tracer ++do_reset ++ ++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=pid,prio,comm:vals=lat:sort=pid,prio' > events/synthetic/wakeup_latency/trigger ++ ++ping localhost -c 3 ++if ! grep -q "ping" events/synthetic/wakeup_latency/hist; then ++ fail "Failed to create inter-event histogram" ++fi ++ ++if ! grep -q "synthetic_prio=prio" events/sched/sched_waking/hist; then ++ 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 ++ ++if grep -q "synthetic_prio=prio" events/sched/sched_waking/hist; then ++ fail "Failed to remove histogram with field variable" ++fi ++ ++do_reset ++ ++exit 0 +--- /dev/null ++++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc +@@ -0,0 +1,58 @@ ++#!/bin/sh ++# description: event trigger - test inter-event combined histogram trigger ++ ++do_reset() { ++ reset_trigger ++ echo > set_event ++ clear_trace ++} ++ ++fail() { #msg ++ do_reset ++ echo $1 ++ exit_fail ++} ++ ++if [ ! -f set_event ]; then ++ echo "event tracing is not supported" ++ exit_unsupported ++fi ++ ++if [ ! -f synthetic_events ]; then ++ echo "synthetic event is not supported" ++ exit_unsupported ++fi ++ ++reset_tracer ++do_reset ++clear_synthetic_events ++ ++echo "Test create synthetic event" ++ ++echo 'waking_latency u64 lat pid_t pid' > synthetic_events ++if [ ! -d events/synthetic/waking_latency ]; then ++ fail "Failed to create waking_latency synthetic event" ++fi ++ ++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,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 '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 ++echo 'hist:keys=pid,lat:sort=pid,lat' >> events/synthetic/waking+wakeup_latency/trigger ++ ++ping localhost -c 3 ++if ! grep -q "pid:" events/synthetic/waking+wakeup_latency/hist; then ++ fail "Failed to create combined histogram" ++fi ++ ++do_reset ++ ++exit 0 +--- /dev/null ++++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc +@@ -0,0 +1,50 @@ ++#!/bin/sh ++# description: event trigger - test inter-event histogram trigger onmatch action ++ ++do_reset() { ++ reset_trigger ++ echo > set_event ++ clear_trace ++} ++ ++fail() { #msg ++ do_reset ++ echo $1 ++ exit_fail ++} ++ ++if [ ! -f set_event ]; then ++ echo "event tracing is not supported" ++ exit_unsupported ++fi ++ ++if [ ! -f synthetic_events ]; then ++ echo "synthetic event is not supported" ++ exit_unsupported ++fi ++ ++clear_synthetic_events ++reset_tracer ++do_reset ++ ++echo "Test create synthetic event" ++ ++echo 'wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events ++if [ ! -d events/synthetic/wakeup_latency ]; then ++ fail "Failed to create wakeup_latency synthetic event" ++fi ++ ++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=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 ++ fail "Failed to create onmatch action inter-event histogram" ++fi ++ ++do_reset ++ ++exit 0 +--- /dev/null ++++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc +@@ -0,0 +1,50 @@ ++#!/bin/sh ++# description: event trigger - test inter-event histogram trigger onmatch-onmax action ++ ++do_reset() { ++ reset_trigger ++ echo > set_event ++ clear_trace ++} ++ ++fail() { #msg ++ do_reset ++ echo $1 ++ exit_fail ++} ++ ++if [ ! -f set_event ]; then ++ echo "event tracing is not supported" ++ exit_unsupported ++fi ++ ++if [ ! -f synthetic_events ]; then ++ echo "synthetic event is not supported" ++ exit_unsupported ++fi ++ ++clear_synthetic_events ++reset_tracer ++do_reset ++ ++echo "Test create synthetic event" ++ ++echo 'wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events ++if [ ! -d events/synthetic/wakeup_latency ]; then ++ fail "Failed to create wakeup_latency synthetic event" ++fi ++ ++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=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 ++ fail "Failed to create onmatch-onmax action inter-event histogram" ++fi ++ ++do_reset ++ ++exit 0 +--- /dev/null ++++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc +@@ -0,0 +1,48 @@ ++#!/bin/sh ++# description: event trigger - test inter-event histogram trigger onmax action ++ ++do_reset() { ++ reset_trigger ++ echo > set_event ++ clear_trace ++} ++ ++fail() { #msg ++ do_reset ++ echo $1 ++ exit_fail ++} ++ ++if [ ! -f set_event ]; then ++ echo "event tracing is not supported" ++ exit_unsupported ++fi ++ ++if [ ! -f synthetic_events ]; then ++ echo "synthetic event is not supported" ++ exit_unsupported ++fi ++ ++clear_synthetic_events ++reset_tracer ++do_reset ++ ++echo "Test create synthetic event" ++ ++echo 'wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events ++if [ ! -d events/synthetic/wakeup_latency ]; then ++ fail "Failed to create wakeup_latency synthetic event" ++fi ++ ++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 ++ping localhost -c 3 ++if ! grep -q "max:" events/sched/sched_switch/hist; then ++ fail "Failed to create onmax action inter-event histogram" ++fi ++ ++do_reset ++ ++exit 0 +--- /dev/null ++++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc +@@ -0,0 +1,54 @@ ++#!/bin/sh ++# description: event trigger - test synthetic event create remove ++do_reset() { ++ reset_trigger ++ echo > set_event ++ clear_trace ++} ++ ++fail() { #msg ++ do_reset ++ echo $1 ++ exit_fail ++} ++ ++if [ ! -f set_event ]; then ++ echo "event tracing is not supported" ++ exit_unsupported ++fi ++ ++if [ ! -f synthetic_events ]; then ++ echo "synthetic event is not supported" ++ exit_unsupported ++fi ++ ++clear_synthetic_events ++reset_tracer ++do_reset ++ ++echo "Test create synthetic event" ++ ++echo 'wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events ++if [ ! -d events/synthetic/wakeup_latency ]; then ++ fail "Failed to create wakeup_latency synthetic event" ++fi ++ ++reset_trigger ++ ++echo "Test create synthetic event with an error" ++echo 'wakeup_latency u64 lat pid_t pid char' > synthetic_events > /dev/null ++if [ -d events/synthetic/wakeup_latency ]; then ++ fail "Created wakeup_latency synthetic event with an invalid format" ++fi ++ ++reset_trigger ++ ++echo "Test remove synthetic event" ++echo '!wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events ++if [ -d events/synthetic/wakeup_latency ]; then ++ fail "Failed to delete wakeup_latency synthetic event" ++fi ++ ++do_reset ++ ++exit 0 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 28e6374f7..05515141f 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 8b427c78a..3b0810c68 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Mart reported a deadlock in -RT in the call path: hci_send_monitor_ctrl_event() -> hci_send_to_channel() 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 145b18a80..43c250588 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 582927cb8..688ee6cef 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e9fc44f46..0ac57b4da 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz The raw_write_seqcount_begin() in nfs4_reclaim_open_state() bugs me because it maps to preempt_disable() in -RT which I can't have at this diff --git a/debian/patches/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 e236435b4..92c8a26b5 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 new file mode 100644 index 000000000..91a689ea4 --- /dev/null +++ b/debian/patches/features/all/rt/Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch @@ -0,0 +1,26 @@ +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 + +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 +Signed-off-by: Sebastian Andrzej Siewior +--- + fs/jbd2/checkpoint.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/fs/jbd2/checkpoint.c ++++ b/fs/jbd2/checkpoint.c +@@ -116,8 +116,6 @@ void __jbd2_log_wait_for_space(journal_t + nblocks = jbd2_space_needed(journal); + while (jbd2_log_space_left(journal) < nblocks) { + write_unlock(&journal->j_state_lock); +- if (current->plug) +- io_schedule(); + mutex_lock(&journal->j_checkpoint_mutex); + + /* 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 new file mode 100644 index 000000000..c2572d997 --- /dev/null +++ b/debian/patches/features/all/rt/Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch @@ -0,0 +1,101 @@ +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 + +The commit "memcontrol: Prevent scheduling while atomic in cgroup code" +fixed this issue: + + refill_stock() + get_cpu_var() + drain_stock() + res_counter_uncharge() + res_counter_uncharge_until() + spin_lock() <== boom + +But commit 3e32cb2e0a12b ("mm: memcontrol: lockless page counters") replaced +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: +Reported-by: Haiyang HY1 Tan +Signed-off-by: Steven Rostedt (VMware) +[bigeasy: That upstream commit appeared in v3.19 and the patch in + question in v3.18.7-rt2 and v3.18 seems still to be maintained. So I + guess that v3.18 would need the locallocks that we are about to remove + here. I am not sure if any earlier versions have the patch + backported. + The stable tag here is because Haiyang reported (and debugged) a crash + in 4.4-RT with this patch applied (which has get_cpu_light() instead + the locallocks it gained in v4.9-RT). + https://lkml.kernel.org/r/05AA4EC5C6EC1D48BE2CDCFF3AE0B8A637F78A15@CNMAILEX04.lenovo.com +] +Signed-off-by: Sebastian Andrzej Siewior +--- + mm/memcontrol.c | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +--- a/mm/memcontrol.c ++++ b/mm/memcontrol.c +@@ -1723,7 +1723,6 @@ struct memcg_stock_pcp { + #define FLUSHING_CACHED_CHARGE 0 + }; + static DEFINE_PER_CPU(struct memcg_stock_pcp, memcg_stock); +-static DEFINE_LOCAL_IRQ_LOCK(memcg_stock_ll); + static DEFINE_MUTEX(percpu_charge_mutex); + + /** +@@ -1746,7 +1745,7 @@ static bool consume_stock(struct mem_cgr + if (nr_pages > CHARGE_BATCH) + return ret; + +- local_lock_irqsave(memcg_stock_ll, flags); ++ local_irq_save(flags); + + stock = this_cpu_ptr(&memcg_stock); + if (memcg == stock->cached && stock->nr_pages >= nr_pages) { +@@ -1754,7 +1753,7 @@ static bool consume_stock(struct mem_cgr + ret = true; + } + +- local_unlock_irqrestore(memcg_stock_ll, flags); ++ local_irq_restore(flags); + + return ret; + } +@@ -1785,13 +1784,13 @@ static void drain_local_stock(struct wor + * The only protection from memory hotplug vs. drain_stock races is + * that we always operate on local CPU stock here with IRQ disabled + */ +- local_lock_irqsave(memcg_stock_ll, flags); ++ local_irq_save(flags); + + stock = this_cpu_ptr(&memcg_stock); + drain_stock(stock); + clear_bit(FLUSHING_CACHED_CHARGE, &stock->flags); + +- local_unlock_irqrestore(memcg_stock_ll, flags); ++ local_irq_restore(flags); + } + + /* +@@ -1803,7 +1802,7 @@ static void refill_stock(struct mem_cgro + struct memcg_stock_pcp *stock; + unsigned long flags; + +- local_lock_irqsave(memcg_stock_ll, flags); ++ local_irq_save(flags); + + stock = this_cpu_ptr(&memcg_stock); + if (stock->cached != memcg) { /* reset if necessary */ +@@ -1815,7 +1814,7 @@ static void refill_stock(struct mem_cgro + if (stock->nr_pages > CHARGE_BATCH) + drain_stock(stock); + +- local_unlock_irqrestore(memcg_stock_ll, flags); ++ local_irq_restore(flags); + } + + /* 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 8dbc932e7..2d104dc9c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 c7ec0c3d2..8caa90acc 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz --- include/linux/preempt.h | 23 ++++++++ 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 31eb50bbd..68dde890c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 1db6b7ec9..0d9375bbc 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 8f64e4c75..e46d3c5e6 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 3a5f27f73..6336b7e69 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 b38f89a7c..4605ca109 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz The arm boot_lock is used by the secondary processor startup code. The locking task is the idle thread, which has idle->sched_class == &idle_sched_class. diff --git a/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch b/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch index 7dbab1cef..692ef55bb 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d6b0de65b..39848e95c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e4f067c67..57af6a00d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 c33d015d8..594e4a36d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 b4c58216a..406c31a78 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 5fcd44407..b9e8d9aa2 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 52bd7a88c..f3af76524 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e3ca7f037..972a80f4e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 38adf6d1d..71952ae6e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 88ca5edcc..6b456d009 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 | in_atomic(): 1, irqs_disabled(): 0, pid: 255, name: kworker/u257:6 diff --git a/debian/patches/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 e7e9b47cb..be483b48a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d1b7d0d35..729e73028 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 fdc85efee..34434ed97 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 cb766cad3..c589eb54b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Moving the blk_sched_flush_plug() call out of the interrupt/preempt disabled region in the scheduler allows us to replace 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 4615f6ff7..0a44a39dc 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4de442e4f..c53e6ef7d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 22b0b5cb5..da05901dc 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 657769bf9..5141d459b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 0e933ea5f..9170d84e4 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 bf0138afb..49bba06b2 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 45ff5f515..c136c8d27 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 ea4fd4aca..4a4b7b91a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Completions have no long lasting callbacks and therefor do not need the complex waitqueue variant. Use simple waitqueues which reduces the diff --git a/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch b/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch index 380ee1b82..fde80db53 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 ef5907700..b691e5f7d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 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 e09acbb03..b1a58760c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 43556a55c..801445d56 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 66f38a854..cf5815bb4 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz We hit another bug that was caused by switching cpu_chill() from msleep() to hrtimer_nanosleep(). diff --git a/debian/patches/features/all/rt/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 12b1e9210..e198ecefb 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 9562aa22d..fdb3a1b86 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d6d03cbb9..2deabde3a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 60c4794d7..a8b621716 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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/debugobjects-rt.patch b/debian/patches/features/all/rt/debugobjects-rt.patch index c58a43a9f..cd660267a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 64d386bb4..94014a93e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 f01aeb4b7..d7acc65ff 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 52bf2cfd5..fa5b07394 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 3efdc012f..b3d0748f1 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 29dd22200..84ad16286 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4071798f5..5f0362cc6 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 ed6bcd515..1e391cace 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 7daac38b4..5974ffbfe 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 8097a4fd6..e28ec91f1 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 9e062126a..07f4c2067 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 index e778daa79..23dc0d52d 100644 --- 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 @@ -1,7 +1,7 @@ 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-rt1.tar.xz +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… 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 5dda228e6..1b7fa51db 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 690dbeef8..31b636738 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 7eb09dfde..96f68707d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 273f10eca..b378b30b8 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e9226b14b..eb58a2abd 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 461768acf..251e99ee9 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 5f7e08da3..9709f1def 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 f39ca12c5..34e582962 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 477275f7f..4bc9ba834 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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. 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 478169e63..3cffe5ece 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 53d50f6bb..424f2d911 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 cfeba7985..5eb5462d3 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 f9def46db..b65adc4ef 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 9522dbd5f..b460b3455 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4975d101f..062bd7dc3 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Wrap the bit_spin_lock calls into a separate inline and add the RT replacements with a real spinlock. diff --git a/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch b/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch index 4a365575a..61a3c7acf 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 b57cf27e7..3f6641461 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d5b8d5182..ab40579c3 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 30841a0b5..2a105e8c2 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 1fcf7ddb2..78a5b46c6 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 bf1275ba0..227b87855 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 9d2f6995d..e71fe2b37 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Joe Korty reported, that __irq_set_affinity_locked() schedules a workqueue while holding a rawlock which results in a might_sleep() diff --git a/debian/patches/features/all/rt/genirq-force-threading.patch b/debian/patches/features/all/rt/genirq-force-threading.patch index aa1de8967..98a4ee620 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 6f0197b14..1ed03b199 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz On -rt kernels, the use of migrate_disable()/migrate_enable() is sufficient to guarantee a task isn't moved to another CPU. Update the diff --git a/debian/patches/features/all/rt/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 49e6ebcaf..fb2dcc330 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 3f7a5ecb4..a964e7055 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 af2744748..ce4582d78 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz get_online_cpus() is a heavy weight function which involves a global mutex. migrate_disable() wants a simpler construct which prevents only diff --git a/debian/patches/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 41e2be975..2d663258c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz When run ltp leapsec_timer test, the following call trace is caught: 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 cdd3576cf..f4d0ee202 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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. 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 5e72ab173..af1b5102c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz hrtimer_init_sleeper() calls require a prior initialisation of the hrtimer object with hrtimer_init(). Lets make the initialisation of the @@ -34,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior break; --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h -@@ -363,10 +363,17 @@ DECLARE_PER_CPU(struct tick_device, tick +@@ -364,10 +364,17 @@ DECLARE_PER_CPU(struct tick_device, tick /* Initialize timers: */ extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, enum hrtimer_mode mode); @@ -52,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern void destroy_hrtimer_on_stack(struct hrtimer *timer); #else -@@ -376,6 +383,15 @@ static inline void hrtimer_init_on_stack +@@ -377,6 +384,15 @@ static inline void hrtimer_init_on_stack { hrtimer_init(timer, which_clock, mode); } @@ -68,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { } #endif -@@ -478,9 +494,6 @@ extern long hrtimer_nanosleep(const stru +@@ -479,9 +495,6 @@ extern long hrtimer_nanosleep(const stru const enum hrtimer_mode mode, const clockid_t clockid); 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 a7b8d1948..6aa0091e7 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Make cancellation of a running callback in softirq context safe against preemption. @@ -26,7 +26,7 @@ Signed-off-by: Thomas Gleixner struct hrtimer_clock_base; struct hrtimer_cpu_base; -@@ -215,6 +216,9 @@ struct hrtimer_cpu_base { +@@ -216,6 +217,9 @@ struct hrtimer_cpu_base { ktime_t expires_next; struct hrtimer *next_timer; ktime_t softirq_expires_next; @@ -36,7 +36,7 @@ Signed-off-by: Thomas Gleixner struct hrtimer *softirq_next_timer; struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; } ____cacheline_aligned; -@@ -432,6 +436,13 @@ static inline void hrtimer_restart(struc +@@ -433,6 +437,13 @@ static inline void hrtimer_restart(struc hrtimer_start_expires(timer, HRTIMER_MODE_ABS); } @@ -50,7 +50,7 @@ Signed-off-by: Thomas Gleixner /* Query timers: */ extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust); -@@ -456,7 +467,7 @@ static inline int hrtimer_is_queued(stru +@@ -457,7 +468,7 @@ static inline int hrtimer_is_queued(stru * Helper function to check, whether the timer is running the callback * function */ 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 354f09e28..7596fbff2 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 c0ab94b2f..ede2e720d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 bf8b86193..9b8acf7a3 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 9893ddf79..db5224e9d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 b0a403bba..d8e3ac5d8 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 85c7a9684..37ede28ac 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz The processing of softirqs in irq thread context is a performance gain for the non-rt workloads of a system, but it's counterproductive for diff --git a/debian/patches/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 22dbaa222..00b75b20a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -56,7 +56,7 @@ Cc: stable-rt@vger.kernel.org * Synchronize against the irq_work @entry, ensures the entry is not --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -1646,7 +1646,7 @@ void update_process_times(int user_tick) +@@ -1640,7 +1640,7 @@ void update_process_times(int user_tick) scheduler_tick(); run_local_timers(); rcu_check_callbacks(user_tick); @@ -65,7 +65,7 @@ Cc: stable-rt@vger.kernel.org if (in_irq()) irq_work_tick(); #endif -@@ -1687,9 +1687,7 @@ static __latent_entropy void run_timer_s +@@ -1681,9 +1681,7 @@ static __latent_entropy void run_timer_s { struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); diff --git a/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch b/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch index 726744a36..dee8c5e65 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Initially we defered all irqwork into softirq because we didn't want the latency spikes if perf or another user was busy and delayed the RT task. @@ -22,7 +22,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- include/linux/irq_work.h | 1 + kernel/irq_work.c | 47 ++++++++++++++++++++++++++++++++++------------- - kernel/sched/rt.c | 1 + + kernel/sched/topology.c | 1 + kernel/time/tick-sched.c | 1 + kernel/time/timer.c | 5 ++++- 5 files changed, 41 insertions(+), 14 deletions(-) @@ -142,16 +142,16 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(irq_work_run); ---- a/kernel/sched/rt.c -+++ b/kernel/sched/rt.c -@@ -103,6 +103,7 @@ void init_rt_rq(struct rt_rq *rt_rq) - rt_rq->push_cpu = nr_cpu_ids; - raw_spin_lock_init(&rt_rq->push_lock); - init_irq_work(&rt_rq->push_work, push_irq_work_func); -+ rt_rq->push_work.flags |= IRQ_WORK_HARD_IRQ; +--- a/kernel/sched/topology.c ++++ b/kernel/sched/topology.c +@@ -273,6 +273,7 @@ static int init_rootdomain(struct root_d + rd->rto_cpu = -1; + raw_spin_lock_init(&rd->rto_lock); + init_irq_work(&rd->rto_push_work, rto_push_irq_work_func); ++ rd->rto_push_work.flags |= IRQ_WORK_HARD_IRQ; #endif - #endif /* CONFIG_SMP */ - /* We start is dequeued state, because no RT tasks are queued */ + + init_dl_bw(&rd->dl_bw); --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -230,6 +230,7 @@ static void nohz_full_kick_func(struct i @@ -164,7 +164,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -1646,7 +1646,7 @@ void update_process_times(int user_tick) +@@ -1640,7 +1640,7 @@ void update_process_times(int user_tick) scheduler_tick(); run_local_timers(); rcu_check_callbacks(user_tick); @@ -173,7 +173,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (in_irq()) irq_work_tick(); #endif -@@ -1687,6 +1687,9 @@ static __latent_entropy void run_timer_s +@@ -1681,6 +1681,9 @@ static __latent_entropy void run_timer_s { struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); diff --git a/debian/patches/features/all/rt/jump-label-rt.patch b/debian/patches/features/all/rt/jump-label-rt.patch index e15151af1..ba15b2bd4 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 631a91f9e..40127d2a4 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e4c41f879..9a1f31d2e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4e5b78110..4a9274c65 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 cf7578530..1ab931f2a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a16385bbd..aa93b8789 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -711,7 +711,7 @@ Signed-off-by: Sebastian Andrzej Siewior env.flags |= LBF_ALL_PINNED; --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c -@@ -1603,7 +1603,7 @@ static void put_prev_task_rt(struct rq * +@@ -1592,7 +1592,7 @@ static void put_prev_task_rt(struct rq * static int pick_rt_task(struct rq *rq, struct task_struct *p, int cpu) { if (!task_running(rq, p) && @@ -720,7 +720,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 1; return 0; } -@@ -1738,7 +1738,7 @@ static struct rq *find_lock_lowest_rq(st +@@ -1727,7 +1727,7 @@ static struct rq *find_lock_lowest_rq(st * Also make sure that it wasn't scheduled on its rq. */ if (unlikely(task_rq(task) != rq || 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 97b86122b..217595a73 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 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 c872bfd29..2481e8d75 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 bf73831c8..b3758ef95 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz On 07/27/2011 04:37 PM, Thomas Gleixner wrote: > - KGDB (not yet disabled) is reportedly unusable on -rt right now due diff --git a/debian/patches/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 f14d24545..4d48a1a9a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 944bbac4e..cd547e173 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 576229479..52b9617d6 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a8a29e4f1..31bad2b37 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 ffbbdbe3e..5a6cb30e3 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Signed-off-by: Thomas Gleixner --- @@ -11,4 +11,4 @@ Signed-off-by: Thomas Gleixner --- /dev/null +++ b/localversion-rt @@ -0,0 +1 @@ -+-rt1 ++-rt3 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 2dadffb65..0a911ca6b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 ea34da364..965295c53 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4a308ab9e..9eb2aa956 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 0be0e4bcb..ce21f3da0 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d4f44c242..2f3271982 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 ff770fa1f..99e2eb840 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 45ab7ef4c..3a3a822ec 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e604198d4..46361bd95 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 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 5c34db0ba..81ed08963 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 815553164..968a9eae6 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 42ce5a790..6a130b57d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 84cf97ee0..64515e1da 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 3257be927..dcea452c8 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 3fbdf4518..8e9abaaee 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 0b462ca29..a87ba139e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d0e1c27cd..f95195a4a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 5f744faae..46696c9d1 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 343440b89..1330a634f 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Replace global locks (get_cpu + local_irq_save) with "local_locks()". Currently there is one of for "rotate" and one for "swap". 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 410d1f430..7e6c58473 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d51111553..7aba4c423 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 75bbb6659..e35c54688 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 c301d3119..e3eaf6c8a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d5e0c2984..f791a3b2d 100644 --- a/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch +++ b/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. diff --git a/debian/patches/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 7fb2077ee..78a8abc51 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 8ae00eb8f..cda662518 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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. 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 f8d666484..38eb0a346 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz rt-friendly per-cpu pages: convert the irqs-off per-cpu locking method into a preemptible, explicit-per-cpu-locks method. 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 782a8856f..953096d8b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 f18e2e471..c7deb2552 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 dca954dd6..17fd805e5 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 9b3297fda..3ab542af7 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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-vmalloc-use-get-cpu-light.patch b/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch index 4ac9276d0..129b1e482 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 af114bddb..37d67b905 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 c550fed16..46d9b1ae3 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 c8bf48b89..1db40a96f 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 68c478f42..a7beb47de 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 14087b74a..e3708085a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 54f1d6c15..1b325242b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 12bab8be0..65e7724a1 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 097105ee4..e9ef27a64 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 6d63e0c42..baa726228 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 494d19001..1e7dd0e48 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 2aed96f62..87b8f34a1 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4a845dd29..8ed4b497b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 00474dd77..c226bcdc3 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 76b524092..0fabbbaa8 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 42ea3e717..00b44dbe5 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 39fe0ae93..cd030c785 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e260831a2..ed49f633b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d7681adaf..9315e860a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 249da649c..137708cce 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 78792c8cf..ee73bf1ea 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 72223e8d0..aa9a1a5c6 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 9e75a944e..41985bb1a 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,7 +1,7 @@ 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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. 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 87dd30c97..587187314 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 454a11742..48a9ef0cf 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 732315fe8..287d73ccc 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e819ca707..2798924bd 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 5a3164c25..f3abf728b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4bd9d5fd8..c62c548ea 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 10aafa296..cabf7e5f4 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 2b488b50d..bdabb0c4c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 de206abb3..b08e4cf5e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 fdfec7eb6..d8c86291c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 bfc6c3b45..6a9a680f1 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 1ac30e045..d13fb3602 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 fe3957e0b..1ff536c6b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d0860bbc1..7ccfd7a8c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 c584b07da..12a4cec16 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4925a09e3..776eaf8ca 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a25ac6317..5508a1f90 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 87010b0ed..01c32b158 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 94c9c97da..e5acbae10 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 9ef2f614f..7be92a0ac 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz It has become an obsession to mitigate the determinism vs. throughput loss of RT. Looking at the mainline semantics of preemption points @@ -475,7 +475,7 @@ Signed-off-by: Thomas Gleixner /* --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h -@@ -1534,6 +1534,15 @@ extern void init_sched_fair_class(void); +@@ -1544,6 +1544,15 @@ extern void init_sched_fair_class(void); extern void resched_curr(struct rq *rq); extern void resched_cpu(int 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 b77211a73..d9c7b6ca1 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 97d0717f8..4322dd983 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 41f606469..55f50a06e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 20632bacc..338182f31 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 278cce406..6a73f8966 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz As explained by Alexander Fyodorov : 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 16b416964..08308110a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 494fe5bd7..c18be8f5e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 04dd3a894..b4a2de28c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4f1eec1a5..fd56c8c71 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 ef21bea2d..cfce6e1b9 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a73d84253..a8f5f445a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 b56a8235f..aaed70df9 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 20d0aceb8..108bb94f9 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 c2dbb58c7..479374f1c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 fafa0d277..e879b442d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 035c7b9f1..8434a9e76 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,7 +1,7 @@ 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz The RT build on ARM complains about non-existing ULONG_CMP_LT. 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 543d3a1dc..6417803b4 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 f76815170..375d1ecdb 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 50ea0e858..95cdd8911 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 8c8caf706..ef4b0fac9 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz There is a problem in the migrate_disable()/enable() implementation regarding the number of migratory tasks in the rt/dl RQs. The problem diff --git a/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch b/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch index 24ea11166..d17478b50 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() diff --git a/debian/patches/features/all/rt/rt-local-irq-lock.patch b/debian/patches/features/all/rt/rt-local-irq-lock.patch index 5b7cd9c7a..def761942 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 bd9e973a6..adf2bef4c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 edbef9683..878f61539 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 f85b6504e..8b461cb4b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 029fe596d..fd46a2c99 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,7 +1,7 @@ From: Thomas Gleixner Date: Sat, 1 Apr 2017 12:50:59 +0200 Subject: [PATCH] rtmutex: Make lock_killable work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. 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 0020f397c..6de0ade8a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e9c471304..af3126743 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 046295877..1c9a1c229 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 c07656a6a..560a4b650 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a80b185e2..1142674a1 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 f8c1d2c75..a9f1cf6bd 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 19b171f78..8bbaff576 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 0d4d53b54..253aec6b1 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 b63ce382f..e0071e659 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 95acbf51d..6c57bd1ee 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a5bdd4d3b..6efa7010c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 b548e3fae..6addc8fa4 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 8ae0d24e8..b061d2106 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 9998cb936..d34705969 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 8a8acd2cf..ae6b46293 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 2c97b7fbe..821caad6e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Mathias and others reported GDB failures on RT. 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 e73da24c9..5b6e910cf 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4314a4c8c..0551bf8f0 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 6d2673af4..bbed0703e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 97afc8375..2b4e9fb45 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a9f66aadb..128058a42 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4c3be8020..b5e548581 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz RT changes the rcu_preempt_depth semantics, so we cannot check for it in might_sleep(). diff --git a/debian/patches/features/all/rt/sched-mmdrop-delayed.patch b/debian/patches/features/all/rt/sched-mmdrop-delayed.patch index 2a407ed0e..cb76f7c59 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Takes sleeping locks and calls into the memory allocator, so nothing we want to do in task switch and oder atomic contexts. diff --git a/debian/patches/features/all/rt/sched-rt-Simplify-the-IPI-based-RT-balancing-logic.patch b/debian/patches/features/all/rt/sched-rt-Simplify-the-IPI-based-RT-balancing-logic.patch new file mode 100644 index 000000000..3179d8a86 --- /dev/null +++ b/debian/patches/features/all/rt/sched-rt-Simplify-the-IPI-based-RT-balancing-logic.patch @@ -0,0 +1,565 @@ +From: "Steven Rostedt (Red Hat)" +Date: Fri, 6 Oct 2017 14:05:04 -0400 +Subject: [PATCH] sched/rt: Simplify the IPI based RT balancing logic +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz + +Upstream commit 4bdced5c9a2922521e325896a7bbbf0132c94e56 + +When a CPU lowers its priority (schedules out a high priority task for a +lower priority one), a check is made to see if any other CPU has overloaded +RT tasks (more than one). It checks the rto_mask to determine this and if so +it will request to pull one of those tasks to itself if the non running RT +task is of higher priority than the new priority of the next task to run on +the current CPU. + +When we deal with large number of CPUs, the original pull logic suffered +from large lock contention on a single CPU run queue, which caused a huge +latency across all CPUs. This was caused by only having one CPU having +overloaded RT tasks and a bunch of other CPUs lowering their priority. To +solve this issue, commit: + + b6366f048e0c ("sched/rt: Use IPI to trigger RT task push migration instead of pulling") + +changed the way to request a pull. Instead of grabbing the lock of the +overloaded CPU's runqueue, it simply sent an IPI to that CPU to do the work. + +Although the IPI logic worked very well in removing the large latency build +up, it still could suffer from a large number of IPIs being sent to a single +CPU. On a 80 CPU box, I measured over 200us of processing IPIs. Worse yet, +when I tested this on a 120 CPU box, with a stress test that had lots of +RT tasks scheduling on all CPUs, it actually triggered the hard lockup +detector! One CPU had so many IPIs sent to it, and due to the restart +mechanism that is triggered when the source run queue has a priority status +change, the CPU spent minutes! processing the IPIs. + +Thinking about this further, I realized there's no reason for each run queue +to send its own IPI. As all CPUs with overloaded tasks must be scanned +regardless if there's one or many CPUs lowering their priority, because +there's no current way to find the CPU with the highest priority task that +can schedule to one of these CPUs, there really only needs to be one IPI +being sent around at a time. + +This greatly simplifies the code! + +The new approach is to have each root domain have its own irq work, as the +rto_mask is per root domain. The root domain has the following fields +attached to it: + + rto_push_work - the irq work to process each CPU set in rto_mask + rto_lock - the lock to protect some of the other rto fields + rto_loop_start - an atomic that keeps contention down on rto_lock + the first CPU scheduling in a lower priority task + is the one to kick off the process. + rto_loop_next - an atomic that gets incremented for each CPU that + schedules in a lower priority task. + rto_loop - a variable protected by rto_lock that is used to + compare against rto_loop_next + rto_cpu - The cpu to send the next IPI to, also protected by + the rto_lock. + +When a CPU schedules in a lower priority task and wants to make sure +overloaded CPUs know about it. It increments the rto_loop_next. Then it +atomically sets rto_loop_start with a cmpxchg. If the old value is not "0", +then it is done, as another CPU is kicking off the IPI loop. If the old +value is "0", then it will take the rto_lock to synchronize with a possible +IPI being sent around to the overloaded CPUs. + +If rto_cpu is greater than or equal to nr_cpu_ids, then there's either no +IPI being sent around, or one is about to finish. Then rto_cpu is set to the +first CPU in rto_mask and an IPI is sent to that CPU. If there's no CPUs set +in rto_mask, then there's nothing to be done. + +When the CPU receives the IPI, it will first try to push any RT tasks that is +queued on the CPU but can't run because a higher priority RT task is +currently running on that CPU. + +Then it takes the rto_lock and looks for the next CPU in the rto_mask. If it +finds one, it simply sends an IPI to that CPU and the process continues. + +If there's no more CPUs in the rto_mask, then rto_loop is compared with +rto_loop_next. If they match, everything is done and the process is over. If +they do not match, then a CPU scheduled in a lower priority task as the IPI +was being passed around, and the process needs to start again. The first CPU +in rto_mask is sent the IPI. + +This change removes this duplication of work in the IPI logic, and greatly +lowers the latency caused by the IPIs. This removed the lockup happening on +the 120 CPU machine. It also simplifies the code tremendously. What else +could anyone ask for? + +Thanks to Peter Zijlstra for simplifying the rto_loop_start atomic logic and +supplying me with the rto_start_trylock() and rto_start_unlock() helper +functions. + +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Peter Zijlstra (Intel) +Cc: Clark Williams +Cc: Daniel Bristot de Oliveira +Cc: John Kacur +Cc: Linus Torvalds +Cc: Mike Galbraith +Cc: Peter Zijlstra +Cc: Scott Wood +Cc: Thomas Gleixner +Link: http://lkml.kernel.org/r/20170424114732.1aac6dc4@gandalf.local.home +Signed-off-by: Ingo Molnar +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/sched/rt.c | 316 +++++++++++++++++------------------------------- + kernel/sched/sched.h | 24 ++- + kernel/sched/topology.c | 6 + 3 files changed, 138 insertions(+), 208 deletions(-) + +--- a/kernel/sched/rt.c ++++ b/kernel/sched/rt.c +@@ -74,10 +74,6 @@ static void start_rt_bandwidth(struct rt + raw_spin_unlock(&rt_b->rt_runtime_lock); + } + +-#if defined(CONFIG_SMP) && defined(HAVE_RT_PUSH_IPI) +-static void push_irq_work_func(struct irq_work *work); +-#endif +- + void init_rt_rq(struct rt_rq *rt_rq) + { + struct rt_prio_array *array; +@@ -97,13 +93,6 @@ void init_rt_rq(struct rt_rq *rt_rq) + rt_rq->rt_nr_migratory = 0; + rt_rq->overloaded = 0; + plist_head_init(&rt_rq->pushable_tasks); +- +-#ifdef HAVE_RT_PUSH_IPI +- rt_rq->push_flags = 0; +- rt_rq->push_cpu = nr_cpu_ids; +- raw_spin_lock_init(&rt_rq->push_lock); +- init_irq_work(&rt_rq->push_work, push_irq_work_func); +-#endif + #endif /* CONFIG_SMP */ + /* We start is dequeued state, because no RT tasks are queued */ + rt_rq->rt_queued = 0; +@@ -1876,241 +1865,166 @@ static void push_rt_tasks(struct rq *rq) + } + + #ifdef HAVE_RT_PUSH_IPI ++ + /* +- * The search for the next cpu always starts at rq->cpu and ends +- * when we reach rq->cpu again. It will never return rq->cpu. +- * This returns the next cpu to check, or nr_cpu_ids if the loop +- * is complete. ++ * When a high priority task schedules out from a CPU and a lower priority ++ * task is scheduled in, a check is made to see if there's any RT tasks ++ * on other CPUs that are waiting to run because a higher priority RT task ++ * is currently running on its CPU. In this case, the CPU with multiple RT ++ * tasks queued on it (overloaded) needs to be notified that a CPU has opened ++ * up that may be able to run one of its non-running queued RT tasks. ++ * ++ * All CPUs with overloaded RT tasks need to be notified as there is currently ++ * no way to know which of these CPUs have the highest priority task waiting ++ * to run. Instead of trying to take a spinlock on each of these CPUs, ++ * which has shown to cause large latency when done on machines with many ++ * CPUs, sending an IPI to the CPUs to have them push off the overloaded ++ * RT tasks waiting to run. ++ * ++ * Just sending an IPI to each of the CPUs is also an issue, as on large ++ * count CPU machines, this can cause an IPI storm on a CPU, especially ++ * if its the only CPU with multiple RT tasks queued, and a large number ++ * of CPUs scheduling a lower priority task at the same time. ++ * ++ * Each root domain has its own irq work function that can iterate over ++ * all CPUs with RT overloaded tasks. Since all CPUs with overloaded RT ++ * tassk must be checked if there's one or many CPUs that are lowering ++ * their priority, there's a single irq work iterator that will try to ++ * push off RT tasks that are waiting to run. ++ * ++ * When a CPU schedules a lower priority task, it will kick off the ++ * irq work iterator that will jump to each CPU with overloaded RT tasks. ++ * As it only takes the first CPU that schedules a lower priority task ++ * to start the process, the rto_start variable is incremented and if ++ * the atomic result is one, then that CPU will try to take the rto_lock. ++ * This prevents high contention on the lock as the process handles all ++ * CPUs scheduling lower priority tasks. ++ * ++ * All CPUs that are scheduling a lower priority task will increment the ++ * rt_loop_next variable. This will make sure that the irq work iterator ++ * checks all RT overloaded CPUs whenever a CPU schedules a new lower ++ * priority task, even if the iterator is in the middle of a scan. Incrementing ++ * the rt_loop_next will cause the iterator to perform another scan. + * +- * rq->rt.push_cpu holds the last cpu returned by this function, +- * or if this is the first instance, it must hold rq->cpu. + */ + static int rto_next_cpu(struct rq *rq) + { +- int prev_cpu = rq->rt.push_cpu; ++ struct root_domain *rd = rq->rd; ++ int next; + int cpu; + +- cpu = cpumask_next(prev_cpu, rq->rd->rto_mask); +- + /* +- * If the previous cpu is less than the rq's CPU, then it already +- * passed the end of the mask, and has started from the beginning. +- * We end if the next CPU is greater or equal to rq's CPU. ++ * When starting the IPI RT pushing, the rto_cpu is set to -1, ++ * rt_next_cpu() will simply return the first CPU found in ++ * the rto_mask. ++ * ++ * If rto_next_cpu() is called with rto_cpu is a valid cpu, it ++ * will return the next CPU found in the rto_mask. ++ * ++ * If there are no more CPUs left in the rto_mask, then a check is made ++ * against rto_loop and rto_loop_next. rto_loop is only updated with ++ * the rto_lock held, but any CPU may increment the rto_loop_next ++ * without any locking. + */ +- if (prev_cpu < rq->cpu) { +- if (cpu >= rq->cpu) +- return nr_cpu_ids; ++ for (;;) { + +- } else if (cpu >= nr_cpu_ids) { +- /* +- * We passed the end of the mask, start at the beginning. +- * If the result is greater or equal to the rq's CPU, then +- * the loop is finished. +- */ +- cpu = cpumask_first(rq->rd->rto_mask); +- if (cpu >= rq->cpu) +- return nr_cpu_ids; +- } +- rq->rt.push_cpu = cpu; ++ /* When rto_cpu is -1 this acts like cpumask_first() */ ++ cpu = cpumask_next(rd->rto_cpu, rd->rto_mask); + +- /* Return cpu to let the caller know if the loop is finished or not */ +- return cpu; +-} ++ rd->rto_cpu = cpu; + +-static int find_next_push_cpu(struct rq *rq) +-{ +- struct rq *next_rq; +- int cpu; ++ if (cpu < nr_cpu_ids) ++ return cpu; + +- while (1) { +- cpu = rto_next_cpu(rq); +- if (cpu >= nr_cpu_ids) +- break; +- next_rq = cpu_rq(cpu); ++ rd->rto_cpu = -1; ++ ++ /* ++ * ACQUIRE ensures we see the @rto_mask changes ++ * made prior to the @next value observed. ++ * ++ * Matches WMB in rt_set_overload(). ++ */ ++ next = atomic_read_acquire(&rd->rto_loop_next); + +- /* Make sure the next rq can push to this rq */ +- if (next_rq->rt.highest_prio.next < rq->rt.highest_prio.curr) ++ if (rd->rto_loop == next) + break; ++ ++ rd->rto_loop = next; + } + +- return cpu; ++ return -1; + } + +-#define RT_PUSH_IPI_EXECUTING 1 +-#define RT_PUSH_IPI_RESTART 2 ++static inline bool rto_start_trylock(atomic_t *v) ++{ ++ return !atomic_cmpxchg_acquire(v, 0, 1); ++} + +-/* +- * When a high priority task schedules out from a CPU and a lower priority +- * task is scheduled in, a check is made to see if there's any RT tasks +- * on other CPUs that are waiting to run because a higher priority RT task +- * is currently running on its CPU. In this case, the CPU with multiple RT +- * tasks queued on it (overloaded) needs to be notified that a CPU has opened +- * up that may be able to run one of its non-running queued RT tasks. +- * +- * On large CPU boxes, there's the case that several CPUs could schedule +- * a lower priority task at the same time, in which case it will look for +- * any overloaded CPUs that it could pull a task from. To do this, the runqueue +- * lock must be taken from that overloaded CPU. Having 10s of CPUs all fighting +- * for a single overloaded CPU's runqueue lock can produce a large latency. +- * (This has actually been observed on large boxes running cyclictest). +- * Instead of taking the runqueue lock of the overloaded CPU, each of the +- * CPUs that scheduled a lower priority task simply sends an IPI to the +- * overloaded CPU. An IPI is much cheaper than taking an runqueue lock with +- * lots of contention. The overloaded CPU will look to push its non-running +- * RT task off, and if it does, it can then ignore the other IPIs coming +- * in, and just pass those IPIs off to any other overloaded CPU. +- * +- * When a CPU schedules a lower priority task, it only sends an IPI to +- * the "next" CPU that has overloaded RT tasks. This prevents IPI storms, +- * as having 10 CPUs scheduling lower priority tasks and 10 CPUs with +- * RT overloaded tasks, would cause 100 IPIs to go out at once. +- * +- * The overloaded RT CPU, when receiving an IPI, will try to push off its +- * overloaded RT tasks and then send an IPI to the next CPU that has +- * overloaded RT tasks. This stops when all CPUs with overloaded RT tasks +- * have completed. Just because a CPU may have pushed off its own overloaded +- * RT task does not mean it should stop sending the IPI around to other +- * overloaded CPUs. There may be another RT task waiting to run on one of +- * those CPUs that are of higher priority than the one that was just +- * pushed. +- * +- * An optimization that could possibly be made is to make a CPU array similar +- * to the cpupri array mask of all running RT tasks, but for the overloaded +- * case, then the IPI could be sent to only the CPU with the highest priority +- * RT task waiting, and that CPU could send off further IPIs to the CPU with +- * the next highest waiting task. Since the overloaded case is much less likely +- * to happen, the complexity of this implementation may not be worth it. +- * Instead, just send an IPI around to all overloaded CPUs. +- * +- * The rq->rt.push_flags holds the status of the IPI that is going around. +- * A run queue can only send out a single IPI at a time. The possible flags +- * for rq->rt.push_flags are: +- * +- * (None or zero): No IPI is going around for the current rq +- * RT_PUSH_IPI_EXECUTING: An IPI for the rq is being passed around +- * RT_PUSH_IPI_RESTART: The priority of the running task for the rq +- * has changed, and the IPI should restart +- * circulating the overloaded CPUs again. +- * +- * rq->rt.push_cpu contains the CPU that is being sent the IPI. It is updated +- * before sending to the next CPU. +- * +- * Instead of having all CPUs that schedule a lower priority task send +- * an IPI to the same "first" CPU in the RT overload mask, they send it +- * to the next overloaded CPU after their own CPU. This helps distribute +- * the work when there's more than one overloaded CPU and multiple CPUs +- * scheduling in lower priority tasks. +- * +- * When a rq schedules a lower priority task than what was currently +- * running, the next CPU with overloaded RT tasks is examined first. +- * That is, if CPU 1 and 5 are overloaded, and CPU 3 schedules a lower +- * priority task, it will send an IPI first to CPU 5, then CPU 5 will +- * send to CPU 1 if it is still overloaded. CPU 1 will clear the +- * rq->rt.push_flags if RT_PUSH_IPI_RESTART is not set. +- * +- * The first CPU to notice IPI_RESTART is set, will clear that flag and then +- * send an IPI to the next overloaded CPU after the rq->cpu and not the next +- * CPU after push_cpu. That is, if CPU 1, 4 and 5 are overloaded when CPU 3 +- * schedules a lower priority task, and the IPI_RESTART gets set while the +- * handling is being done on CPU 5, it will clear the flag and send it back to +- * CPU 4 instead of CPU 1. +- * +- * Note, the above logic can be disabled by turning off the sched_feature +- * RT_PUSH_IPI. Then the rq lock of the overloaded CPU will simply be +- * taken by the CPU requesting a pull and the waiting RT task will be pulled +- * by that CPU. This may be fine for machines with few CPUs. +- */ +-static void tell_cpu_to_push(struct rq *rq) ++static inline void rto_start_unlock(atomic_t *v) + { +- int cpu; ++ atomic_set_release(v, 0); ++} + +- if (rq->rt.push_flags & RT_PUSH_IPI_EXECUTING) { +- raw_spin_lock(&rq->rt.push_lock); +- /* Make sure it's still executing */ +- if (rq->rt.push_flags & RT_PUSH_IPI_EXECUTING) { +- /* +- * Tell the IPI to restart the loop as things have +- * changed since it started. +- */ +- rq->rt.push_flags |= RT_PUSH_IPI_RESTART; +- raw_spin_unlock(&rq->rt.push_lock); +- return; +- } +- raw_spin_unlock(&rq->rt.push_lock); +- } ++static void tell_cpu_to_push(struct rq *rq) ++{ ++ int cpu = -1; + +- /* When here, there's no IPI going around */ ++ /* Keep the loop going if the IPI is currently active */ ++ atomic_inc(&rq->rd->rto_loop_next); + +- rq->rt.push_cpu = rq->cpu; +- cpu = find_next_push_cpu(rq); +- if (cpu >= nr_cpu_ids) ++ /* Only one CPU can initiate a loop at a time */ ++ if (!rto_start_trylock(&rq->rd->rto_loop_start)) + return; + +- rq->rt.push_flags = RT_PUSH_IPI_EXECUTING; ++ raw_spin_lock(&rq->rd->rto_lock); + +- irq_work_queue_on(&rq->rt.push_work, cpu); ++ /* ++ * The rto_cpu is updated under the lock, if it has a valid cpu ++ * then the IPI is still running and will continue due to the ++ * update to loop_next, and nothing needs to be done here. ++ * Otherwise it is finishing up and an ipi needs to be sent. ++ */ ++ if (rq->rd->rto_cpu < 0) ++ cpu = rto_next_cpu(rq); ++ ++ raw_spin_unlock(&rq->rd->rto_lock); ++ ++ rto_start_unlock(&rq->rd->rto_loop_start); ++ ++ if (cpu >= 0) ++ irq_work_queue_on(&rq->rd->rto_push_work, cpu); + } + + /* Called from hardirq context */ +-static void try_to_push_tasks(void *arg) ++void rto_push_irq_work_func(struct irq_work *work) + { +- struct rt_rq *rt_rq = arg; +- struct rq *rq, *src_rq; +- int this_cpu; ++ struct rq *rq; + int cpu; + +- this_cpu = rt_rq->push_cpu; ++ rq = this_rq(); + +- /* Paranoid check */ +- BUG_ON(this_cpu != smp_processor_id()); +- +- rq = cpu_rq(this_cpu); +- src_rq = rq_of_rt_rq(rt_rq); +- +-again: ++ /* ++ * We do not need to grab the lock to check for has_pushable_tasks. ++ * When it gets updated, a check is made if a push is possible. ++ */ + if (has_pushable_tasks(rq)) { + raw_spin_lock(&rq->lock); +- push_rt_task(rq); ++ push_rt_tasks(rq); + raw_spin_unlock(&rq->lock); + } + +- /* Pass the IPI to the next rt overloaded queue */ +- raw_spin_lock(&rt_rq->push_lock); +- /* +- * If the source queue changed since the IPI went out, +- * we need to restart the search from that CPU again. +- */ +- if (rt_rq->push_flags & RT_PUSH_IPI_RESTART) { +- rt_rq->push_flags &= ~RT_PUSH_IPI_RESTART; +- rt_rq->push_cpu = src_rq->cpu; +- } ++ raw_spin_lock(&rq->rd->rto_lock); + +- cpu = find_next_push_cpu(src_rq); ++ /* Pass the IPI to the next rt overloaded queue */ ++ cpu = rto_next_cpu(rq); + +- if (cpu >= nr_cpu_ids) +- rt_rq->push_flags &= ~RT_PUSH_IPI_EXECUTING; +- raw_spin_unlock(&rt_rq->push_lock); ++ raw_spin_unlock(&rq->rd->rto_lock); + +- if (cpu >= nr_cpu_ids) ++ if (cpu < 0) + return; + +- /* +- * It is possible that a restart caused this CPU to be +- * chosen again. Don't bother with an IPI, just see if we +- * have more to push. +- */ +- if (unlikely(cpu == rq->cpu)) +- goto again; +- + /* Try the next RT overloaded CPU */ +- irq_work_queue_on(&rt_rq->push_work, cpu); +-} +- +-static void push_irq_work_func(struct irq_work *work) +-{ +- struct rt_rq *rt_rq = container_of(work, struct rt_rq, push_work); +- +- try_to_push_tasks(rt_rq); ++ irq_work_queue_on(&rq->rd->rto_push_work, cpu); + } + #endif /* HAVE_RT_PUSH_IPI */ + +--- a/kernel/sched/sched.h ++++ b/kernel/sched/sched.h +@@ -502,7 +502,7 @@ static inline int rt_bandwidth_enabled(v + } + + /* RT IPI pull logic requires IRQ_WORK */ +-#ifdef CONFIG_IRQ_WORK ++#if defined(CONFIG_IRQ_WORK) && defined(CONFIG_SMP) + # define HAVE_RT_PUSH_IPI + #endif + +@@ -524,12 +524,6 @@ struct rt_rq { + unsigned long rt_nr_total; + int overloaded; + struct plist_head pushable_tasks; +-#ifdef HAVE_RT_PUSH_IPI +- int push_flags; +- int push_cpu; +- struct irq_work push_work; +- raw_spinlock_t push_lock; +-#endif + #endif /* CONFIG_SMP */ + int rt_queued; + +@@ -638,6 +632,19 @@ struct root_domain { + struct dl_bw dl_bw; + struct cpudl cpudl; + ++#ifdef HAVE_RT_PUSH_IPI ++ /* ++ * For IPI pull requests, loop across the rto_mask. ++ */ ++ struct irq_work rto_push_work; ++ raw_spinlock_t rto_lock; ++ /* These are only updated and read within rto_lock */ ++ int rto_loop; ++ int rto_cpu; ++ /* These atomics are updated outside of a lock */ ++ atomic_t rto_loop_next; ++ atomic_t rto_loop_start; ++#endif + /* + * The "RT overload" flag: it gets set if a CPU has more than + * one runnable RT task. +@@ -655,6 +662,9 @@ extern void init_defrootdomain(void); + extern int sched_init_domains(const struct cpumask *cpu_map); + extern void rq_attach_root(struct rq *rq, struct root_domain *rd); + ++#ifdef HAVE_RT_PUSH_IPI ++extern void rto_push_irq_work_func(struct irq_work *work); ++#endif + #endif /* CONFIG_SMP */ + + /* +--- a/kernel/sched/topology.c ++++ b/kernel/sched/topology.c +@@ -269,6 +269,12 @@ static int init_rootdomain(struct root_d + if (!zalloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) + goto free_dlo_mask; + ++#ifdef HAVE_RT_PUSH_IPI ++ rd->rto_cpu = -1; ++ raw_spin_lock_init(&rd->rto_lock); ++ init_irq_work(&rd->rto_push_work, rto_push_irq_work_func); ++#endif ++ + init_dl_bw(&rd->dl_bw); + if (cpudl_init(&rd->cpudl) != 0) + goto free_rto_mask; 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 24a0c9f62..1bd5ea88a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -85,7 +85,7 @@ Signed-off-by: Thomas Gleixner return try_to_wake_up(p, state, 0); --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h -@@ -1342,6 +1342,7 @@ static inline void finish_lock_switch(st +@@ -1352,6 +1352,7 @@ static inline void finish_lock_switch(st #define WF_SYNC 0x01 /* waker goes to sleep after wakeup */ #define WF_FORK 0x02 /* child wakeup after fork */ #define WF_MIGRATED 0x4 /* internal use, task got migrated */ diff --git a/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch b/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch index 31299c105..8c5477dbf 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 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 9ad3c67bf..20f59c350 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz In -rt, most spin_locks() turn into mutexes. One of these spin_lock conversions is performed on the workqueue gcwq->lock. When the idle diff --git a/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch b/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch index b9d350740..8222465d0 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 8f52bcce8..68261e548 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 83a06520b..232a9e024 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 3eabcf73e..323d615fd 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 882e65648..95c1db309 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 d2afedb38..5ab18e347 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 b63a2a6d5..d8e8389a6 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 5f46b58b0..15b1c4acd 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 538380e40..443a82d88 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4767e88e0..f3f7726af 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 6e21f70ed..255bc0626 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. diff --git a/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch b/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch index 20ebf3c26..520de31f3 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a4c3afaa1..107ea6e39 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz The 3.x RT series removed the split softirq implementation in favour of pushing softirq processing into the context of the thread which diff --git a/debian/patches/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 ea5c4257c..567030d2b 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 0a6b53cf1..765ad53ac 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 499756b37..2318d766c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 b8312d601..5d1f9599f 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 795b53e94..5474b7297 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 2eacce312..2da3d9cfd 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 ccab258be..79f43d266 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 5a23f5784..fb43eef93 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4fbb55351..bfd452886 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 2dd90cc71..9fad76c39 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 52590bcf7..b4967b936 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4a5a18109..f5d6b3254 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 5909e69f7..5411ff78e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads, and spinlocks turn are mutexes. But this can cause issues with diff --git a/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch b/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch index b7ff95c47..fe5359bf4 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a879a2a1b..e69eb8773 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 dcd29d5ff..091dc57d4 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 7b1815def..e92e15828 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz People were complaining about broken balancing with the recent -rt series. @@ -59,7 +59,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -1636,13 +1636,13 @@ void update_process_times(int user_tick) +@@ -1630,13 +1630,13 @@ void update_process_times(int user_tick) /* Note: this timer irq context must be accounted for as well. */ account_process_tick(p, user_tick); 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 48a58a63a..634133ea6 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 abca04795..4e5d0eb74 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 @@ -75,7 +75,7 @@ Signed-off-by: Thomas Gleixner unsigned long clk; unsigned long next_expiry; unsigned int cpu; -@@ -1148,6 +1152,33 @@ void add_timer_on(struct timer_list *tim +@@ -1142,6 +1146,33 @@ void add_timer_on(struct timer_list *tim } EXPORT_SYMBOL_GPL(add_timer_on); @@ -109,7 +109,7 @@ Signed-off-by: Thomas Gleixner /** * del_timer - deactivate a timer. * @timer: the timer to be deactivated -@@ -1203,7 +1234,7 @@ int try_to_del_timer_sync(struct timer_l +@@ -1197,7 +1228,7 @@ int try_to_del_timer_sync(struct timer_l } EXPORT_SYMBOL(try_to_del_timer_sync); @@ -118,7 +118,7 @@ Signed-off-by: Thomas Gleixner /** * del_timer_sync - deactivate a timer and wait for the handler to finish. * @timer: the timer to be deactivated -@@ -1263,7 +1294,7 @@ int del_timer_sync(struct timer_list *ti +@@ -1257,7 +1288,7 @@ int del_timer_sync(struct timer_list *ti int ret = try_to_del_timer_sync(timer); if (ret >= 0) return ret; @@ -127,7 +127,7 @@ Signed-off-by: Thomas Gleixner } } EXPORT_SYMBOL(del_timer_sync); -@@ -1327,13 +1358,16 @@ static void expire_timers(struct timer_b +@@ -1321,13 +1352,16 @@ static void expire_timers(struct timer_b fn = timer->function; data = timer->data; @@ -145,7 +145,7 @@ Signed-off-by: Thomas Gleixner raw_spin_lock_irq(&base->lock); } } -@@ -1635,8 +1669,8 @@ static inline void __run_timers(struct t +@@ -1629,8 +1663,8 @@ static inline void __run_timers(struct t while (levels--) expire_timers(base, heads + levels); } @@ -155,7 +155,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -1861,6 +1895,9 @@ static void __init init_timer_cpu(int cp +@@ -1855,6 +1889,9 @@ static void __init init_timer_cpu(int cp base->cpu = cpu; raw_spin_lock_init(&base->lock); base->clk = jiffies; 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 19897b44c..8ede6d1d1 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 0095fa801..4f1cc7dce 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz The preempt_schedule() uses the preempt_disable_notrace() version because it can cause infinite recursion by the function tracer as 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 876ef09bf..9a2ca27fc 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz An oops with irqs off (panic() from irqsafe hrtimer like the watchdog timer) will lead to a lockdep warning on each invocation and as such diff --git a/debian/patches/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 72b3ad085..38af015d8 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 00a16a887..cb0749541 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e74f69453..131117827 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 cf2226095..ea6d8da8e 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 4a9d9dbbd..2f74c1360 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 879225fd5..23ebd9be2 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 959cfc547..86f193210 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz --- kernel/sched/core.c | 84 +++++++------------------------------------- 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 cf4f42349..a70baa3ea 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Austin reported a XFS deadlock/stall on RT where scheduled work gets never exececuted and tasks are waiting for each other for ever. diff --git a/debian/patches/features/all/rt/workqueue-use-locallock.patch b/debian/patches/features/all/rt/workqueue-use-locallock.patch index f3deef263..e3a9c1bbe 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 666ae49e1..ac3649896 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 94cb6917a..a23f3f2b0 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 439bae962..8ad5ab1ea 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 55837d9fd..5a2441601 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 5fb22e515..16767686d 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a9e94099f..22ddb60d6 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz Non constant TSC is a nightmare on bare metal already, but with virtualization it becomes a complete disaster because the workarounds 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 7a7634e1c..7500debf7 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 543a4729a..8ec178a6c 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 a53f34b2a..408cd1b96 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 e95b06489..18d10deff 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 076eb3806..85fdda69a 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 bd0988363..e054e9f20 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 0d36dcd0d..c2f1a6683 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-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.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 11b0da843..3f3883dad 100644 --- a/debian/patches/series-rt +++ b/debian/patches/series-rt @@ -6,6 +6,7 @@ # UPSTREAM changes queued ############################################################ features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch +features/all/rt/sched-rt-Simplify-the-IPI-based-RT-balancing-logic.patch ############################################################ # UPSTREAM FIXES, patches pending @@ -16,7 +17,7 @@ features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch ############################################################ # soft hrtimer patches (v3) -features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-and-nohz_a.patch +features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch features/all/rt/0002-hrtimer-Correct-blantanly-wrong-comment.patch features/all/rt/0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch features/all/rt/0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch @@ -33,7 +34,7 @@ features/all/rt/0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch features/all/rt/0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch features/all/rt/0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch features/all/rt/0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch -features/all/rt/0018-hrtimer-Reduce-conditional-code-and-make-hrtimer_for.patch +features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch features/all/rt/0019-hrtimer-Unify-handling-of-hrtimer-remove.patch features/all/rt/0020-hrtimer-Unify-handling-of-remote-enqueue.patch features/all/rt/0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch @@ -128,40 +129,44 @@ 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 -# v3 tracing: Inter-event (e.g. latency) support | 2017-09-22 -features/all/rt/0010-tracing-Add-support-to-detect-and-avoid-duplicates.patch -features/all/rt/0011-tracing-Remove-code-which-merges-duplicates.patch -features/all/rt/0012-ring-buffer-Add-interface-for-setting-absolute-time-.patch -features/all/rt/0013-ring-buffer-Redefine-the-unimplemented-RINGBUF_TIME_.patch -features/all/rt/0014-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch -features/all/rt/0015-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch -features/all/rt/0016-tracing-Break-out-hist-trigger-assignment-parsing.patch -features/all/rt/0017-tracing-Add-hist-trigger-timestamp-support.patch -features/all/rt/0018-tracing-Add-per-element-variable-support-to-tracing_.patch -features/all/rt/0019-tracing-Add-hist_data-member-to-hist_field.patch -features/all/rt/0020-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch -features/all/rt/0021-tracing-Add-variable-support-to-hist-triggers.patch -features/all/rt/0022-tracing-Account-for-variables-in-named-trigger-compa.patch -features/all/rt/0023-tracing-Move-get_hist_field_flags.patch -features/all/rt/0024-tracing-Add-simple-expression-support-to-hist-trigge.patch -features/all/rt/0025-tracing-Generalize-per-element-hist-trigger-data.patch -features/all/rt/0026-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch -features/all/rt/0027-tracing-Add-hist_field-type-field.patch -features/all/rt/0028-tracing-Add-variable-reference-handling-to-hist-trig.patch -features/all/rt/0029-tracing-Add-hist-trigger-action-hook.patch -features/all/rt/0030-tracing-Add-support-for-synthetic-events.patch -features/all/rt/0031-tracing-Add-support-for-field-variables.patch -features/all/rt/0032-tracing-Add-onmatch-hist-trigger-action-support.patch -features/all/rt/0033-tracing-Add-onmax-hist-trigger-action-support.patch -features/all/rt/0034-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch -features/all/rt/0035-tracing-Add-cpu-field-for-hist-triggers.patch -features/all/rt/0036-tracing-Add-hist-trigger-support-for-variable-refere.patch -features/all/rt/0037-tracing-Add-last-error-error-facility-for-hist-trigg.patch -features/all/rt/0038-tracing-Add-inter-event-hist-trigger-Documentation.patch -features/all/rt/0039-tracing-Make-tracing_set_clock-non-static.patch -features/all/rt/0040-tracing-Add-a-clock-attribute-for-hist-triggers.patch -features/all/rt/0041-tracing-Increase-trace_recursive_lock-limit-for-synt.patch -features/all/rt/0042-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch +# v6 tracing: Inter-event (e.g. latency) support | 2017-11-17 +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 +features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch +features/all/rt/0005-ring-buffer-Add-interface-for-setting-absolute-time-.patch +features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch +features/all/rt/0007-tracing-Add-timestamp_mode-trace-file.patch +features/all/rt/0008-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch +features/all/rt/0009-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch +features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch +features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch +features/all/rt/0012-tracing-Add-per-element-variable-support-to-tracing_.patch +features/all/rt/0013-tracing-Add-hist_data-member-to-hist_field.patch +features/all/rt/0014-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch +features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch +features/all/rt/0016-tracing-Account-for-variables-in-named-trigger-compa.patch +features/all/rt/0017-tracing-Move-get_hist_field_flags.patch +features/all/rt/0018-tracing-Add-simple-expression-support-to-hist-trigge.patch +features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch +features/all/rt/0020-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch +features/all/rt/0021-tracing-Add-hist_field-type-field.patch +features/all/rt/0022-tracing-Add-variable-reference-handling-to-hist-trig.patch +features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch +features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch +features/all/rt/0025-tracing-Add-support-for-field-variables.patch +features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch +features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch +features/all/rt/0028-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch +features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch +features/all/rt/0030-tracing-Add-hist-trigger-support-for-variable-refere.patch +features/all/rt/0031-tracing-Add-last-error-error-facility-for-hist-trigg.patch +features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch +features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch +features/all/rt/0034-tracing-Add-a-clock-attribute-for-hist-triggers.patch +features/all/rt/0035-tracing-Increase-trace_recursive_lock-limit-for-synt.patch +features/all/rt/0036-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch +features/all/rt/0037-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch # SCHED BLOCK/WQ features/all/rt/block-shorten-interrupt-disabled-regions.patch @@ -443,6 +448,7 @@ features/all/rt/mm-protect-activate-switch-mm.patch features/all/rt/fs-block-rt-support.patch features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch +features/all/rt/Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch features/all/rt/fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch features/all/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch @@ -642,6 +648,7 @@ features/all/rt/drm-i915-init-spinlock-properly-on-RT.patch # CGROUPS features/all/rt/cgroups-use-simple-wait-in-css_release.patch features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch +features/all/rt/Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch features/all/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch # New stuff