From d5f85efa05537ffacdd64a8ca6610959425964c9 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: May 09 2023 08:22:42 +0000 Subject: cpuidle: powerpc: read mostly for common globals (PED-3947 bsc#1210544 ltc#202303). - Refresh patches.suse/cpuidle-powernv-Fix-promotion-from-snooze-if-next-st.patch --- diff --git a/patches.suse/cpuidle-powernv-Fix-promotion-from-snooze-if-next-st.patch b/patches.suse/cpuidle-powernv-Fix-promotion-from-snooze-if-next-st.patch index 38ce05f..e9c0d11 100644 --- a/patches.suse/cpuidle-powernv-Fix-promotion-from-snooze-if-next-st.patch +++ b/patches.suse/cpuidle-powernv-Fix-promotion-from-snooze-if-next-st.patch @@ -1,9 +1,12 @@ +From 0a4ec6aa035a52c422eceb2ed51ed88392a3d6c2 Mon Sep 17 00:00:00 2001 From: "Gautham R. Shenoy" Date: Thu, 31 May 2018 17:45:09 +0530 -Subject: cpuidle: powernv: Fix promotion from snooze if next state disabled +Subject: [PATCH] cpuidle: powernv: Fix promotion from snooze if next state + disabled + +References: bsc#1100884 Patch-mainline: v4.18-rc1 Git-commit: 0a4ec6aa035a52c422eceb2ed51ed88392a3d6c2 -References: bsc#1100884 The commit 78eaa10f027c ("cpuidle: powernv/pseries: Auto-promotion of snooze to deeper idle state") introduced a timeout for the snooze idle @@ -80,18 +83,20 @@ Reviewed-by: Balbir Singh Signed-off-by: Michael Ellerman Acked-by: Giovanni Gherdovich --- - drivers/cpuidle/cpuidle-powernv.c | 32 ++++++++++++++++++++++++++------ + drivers/cpuidle/cpuidle-powernv.c | 32 +++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) +diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c +index 1a8234e706bc..d29e4f041efe 100644 --- a/drivers/cpuidle/cpuidle-powernv.c +++ b/drivers/cpuidle/cpuidle-powernv.c -@@ -42,9 +42,31 @@ struct stop_psscr_table { +@@ -43,9 +43,31 @@ struct stop_psscr_table { - static struct stop_psscr_table stop_psscr_table[CPUIDLE_STATE_MAX]; + static struct stop_psscr_table stop_psscr_table[CPUIDLE_STATE_MAX] __read_mostly; --static u64 snooze_timeout; -+static u64 default_snooze_timeout; - static bool snooze_timeout_en; +-static u64 snooze_timeout __read_mostly; ++static u64 default_snooze_timeout __read_mostly; + static bool snooze_timeout_en __read_mostly; +static u64 get_snooze_timeout(struct cpuidle_device *dev, + struct cpuidle_driver *drv, @@ -118,8 +123,8 @@ Acked-by: Giovanni Gherdovich static int snooze_loop(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) -@@ -54,7 +76,7 @@ static int snooze_loop(struct cpuidle_de - +@@ -56,7 +78,7 @@ static int snooze_loop(struct cpuidle_device *dev, + local_irq_enable(); - snooze_exit_time = get_tb() + snooze_timeout; @@ -127,7 +132,7 @@ Acked-by: Giovanni Gherdovich ppc64_runlatch_off(); HMT_very_low(); while (!need_resched()) { -@@ -453,11 +475,9 @@ static int powernv_idle_probe(void) +@@ -465,11 +487,9 @@ static int powernv_idle_probe(void) cpuidle_state_table = powernv_states; /* Device tree can indicate more idle states */ max_idle_state = powernv_add_idle_states(); @@ -141,3 +146,6 @@ Acked-by: Giovanni Gherdovich } else return -ENODEV; +-- +2.40.0 + diff --git a/patches.suse/cpuidle-powerpc-read-mostly-for-common-globals.patch b/patches.suse/cpuidle-powerpc-read-mostly-for-common-globals.patch new file mode 100644 index 0000000..1608463 --- /dev/null +++ b/patches.suse/cpuidle-powerpc-read-mostly-for-common-globals.patch @@ -0,0 +1,71 @@ +From 624e46d03576dd4d5667bad9d2ef814135d0075c Mon Sep 17 00:00:00 2001 +From: Nicholas Piggin +Date: Wed, 14 Jun 2017 23:02:40 +1000 +Subject: [PATCH] cpuidle: powerpc: read mostly for common globals + +References: PED-3947 bsc#1210544 ltc#202303 +Patch-mainline: v4.13-rc1 +Git-commit: 624e46d03576dd4d5667bad9d2ef814135d0075c + +Ensure these don't get put into bouncing cachelines. + +Reviewed-by: Vaidyanathan Srinivasan +Reviewed-by: Gautham R. Shenoy +Signed-off-by: Nicholas Piggin +Signed-off-by: Michael Ellerman +Acked-by: Michal Suchanek +--- + drivers/cpuidle/cpuidle-powernv.c | 10 +++++----- + drivers/cpuidle/cpuidle-pseries.c | 8 ++++---- + 2 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c +index 50b3c2e0306f..9d03326ac05e 100644 +--- a/drivers/cpuidle/cpuidle-powernv.c ++++ b/drivers/cpuidle/cpuidle-powernv.c +@@ -32,18 +32,18 @@ static struct cpuidle_driver powernv_idle_driver = { + .owner = THIS_MODULE, + }; + +-static int max_idle_state; +-static struct cpuidle_state *cpuidle_state_table; ++static int max_idle_state __read_mostly; ++static struct cpuidle_state *cpuidle_state_table __read_mostly; + + struct stop_psscr_table { + u64 val; + u64 mask; + }; + +-static struct stop_psscr_table stop_psscr_table[CPUIDLE_STATE_MAX]; ++static struct stop_psscr_table stop_psscr_table[CPUIDLE_STATE_MAX] __read_mostly; + +-static u64 snooze_timeout; +-static bool snooze_timeout_en; ++static u64 snooze_timeout __read_mostly; ++static bool snooze_timeout_en __read_mostly; + + static int snooze_loop(struct cpuidle_device *dev, + struct cpuidle_driver *drv, +diff --git a/drivers/cpuidle/cpuidle-pseries.c b/drivers/cpuidle/cpuidle-pseries.c +index 7b12bb2ea70f..a404f352d284 100644 +--- a/drivers/cpuidle/cpuidle-pseries.c ++++ b/drivers/cpuidle/cpuidle-pseries.c +@@ -25,10 +25,10 @@ struct cpuidle_driver pseries_idle_driver = { + .owner = THIS_MODULE, + }; + +-static int max_idle_state; +-static struct cpuidle_state *cpuidle_state_table; +-static u64 snooze_timeout; +-static bool snooze_timeout_en; ++static int max_idle_state __read_mostly; ++static struct cpuidle_state *cpuidle_state_table __read_mostly; ++static u64 snooze_timeout __read_mostly; ++static bool snooze_timeout_en __read_mostly; + + static inline void idle_loop_prolog(unsigned long *in_purr) + { +-- +2.40.0 + diff --git a/series.conf b/series.conf index 9bf7813..0c852d0 100644 --- a/series.conf +++ b/series.conf @@ -3849,6 +3849,7 @@ patches.suse/powerpc-fadump-provide-a-helpful-error-message.patch patches.suse/powerpc-fadump-add-reschedule-point-while-releasing-memory.patch patches.suse/cpuidle-powerpc-cpuidle-set-polling-before-enabling-.patch + patches.suse/cpuidle-powerpc-read-mostly-for-common-globals.patch patches.suse/powerpc-powernv-idle-Clear-r12-on-wakeup-from-stop-lite.patch patches.suse/0001-spin-loop-primitives-for-busy-waiting.patch patches.suse/0001-powerpc-use-spin-loop-primitives-in-some-functions.patch