]>
git.proxmox.com Git - mirror_lxcfs.git/log
Stéphane Graber [Mon, 24 Feb 2020 12:50:04 +0000 (07:50 -0500)]
Merge pull request #323 from brauner/2020-02-20/cgroup2_support_7
bindings: port cpuview to new cgroup getters & cleanup macro expansion
Christian Brauner [Mon, 24 Feb 2020 11:56:05 +0000 (12:56 +0100)]
bindings: use more cleanup macros
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 24 Feb 2020 11:01:07 +0000 (12:01 +0100)]
bindings: port cpuview to new cgroup getters
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Mon, 24 Feb 2020 11:02:04 +0000 (06:02 -0500)]
Merge pull request #322 from brauner/2020-02-20/cgroup2_support_5
bindings: port blkio to new cgroup getters
Christian Brauner [Mon, 24 Feb 2020 10:32:47 +0000 (11:32 +0100)]
bindings: port blkio to new cgroup getters
cgroup2's io controller does not support most of the blkio files.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Mon, 24 Feb 2020 10:01:05 +0000 (05:01 -0500)]
Merge pull request #321 from brauner/2020-02-20/cgroup2_support_4
bindings: port cpuset to new cgroup getters and implement cgroup2 sup…
Christian Brauner [Mon, 24 Feb 2020 09:54:08 +0000 (10:54 +0100)]
bindings: introduce dot_or_empty()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 24 Feb 2020 09:35:50 +0000 (10:35 +0100)]
bindings: port cpuset to new cgroup getters and implement cgroup2 support
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Fri, 21 Feb 2020 14:43:47 +0000 (09:43 -0500)]
Merge pull request #320 from brauner/2020-02-20/cgroup2_support_3
bindings: port memory to new cgroup getters and support cgroup2
Christian Brauner [Fri, 21 Feb 2020 14:19:08 +0000 (15:19 +0100)]
bindings: port memory to new cgroup getters and implement cgroup2 support
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Fri, 21 Feb 2020 13:05:56 +0000 (14:05 +0100)]
bindings: rework proc meminfo helpers
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Thu, 20 Feb 2020 21:46:27 +0000 (16:46 -0500)]
Merge pull request #319 from brauner/2020-02-20/cgroup2_support_2
cgroups: add getter instead of open-coded cgfs_get_value()
Christian Brauner [Thu, 20 Feb 2020 21:06:10 +0000 (22:06 +0100)]
cgroups: add getter instead of open-coded cgfs_get_value()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Thu, 20 Feb 2020 15:48:43 +0000 (10:48 -0500)]
Merge pull request #318 from brauner/2020-02-20/cgroup2_support
bindings: add infrastructure for cgroup2 support
Christian Brauner [Thu, 20 Feb 2020 15:30:47 +0000 (16:30 +0100)]
bindings: add infrastructure for cgroup2 support
Mostly based on code I've written for liblxc.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 28 Jan 2020 10:17:48 +0000 (11:17 +0100)]
Merge pull request #316 from KellenRenshaw/lp1860813
handle swap reporting better when swap accounting is enabled
Kellen Renshaw [Tue, 28 Jan 2020 00:57:58 +0000 (17:57 -0700)]
bindings: Adjusts the logic for calculating SwapFree to better handle conditions where swap usage is reported to be <0.
Signed-off-by: Kellen Renshaw <kellen.renshaw@canonical.com>
Stéphane Graber [Wed, 8 Jan 2020 13:19:36 +0000 (08:19 -0500)]
Merge pull request #312 from wlm86/dev
Improve version reporting
LiMing Wu [Wed, 8 Jan 2020 00:59:51 +0000 (08:59 +0800)]
Enhance version option
Signed-off-by: LiMing Wu <19092205@suning.com>
LiMing Wu [Tue, 7 Jan 2020 10:01:03 +0000 (18:01 +0800)]
Add compile method to README
Signed-off-by: LiMing Wu <19092205@suning.com>
Christian Brauner [Tue, 17 Dec 2019 13:25:35 +0000 (14:25 +0100)]
Merge pull request #308 from yinhongbo/master
fixed a problem with server stability degradation caused by cgroup dy…
Hongbo Yin [Tue, 17 Dec 2019 13:14:14 +0000 (21:14 +0800)]
use is_shared_pidns helper
Signed-off-by: Hongbo Yin <yinhongbo@bytedance.com>
Hongbo Yin [Tue, 22 Oct 2019 08:41:55 +0000 (16:41 +0800)]
bindings: handle shared pidns
Signed-off-by: Hongbo Yin <yinhongbo@bytedance.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Hongbo Yin <yinhongbo@bytedance.com>
Christian Brauner [Tue, 15 Oct 2019 09:45:34 +0000 (11:45 +0200)]
Merge pull request #309 from yinhongbo/read_file
fix read_file second reading empty bug
Hongbo Yin [Tue, 15 Oct 2019 07:39:58 +0000 (15:39 +0800)]
fix read_file second reading empty bug
Signed-off-by: Hongbo Yin <yinhongbo@bytedance.com>
Serge Hallyn [Tue, 8 Oct 2019 12:23:14 +0000 (07:23 -0500)]
Merge pull request #307 from yinhongbo/master
fix the problem of counting the number of CPUs when using cpuset and …
Hongbo Yin [Fri, 27 Sep 2019 10:50:44 +0000 (18:50 +0800)]
fix the problem of counting the number of CPUs when using cpuset and cpuset or using cpuset alone
Changelog: format code style
Signed-off-by: Hongbo Yin <yinhongbo@bytedance.com>
Christian Brauner [Fri, 6 Sep 2019 07:45:10 +0000 (09:45 +0200)]
Merge pull request #305 from yinhongbo/master
fix /sys/devices/system/cpu/online in cpuset not correct bug
Hongbo Yin [Fri, 6 Sep 2019 07:35:58 +0000 (15:35 +0800)]
fix /sys/devices/system/cpu/online in cpuset not correct bug
Signed-off-by: Hongbo Yin <yinhongbo@bytedance.com>
Christian Brauner [Mon, 26 Aug 2019 17:49:48 +0000 (19:49 +0200)]
Merge pull request #303 from yinhongbo/master
fix container run pid host mode /proc/stat error log
Hongbo Yin [Mon, 26 Aug 2019 17:33:04 +0000 (01:33 +0800)]
fix container run pid host mode /proc/stat error log
Signed-off-by: Hongbo Yin <yinhongbo@bytedance.com>
Christian Brauner [Mon, 26 Aug 2019 15:16:49 +0000 (17:16 +0200)]
Merge pull request #302 from time-river/master
macro: fix lxcfs_{error,debug,v} build error when __VA_ARGS__ is empty
river [Mon, 26 Aug 2019 10:01:12 +0000 (18:01 +0800)]
macro: fix lxcfs_{error,debug,v} build error when __VA_ARGS__ is empty
Originally, the compiler complained:
macro.h:7:25: error: expected expression before ')' token
__func__, __VA_ARGS__);
The reason is that GCC wouldn't abandon `,` when `__VA_ARGS__` is empty.
For emaple:
#define eprintf(format, ...) fprintf (stderr, format, __VA_ARGS__)
eprintf("success!\n", );
→ fprintf(stderr, "success!\n", );
According to GCC doc, it's okay when adding `##` before `__VA_ARGS__`:
#define eprintf(format, ...) fprintf (stderr, format, ##__VA_ARGS__)
eprintf ("success!\n")
→ fprintf(stderr, "success!\n");
Signed-off-by: river <river@vvl.me>
Stéphane Graber [Wed, 24 Jul 2019 01:18:13 +0000 (21:18 -0400)]
Release LXCFS 3.1.2
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Stéphane Graber [Tue, 23 Jul 2019 15:16:35 +0000 (11:16 -0400)]
Merge pull request #296 from brauner/2019-07-23/swapfix
bindings: ensure that opts is non NULL
Stéphane Graber [Tue, 23 Jul 2019 15:08:52 +0000 (11:08 -0400)]
Revert "Revert "cpu: improve cpu info virtualization""
This reverts commit
39b7df424120fa9c3c5dc209b37990fed57f1efd .
Looks like this is actually fine, un-revert.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Christian Brauner [Tue, 23 Jul 2019 14:57:28 +0000 (16:57 +0200)]
bindings: ensure that opts is non NULL
When the shared library is reloaded but the lxcfs binary itself will
likely not be replaced and even if will still be in-memory, i.e. the
fuse loop will not be restarted.
The code here introduced a new struct lxcfs_opts which is allocated and
gets stashed in the private_data member of the fuse file when the lxcfs
binary is first called. Now, in a scenario where the shared library is
reloaded the lxcfs binary itself won't be re-run. So now we have a
shared library that assumes there's always a valid struct lxcfs_opts
stashed in the private_data member. But there isnt'. This very likely
causes the segfaults we have seen.
Fix it by verifying a struct has been stashed.
Fixes: 7e60aa1b1540 ("option to disable swap in meminfo")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Tue, 23 Jul 2019 13:56:18 +0000 (09:56 -0400)]
Merge pull request #294 from brauner/master
Revert "cpu: improve cpu info virtualization"
Christian Brauner [Tue, 23 Jul 2019 13:50:49 +0000 (15:50 +0200)]
Revert "cpu: improve cpu info virtualization"
This reverts commit
db1b32f6ff056ce713c06b9d41bcc1eadd054abd .
We had a multitude of reports saying that they hit segfaults with
current lxcfs. After a bisect and various mentions in the error reports
of corrupt cpu information this is likely the culprit: revert for now.
Link: https://github.com/lxc/lxd/issues/6000
Link: https://lists.linuxcontainers.org/pipermail/lxc-users/2019-July/014932.html
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Mon, 22 Jul 2019 22:47:50 +0000 (18:47 -0400)]
Release LXCFS 3.1.1
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Stéphane Graber [Mon, 22 Jul 2019 22:47:20 +0000 (18:47 -0400)]
Makefile: Fix typo in file name
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Stéphane Graber [Mon, 22 Jul 2019 22:43:16 +0000 (18:43 -0400)]
Release LXCFS 3.1.0
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Stéphane Graber [Thu, 18 Jul 2019 19:44:14 +0000 (15:44 -0400)]
Merge pull request #293 from brauner/2019-07-18/higher_precision_uptime
bindings: enable higher precision uptime
Christian Brauner [Thu, 18 Jul 2019 13:44:06 +0000 (15:44 +0200)]
bindings: enable higher precision uptime
I don't know for what reason anyone but care but I guess ok.
Closes #292.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Jul 2019 16:39:37 +0000 (18:39 +0200)]
Merge pull request #290 from BurningXFlame/master
CPU views based on quotas: several improvements
Stephen Xiang [Fri, 14 Jun 2019 02:52:43 +0000 (10:52 +0800)]
cpu: improve cpu info virtualization
This commit introduces several improvements to CPU views based on
quotas:
- fall back to cpuacct.usage_percpu if cpuacct.usage_all not exists
- correct CPU usage
- correct CPU usage in partial CPU cases when quota/period doesn't yield
an integer
Signed-off-by: Stephen Xiang <BurningXFlame@gmail.com>
[christian.brauner@ubuntu.com: squashed commits and fixed up commit message]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Abstract must_strcat from must_strcat_pid. Replace stringbuild with must_strcat.
Signed-off-by: Stephen Xiang <BurningXFlame@gmail.com>
Christian Brauner [Tue, 21 May 2019 14:19:48 +0000 (16:19 +0200)]
Merge pull request #282 from aither64/syscpus
mount hook: mount /sys/devices/system/cpu/online
Jakub Skokan [Tue, 21 May 2019 13:50:54 +0000 (15:50 +0200)]
mount hook: mount /sys/devices/system/cpu/online
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Christian Brauner [Thu, 9 May 2019 10:14:38 +0000 (12:14 +0200)]
Merge pull request #278 from wavezhang/master
Support /sys/devices/system/cpu/online
Stéphane Graber [Wed, 24 Apr 2019 12:50:09 +0000 (08:50 -0400)]
Merge pull request #280 from brauner/master
Revert "Merge pull request #272 from brauner/2019-02-19/compiler_base…
Christian Brauner [Wed, 24 Apr 2019 12:14:16 +0000 (14:14 +0200)]
Revert "Merge pull request #272 from brauner/2019-02-19/compiler_based_housekeeping"
This reverts commit
ac98f00cd89278e82a4cffe9075792d2070abe69 , reversing
changes made to
d8addb023a0e96b7d42e253703ba909bbc81dd26 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Serge Hallyn [Mon, 22 Apr 2019 04:25:58 +0000 (23:25 -0500)]
Merge pull request #272 from brauner/2019-02-19/compiler_based_housekeeping
lxcfs: coding style update
Yafei Bao [Tue, 9 Apr 2019 02:37:29 +0000 (10:37 +0800)]
remove unused function
Signed-off-by: Yafei Bao <baoyafei@gmail.com>
Yafei Bao [Mon, 8 Apr 2019 03:06:16 +0000 (11:06 +0800)]
sys dirs do not need to implement 'read' method
Signed-off-by: Yafei Bao <baoyafei@gmail.com>
Yafei Bao [Fri, 22 Mar 2019 07:58:21 +0000 (15:58 +0800)]
support /sys/devices/system/cpu/online
Signed-off-by: Yafei Bao <baoyafei@gmail.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 19 Feb 2019 22:09:27 +0000 (23:09 +0100)]
bindings: partially convert to cleanup macros
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 19 Feb 2019 21:44:48 +0000 (22:44 +0100)]
lxcfs: use close cleanup attributes
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 19 Feb 2019 21:17:40 +0000 (22:17 +0100)]
lxcfs: coding style update
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Serge Hallyn [Tue, 19 Feb 2019 18:41:44 +0000 (12:41 -0600)]
Merge pull request #271 from dmaj/master
option to disable swap in meminfo
dm@localhost [Mon, 18 Feb 2019 05:17:30 +0000 (06:17 +0100)]
option to disable swap in meminfo
Signed-off-by: Dieter Maier <dma@web.de>
Stéphane Graber [Thu, 7 Feb 2019 01:39:17 +0000 (20:39 -0500)]
Merge pull request #269 from tomponline/tp-skipcgroupmount
hooks: skip mounting lxcfs cgroup tree on centos 7 hosts
tomponline [Wed, 6 Feb 2019 19:51:22 +0000 (19:51 +0000)]
config: Adds RPM spec file.
On RHEL 7 distros the RPM spec file will run the lxc.mount.hook with the --skip-cgroup-mounts option.
Signed-off-by: tomponline <tomp@tomp.uk>
tomponline [Wed, 6 Feb 2019 19:49:11 +0000 (19:49 +0000)]
hooks: Adds --skip-cgroup-mounts flag to lxc.mount.hook script.
This can be used to avoid instability in LXCFS when running on RHEL 7 hosts.
Signed-off-by: tomponline <tomp@tomp.uk>
Christian Brauner [Wed, 23 Jan 2019 11:45:08 +0000 (12:45 +0100)]
Merge pull request #270 from tomponline/tp-reload
config: Adds reload mode to sysvinit and systemd scripts.
Christian Brauner [Wed, 23 Jan 2019 10:24:44 +0000 (11:24 +0100)]
Merge pull request #268 from tomponline/tp-lock
Revert "bindings: protect do_release_file_info() with mutex"
tomponline [Tue, 22 Jan 2019 14:23:05 +0000 (14:23 +0000)]
config: Adds reload mode to sysvinit and systemd scripts.
To to close down https://github.com/lxc/lxcfs/pull/188
Signed-off-by: tomponline <tomp@tomp.uk>
tomponline [Tue, 22 Jan 2019 12:38:25 +0000 (12:38 +0000)]
Revert "bindings: protect do_release_file_info() with mutex"
This reverts commit
0108dc1cc6eab76392d228ee4ca844729096473d .
I am still experiencing hangs in lxcfs even with this patch.
Signed-off-by: tomponline <tomp@tomp.uk>
Christian Brauner [Fri, 18 Jan 2019 14:24:08 +0000 (16:24 +0200)]
Merge pull request #266 from tomponline/master
Adds mutex to do_release_file_info
tomponline [Fri, 18 Jan 2019 13:05:09 +0000 (13:05 +0000)]
bindings: protect do_release_file_info() with mutex
Add a mutex to do_release_file_info to avoid lxcfs crash when stopping
multiple containers concurrently
Signed-off-by: tomponline <tomp@tomp.uk>
[christian.brauner@ubuntu.com: use correct commit message style]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Wolfgang Bumiller [Wed, 12 Dec 2018 16:09:12 +0000 (17:09 +0100)]
Merge pull request #262 from brauner/2018-12-12/cg_readdir
bindings: prevent NULL pointer dereference
Christian Brauner [Wed, 12 Dec 2018 11:49:16 +0000 (12:49 +0100)]
bindings: prevent NULL pointer dereference
Fixes: https://bugs.launchpad.net/ubuntu/+source/lxcfs/+bug/1807628
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Serge Hallyn [Sat, 8 Dec 2018 19:28:55 +0000 (13:28 -0600)]
Merge pull request #260 from aither64/cpu-views
CPU views based on quotas
Jakub Skokan [Wed, 24 Oct 2018 12:39:39 +0000 (14:39 +0200)]
stat: check for out of bound access to cpuacct usage data
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Jakub Skokan [Sun, 21 Oct 2018 13:13:07 +0000 (15:13 +0200)]
CPU view: handle disabling/enabling of physical CPUs at runtime
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Jakub Skokan [Sun, 21 Oct 2018 07:04:12 +0000 (09:04 +0200)]
CPU view: handle CPU hotplug at runtime
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Jakub Skokan [Mon, 25 Jun 2018 16:24:14 +0000 (18:24 +0200)]
CPU view: add mutexes
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Jakub Skokan [Mon, 25 Jun 2018 12:47:43 +0000 (14:47 +0200)]
CPU view: prune stale entries
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Jakub Skokan [Mon, 25 Jun 2018 07:05:30 +0000 (09:05 +0200)]
stat: use cpu views
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Jakub Skokan [Mon, 25 Jun 2018 06:55:23 +0000 (08:55 +0200)]
calc_hash(): do not apply modulo LOAD_SIZE
This will allow `calc_hash()` to be used for other purposes than
the loadavg implementation.
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Jakub Skokan [Mon, 25 Jun 2018 06:54:15 +0000 (08:54 +0200)]
cpuinfo: use cpu view based on cpu quotas
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Stéphane Graber [Sun, 26 Aug 2018 20:09:35 +0000 (16:09 -0400)]
Merge pull request #255 from brauner/2018-08-26/fix_makedev
tests: include missing sys/sysmacros.h header
Christian Brauner [Sun, 26 Aug 2018 10:23:31 +0000 (12:23 +0200)]
tests: include missing sys/sysmacros.h header
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Fri, 17 Aug 2018 16:00:00 +0000 (12:00 -0400)]
Merge pull request #253 from brauner/2018-08-17/prevent_double_free
bindings: prevent double free
Christian Brauner [Fri, 17 Aug 2018 15:33:22 +0000 (17:33 +0200)]
bindings: prevent double free
Closes #252.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Mon, 30 Jul 2018 21:47:32 +0000 (17:47 -0400)]
Merge pull request #250 from brauner/2018-07-30/improve_error_message
bindings: better logging for write_string()
Christian Brauner [Mon, 30 Jul 2018 08:53:19 +0000 (10:53 +0200)]
bindings: better logging for write_string()
Closes #249.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 4 Jul 2018 16:26:09 +0000 (18:26 +0200)]
Merge pull request #248 from aither64/meminfo
meminfo: read shmem from memory cgroup
Jakub Skokan [Wed, 4 Jul 2018 15:50:30 +0000 (17:50 +0200)]
meminfo: set ShmemHugePages and ShmemPmdMapped to zero
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Jakub Skokan [Wed, 4 Jul 2018 15:48:52 +0000 (17:48 +0200)]
meminfo: read shmem from cgroup parameter memory.stat
Shmem was passed as-is from the host, but other fields weren't (such as
Cached and SReclaimed), which has caused htop to show incorrect memory usage.
If `total_shmem` is found in `memory.stat`, it is used, otherwise `Shmem`
is reported as zero.
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Christian Brauner [Thu, 21 Jun 2018 07:58:45 +0000 (09:58 +0200)]
Merge pull request #245 from aither64/loadavg-leak
bindings: fix memory leak in calc_pid()
Jakub Skokan [Wed, 20 Jun 2018 18:24:28 +0000 (20:24 +0200)]
bindings: fix memory leak in calc_pid()
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Christian Brauner [Wed, 20 Jun 2018 13:45:09 +0000 (15:45 +0200)]
travis: fix .travis.yml
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 20 Jun 2018 10:54:10 +0000 (12:54 +0200)]
travis: add coverity support
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 20 Jun 2018 10:44:12 +0000 (12:44 +0200)]
Merge pull request #244 from aither64/perct-cpu-usage
Per-container CPU usage in /proc/stat
Jakub Skokan [Mon, 18 Jun 2018 08:50:02 +0000 (10:50 +0200)]
Per-container CPU usage in /proc/stat
Containers can see utilization of all available CPUs, even if the CPU
is utilized by other containers or by the host. The contents
of `/proc/stat` is shared across the system, except for hiding CPUs
excluded by cpuset. This commit attempts to fix that, but at a cost.
CPU usage is read from cpuacct cgroup, but that accounts only for
`user` and `system` fields from `/proc/stat`. Idle time can be
calculated, but other fields cannot, thus are always set to 0.
Additionally, idle time is based on values from the host, so even
a freshly started container has large initial idle time.
If the cpuacct cgroup is not present, or reading from it fails, LXCFS
will return CPU usage stats from the host as before.
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Christian Brauner [Thu, 14 Jun 2018 07:39:36 +0000 (09:39 +0200)]
Merge pull request #242 from aither64/loadavg-reload
loadavg: restart thread on library reload
Jakub Skokan [Mon, 11 Jun 2018 13:05:14 +0000 (15:05 +0200)]
loadavg: restart thread on library reload
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Christian Brauner [Wed, 13 Jun 2018 09:00:41 +0000 (11:00 +0200)]
Merge pull request #241 from aither64/loadavg-leak
bindings: fix memory leak in proc_loadavg_read()
Jakub Skokan [Mon, 11 Jun 2018 13:12:22 +0000 (15:12 +0200)]
bindings: fix memory leak in proc_loadavg_read()
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
Christian Brauner [Thu, 24 May 2018 14:58:18 +0000 (16:58 +0200)]
Merge pull request #237 from zhang2639/master
loadavg