diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 6e291ea4245fbae69661ea52a832e39c67faf82f..79642053cb54460683672f1a073e05049836bc9e 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -1290,10 +1290,12 @@ static const struct file_operations psi_cpu_fops = { static int __init psi_proc_init(void) { - proc_mkdir("pressure", NULL); - proc_create("pressure/io", 0, NULL, &psi_io_fops); - proc_create("pressure/memory", 0, NULL, &psi_memory_fops); - proc_create("pressure/cpu", 0, NULL, &psi_cpu_fops); + if (psi_enable) { + proc_mkdir("pressure", NULL); + proc_create("pressure/io", 0, NULL, &psi_io_fops); + proc_create("pressure/memory", 0, NULL, &psi_memory_fops); + proc_create("pressure/cpu", 0, NULL, &psi_cpu_fops); + } return 0; } module_init(psi_proc_init);