Hi, Here's my take on migrate_disable(). It avoids growing a second means of changing the affinity, documents how the things violates locking rules but still mostly works.
It also avoids blocking completely, so no more futex band-aids required. Also, no more atomics/locks on the fast path. I also put in a comment that explains how the whole concept is fundamentally flawed but a necessary evil to get PREEMPT_RT going -- for now. Somewhat tested with PREEMPT_RT. --- include/linux/cpuhotplug.h | 1 include/linux/preempt.h | 60 +++ include/linux/sched.h | 4 include/linux/sched/hotplug.h | 2 include/linux/stop_machine.h | 5 kernel/cpu.c | 9 kernel/sched/core.c | 673 +++++++++++++++++++++++++++++++----------- kernel/sched/deadline.c | 5 kernel/sched/sched.h | 24 + kernel/stop_machine.c | 23 + lib/dump_stack.c | 2 lib/smp_processor_id.c | 5 12 files changed, 635 insertions(+), 178 deletions(-)