cgroup: Enable memory.use_hierarchy of cgroup for domain
cgroup: Enable memory.use_hierarchy of cgroup for domain

Through conversation with Kumar L Srikanth-B22348, I found
that the function of getting memory usage (e.g., virsh dominfo)
doesn't work for lxc with ns subsystem of cgroup enabled.

This is because of features of ns and memory subsystems.
Ns creates child cgroup on every process fork and as a result
processes in a container are not assigned in a cgroup for
domain (e.g., libvirt/lxc/test1/). For example, libvirt_lxc
and init (or somewhat specified in XML) are assigned into
libvirt/lxc/test1/8839/ and libvirt/lxc/test1/8839/8849/,
respectively. On the other hand, memory subsystem accounts
memory usage within a group of processes by default, i.e.,
it does not take any child (and descendant) groups into
account. With the two features, virsh dominfo which just
checks memory usage of a cgroup for domain always returns
zero because the cgroup has no process.

Setting memory.use_hierarchy of a group allows to account
(and limit) memory usage of every descendant groups of the group.
By setting it of a cgroup for domain, we can get proper memory
usage of lxc with ns subsystem enabled. (To be exact, the
setting is required only when memory and ns subsystems are
enabled at the same time, e.g., mount -t cgroup none /cgroup.)

kantai/libvirt-vfork,wiedi/libvirt,datto/libvirt,jeckersb/libvirt,bjzhang/libvirt,foomango/libvirt,novel/fbsd-libvirt,iam-TJ/libvirt,shugaoye/libvirt,soulxu/libvirt-xuhj,dumbbell/libvirt,jeckersb/libvirt,jardasgit/libvirt,warewolf/libvirt,dumbbell/libvirt,usc-isi/libvirt,dumbbell/libvirt,libvirt/libvirt,fabianfreyer/libvirt,danwent/libvirt-ovs,rmarwaha/libvirt1,andreabolognani/libvirt,leilihh/libvirt,iam-TJ/libvirt,warewolf/libvirt,VenkatDatta/libvirt,rmarwaha/libvirt1,bjzhang/libvirt,taget/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,rbu/libvirt,leilihh/libvirt,dumbbell/libvirt,olafhering/libvirt,jeckersb/libvirt,novel/fbsd-libvirt,iam-TJ/libvirt,zippy2/libvirt,trainstack/libvirt,cbosdo/libvirt,emaste/libvirt,siboulet/libvirt-openvz,iam-TJ/libvirt,soulxu/libvirt-xuhj,libvirt/libvirt,zhlcindy/libvirt-1.1.4-maintain,datto/libvirt,nertpinx/libvirt,rmarwaha/libvirt,taget/libvirt,amery/libvirt-vserver,usc-isi/libvirt,jardasgit/libvirt,olafhering/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,jfehlig/libvirt,iam-TJ/libvirt,leilihh/libvirt,andreabolognani/libvirt,wiedi/libvirt,siboulet/libvirt-openvz,rmarwaha/libvirt1,jfehlig/libvirt,trainstack/libvirt,zhlcindy/libvirt-1.1.4-maintain,zippy2/libvirt,eskultety/libvirt,siboulet/libvirt-openvz,VenkatDatta/libvirt,rmarwaha/libvirt1,VenkatDatta/libvirt,trainstack/libvirt,kantai/libvirt-vfork,olafhering/libvirt,eskultety/libvirt,cbosdo/libvirt,elmarco/libvirt,amery/libvirt-vserver,emaste/libvirt,warewolf/libvirt,leilihh/libvirt,rbu/libvirt,nertpinx/libvirt,rlaager/libvirt,kantai/libvirt-vfork,VenkatDatta/libvirt,foomango/libvirt,amery/libvirt-vserver,elmarco/libvirt,rbu/libvirt,rlaager/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,shugaoye/libvirt,elmarco/libvirt,jfehlig/libvirt,iam-TJ/libvirt,cbosdo/libvirt,iam-TJ/libvirt,dumbbell/libvirt,shugaoye/libvirt,rmarwaha/libvirt,rlaager/libvirt,shugaoye/libvirt,zhlcindy/libvirt-1.1.4-maintain,leilihh/libvirt,danwent/libvirt-ovs,sshah-solarflare/Libvirt-PCI-passthrough-,andreabolognani/libvirt,danwent/libvirt-ovs,warewolf/libvirt,taget/libvirt,wiedi/libvirt,crobinso/libvirt,cbosdo/libvirt,agx/libvirt,rbu/libvirt,soulxu/libvirt-xuhj,datto/libvirt,rmarwaha/libvirt,jardasgit/libvirt,rlaager/libvirt,danwent/libvirt-ovs,siboulet/libvirt-openvz,crobinso/libvirt,rmarwaha/libvirt1,novel/fbsd-libvirt,agx/libvirt,warewolf/libvirt,amery/libvirt-vserver,datto/libvirt,eskultety/libvirt,kantai/libvirt-vfork,rmarwaha/libvirt,datto/libvirt,zhlcindy/libvirt-1.1.4-maintain,usc-isi/libvirt,siboulet/libvirt-openvz,bjzhang/libvirt,libvirt/libvirt,novel/fbsd-libvirt,amery/libvirt-vserver,soulxu/libvirt-xuhj,andreabolognani/libvirt,jardasgit/libvirt,elmarco/libvirt,wiedi/libvirt,olafhering/libvirt,trainstack/libvirt,novel/fbsd-libvirt,leilihh/libvirt,emaste/libvirt,zhlcindy/libvirt-1.1.4-maintain,nertpinx/libvirt,soulxu/libvirt-xuhj,zippy2/libvirt,andreabolognani/libvirt,nertpinx/libvirt,dumbbell/libvirt,warewolf/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,novel/fbsd-libvirt,rmarwaha/libvirt1,libvirt/libvirt,jeckersb/libvirt,wiedi/libvirt,fabianfreyer/libvirt,novel/fbsd-libvirt,trainstack/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,agx/libvirt,usc-isi/libvirt,emaste/libvirt,kantai/libvirt-vfork,warewolf/libvirt,agx/libvirt,wiedi/libvirt,danwent/libvirt-ovs,wiedi/libvirt,novel/fbsd-libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,agx/libvirt,foomango/libvirt,shugaoye/libvirt,trainstack/libvirt,jeckersb/libvirt,elmarco/libvirt,trainstack/libvirt,cbosdo/libvirt,emaste/libvirt,emaste/libvirt,jeckersb/libvirt,novel/fbsd-libvirt,rmarwaha/libvirt,eskultety/libvirt,foomango/libvirt,rbu/libvirt,nertpinx/libvirt,eskultety/libvirt,zippy2/libvirt,crobinso/libvirt,VenkatDatta/libvirt,bjzhang/libvirt,emaste/libvirt,usc-isi/libvirt,jeckersb/libvirt,jfehlig/libvirt,taget/libvirt,foomango/libvirt,bjzhang/libvirt,rlaager/libvirt,rmarwaha/libvirt,taget/libvirt,crobinso/libvirt