Fix spurious ERROR log for unsupported optional cgroup controllers (#41122)
* Fix spurious ERROR log for unsupported optional cgroup controllers UtilEnableAllCgroupControllers previously attempted to enable a hardcoded list of optional controllers (pids, io, cpuset, hugetlb, rdma, misc) regardless of kernel support. On the default WSL2 kernel, which lacks CONFIG_CGROUP_MISC, the write for +misc fails and WriteToFile logs it as an ERROR, producing a scary but harmless line in dmesg on every boot: WSL ERROR: WriteToFile:3414: write(.../cgroup.subtree_control, +misc) failed -1 22 Fix: use cgroup.controllers as the single source of truth for which optional controllers are actually supported by the running kernel, instead of guessing with a hardcoded list. cpu and memory remain required and are enabled unconditionally (fatal if it fails); every other controller the kernel reports is enabled best-effort (a failure there is just a warning). Validated on a live WSL2 instance: dmesg is clean and cgroup.controllers/cgroup.subtree_control are consistent at every cgroup level. * Drop redundant WARNING for optional cgroup controller failures WriteToFile already logs on failure, so the extra LOG_WARNING wrapper was redundant double-logging. This path shouldn't be hit in practice now that optional controllers are sourced from cgroup.controllers. --------- Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>