Re: [RFC PATCH v3 00/16] Core scheduling v3

From: Tim Chen
Date: Wed Sep 18 2019 - 17:27:30 EST


On 9/4/19 6:44 PM, Julien Desfossez wrote:

> +
> +static void coresched_idle_worker_fini(struct rq *rq)
> +{
> + if (rq->core_idle_task) {
> + kthread_stop(rq->core_idle_task);
> + rq->core_idle_task = NULL;
> + }

During testing, I have found access of rq->core_idle_task as
NULL pointer from other cpus (other than the cpu executing the stop_machine
function) when you toggle cpu.tag of the cgroup.
Doing locking here is tricky because the rq lock is being
transitioned from core lock to per run queue lock. As a fix,
I made coresched_idle_worker_fini a null function, and not
to null out the core_idle_task.

Tim