cpuidle: Add cpuidle_use_deepest_state_mask() helper function

The cpuidle_use_deepest_state() function introduced in commit
2847a3ac96d32 only affects the calling CPU. Add a helper function that
affects all CPUs in a given cpumask to make it easier to toggle
use_deepest_state for multiple CPUs at once and reduce boilerplate code
wherever such behavior is desired.

Signed-off-by: kdrag0n <dragon@khronodragon.com>
This commit is contained in:
kdrag0n 2019-03-09 18:52:04 -08:00 committed by xxmustafacooTR
parent 88ef894b09
commit bef0d9ad57
No known key found for this signature in database
GPG key ID: 520B6FE385CBF5C9
2 changed files with 35 additions and 1 deletions

View file

@ -198,7 +198,9 @@ extern int cpuidle_find_deepest_state(struct cpuidle_driver *drv,
struct cpuidle_device *dev);
extern int cpuidle_enter_freeze(struct cpuidle_driver *drv,
struct cpuidle_device *dev);
extern void cpuidle_use_deepest_state(bool enable);
extern void cpuidle_use_deepest_state(bool enable);
extern int cpuidle_use_deepest_state_mask(const struct cpumask *target,
bool enable);
#else
static inline int cpuidle_find_deepest_state(struct cpuidle_driver *drv,
struct cpuidle_device *dev)
@ -209,6 +211,11 @@ static inline int cpuidle_enter_freeze(struct cpuidle_driver *drv,
static inline void cpuidle_use_deepest_state(bool enable)
{
}
static inline int cpuidle_use_deepest_state_mask(const struct cpumask *target,
bool enable)
{
return -ENODEV;
}
#endif
/* kernel/sched/idle.c */