• Tejun Heo's avatar
    slub: make sysfs directories for memcg sub-caches optional · 1663f26d
    Tejun Heo authored
    SLUB creates a per-cache directory under /sys/kernel/slab which hosts a
    bunch of debug files.  Usually, there aren't that many caches on a
    system and this doesn't really matter; however, if memcg is in use, each
    cache can have per-cgroup sub-caches.  SLUB creates the same directories
    for these sub-caches under /sys/kernel/slab/$CACHE/cgroup.
    Unfortunately, because there can be a lot of cgroups, active or
    draining, the product of the numbers of caches, cgroups and files in
    each directory can reach a very high number - hundreds of thousands is
    commonplace.  Millions and beyond aren't difficult to reach either.
    What's under /sys/kernel/slab is primarily for debugging and the
    information and control on the a root cache already cover its
    sub-caches.  While having a separate directory for each sub-cache can be
    helpful for development, it doesn't make much sense to pay this amount
    of overhead by default.
    This patch introduces a boot parameter slub_mem...