Re: Scheduling tasks on idle cpu

From: Steven Rostedt
Date: Mon Apr 11 2022 - 05:26:55 EST


On Mon, 11 Apr 2022 08:26:33 +0000
David Laight <David.Laight@xxxxxxxxxx> wrote:

> Does that actually happen?
> I've seen the following:
> 34533 [017]: sys_futex(uaddr: 1049104, op: 85, val: 1, utime: 1, uaddr2: 1049100, val3: 4000001)
> 34533 [017]: sched_migrate_task: pid=34512 prio=120 orig_cpu=14 dest_cpu=17
> 34533 [017]: sched_wakeup: pid=34512 prio=120 success=1 target_cpu=017
> and pid 34512 doesn't get scheduled until pid 34533 finally sleeps.
> This is in spite of there being 5 idle cpu.

What's the topology? I believe the scheduler will refrain from
migrating tasks to idle CPUs that are on other NUMA nodes as much as
possible. Were those other 5 idle CPUs on another node?

-- Steve


> cpu 14 is busy running a RT thread, but migrating to cpu 17 seems wrong.
>
> This is on a RHEL7 kernel, I've not replicated it on anything recent.
> But I've very much like a RT thread to be able to schedule a non-RT
> thread to run on an idle cpu.