mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
cpuidle: pseries: Mark ->enter() functions as __cpuidle
Code in the idle path is not allowed to be instrumented because RCU is
disabled, see commit 0e985e9d22
("cpuidle: Add comments about
noinstr/__cpuidle usage").
Mark the cpuidle ->enter() callbacks as __cpuidle and use the
raw_local_irq_*() routines to ensure that is the case.
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Link: https://lore.kernel.org/all/4C073F6A-C812-4C4A-BB7A-ECD10B75FB88@linux.ibm.com/
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230406144535.3786008-3-mpe@ellerman.id.au
This commit is contained in:
parent
6fee130204
commit
88990745c9
1 changed files with 14 additions and 14 deletions
|
@ -33,8 +33,8 @@ static struct cpuidle_state *cpuidle_state_table __read_mostly;
|
||||||
static u64 snooze_timeout __read_mostly;
|
static u64 snooze_timeout __read_mostly;
|
||||||
static bool snooze_timeout_en __read_mostly;
|
static bool snooze_timeout_en __read_mostly;
|
||||||
|
|
||||||
static int snooze_loop(struct cpuidle_device *dev,
|
static __cpuidle
|
||||||
struct cpuidle_driver *drv,
|
int snooze_loop(struct cpuidle_device *dev, struct cpuidle_driver *drv,
|
||||||
int index)
|
int index)
|
||||||
{
|
{
|
||||||
u64 snooze_exit_time;
|
u64 snooze_exit_time;
|
||||||
|
@ -42,7 +42,7 @@ static int snooze_loop(struct cpuidle_device *dev,
|
||||||
set_thread_flag(TIF_POLLING_NRFLAG);
|
set_thread_flag(TIF_POLLING_NRFLAG);
|
||||||
|
|
||||||
pseries_idle_prolog();
|
pseries_idle_prolog();
|
||||||
local_irq_enable();
|
raw_local_irq_enable();
|
||||||
snooze_exit_time = get_tb() + snooze_timeout;
|
snooze_exit_time = get_tb() + snooze_timeout;
|
||||||
dev->poll_time_limit = false;
|
dev->poll_time_limit = false;
|
||||||
|
|
||||||
|
@ -65,14 +65,14 @@ static int snooze_loop(struct cpuidle_device *dev,
|
||||||
HMT_medium();
|
HMT_medium();
|
||||||
clear_thread_flag(TIF_POLLING_NRFLAG);
|
clear_thread_flag(TIF_POLLING_NRFLAG);
|
||||||
|
|
||||||
local_irq_disable();
|
raw_local_irq_disable();
|
||||||
|
|
||||||
pseries_idle_epilog();
|
pseries_idle_epilog();
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void check_and_cede_processor(void)
|
static __cpuidle void check_and_cede_processor(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Ensure our interrupt state is properly tracked,
|
* Ensure our interrupt state is properly tracked,
|
||||||
|
@ -216,8 +216,8 @@ static int __init parse_cede_parameters(void)
|
||||||
#define NR_DEDICATED_STATES 2 /* snooze, CEDE */
|
#define NR_DEDICATED_STATES 2 /* snooze, CEDE */
|
||||||
static u8 cede_latency_hint[NR_DEDICATED_STATES];
|
static u8 cede_latency_hint[NR_DEDICATED_STATES];
|
||||||
|
|
||||||
static int dedicated_cede_loop(struct cpuidle_device *dev,
|
static __cpuidle
|
||||||
struct cpuidle_driver *drv,
|
int dedicated_cede_loop(struct cpuidle_device *dev, struct cpuidle_driver *drv,
|
||||||
int index)
|
int index)
|
||||||
{
|
{
|
||||||
u8 old_latency_hint;
|
u8 old_latency_hint;
|
||||||
|
@ -230,7 +230,7 @@ static int dedicated_cede_loop(struct cpuidle_device *dev,
|
||||||
HMT_medium();
|
HMT_medium();
|
||||||
check_and_cede_processor();
|
check_and_cede_processor();
|
||||||
|
|
||||||
local_irq_disable();
|
raw_local_irq_disable();
|
||||||
get_lppaca()->donate_dedicated_cpu = 0;
|
get_lppaca()->donate_dedicated_cpu = 0;
|
||||||
get_lppaca()->cede_latency_hint = old_latency_hint;
|
get_lppaca()->cede_latency_hint = old_latency_hint;
|
||||||
|
|
||||||
|
@ -239,8 +239,8 @@ static int dedicated_cede_loop(struct cpuidle_device *dev,
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int shared_cede_loop(struct cpuidle_device *dev,
|
static __cpuidle
|
||||||
struct cpuidle_driver *drv,
|
int shared_cede_loop(struct cpuidle_device *dev, struct cpuidle_driver *drv,
|
||||||
int index)
|
int index)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ static int shared_cede_loop(struct cpuidle_device *dev,
|
||||||
*/
|
*/
|
||||||
check_and_cede_processor();
|
check_and_cede_processor();
|
||||||
|
|
||||||
local_irq_disable();
|
raw_local_irq_disable();
|
||||||
pseries_idle_epilog();
|
pseries_idle_epilog();
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
|
|
Loading…
Reference in a new issue