Skip to contentSkip to conversation

x86/itmt: Don't make ITMT enablement depend on debugfs

PATCH Applied Mario Limonciello 2 participants 2 messages Sep 1 – Sep 2 x86

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/itmt: Don't make ITMT enablement depend on debugfs

sched_set_itmt_support() treats debugfs file creation failures as fatal. When CONFIG_DEBUG_FS is disabled, debugfs stubs return ERR_PTR(-ENODEV), causing ITMT to be silently disabled.

debugfs is a debug-only facility; its return values should be ignored. Drop the fatal error handling and enable ITMT unconditionally.

Fixes d04013a4b21b ("x86/itmt: Move the "sched_itmt_enabled" sysctl to debugfs")

---
v2:
* Pick up tags

---
 arch/x86/kernel/itmt.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
arch/x86/kernel/itmt.c +2 -6
index 243a769fdd97b..85ebde361d6ae 100644
@@ -110,18 +110,14 @@ int sched_set_itmt_support(void)
 						    arch_debugfs_dir,
 						    &sysctl_sched_itmt_enabled,
 						    &dfs_sched_itmt_fops);
-	if (IS_ERR_OR_NULL(dfs_sched_itmt)) {
+	if (IS_ERR(dfs_sched_itmt))
 		dfs_sched_itmt = NULL;
-		return -ENOMEM;
-	}
 
 	dfs_sched_core_prio = debugfs_create_file("sched_core_priority", 0644,
 						  arch_debugfs_dir, NULL,
 						  &sched_core_priority_fops);
-	if (IS_ERR_OR_NULL(dfs_sched_core_prio)) {
+	if (IS_ERR(dfs_sched_core_prio))
 		dfs_sched_core_prio = NULL;
-		return -ENOMEM;
-	}
 
 	sched_itmt_capable = true;
 
Signature · 1 line
2.43.0
#1 lore raw
The following commit has been merged into the x86/misc branch of tip:

The following commit has been merged into the x86/misc branch of tip:

Commit-ID:     4a673a0026b95030ee727f1f8578c46a42107011
Gitweb:        https://git.kernel.org/tip/4a673a0026b95030ee727f1f8578c46a42107011
Author:        Mario Limonciello <[email protected]>
AuthorDate:    Tue, 01 Sep 2026 07:34:04 -05:00
Committer:     Dave Hansen <[email protected]>
CommitterDate: Wed, 02 Sep 2026 14:01:08 -07:00

x86/itmt: Don't make ITMT enablement depend on debugfs

sched_set_itmt_support() treats debugfs file creation failures as fatal. When CONFIG_DEBUG_FS is disabled, debugfs stubs return ERR_PTR(-ENODEV), causing ITMT to be silently disabled.

debugfs is a debug-only facility; its return values should be ignored. Drop the fatal error handling and enable ITMT unconditionally.

---
 arch/x86/kernel/itmt.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
arch/x86/kernel/itmt.c +2 -6
index 243a769..85ebde3 100644
@@ -110,18 +110,14 @@ int sched_set_itmt_support(void)
 						    arch_debugfs_dir,
 						    &sysctl_sched_itmt_enabled,
 						    &dfs_sched_itmt_fops);
-	if (IS_ERR_OR_NULL(dfs_sched_itmt)) {
+	if (IS_ERR(dfs_sched_itmt))
 		dfs_sched_itmt = NULL;
-		return -ENOMEM;
-	}
 
 	dfs_sched_core_prio = debugfs_create_file("sched_core_priority", 0644,
 						  arch_debugfs_dir, NULL,
 						  &sched_core_priority_fops);
-	if (IS_ERR_OR_NULL(dfs_sched_core_prio)) {
+	if (IS_ERR(dfs_sched_core_prio))
 		dfs_sched_core_prio = NULL;
-		return -ENOMEM;
-	}
 
 	sched_itmt_capable = true;