Skip to content

Commit 794a865

Browse files
committed
x86/itmt: Convert "sysctl_sched_itmt_enabled" to boolean
JIRA: https://issues.redhat.com/browse/RHEL-53784 commit 2f6f726 Author: K Prateek Nayak <[email protected]> Date: Mon Dec 23 04:34:00 2024 +0000 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] Signed-off-by: David Arcari <[email protected]>
1 parent 1f46989 commit 794a865

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
@@ -245,7 +245,7 @@ extern bool x86_topology_update;
245245
#include <asm/percpu.h>
246246

247247
DECLARE_PER_CPU_READ_MOSTLY(int, sched_core_priority);
248-
extern unsigned int __read_mostly sysctl_sched_itmt_enabled;
248+
extern bool __read_mostly sysctl_sched_itmt_enabled;
249249

250250
/* Interface to set priority of a cpu */
251251
void sched_set_itmt_core_prio(int prio, int core_cpu);
@@ -258,7 +258,7 @@ void sched_clear_itmt_support(void);
258258

259259
#else /* CONFIG_SCHED_MC_PRIO */
260260

261-
#define sysctl_sched_itmt_enabled 0
261+
#define sysctl_sched_itmt_enabled false
262262
static inline void sched_set_itmt_core_prio(int prio, int core_cpu)
263263
{
264264
}

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(struct ctl_table *table, int write,
4242
void *buffer, size_t *lenp, loff_t *ppos)

0 commit comments

Comments
 (0)