aboutsummaryrefslogtreecommitdiff
path: root/include/linux/cpuset.h
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2017-08-24 19:27:57 +0800
committerAlex Shi <alex.shi@linaro.org>2017-08-24 19:27:57 +0800
commit2d24df0e84490d49a5211468e8793ecf9ad8a5bb (patch)
treef6ad5cf51e4369f66f221cea59bdbb575d060480 /include/linux/cpuset.h
parent21b5f5d91a589931a22009d918fd319f481e8eee (diff)
parent425fdd287e9b41a20bc8b47a00064da3fcd8cae4 (diff)
Merge tag 'v4.4.83' into linux-linaro-lsk-v4.4lsk-v4.4-17.08
This is the 4.4.83 stable release
Diffstat (limited to 'include/linux/cpuset.h')
-rw-r--r--include/linux/cpuset.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 85a868ccb493..8397dc235e84 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -16,6 +16,7 @@
#ifdef CONFIG_CPUSETS
+extern struct static_key cpusets_pre_enable_key;
extern struct static_key cpusets_enabled_key;
static inline bool cpusets_enabled(void)
{
@@ -30,12 +31,14 @@ static inline int nr_cpusets(void)
static inline void cpuset_inc(void)
{
+ static_key_slow_inc(&cpusets_pre_enable_key);
static_key_slow_inc(&cpusets_enabled_key);
}
static inline void cpuset_dec(void)
{
static_key_slow_dec(&cpusets_enabled_key);
+ static_key_slow_dec(&cpusets_pre_enable_key);
}
extern int cpuset_init(void);
@@ -104,7 +107,7 @@ extern void cpuset_print_current_mems_allowed(void);
*/
static inline unsigned int read_mems_allowed_begin(void)
{
- if (!cpusets_enabled())
+ if (!static_key_false(&cpusets_pre_enable_key))
return 0;
return read_seqcount_begin(&current->mems_allowed_seq);
@@ -118,7 +121,7 @@ static inline unsigned int read_mems_allowed_begin(void)
*/
static inline bool read_mems_allowed_retry(unsigned int seq)
{
- if (!cpusets_enabled())
+ if (!static_key_false(&cpusets_enabled_key))
return false;
return read_seqcount_retry(&current->mems_allowed_seq, seq);