[RFC PATCH 19/23] sched/core: Initialize helpers of task classification

Ricardo Neri
2022-09-09T23:07:50Z

Just as tasks start life unclassified, initialize the classification
auxiliary variables.

Cc: Ben Segall <bsegall@google.com>
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tim C. Chen <tim.c.chen@intel.com>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: x86@kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
---
kernel/sched/core.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 477a90bddcd5..5f84aae735d9 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4338,6 +4338,8 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
p->se.vruntime = 0;
#ifdef CONFIG_SCHED_TASK_CLASSES
p->class = TASK_CLASS_UNCLASSIFIED;
+ p->class_candidate = TASK_CLASS_UNCLASSIFIED;
+ p->class_debounce_counter = 0;
#endif
INIT_LIST_HEAD(&p->se.group_node);

--
2.25.1