Hi Tejun, Following up on your review: https://lore.kernel.org/r/[email protected]
My earlier v2 submission and reply were rejected for the kernel.org and kernel mailing-list recipients, so I have resent v2 from this address at the start of this thread. The code is unchanged, and for-7.4 has not moved. V2 checks the selected CPU against p->cpus_mask and uses dynamically allocated affinity masks, growing them when sched_getaffinity() returns EINVAL. The masks are zeroed before use, and affinity restoration and resource cleanup are handled on failure paths. I reproduced the fixed-size mask failure in a guest with 2048 possible CPUs and two online CPUs. V2 passes there, including with single-CPU affinity. Testing with CONFIG_PREEMPT_RCU and injected failure paths also passed. Thanks, Tianyi

