Skip to content

Commit 2f6f726

Browse files
kudureranganathPeter Zijlstra
authored andcommitted
x86/itmt: Convert "sysctl_sched_itmt_enabled" to boolean
In preparation to move "sysctl_sched_itmt_enabled" to debugfs, convert the unsigned int to bool since debugfs readily exposes boolean fops primitives (debugfs_read_file_bool, debugfs_write_file_bool) which can streamline the conversion. Since the current ctl_table initializes extra1 and extra2 to SYSCTL_ZERO and SYSCTL_ONE respectively, the value of "sysctl_sched_itmt_enabled" can only be 0 or 1 and this datatype conversion should not cause any functional changes. Signed-off-by: K Prateek Nayak <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Tim Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 873199d commit 2f6f726

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/x86/include/asm/topology.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ extern bool x86_topology_update;
250250
#include <asm/percpu.h>
251251

252252
DECLARE_PER_CPU_READ_MOSTLY(int, sched_core_priority);
253-
extern unsigned int __read_mostly sysctl_sched_itmt_enabled;
253+
extern bool __read_mostly sysctl_sched_itmt_enabled;
254254

255255
/* Interface to set priority of a cpu */
256256
void sched_set_itmt_core_prio(int prio, int core_cpu);
@@ -263,7 +263,7 @@ void sched_clear_itmt_support(void);
263263

264264
#else /* CONFIG_SCHED_MC_PRIO */
265265

266-
#define sysctl_sched_itmt_enabled 0
266+
#define sysctl_sched_itmt_enabled false
267267
static inline void sched_set_itmt_core_prio(int prio, int core_cpu)
268268
{
269269
}

arch/x86/kernel/itmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static bool __read_mostly sched_itmt_capable;
3636
*
3737
* It can be set via /proc/sys/kernel/sched_itmt_enabled
3838
*/
39-
unsigned int __read_mostly sysctl_sched_itmt_enabled;
39+
bool __read_mostly sysctl_sched_itmt_enabled;
4040

4141
static int sched_itmt_update_handler(const struct ctl_table *table, int write,
4242
void *buffer, size_t *lenp, loff_t *ppos)

0 commit comments

Comments
 (0)