+		}
+		sprintf(cgrp_opt[i].opt + len, ",%s", name);
So we create a list of subsystem by hierarchy here, and try to mount
them with xattr later?
That's right
Ah but due to bug in kernel (hier == 0 when we got to this part) we end
up only with these that are not mounted at the moment, right?
That looks OK. Hopefully the kernel gets fixed. Will the kernel support
mouting the subsystems with additional xattr flags or will the mount
return an error (on my machine all mounted subsystems are mounted
without xattr)?

It's difficult to say, for now, we have a recent upstream commit in which new cgroup mount option introduced (__DEVEL__sane_behavior). It can be used to get mount error. Developer says that this bug is a part of larger breakage - cgroup silently ignores mount option changes when remounted. He thinks that fixing only this part is not meaningful, suggesting to add warning message if the mount options mismatch.