summaryrefslogtreecommitdiffstats
path: root/kernel/sched/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/debug.c')
-rw-r--r--kernel/sched/debug.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index e593b4118578..870d4f3da285 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -111,20 +111,19 @@ static int sched_feat_set(char *cmp)
111 cmp += 3; 111 cmp += 3;
112 } 112 }
113 113
114 for (i = 0; i < __SCHED_FEAT_NR; i++) { 114 i = match_string(sched_feat_names, __SCHED_FEAT_NR, cmp);
115 if (strcmp(cmp, sched_feat_names[i]) == 0) { 115 if (i < 0)
116 if (neg) { 116 return i;
117 sysctl_sched_features &= ~(1UL << i); 117
118 sched_feat_disable(i); 118 if (neg) {
119 } else { 119 sysctl_sched_features &= ~(1UL << i);
120 sysctl_sched_features |= (1UL << i); 120 sched_feat_disable(i);
121 sched_feat_enable(i); 121 } else {
122 } 122 sysctl_sched_features |= (1UL << i);
123 break; 123 sched_feat_enable(i);
124 }
125 } 124 }
126 125
127 return i; 126 return 0;
128} 127}
129 128
130static ssize_t 129static ssize_t
@@ -133,7 +132,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
133{ 132{
134 char buf[64]; 133 char buf[64];
135 char *cmp; 134 char *cmp;
136 int i; 135 int ret;
137 struct inode *inode; 136 struct inode *inode;
138 137
139 if (cnt > 63) 138 if (cnt > 63)
@@ -148,10 +147,10 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
148 /* Ensure the static_key remains in a consistent state */ 147 /* Ensure the static_key remains in a consistent state */
149 inode = file_inode(filp); 148 inode = file_inode(filp);
150 inode_lock(inode); 149 inode_lock(inode);
151 i = sched_feat_set(cmp); 150 ret = sched_feat_set(cmp);
152 inode_unlock(inode); 151 inode_unlock(inode);
153 if (i == __SCHED_FEAT_NR) 152 if (ret < 0)
154 return -EINVAL; 153 return ret;
155 154
156 *ppos += cnt; 155 *ppos += cnt;
157 156
@@ -843,8 +842,8 @@ void print_numa_stats(struct seq_file *m, int node, unsigned long tsf,
843 unsigned long tpf, unsigned long gsf, unsigned long gpf) 842 unsigned long tpf, unsigned long gsf, unsigned long gpf)
844{ 843{
845 SEQ_printf(m, "numa_faults node=%d ", node); 844 SEQ_printf(m, "numa_faults node=%d ", node);
846 SEQ_printf(m, "task_private=%lu task_shared=%lu ", tsf, tpf); 845 SEQ_printf(m, "task_private=%lu task_shared=%lu ", tpf, tsf);
847 SEQ_printf(m, "group_private=%lu group_shared=%lu\n", gsf, gpf); 846 SEQ_printf(m, "group_private=%lu group_shared=%lu\n", gpf, gsf);
848} 847}
849#endif 848#endif
850 849