This gist is mostly to document my journey of understanding how cpusets are setup for containers when cores go offline and how I used udev rules to automate the cpuset files.
PS: This topic is only valid for cgroups v1. I am yet to play this out with cgroupsv2 and see how it behaves
From within a container, setting thread affinity to an offlined and onlined core will fail even though the core is back online and you can schedule onto it from the host.
I will not cover cgroups in-depth here. There are a ton of articles in the internet that talk and explain cgroups much better than I can. I will stick with cpusets and my observations of that with containers.