aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/debug.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-09-15 14:00:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-09-15 14:00:37 -0400
commit4314daa55b4ddc2dc1c28a3835b484de33ffbfdd (patch)
tree584e5077160abcbf4d13eb03ff42ed58d87c1a90 /kernel/sched/debug.c
parentc0be92b5b14bc6928363527602dabff57875473a (diff)
parent882a78a9f39f5535b209b4aa0a1741e35b8c67fb (diff)
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar: "Misc fixes: various scheduler metrics corner case fixes, a sched_features deadlock fix, and a topology fix for certain NUMA systems" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Fix kernel-doc notation warning sched/fair: Fix load_balance redo for !imbalance sched/fair: Fix scale_rt_capacity() for SMT sched/fair: Fix vruntime_normalized() for remote non-migration wakeup sched/pelt: Fix update_blocked_averages() for RT and DL classes sched/topology: Set correct NUMA topology type sched/debug: Fix potential deadlock when writing to sched_features
Diffstat (limited to 'kernel/sched/debug.c')
-rw-r--r--kernel/sched/debug.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 60caf1fb94e0..6383aa6a60ca 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -89,12 +89,12 @@ struct static_key sched_feat_keys[__SCHED_FEAT_NR] = {
89 89
90static void sched_feat_disable(int i) 90static void sched_feat_disable(int i)
91{ 91{
92 static_key_disable(&sched_feat_keys[i]); 92 static_key_disable_cpuslocked(&sched_feat_keys[i]);
93} 93}
94 94
95static void sched_feat_enable(int i) 95static void sched_feat_enable(int i)
96{ 96{
97 static_key_enable(&sched_feat_keys[i]); 97 static_key_enable_cpuslocked(&sched_feat_keys[i]);
98} 98}
99#else 99#else
100static void sched_feat_disable(int i) { }; 100static void sched_feat_disable(int i) { };
@@ -146,9 +146,11 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
146 146
147 /* Ensure the static_key remains in a consistent state */ 147 /* Ensure the static_key remains in a consistent state */
148 inode = file_inode(filp); 148 inode = file_inode(filp);
149 cpus_read_lock();
149 inode_lock(inode); 150 inode_lock(inode);
150 ret = sched_feat_set(cmp); 151 ret = sched_feat_set(cmp);
151 inode_unlock(inode); 152 inode_unlock(inode);
153 cpus_read_unlock();
152 if (ret < 0) 154 if (ret < 0)
153 return ret; 155 return ret;
154 156