cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
Cc: lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
	bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 06/12] cgroup, memcg: move cgroup_event implementation to memcg
Date: Tue, 27 Aug 2013 16:00:02 -0400	[thread overview]
Message-ID: <20130827200002.GD12212@mtj.dyndns.org> (raw)
In-Reply-To: <20130827142002.GC13302-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>

Hey, Michal.

On Tue, Aug 27, 2013 at 04:20:02PM +0200, Michal Hocko wrote:
> Doing notification and read() every time might be a concern for
> embedded-world who are worried about too many wakeups. We have
> already seen suggestions to do a different modes of event triggering
> to reduce wake up costs because of the power consumption (e.g.
> http://comments.gmane.org/gmane.linux.kernel.mm/101628).

Given the expected frequency of the event, I highly doubt it's gonna
matter.  The patch you linked is different.  That's just the event
designed wrong.  Sigh... so it's mixing events for vmpressure state
changing and reclaim activities happening?  Am I understanding it
correctly?  If so, I really have no idea why so many things are so ill
designed, even the new things.

* As a general principle, events should either be edge-triggered or
  level-triggered with a way to acknowledge the current state;
  otherwise, it's a fundamentally broken design.

* Let's please not slide in some completely unobvious side-channel
  information into an event.  If someone wants to watch reclaim
  events, add a dedicated event for that rather than overloading state
  changed event.

Let's just hope I grossly misunderstood the whole thread.

If it *really* is critical to discern low/mid and mid/high
transitions, we can add a seprate file so that the transitions can be
monitored separately but I can't emphasize enough that we shouldn't
chase every single requirement people come up with without the overall
sense of its relative importance and impact on long term maintenance
of the subsystem.  I'm highly skeptical that distinguishing the two
transitions and saving the occassional spurious events would be
justifiable.

> You just forgot to tell us what is that "something simpler". Does it
> exist yet? What is the semantic?

It's gonna be a file modified event, exactly the same as regular
files.  Haven't we gone over this multiple times now?  cgroup
implementation doesn't exist yet but everything about normal file
events including its semantics are already well defined and
understood.

> We have been trying to reduce memcg specific things in the past and
> this will add non trivial chunk of code. I would at least expect some
> justification _why_ moving the maintenance burden is worth it. It
> certainly won't make memcg live easier. I can bite a bullet though if
> this is the roadblock for making important changes in the cgroup core.
> But you didn't tell us anything like that, except that you do not like
> the interface because like other parts it is over-engineered thus bad.

Yes, it is a road block in two ways.

* Everything is being made per-css which is necessary as css's
  lifetime would no longer coincide with cgroup's.  Keeping this in
  cgroup proper would mean that it needs to be updated so that it's
  attached to css instead of cgroup.

* The file system interface of cgroup will go through sysfs so that
  cgroup doesn't have to worry about inode locking maze.  This is a
  major issue for nested subsys enable / disable and implementating
  migration as currently we end up having to lock inodes which belong
  to different subtrees and vfs doesn't define locking order between
  them.  So, short of meddling with vfs rename mutex, it'll deadlock.

> You have mentioned it will help you clean up code further in the past
> but I do not see any mention about it in this patch neither in the
> leader email. Could you be more specific? How much? Is this piece of
> code blocking those cleanups?

See above.

> That is what I _really_ dislike about this patch and why I am really
> reluctant to ack it.

See above.

> And we might end up having that code there for ever because your new and
> yet to be shown interface might turn out to be not the best fit for the
> current users.

We're gonna keep that code for years no matter what and you know that
the existing interface has fundamental issues.  Regardless of what we
do in the future, it needs to go.  That much is clear, isn't it?

> Tejun, you have done _a lot_ of great work on cleaning up cgroup
> core mess and I really appreciate that! I was supporting you in some
> of those, I wish I had more time to do more. But I think you are
> deprecating some things too easily without carrying much about the
> current users assuming they will cope with that somehow and that a magic
> central authority will do everything for them in a sane way. I am quite
> skeptical, to be honest.

This one eventually has to go.  It's the wrong piece of logic at the
wrong place / layer.  The sequence could be debatable but I don't
wanna introduce new thing before the filesystem part is converted to
sysfs as it'll need to be re-done then and I can tell you with
relative high level of confidence that the new interface will be
implemented in some months and its interface will be something along
the line of css_notify(css).

And as for the general skepticism, well, I can't make you to see
things my way.  I have been trying pretty hard with all involved and
am confident enough that at least enough are looking towards the same
general direction and the progress is pretty healthy too.  As for
memcg, I don't know.  I frankly have no idea what your general
direction and long term plan are and memcg in general still seems to
be lost quite often.  So, ummm, I don't know.  Can you at least
pretend to play along?

Thanks.

-- 
tejun

  parent reply	other threads:[~2013-08-27 20:00 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` [PATCH 02/12] cgroup: make cgroup_css() take cgroup_subsys * instead and allow NULL subsys Tejun Heo
2013-08-15 16:02   ` [PATCH 03/12] cgroup: implement CFTYPE_NO_PREFIX 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   ` [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   ` [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 [this message]
     [not found]             ` <20130827200002.GD12212-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-08-28 14:29               ` Michal Hocko
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-15 16:02   ` [PATCH 07/12] memcg: cgroup_write_event_control() now knows @css is for memcg Tejun Heo
2013-08-15 16:02   ` [PATCH 08/12] cgroup, memcg: move cgroup->event_list[_lock] and event callbacks into memcg 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-08-15 16:02   ` [PATCH 09/12] memcg: remove cgroup_event->cft 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
     [not found]     ` <1376582550-12548-11-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
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-30 11:19       ` Michal Hocko
2013-08-15 16:02   ` [PATCH 12/12] cgroup: unexport cgroup_css() and remove __file_cft() 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-24 18:20       ` Michal Hocko
     [not found]         ` <20130824182005.GA15897-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-08-24 18:25           ` 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-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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130827200002.GD12212@mtj.dyndns.org \
    --to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).