• Tejun Heo's avatar
    cgroup, memcg: move cgroup->event_list[_lock] and event callbacks into memcg · fba94807
    Tejun Heo authored
    cgroup_event is being moved from cgroup core to memcg and the
    implementation is already moved by the previous patch.  This patch
    moves the data fields and callbacks.
    
    * cgroup->event_list[_lock] are moved to mem_cgroup.
    
    * cftype->[un]register_event() are moved to cgroup_event.  This makes
      it impossible for individual cftype definitions to specify their
      event callbacks.  This is worked around by simply hard-coding
      filename to event callback mapping in cgroup_write_event_control().
      This is awkward and inflexible, which is actually desirable given
      that we don't want to grow more usages of this feature.
    
    * eventfd_ctx declaration is removed from cgroup.h, which makes
      vmpressure.h miss eventfd_ctx declaration.  Include eventfd.h from
      vmpressure.h.
    
    v2: Use file name from dentry instead of cftype.  This will allow
        removing all cftype handling in the function.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarLi Zefan <lizefan@huawei.com>
    Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Acked-by: default avatarMichal Hocko <mhocko@suse.cz>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Balbir Singh <bsingharora@gmail.com>
    fba94807
cgroup.c 152 KB