Commit d27f1ee36e ("Linux std kernel upgrade to align with CentOS 8")
and commit c0fee2da8e ("[kernel-rt 4.18] Upgrade kernel-rt to version
4.18.0-147.3.1 based on SRPM") uprevisioned the StarlingX kernel from
v3.10 to v4.18 for migration to CentOS 8 and adapted the kernel patches
accordingly.
However, the CPU affinity patches' uprevisioning was made in a buggy
manner: The connection between the bitmask cpu_kthread_bits and the CPU
mask __cpu_kthread_mask was not kept, which made these two patches
essentially inoperative, as described by bug report 1924799.
This commit updates the two patches to make the kthread_cpus= kernel
command line argument functional again by removing cpu_kthread_bits and
making the argument parser function kthread_setup store the parsed CPU
mask into __cpu_kthread_mask.
This commit introduces error handling for the parsing of the
kthread_cpus= argument's value as well, based on code review feedback.
If a parser error occurs, then the error code is reported and the
effective CPU affinity will correspond to all possible CPUs.
This change was verified with the StarlingX master branch as of last
week. As an example, prior to this commit, the kthreadd kernel thread
(i.e., usually PID 2) had a CPU affinity of 0 on a qemu-based VM with 8
virtual CPUs despite the use of "kthread_cpus=0-1" on the kernel command
line. With this patch, PID 2's CPU affinity is 0-1, as expected.
Change-Id: Ica1dfe00947e4e52f19659b721958f1e1845609b
Closes-Bug: 1924799
Signed-off-by: Vefa Bicakci <vefa.bicakci@windriver.com>