[lxc-devel] [lxc/lxc] 2202af: cgroups: refactor cgroup handling

GitHub noreply at github.com
Tue May 22 19:48:41 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 2202afc960d7d90df1fd5a1bb27be2529fcc235b
      https://github.com/lxc/lxc/commit/2202afc960d7d90df1fd5a1bb27be2529fcc235b
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2018-05-19 (Sat, 19 May 2018)

  Changed paths:
    M src/lxc/attach.c
    M src/lxc/cgroups/cgfsng.c
    M src/lxc/cgroups/cgroup.c
    M src/lxc/cgroups/cgroup.h
    M src/lxc/commands.c
    M src/lxc/conf.c
    M src/lxc/criu.c
    M src/lxc/freezer.c
    M src/lxc/lxc.h
    M src/lxc/lxccontainer.c
    M src/lxc/start.c
    M src/lxc/start.h
    M src/tests/cgpath.c

  Log Message:
  -----------
  cgroups: refactor cgroup handling

This replaces the constructor implementation of cgroup handling with a simpler,
thread-safe on-demand model of cgroup driver initialization.
Making the cgroup initialization code run in a constructor means that each time
the shared library gets mapped the cgroup parsing code gets run. That's
unnecessary overhead.
It also feels to me that this is only accidently thread-safe because
constructors are only run once. But should threads actually end up manipulating
or freeing memory that is file-global to cgfsng.c we'd be screwed. Now, I might
be wrong here but the cleaner implementation is to allocate a cgroup driver on
demand whenever we need it.
Take the chance and rework the cgroup_ops interface to make the functions it
wants to have implemented a lot cleaner.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: dd66700c56d51604d0877daf31da943d02ec4733
      https://github.com/lxc/lxc/commit/dd66700c56d51604d0877daf31da943d02ec4733
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2018-05-19 (Sat, 19 May 2018)

  Changed paths:
    M src/lxc/freezer.c
    M src/lxc/state.c

  Log Message:
  -----------
  cgroups: remove freezer_state()

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: b1c428f9e8b41f7bc9aaf4fe2adabb2effbccaed
      https://github.com/lxc/lxc/commit/b1c428f9e8b41f7bc9aaf4fe2adabb2effbccaed
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2018-05-19 (Sat, 19 May 2018)

  Changed paths:
    M src/lxc/seccomp.c

  Log Message:
  -----------
  seccomp: #ifdef SCMP_ARCH_AARCH64

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 395b1a3ed680438dc62323e50776d2ec447a4551
      https://github.com/lxc/lxc/commit/395b1a3ed680438dc62323e50776d2ec447a4551
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2018-05-19 (Sat, 19 May 2018)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  conf: simplify write_id_mapping()

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 394769b16ae5a21353216efb7f1ac2d283f8a433
      https://github.com/lxc/lxc/commit/394769b16ae5a21353216efb7f1ac2d283f8a433
  Author: Serge Hallyn <serge at hallyn.com>
  Date:   2018-05-22 (Tue, 22 May 2018)

  Changed paths:
    M src/lxc/attach.c
    M src/lxc/cgroups/cgfsng.c
    M src/lxc/cgroups/cgroup.c
    M src/lxc/cgroups/cgroup.h
    M src/lxc/commands.c
    M src/lxc/conf.c
    M src/lxc/criu.c
    M src/lxc/freezer.c
    M src/lxc/lxc.h
    M src/lxc/lxccontainer.c
    M src/lxc/seccomp.c
    M src/lxc/start.c
    M src/lxc/start.h
    M src/lxc/state.c
    M src/tests/cgpath.c

  Log Message:
  -----------
  Merge pull request #2337 from brauner/2018-05-18/cgroup_rework

cgroups: refactor cgroup handling


Compare: https://github.com/lxc/lxc/compare/f49098e0d3b2...394769b16ae5
      **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the lxc-devel mailing list