Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
505b308b
Commit
505b308b
authored
Dec 19, 2019
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pm-cpufreq'
* pm-cpufreq: cpufreq: Avoid leaving stale IRQ work items during CPU offline
parents
4c84515d
85572c2c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
16 deletions
+24
-16
include/linux/cpufreq.h
include/linux/cpufreq.h
+0
-11
include/linux/sched/cpufreq.h
include/linux/sched/cpufreq.h
+3
-0
kernel/sched/cpufreq.c
kernel/sched/cpufreq.c
+18
-0
kernel/sched/cpufreq_schedutil.c
kernel/sched/cpufreq_schedutil.c
+3
-5
No files found.
include/linux/cpufreq.h
View file @
505b308b
...
@@ -595,17 +595,6 @@ struct governor_attr {
...
@@ -595,17 +595,6 @@ struct governor_attr {
size_t
count
);
size_t
count
);
};
};
static
inline
bool
cpufreq_this_cpu_can_update
(
struct
cpufreq_policy
*
policy
)
{
/*
* Allow remote callbacks if:
* - dvfs_possible_from_any_cpu flag is set
* - the local and remote CPUs share cpufreq policy
*/
return
policy
->
dvfs_possible_from_any_cpu
||
cpumask_test_cpu
(
smp_processor_id
(),
policy
->
cpus
);
}
/*********************************************************************
/*********************************************************************
* FREQUENCY TABLE HELPERS *
* FREQUENCY TABLE HELPERS *
*********************************************************************/
*********************************************************************/
...
...
include/linux/sched/cpufreq.h
View file @
505b308b
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
#define SCHED_CPUFREQ_MIGRATION (1U << 1)
#define SCHED_CPUFREQ_MIGRATION (1U << 1)
#ifdef CONFIG_CPU_FREQ
#ifdef CONFIG_CPU_FREQ
struct
cpufreq_policy
;
struct
update_util_data
{
struct
update_util_data
{
void
(
*
func
)(
struct
update_util_data
*
data
,
u64
time
,
unsigned
int
flags
);
void
(
*
func
)(
struct
update_util_data
*
data
,
u64
time
,
unsigned
int
flags
);
};
};
...
@@ -20,6 +22,7 @@ void cpufreq_add_update_util_hook(int cpu, struct update_util_data *data,
...
@@ -20,6 +22,7 @@ void cpufreq_add_update_util_hook(int cpu, struct update_util_data *data,
void
(
*
func
)(
struct
update_util_data
*
data
,
u64
time
,
void
(
*
func
)(
struct
update_util_data
*
data
,
u64
time
,
unsigned
int
flags
));
unsigned
int
flags
));
void
cpufreq_remove_update_util_hook
(
int
cpu
);
void
cpufreq_remove_update_util_hook
(
int
cpu
);
bool
cpufreq_this_cpu_can_update
(
struct
cpufreq_policy
*
policy
);
static
inline
unsigned
long
map_util_freq
(
unsigned
long
util
,
static
inline
unsigned
long
map_util_freq
(
unsigned
long
util
,
unsigned
long
freq
,
unsigned
long
cap
)
unsigned
long
freq
,
unsigned
long
cap
)
...
...
kernel/sched/cpufreq.c
View file @
505b308b
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
* Copyright (C) 2016, Intel Corporation
* Copyright (C) 2016, Intel Corporation
* Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
*/
*/
#include <linux/cpufreq.h>
#include "sched.h"
#include "sched.h"
DEFINE_PER_CPU
(
struct
update_util_data
__rcu
*
,
cpufreq_update_util_data
);
DEFINE_PER_CPU
(
struct
update_util_data
__rcu
*
,
cpufreq_update_util_data
);
...
@@ -57,3 +59,19 @@ void cpufreq_remove_update_util_hook(int cpu)
...
@@ -57,3 +59,19 @@ void cpufreq_remove_update_util_hook(int cpu)
rcu_assign_pointer
(
per_cpu
(
cpufreq_update_util_data
,
cpu
),
NULL
);
rcu_assign_pointer
(
per_cpu
(
cpufreq_update_util_data
,
cpu
),
NULL
);
}
}
EXPORT_SYMBOL_GPL
(
cpufreq_remove_update_util_hook
);
EXPORT_SYMBOL_GPL
(
cpufreq_remove_update_util_hook
);
/**
* cpufreq_this_cpu_can_update - Check if cpufreq policy can be updated.
* @policy: cpufreq policy to check.
*
* Return 'true' if:
* - the local and remote CPUs share @policy,
* - dvfs_possible_from_any_cpu is set in @policy and the local CPU is not going
* offline (in which case it is not expected to run cpufreq updates any more).
*/
bool
cpufreq_this_cpu_can_update
(
struct
cpufreq_policy
*
policy
)
{
return
cpumask_test_cpu
(
smp_processor_id
(),
policy
->
cpus
)
||
(
policy
->
dvfs_possible_from_any_cpu
&&
rcu_dereference_sched
(
*
this_cpu_ptr
(
&
cpufreq_update_util_data
)));
}
kernel/sched/cpufreq_schedutil.c
View file @
505b308b
...
@@ -82,12 +82,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
...
@@ -82,12 +82,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
* by the hardware, as calculating the frequency is pointless if
* by the hardware, as calculating the frequency is pointless if
* we cannot in fact act on it.
* we cannot in fact act on it.
*
*
* For the slow switching platforms, the kthread is always scheduled on
* This is needed on the slow switching platforms too to prevent CPUs
* the right set of CPUs and any CPU can find the next frequency and
* going offline from leaving stale IRQ work items behind.
* schedule the kthread.
*/
*/
if
(
sg_policy
->
policy
->
fast_switch_enabled
&&
if
(
!
cpufreq_this_cpu_can_update
(
sg_policy
->
policy
))
!
cpufreq_this_cpu_can_update
(
sg_policy
->
policy
))
return
false
;
return
false
;
if
(
unlikely
(
sg_policy
->
limits_changed
))
{
if
(
unlikely
(
sg_policy
->
limits_changed
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment