In my opinion it should be even more restrictive (restrictingcgroup_disabled=memory boot option and cgroup legacy hierarchy). So,instead of IS_ENABLED(CONFIG_MEMCG), the check should be somethinglike (cgroup_subsys_enabled(memory_cgrp_subsys) &&cgroup_subsys_on_dfl(memory_cgrp_subsys)).