]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Drop perf-evlist-avoid-frequency-mode-for-the-dummy-event.patch
authorSasha Levin <sashal@kernel.org>
Thu, 16 Nov 2023 13:56:03 +0000 (08:56 -0500)
committerSasha Levin <sashal@kernel.org>
Thu, 16 Nov 2023 13:56:03 +0000 (08:56 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.10/perf-evlist-avoid-frequency-mode-for-the-dummy-event.patch [deleted file]
queue-5.10/series
queue-5.15/perf-evlist-avoid-frequency-mode-for-the-dummy-event.patch [deleted file]
queue-5.15/series

diff --git a/queue-5.10/perf-evlist-avoid-frequency-mode-for-the-dummy-event.patch b/queue-5.10/perf-evlist-avoid-frequency-mode-for-the-dummy-event.patch
deleted file mode 100644 (file)
index 2ef068d..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-From 672023d6b64f7a9777388961b72745c41ec33e1b Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 15 Sep 2023 20:56:40 -0700
-Subject: perf evlist: Avoid frequency mode for the dummy event
-
-From: Ian Rogers <irogers@google.com>
-
-[ Upstream commit f9cdeb58a9cf46c09b56f5f661ea8da24b6458c3 ]
-
-Dummy events are created with an attribute where the period and freq
-are zero. evsel__config will then see the uninitialized values and
-initialize them in evsel__default_freq_period. As fequency mode is
-used by default the dummy event would be set to use frequency
-mode. However, this has no effect on the dummy event but does cause
-unnecessary timers/interrupts. Avoid this overhead by setting the
-period to 1 for dummy events.
-
-evlist__add_aux_dummy calls evlist__add_dummy then sets freq=0 and
-period=1. This isn't necessary after this change and so the setting is
-removed.
-
-From Stephane:
-
-The dummy event is not counting anything. It is used to collect mmap
-records and avoid a race condition during the synthesize mmap phase of
-perf record. As such, it should not cause any overhead during active
-profiling. Yet, it did. Because of a bug the dummy event was
-programmed as a sampling event in frequency mode. Events in that mode
-incur more kernel overheads because on timer tick, the kernel has to
-look at the number of samples for each event and potentially adjust
-the sampling period to achieve the desired frequency. The dummy event
-was therefore adding a frequency event to task and ctx contexts we may
-otherwise not have any, e.g.,
-
-  perf record -a -e cpu/event=0x3c,period=10000000/.
-
-On each timer tick the perf_adjust_freq_unthr_context() is invoked and
-if ctx->nr_freq is non-zero, then the kernel will loop over ALL the
-events of the context looking for frequency mode ones. In doing, so it
-locks the context, and enable/disable the PMU of each hw event. If all
-the events of the context are in period mode, the kernel will have to
-traverse the list for nothing incurring overhead. The overhead is
-multiplied by a very large factor when this happens in a guest kernel.
-There is no need for the dummy event to be in frequency mode, it does
-not count anything and therefore should not cause extra overhead for
-no reason.
-
-Fixes: 5bae0250237f ("perf evlist: Introduce perf_evlist__new_dummy constructor")
-Reported-by: Stephane Eranian <eranian@google.com>
-Signed-off-by: Ian Rogers <irogers@google.com>
-Acked-by: Adrian Hunter <adrian.hunter@intel.com>
-Cc: Yang Jihong <yangjihong1@huawei.com>
-Cc: Kan Liang <kan.liang@linux.intel.com>
-Link: https://lore.kernel.org/r/20230916035640.1074422-1-irogers@google.com
-Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/perf/util/evlist.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
-index f0ca9aa7c208e..84b328d2515bd 100644
---- a/tools/perf/util/evlist.c
-+++ b/tools/perf/util/evlist.c
-@@ -251,6 +251,9 @@ int evlist__add_dummy(struct evlist *evlist)
-               .type   = PERF_TYPE_SOFTWARE,
-               .config = PERF_COUNT_SW_DUMMY,
-               .size   = sizeof(attr), /* to capture ABI version */
-+              /* Avoid frequency mode for dummy events to avoid associated timers. */
-+              .freq = 0,
-+              .sample_period = 1,
-       };
-       struct evsel *evsel = evsel__new_idx(&attr, evlist->core.nr_entries);
-@@ -271,8 +274,6 @@ struct evsel *evlist__add_aux_dummy(struct evlist *evlist, bool system_wide)
-       evsel->core.attr.exclude_kernel = 1;
-       evsel->core.attr.exclude_guest = 1;
-       evsel->core.attr.exclude_hv = 1;
--      evsel->core.attr.freq = 0;
--      evsel->core.attr.sample_period = 1;
-       evsel->core.system_wide = system_wide;
-       evsel->no_aux_samples = true;
-       evsel->name = strdup("dummy:u");
--- 
-2.42.0
-
index 86f25be0e83767c7cf72fa2bb9adb9071f2b73f7..aaf8019c84ab0494f4829653b9ba51a09f2e040f 100644 (file)
@@ -122,7 +122,6 @@ tty-tty_jobctrl-fix-pid-memleak-in-disassociate_ctty.patch
 livepatch-fix-missing-newline-character-in-klp_resol.patch
 perf-evlist-add-evlist__add_dummy_on_all_cpus.patch
 perf-tools-get-rid-of-evlist__add_on_all_cpus.patch
-perf-evlist-avoid-frequency-mode-for-the-dummy-event.patch
 usb-dwc2-fix-possible-null-pointer-dereference-cause.patch
 dmaengine-ti-edma-handle-irq_of_parse_and_map-errors.patch
 misc-st_core-do-not-call-kfree_skb-under-spin_lock_i.patch
diff --git a/queue-5.15/perf-evlist-avoid-frequency-mode-for-the-dummy-event.patch b/queue-5.15/perf-evlist-avoid-frequency-mode-for-the-dummy-event.patch
deleted file mode 100644 (file)
index 4c3b3c5..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-From dce002fd193111afa04774420e3798b77c54e543 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 15 Sep 2023 20:56:40 -0700
-Subject: perf evlist: Avoid frequency mode for the dummy event
-
-From: Ian Rogers <irogers@google.com>
-
-[ Upstream commit f9cdeb58a9cf46c09b56f5f661ea8da24b6458c3 ]
-
-Dummy events are created with an attribute where the period and freq
-are zero. evsel__config will then see the uninitialized values and
-initialize them in evsel__default_freq_period. As fequency mode is
-used by default the dummy event would be set to use frequency
-mode. However, this has no effect on the dummy event but does cause
-unnecessary timers/interrupts. Avoid this overhead by setting the
-period to 1 for dummy events.
-
-evlist__add_aux_dummy calls evlist__add_dummy then sets freq=0 and
-period=1. This isn't necessary after this change and so the setting is
-removed.
-
-From Stephane:
-
-The dummy event is not counting anything. It is used to collect mmap
-records and avoid a race condition during the synthesize mmap phase of
-perf record. As such, it should not cause any overhead during active
-profiling. Yet, it did. Because of a bug the dummy event was
-programmed as a sampling event in frequency mode. Events in that mode
-incur more kernel overheads because on timer tick, the kernel has to
-look at the number of samples for each event and potentially adjust
-the sampling period to achieve the desired frequency. The dummy event
-was therefore adding a frequency event to task and ctx contexts we may
-otherwise not have any, e.g.,
-
-  perf record -a -e cpu/event=0x3c,period=10000000/.
-
-On each timer tick the perf_adjust_freq_unthr_context() is invoked and
-if ctx->nr_freq is non-zero, then the kernel will loop over ALL the
-events of the context looking for frequency mode ones. In doing, so it
-locks the context, and enable/disable the PMU of each hw event. If all
-the events of the context are in period mode, the kernel will have to
-traverse the list for nothing incurring overhead. The overhead is
-multiplied by a very large factor when this happens in a guest kernel.
-There is no need for the dummy event to be in frequency mode, it does
-not count anything and therefore should not cause extra overhead for
-no reason.
-
-Fixes: 5bae0250237f ("perf evlist: Introduce perf_evlist__new_dummy constructor")
-Reported-by: Stephane Eranian <eranian@google.com>
-Signed-off-by: Ian Rogers <irogers@google.com>
-Acked-by: Adrian Hunter <adrian.hunter@intel.com>
-Cc: Yang Jihong <yangjihong1@huawei.com>
-Cc: Kan Liang <kan.liang@linux.intel.com>
-Link: https://lore.kernel.org/r/20230916035640.1074422-1-irogers@google.com
-Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/perf/util/evlist.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
-index 63ef40543a9fe..9d0f2feb25671 100644
---- a/tools/perf/util/evlist.c
-+++ b/tools/perf/util/evlist.c
-@@ -248,6 +248,9 @@ int evlist__add_dummy(struct evlist *evlist)
-               .type   = PERF_TYPE_SOFTWARE,
-               .config = PERF_COUNT_SW_DUMMY,
-               .size   = sizeof(attr), /* to capture ABI version */
-+              /* Avoid frequency mode for dummy events to avoid associated timers. */
-+              .freq = 0,
-+              .sample_period = 1,
-       };
-       struct evsel *evsel = evsel__new_idx(&attr, evlist->core.nr_entries);
-@@ -268,8 +271,6 @@ struct evsel *evlist__add_aux_dummy(struct evlist *evlist, bool system_wide)
-       evsel->core.attr.exclude_kernel = 1;
-       evsel->core.attr.exclude_guest = 1;
-       evsel->core.attr.exclude_hv = 1;
--      evsel->core.attr.freq = 0;
--      evsel->core.attr.sample_period = 1;
-       evsel->core.system_wide = system_wide;
-       evsel->no_aux_samples = true;
-       evsel->name = strdup("dummy:u");
--- 
-2.42.0
-
index 385a078e3cda191a16dfb022a77ab530b1006538..269bb9e176b444a5bf3ae8ba129f35afda54750e 100644 (file)
@@ -169,7 +169,6 @@ tty-tty_jobctrl-fix-pid-memleak-in-disassociate_ctty.patch
 livepatch-fix-missing-newline-character-in-klp_resol.patch
 perf-evlist-add-evlist__add_dummy_on_all_cpus.patch
 perf-tools-get-rid-of-evlist__add_on_all_cpus.patch
-perf-evlist-avoid-frequency-mode-for-the-dummy-event.patch
 dmaengine-idxd-register-dsa_bus_type-before-register.patch
 usb-dwc2-fix-possible-null-pointer-dereference-cause.patch
 usb-chipidea-fix-dma-overwrite-for-tegra.patch