All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v2 cgroup/for-3.12] cgroup: make cgroup_event specific to memcg
@ 2013-08-15 16:02 Tejun Heo
       [not found] ` <1376582550-12548-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 73+ messages in thread
From: Tejun Heo @ 2013-08-15 16:02 UTC (permalink / raw)
  To: lizefan-hv44wF8Li93QT0dZR+AlfA, mhocko-AlSwsSmVLrQ,
	hannes-druUgvl0LCNAfugRpC6u6w,
	bsingharora-Re5JQEeQqe8AvxtiuMwx3w,
	kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A
  Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	cgroups-u79uwXL29TY76Z2rM5mHXA

Hello,

Changes from the last take[L] are

* Event handling updated such that it doesn't require meddling with
  internals not normally exposed outside cgroup core proper.  dentry
  reference counting is replaced with css one and cftype handling is
  completely gone.  Hopefully, this addresses Michal's complaints.

* Further simplifications.

* Rebased on top of the current cgroup/for-3.12 and pending patches.

Like many other things in cgroup, cgroup_event is way too flexible and
complex - it strives to provide completely flexible event monitoring
facility in cgroup proper which allows any number of users to monitor
custom events.  This essentially is a layering violation and leads to
weird issues like worrying about event API mis/abuse from userland in
cgroup controller event source implementation.

The only thing cgroup_event can do better than standard "file changed"
notification is serving many uncoordinated event listeners watching
many different thresholds which would only make sense if access to the
cgroup hierarchy is widely distributed.  The existing implementation
is pretty ill-equipped to handle such scenario, is not in the right
layer to tackle such issues and the whole cgroup is headed the other
way.  As such, going forward, cgroup core won't support cgroup_event
as the common event mechanism.

Fortunately, memcg along with vmpressure is the only user of the
facility and gets to keep it.  This patchset makes cgroup_event
specific to memcg, moves all related code into mm/memcontrol.c and
renames it to mem_cgroup_event so that its usage can't spread to other
subsystems and later deprecation and cleanup can be localized.

Note that after this patchset, cgroup.event_control file exists only
for the hierarchy which has memcg attached to it.  This is a userland
visible change but unlikely to be noticeable as the file has never
been meaningful outside memcg.  If this ever becomes problematic, we
can add a dummy file on hierarchies w/o memcg when !sane_behavior.

This patchset is consited of the following 12 patches.

 0001-cgroup-rename-cgroup_css_from_dir-to-css_from_dir-an.patch
 0002-cgroup-make-cgroup_css-take-cgroup_subsys-instead-an.patch
 0003-cgroup-implement-CFTYPE_NO_PREFIX.patch
 0004-cgroup-make-cgroup_event-hold-onto-cgroup_subsys_sta.patch
 0005-cgroup-make-cgroup_write_event_control-use-css_from_.patch
 0006-cgroup-memcg-move-cgroup_event-implementation-to-mem.patch
 0007-memcg-cgroup_write_event_control-now-knows-css-is-fo.patch
 0008-cgroup-memcg-move-cgroup-event_list-_lock-and-event-.patch
 0009-memcg-remove-cgroup_event-cft.patch
 0010-memcg-make-cgroup_event-deal-with-mem_cgroup-instead.patch
 0011-memcg-rename-cgroup_event-to-mem_cgroup_event.patch
 0012-cgroup-unexport-cgroup_css-and-remove-__file_cft.patch

0001-0005 prep for the move.  0005 moves it.  0006-0012 simplify it.

While these are quite a few patches, they are mostly trivial in nature
and some are required changes with the planned unified hierarchy
(e.g. switching to css refcnting) and we'd have to restructure it to
handle dynamic css attach/detach if it's kept generic, which will
likely be a lot more work for no noticeable gain.

The patches are based on top of

  cgroup/for-3.12 ff58ac0d58 ("cpuset: remove an unncessary forward declaration")
+ [PATCH] cgroup: fix subsystem file accesses on the root cgroup
+ [PATCH] cgroup: fix cgroup_write_event_control()

and available in the following git branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-memcg_event

diffstat follows.

 Documentation/cgroups/cgroups.txt |   20 -
 include/linux/cgroup.h            |   28 --
 include/linux/vmpressure.h        |    8
 init/Kconfig                      |    3
 kernel/cgroup.c                   |  383 +++++---------------------------------
 kernel/events/core.c              |    2
 mm/memcontrol.c                   |  351 +++++++++++++++++++++++++++++++---
 mm/vmpressure.c                   |   26 --
 8 files changed, 389 insertions(+), 432 deletions(-)

Thanks.

--
tejun

[L] http://thread.gmane.org/gmane.linux.kernel.cgroups/8726

^ permalink raw reply	[flat|nested] 73+ messages in thread

end of thread, other threads:[~2013-11-25 10:33 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-15 16:02 [PATCHSET v2 cgroup/for-3.12] cgroup: make cgroup_event specific to memcg Tejun Heo
     [not found] ` <1376582550-12548-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-15 16:02   ` [PATCH 01/12] cgroup: rename cgroup_css_from_dir() to css_from_dir() and update its syntax Tejun Heo
2013-08-15 16:02   ` Tejun Heo
2013-08-15 16:02   ` [PATCH 02/12] cgroup: make cgroup_css() take cgroup_subsys * instead and allow NULL subsys Tejun Heo
2013-08-15 16:02   ` Tejun Heo
2013-08-15 16:02   ` [PATCH 03/12] cgroup: implement CFTYPE_NO_PREFIX Tejun Heo
2013-08-15 16:02   ` Tejun Heo
2013-08-15 16:02   ` [PATCH 04/12] cgroup: make cgroup_event hold onto cgroup_subsys_state instead of cgroup Tejun Heo
2013-08-15 16:02   ` Tejun Heo
2013-08-15 16:02   ` [PATCH 05/12] cgroup: make cgroup_write_event_control() use css_from_dir() instead of __d_cgrp() Tejun Heo
     [not found]     ` <1376582550-12548-6-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-26 22:38       ` Tejun Heo
2013-08-15 16:02   ` Tejun Heo
2013-08-15 16:02   ` [PATCH 06/12] cgroup, memcg: move cgroup_event implementation to memcg Tejun Heo
     [not found]     ` <1376582550-12548-7-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-27 14:20       ` Michal Hocko
     [not found]         ` <20130827142002.GC13302-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-08-27 20:00           ` Tejun Heo
     [not found]             ` <20130827200002.GD12212-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-08-28 14:29               ` Michal Hocko
2013-08-28 14:29               ` Michal Hocko
2013-08-27 20:00           ` Tejun Heo
2013-08-29 18:19       ` [PATCH v3 " Tejun Heo
     [not found]         ` <20130829181911.GA8517-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-08-30 10:47           ` Michal Hocko
     [not found]             ` <20130830104755.GC28658-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-08-30 10:52               ` Tejun Heo
     [not found]                 ` <20130830105210.GA30910-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-08-30 11:05                   ` Michal Hocko
2013-08-30 11:05                   ` Michal Hocko
2013-08-30 10:52               ` Tejun Heo
2013-08-30 10:47           ` Michal Hocko
2013-08-29 18:19       ` Tejun Heo
2013-08-15 16:02   ` [PATCH " Tejun Heo
2013-08-15 16:02   ` [PATCH 07/12] memcg: cgroup_write_event_control() now knows @css is for memcg Tejun Heo
2013-08-15 16:02   ` Tejun Heo
2013-08-15 16:02   ` [PATCH 08/12] cgroup, memcg: move cgroup->event_list[_lock] and event callbacks into memcg Tejun Heo
2013-08-15 16:02   ` Tejun Heo
     [not found]     ` <1376582550-12548-9-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-30 11:08       ` Michal Hocko
     [not found]         ` <20130830110846.GB31605-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-09-03 21:56           ` Tejun Heo
     [not found]             ` <20130903215646.GA31091-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-09-04  7:11               ` Michal Hocko
2013-09-03 21:56           ` Tejun Heo
2013-08-15 16:02   ` [PATCH 09/12] memcg: remove cgroup_event->cft Tejun Heo
2013-08-15 16:02   ` Tejun Heo
     [not found]     ` <1376582550-12548-10-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-30 11:13       ` Michal Hocko
2013-08-15 16:02   ` [PATCH 10/12] memcg: make cgroup_event deal with mem_cgroup instead of cgroup_subsys_state Tejun Heo
2013-08-15 16:02   ` Tejun Heo
     [not found]     ` <1376582550-12548-11-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-30 11:15       ` Michal Hocko
2013-08-30 11:15       ` Michal Hocko
2013-08-15 16:02   ` [PATCH 11/12] memcg: rename cgroup_event to mem_cgroup_event Tejun Heo
     [not found]     ` <1376582550-12548-12-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-23  3:42       ` Li Zefan
     [not found]         ` <5216DA08.8040406-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-08-23 16:40           ` Tejun Heo
2013-08-23  3:42       ` Li Zefan
2013-08-30 11:19       ` Michal Hocko
2013-08-30 11:19       ` Michal Hocko
2013-08-15 16:02   ` Tejun Heo
2013-08-15 16:02   ` [PATCH 12/12] cgroup: unexport cgroup_css() and remove __file_cft() Tejun Heo
2013-08-15 16:02   ` Tejun Heo
2013-08-21 20:12   ` [PATCHSET v2 cgroup/for-3.12] cgroup: make cgroup_event specific to memcg Tejun Heo
     [not found]     ` <20130821201239.GB2436-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-08-23  3:43       ` Li Zefan
     [not found]         ` <5216DA6F.3080508-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-08-23 12:31           ` Tejun Heo
2013-08-23  3:43       ` Li Zefan
2013-08-24 18:20       ` Michal Hocko
     [not found]         ` <20130824182005.GA15897-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-08-24 18:25           ` Tejun Heo
2013-08-24 18:20       ` Michal Hocko
2013-08-21 20:12   ` Tejun Heo
2013-08-26 14:15   ` Kirill A. Shutemov
     [not found]     ` <20130826141536.GA14985-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2013-08-26 15:17       ` Tejun Heo
     [not found]         ` <20130826151747.GD25171-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-08-26 14:29           ` Kirill A. Shutemov
     [not found]             ` <20130826142918.GB14985-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2013-08-26 15:30               ` Tejun Heo
     [not found]                 ` <20130826153028.GE25171-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-08-26 14:35                   ` Kirill A. Shutemov
2013-08-26 15:30               ` Tejun Heo
2013-08-26 14:15   ` Kirill A. Shutemov
2013-11-10  4:48   ` Tejun Heo
     [not found]     ` <20131110044811.GA25112-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-11-11 14:10       ` Michal Hocko
     [not found]         ` <20131111141010.GB14497-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-11-22 23:39           ` Tejun Heo
     [not found]             ` <20131122233947.GH8981-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-11-25 10:33               ` Michal Hocko
2013-11-25 10:33               ` Michal Hocko
2013-11-22 23:39           ` Tejun Heo
2013-11-10  4:48   ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.