Re: [BUG v4.14-rt] kernel BUG at /work/rt/stable-rt.git/kernel/sched/core.c:1639!

From: Steven Rostedt
Date: Wed Aug 22 2018 - 12:17:55 EST


On Sun, 19 Aug 2018 08:28:35 +0200
Mike Galbraith <efault@xxxxxx> wrote:

> On Sat, 2018-08-18 at 15:13 +0200, Mike Galbraith wrote:
> > seems it has be something from the 4.17 cycle that went back to 4.14-
> > stable after 4.1[56]-stable trees went extinct.
>
> See ("sched/core: Require cpu_active() in select_task_rq(), for user tasks")
>
> Fix it like so?
>
> sched: Allow pinned user tasks to be awakened to the CPU they pinned
>
> Since 7af443ee16976, select_fallback_rq() will BUG() if the CPU to
> which a task has pinned itself and pinned becomes !cpu_active()
> while it slept. Serving a 10 megaton eviction notice is neither
> helpful nor required, the task will migrate when it can do so.

This seems to fix the issue that I was seeing. Thanks!

I'll add this to my repo as well.

-- Steve

>
> Signed-off-by: Mike Galbraith <efault@xxxxxx>
> ---
> kernel/sched/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -980,7 +980,7 @@ static inline bool is_cpu_allowed(struct
> if (!cpumask_test_cpu(cpu, p->cpus_ptr))
> return false;
>
> - if (is_per_cpu_kthread(p))
> + if (is_per_cpu_kthread(p) || __migrate_disabled(p))
> return cpu_online(cpu);
>
> return cpu_active(cpu);