linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] cgroup changes for v4.18-rc1
@ 2018-06-05 19:21 Tejun Heo
  2018-06-06  0:13 ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Tejun Heo @ 2018-06-05 19:21 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Li Zefan, Johannes Weiner, cgroups

Hello, Linus.

cgroup changes for v4.18.

* For cpustat, cgroup has a percpu hierarchical stat mechanism which
  propagates up the hierarchy lazily.  This pull request contains
  commits to factor out and generalize the mechanism so that it can be
  used for other cgroup stats too.  The original intention was to
  update memcg stats to use it but memcg went for a different
  approach, so still the only user is cpustat.  The factoring out and
  generalization still make sense and it's likely that this can be
  used for other purposes in the future.

* cgroup uses file modified events to notify certain events.  A rate
  limiting mechanism is added.

* Other misc changes.

Thanks.

The following changes since commit fe03a7594d86e0754f05e604cd803a6a9aae3c1c:

  Merge tag 'acpi-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm (2018-04-26 11:06:36 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-4.18

for you to fetch changes up to d8742e22902186e30c346b1ba881cb52942ae3e4:

  cgroup: css_set_lock should nest inside tasklist_lock (2018-05-23 11:04:54 -0700)

----------------------------------------------------------------
Andy Shevchenko (1):
      rdmacg: Convert to use match_string() helper

Tejun Heo (12):
      cgroup: Explicitly remove core interface files
      cgroup: Limit event generation frequency
      cgroup: Rename kernel/cgroup/stat.c to kernel/cgroup/rstat.c
      cgroup: Rename stat to rstat
      cgroup: Distinguish base resource stat implementation from rstat
      cgroup: Reorganize kernel/cgroup/rstat.c
      cgroup: Factor out and expose cgroup_rstat_*() interface functions
      cgroup: Replace cgroup_rstat_mutex with a spinlock
      cgroup: Add cgroup_subsys->css_rstat_flush()
      cgroup: Add memory barriers to plug cgroup_rstat_updated() race window
      cgroup: Make cgroup_rstat_updated() ready for root cgroup usage
      cgroup: css_set_lock should nest inside tasklist_lock

 include/linux/cgroup-defs.h     |  52 +++--
 include/linux/cgroup.h          |  12 +-
 kernel/cgroup/Makefile          |   2 +-
 kernel/cgroup/cgroup-internal.h |  11 +-
 kernel/cgroup/cgroup.c          | 105 +++++++---
 kernel/cgroup/rdma.c            |  35 ++--
 kernel/cgroup/rstat.c           | 416 ++++++++++++++++++++++++++++++++++++++++
 kernel/cgroup/stat.c            | 338 --------------------------------
 8 files changed, 554 insertions(+), 417 deletions(-)
 create mode 100644 kernel/cgroup/rstat.c
 delete mode 100644 kernel/cgroup/stat.c

-- 
tejun

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

* Re: [GIT PULL] cgroup changes for v4.18-rc1
  2018-06-05 19:21 [GIT PULL] cgroup changes for v4.18-rc1 Tejun Heo
@ 2018-06-06  0:13 ` Linus Torvalds
  2018-06-06 15:04   ` Tejun Heo
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2018-06-06  0:13 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Linux Kernel Mailing List, Li Zefan, Johannes Weiner, cgroups

On Tue, Jun 5, 2018 at 12:22 PM Tejun Heo <tj@kernel.org> wrote:
>
> * cgroup uses file modified events to notify certain events.  A rate
>   limiting mechanism is added.

This "explanation" didn't really parse for me at all.

I edited the merge message to something that I think is correct and
made more sense to me.

               Linus

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

* Re: [GIT PULL] cgroup changes for v4.18-rc1
  2018-06-06  0:13 ` Linus Torvalds
@ 2018-06-06 15:04   ` Tejun Heo
  2018-06-06 15:14     ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Tejun Heo @ 2018-06-06 15:04 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Linux Kernel Mailing List, Li Zefan, Johannes Weiner, cgroups

Hello, Linus.

On Tue, Jun 05, 2018 at 05:13:55PM -0700, Linus Torvalds wrote:
> On Tue, Jun 5, 2018 at 12:22 PM Tejun Heo <tj@kernel.org> wrote:
> >
> > * cgroup uses file modified events to notify certain events.  A rate
> >   limiting mechanism is added.
> 
> This "explanation" didn't really parse for me at all.
>
> I edited the merge message to something that I think is correct and
> made more sense to me.

Heh, yeah, yours reads a lot better.  Sorry about that.  The
background is that the mechanism was first added to generate
notifications on events like cgroup becoming empty, which is very low
frequency.  Since then, we've expanded its usage to cover things like
memory.high breached events which can be a lot higher frequency.

The notification implementation isn't super light weight, so the patch
ratelimits the notifications by capping minimum notification interval
interval to 10ms.

Thanks.

-- 
tejun

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

* Re: [GIT PULL] cgroup changes for v4.18-rc1
  2018-06-06 15:04   ` Tejun Heo
@ 2018-06-06 15:14     ` Linus Torvalds
  2018-06-06 15:22       ` Tejun Heo
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2018-06-06 15:14 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Linux Kernel Mailing List, Li Zefan, Johannes Weiner, cgroups

On Wed, Jun 6, 2018 at 8:04 AM Tejun Heo <tj@kernel.org> wrote:
>
> The notification implementation isn't super light weight, so the patch
> ratelimits the notifications by capping minimum notification interval
> interval to 10ms.

Yeah, I looked at the patch (and the code) to make sense of the explanation.

My reaction to that was that it might be a better idea to simply not
notify if a notification was already pending, rather than have the
timeout. Or perhaps in addition to. The path _to_ the fsnotify code
looked quite messy, though.

             Linus

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

* Re: [GIT PULL] cgroup changes for v4.18-rc1
  2018-06-06 15:14     ` Linus Torvalds
@ 2018-06-06 15:22       ` Tejun Heo
  0 siblings, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2018-06-06 15:22 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Linux Kernel Mailing List, Li Zefan, Johannes Weiner, cgroups

On Wed, Jun 06, 2018 at 08:14:27AM -0700, Linus Torvalds wrote:
> On Wed, Jun 6, 2018 at 8:04 AM Tejun Heo <tj@kernel.org> wrote:
> >
> > The notification implementation isn't super light weight, so the patch
> > ratelimits the notifications by capping minimum notification interval
> > interval to 10ms.
> 
> Yeah, I looked at the patch (and the code) to make sense of the explanation.
> 
> My reaction to that was that it might be a better idea to simply not
> notify if a notification was already pending, rather than have the
> timeout. Or perhaps in addition to. The path _to_ the fsnotify code
> looked quite messy, though.

Yeah, getting to the inode is currently quite involved.  Some of the
complications come from the fact that a kernfs node can be associated
with multiple inodes for sysfs namespace support.

The right thing to do could be linking the inodes to the kernfs node
and protect it with a spinlock so that we don't have to punt and walk
them directly from notification path.

For now, I think the 10ms thing is an acceptable workaround but this
likely needs more work in the future.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2018-06-06 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 19:21 [GIT PULL] cgroup changes for v4.18-rc1 Tejun Heo
2018-06-06  0:13 ` Linus Torvalds
2018-06-06 15:04   ` Tejun Heo
2018-06-06 15:14     ` Linus Torvalds
2018-06-06 15:22       ` Tejun Heo

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).