]> git.proxmox.com Git - mirror_lxcfs.git/log
mirror_lxcfs.git
4 years agoconfig: allow system service file to set custom target path
Christian Brauner [Tue, 3 Mar 2020 15:40:02 +0000 (16:40 +0100)]
config: allow system service file to set custom target path

Closes #238.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotree-wide: introduce and use fopen_cached()
Christian Brauner [Tue, 3 Mar 2020 15:02:33 +0000 (16:02 +0100)]
tree-wide: introduce and use fopen_cached()

Closes #257.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotree-wide: make fopen() calls cloexec
Christian Brauner [Tue, 3 Mar 2020 14:30:11 +0000 (15:30 +0100)]
tree-wide: make fopen() calls cloexec

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolxcfs: use fuse's default_permissions
Christian Brauner [Tue, 3 Mar 2020 13:24:09 +0000 (14:24 +0100)]
lxcfs: use fuse's default_permissions

Closes #128.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolxcfs: cleanup
Christian Brauner [Tue, 3 Mar 2020 13:19:08 +0000 (14:19 +0100)]
lxcfs: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolxcfs: use cleanup macro for pidfile fd
Christian Brauner [Tue, 3 Mar 2020 12:36:00 +0000 (13:36 +0100)]
lxcfs: use cleanup macro for pidfile fd

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolxcfs: improve logs
Christian Brauner [Tue, 3 Mar 2020 12:33:59 +0000 (13:33 +0100)]
lxcfs: improve logs

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolxcfs: cleanup mutex
Christian Brauner [Tue, 3 Mar 2020 10:03:00 +0000 (11:03 +0100)]
lxcfs: cleanup mutex

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolxcfs: replace alloca()
Christian Brauner [Tue, 3 Mar 2020 09:53:20 +0000 (10:53 +0100)]
lxcfs: replace alloca()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoproc_cpuview: remove alloca()
Christian Brauner [Tue, 3 Mar 2020 09:32:28 +0000 (10:32 +0100)]
proc_cpuview: remove alloca()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocpuset_parse: cleanup
Christian Brauner [Tue, 3 Mar 2020 09:28:26 +0000 (10:28 +0100)]
cpuset_parse: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agobindings: cleanup send_creds_clone_wrapper()
Christian Brauner [Mon, 2 Mar 2020 09:00:32 +0000 (10:00 +0100)]
bindings: cleanup send_creds_clone_wrapper()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #336 from brauner/2020-02-27/safe_mount
Stéphane Graber [Thu, 27 Feb 2020 21:52:21 +0000 (22:52 +0100)]
Merge pull request #336 from brauner/2020-02-27/safe_mount

support ASAN and UBSAN + bugfixes

4 years agotree-wide: fix memory leaks
Christian Brauner [Thu, 27 Feb 2020 21:23:45 +0000 (22:23 +0100)]
tree-wide: fix memory leaks

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoautotools: add support for ASAN and UBSAN
Christian Brauner [Thu, 27 Feb 2020 20:48:39 +0000 (21:48 +0100)]
autotools: add support for ASAN and UBSAN

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroup_utils: re-add O_NOFOLLOW
Christian Brauner [Thu, 27 Feb 2020 19:38:22 +0000 (20:38 +0100)]
cgroup_utils: re-add O_NOFOLLOW

This got removed on accident.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #335 from brauner/2020-02-27/memory_stat_fix
Stéphane Graber [Thu, 27 Feb 2020 17:58:29 +0000 (18:58 +0100)]
Merge pull request #335 from brauner/2020-02-27/memory_stat_fix

proc_fuse: ensure struct memory_stat is properly zeroed

4 years agoproc_fuse: ensure struct memory_stat is properly zeroed
Christian Brauner [Thu, 27 Feb 2020 16:07:29 +0000 (17:07 +0100)]
proc_fuse: ensure struct memory_stat is properly zeroed

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #333 from brauner/master
Stéphane Graber [Thu, 27 Feb 2020 15:09:02 +0000 (16:09 +0100)]
Merge pull request #333 from brauner/master

api_extensions: add and log api extensions

4 years agoapi_extensions: add and log api extensions
Christian Brauner [Thu, 27 Feb 2020 14:23:02 +0000 (15:23 +0100)]
api_extensions: add and log api extensions

New features should get an entry in here:

Feb 27 15:21:54 wittgenstein lxcfs[2129877]: mount namespace: 4
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: hierarchies:
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:   0: fd:   5:
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:   1: fd:   6: name=systemd
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:   2: fd:   7: cpu,cpuacct
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:   3: fd:   8: rdma
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:   4: fd:   9: devices
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:   5: fd:  10: pids
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:   6: fd:  11: net_cls,net_prio
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:   7: fd:  12: memory
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:   8: fd:  13: perf_event
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:   9: fd:  14: blkio
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:  10: fd:  15: freezer
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:  11: fd:  16: cpuset
Feb 27 15:21:54 wittgenstein lxcfs[2129877]:  12: fd:  17: hugetlb
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: Kernel supports pidfds
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: api_extensions:
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - cgroups
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - sys_cpu_online
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - proc_cpuinfo
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - proc_diskstats
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - proc_loadavg
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - proc_meminfo
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - proc_stat
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - proc_swaps
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - proc_uptime
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - shared_pidns
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - cpuview_daemon
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - loadavg_daemon
Feb 27 15:21:54 wittgenstein lxcfs[2129877]: - pidfds

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #332 from brauner/2020-02-20/meminfo_extension
Stéphane Graber [Thu, 27 Feb 2020 14:04:02 +0000 (15:04 +0100)]
Merge pull request #332 from brauner/2020-02-20/meminfo_extension

meminfo: add some more metrics

4 years agomeminfo: add some more metrics
Christian Brauner [Thu, 27 Feb 2020 13:55:43 +0000 (14:55 +0100)]
meminfo: add some more metrics

dirty/writeback  ... and so on

Closes #315.
Signed-off-by LiMing Wu <19092205@suning.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #331 from brauner/master
Stéphane Graber [Thu, 27 Feb 2020 12:12:56 +0000 (13:12 +0100)]
Merge pull request #331 from brauner/master

bugfixes

4 years agocgroup_utils: fix mounting
Christian Brauner [Thu, 27 Feb 2020 12:07:05 +0000 (13:07 +0100)]
cgroup_utils: fix mounting

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoproc_fuse: use correct format specifier
Christian Brauner [Thu, 27 Feb 2020 11:26:12 +0000 (12:26 +0100)]
proc_fuse: use correct format specifier

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotree-wide: introduce casting helpers
Christian Brauner [Thu, 27 Feb 2020 11:21:43 +0000 (12:21 +0100)]
tree-wide: introduce casting helpers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocroups: remove unused variable
Christian Brauner [Thu, 27 Feb 2020 11:10:57 +0000 (12:10 +0100)]
croups: remove unused variable

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #330 from brauner/master
Stéphane Graber [Wed, 26 Feb 2020 19:32:37 +0000 (20:32 +0100)]
Merge pull request #330 from brauner/master

bindings: cleanup various parts

4 years agotree-wide: use cleanup macros
Christian Brauner [Wed, 26 Feb 2020 18:38:30 +0000 (19:38 +0100)]
tree-wide: use cleanup macros

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agobindings: cleanup various parts
Christian Brauner [Wed, 26 Feb 2020 18:03:50 +0000 (19:03 +0100)]
bindings: cleanup various parts

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #329 from brauner/master
Stéphane Graber [Wed, 26 Feb 2020 16:49:09 +0000 (17:49 +0100)]
Merge pull request #329 from brauner/master

bindings: initialize safely & compiler-based hardening

4 years agoautotools: add compiler-based hardening flags which are already standard in lxc
Christian Brauner [Wed, 26 Feb 2020 16:04:00 +0000 (17:04 +0100)]
autotools: add compiler-based hardening flags which are already standard in lxc

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agobindings: initialize safely
Christian Brauner [Wed, 26 Feb 2020 15:24:44 +0000 (16:24 +0100)]
bindings: initialize safely

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #328 from brauner/master
Stéphane Graber [Wed, 26 Feb 2020 13:16:01 +0000 (14:16 +0100)]
Merge pull request #328 from brauner/master

lxcfs: add --pidfd option

4 years agolxcfs: add --pidfd option
Christian Brauner [Wed, 26 Feb 2020 13:08:08 +0000 (14:08 +0100)]
lxcfs: add --pidfd option

This makes running lxcfs way more reliable. It is opt-in for now.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #327 from brauner/master
Stéphane Graber [Wed, 26 Feb 2020 12:45:52 +0000 (13:45 +0100)]
Merge pull request #327 from brauner/master

tree-wide: post-restructuring cleanup

4 years agotree-wide: post-restructuring cleanup
Christian Brauner [Wed, 26 Feb 2020 09:29:53 +0000 (10:29 +0100)]
tree-wide: post-restructuring cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #326 from brauner/2020-02-20/cgroup2_support_10
Stéphane Graber [Tue, 25 Feb 2020 23:35:22 +0000 (00:35 +0100)]
Merge pull request #326 from brauner/2020-02-20/cgroup2_support_10

restructure everything

4 years agoMakefile: add missing header files
Christian Brauner [Tue, 25 Feb 2020 17:22:16 +0000 (18:22 +0100)]
Makefile: add missing header files

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoproc: split proc virtualization into separate files
Christian Brauner [Tue, 25 Feb 2020 17:17:52 +0000 (18:17 +0100)]
proc: split proc virtualization into separate files

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agobindings: split cgroup part of lxcfs into separate files
Christian Brauner [Tue, 25 Feb 2020 16:17:10 +0000 (17:17 +0100)]
bindings: split cgroup part of lxcfs into separate files

This was long overdue since the cgroup faking part is basically unused
at this point on most kernels.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoutils: split helpers from bindings.c into utils.{c,h}
Christian Brauner [Tue, 25 Feb 2020 15:52:23 +0000 (16:52 +0100)]
utils: split helpers from bindings.c into utils.{c,h}

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: add get_cgroup_fd() helper
Christian Brauner [Tue, 25 Feb 2020 15:18:51 +0000 (16:18 +0100)]
cgroups: add get_cgroup_fd() helper

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #325 from brauner/2020-02-20/cgroup2_support_9
Stéphane Graber [Tue, 25 Feb 2020 13:15:52 +0000 (14:15 +0100)]
Merge pull request #325 from brauner/2020-02-20/cgroup2_support_9

cgroups: fixes and improvements

4 years agocgroups: remove unused variables
Christian Brauner [Tue, 25 Feb 2020 12:33:37 +0000 (13:33 +0100)]
cgroups: remove unused variables

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: remove ->nrtasks method
Christian Brauner [Tue, 25 Feb 2020 12:27:30 +0000 (13:27 +0100)]
cgroups: remove ->nrtasks method

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: move mntns fd into struct cgroup_ops
Christian Brauner [Tue, 25 Feb 2020 12:11:23 +0000 (13:11 +0100)]
cgroups: move mntns fd into struct cgroup_ops

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #324 from brauner/2020-02-20/cgroup2_support_8
Stéphane Graber [Mon, 24 Feb 2020 15:21:27 +0000 (16:21 +0100)]
Merge pull request #324 from brauner/2020-02-20/cgroup2_support_8

bindings: rework {con,de}structor

4 years agobindings: rework {con,de}structor
Christian Brauner [Mon, 24 Feb 2020 15:06:25 +0000 (16:06 +0100)]
bindings: rework {con,de}structor

- Improve naming for {con,de}structor.
- Fail when we can't setup cgroups.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #323 from brauner/2020-02-20/cgroup2_support_7
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

4 years agobindings: use more cleanup macros
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>
4 years agobindings: port cpuview to new cgroup getters
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>
4 years agoMerge pull request #322 from brauner/2020-02-20/cgroup2_support_5
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

4 years agobindings: 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>
4 years agoMerge pull request #321 from brauner/2020-02-20/cgroup2_support_4
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…

4 years agobindings: introduce dot_or_empty()
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>
4 years agobindings: port cpuset to new cgroup getters and implement cgroup2 support
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>
4 years agoMerge pull request #320 from brauner/2020-02-20/cgroup2_support_3
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

4 years agobindings: port memory to new cgroup getters and implement cgroup2 support
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>
4 years agobindings: rework proc meminfo helpers
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>
4 years agoMerge pull request #319 from brauner/2020-02-20/cgroup2_support_2
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()

4 years agocgroups: 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>
4 years agoMerge pull request #318 from brauner/2020-02-20/cgroup2_support
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

4 years agobindings: 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>
4 years agoMerge pull request #316 from KellenRenshaw/lp1860813
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

4 years agobindings: Adjusts the logic for calculating SwapFree to better handle conditions...
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>
4 years agoMerge pull request #312 from wlm86/dev
Stéphane Graber [Wed, 8 Jan 2020 13:19:36 +0000 (08:19 -0500)]
Merge pull request #312 from wlm86/dev

Improve version reporting

4 years agoEnhance version option
LiMing Wu [Wed, 8 Jan 2020 00:59:51 +0000 (08:59 +0800)]
Enhance version option

Signed-off-by: LiMing Wu <19092205@suning.com>
4 years agoAdd compile method to README
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>
4 years agoMerge pull request #308 from yinhongbo/master
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…

4 years agouse is_shared_pidns helper
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>
4 years agobindings: handle shared pidns
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>
4 years agoMerge pull request #309 from yinhongbo/read_file
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

4 years agofix 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>
4 years agoMerge pull request #307 from yinhongbo/master
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 …

4 years agofix the problem of counting the number of CPUs when using cpuset and cpuset or using...
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>
5 years agoMerge pull request #305 from yinhongbo/master
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

5 years agofix /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>
5 years agoMerge pull request #303 from yinhongbo/master
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

5 years agofix 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>
5 years agoMerge pull request #302 from time-river/master
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

5 years agomacro: 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>
5 years agoRelease LXCFS 3.1.2 lxcfs-3.1.2
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>
5 years agoMerge pull request #296 from brauner/2019-07-23/swapfix
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

5 years agoRevert "Revert "cpu: improve cpu info virtualization""
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>
5 years agobindings: ensure that opts is non NULL
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>
5 years agoMerge pull request #294 from brauner/master
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"

5 years agoRevert "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>
5 years agoRelease LXCFS 3.1.1 lxcfs-3.1.1
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>
5 years agoMakefile: Fix typo in file name
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>
5 years agoRelease LXCFS 3.1.0 lxcfs-3.1.0
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>
5 years agoMerge pull request #293 from brauner/2019-07-18/higher_precision_uptime
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

5 years agobindings: 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>
5 years agoMerge pull request #290 from BurningXFlame/master
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

5 years agocpu: improve cpu info virtualization
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>
5 years agoMerge pull request #282 from aither64/syscpus
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

5 years agomount 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>
5 years agoMerge pull request #278 from wavezhang/master
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

5 years agoMerge pull request #280 from brauner/master
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…

5 years agoRevert "Merge pull request #272 from brauner/2019-02-19/compiler_based_housekeeping"
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>