[Devel] [PATCH RH9 3/4] cgroup: allow to write to cgroup.subtree_control in ct root cgroup

2023-08-28 Thread Pavel Tikhomirov
This way systemd in container on cgroup-v2 can enable the controllers it requires. https://jira.vzint.dev/browse/PSBM-149975 Signed-off-by: Pavel Tikhomirov --- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgrou

[Devel] [PATCH RH9 2/4] mm/memcontrol: fix mem_cgroup_enough_memory on cgroup-v2

2023-08-28 Thread Pavel Tikhomirov
In cgroup-v2 memsw is not used anymore, instead we have swap and memory separated from one another. So memory limit should be read from memory.max not from memsw.max. https://jira.vzint.dev/browse/PSBM-149975 Fixes: 9417436f33d1 ("ve/mm: add heuristic check for memory overcommit") Signed-off-by: P

[Devel] [PATCH RH9 1/4] cgroup: fix uninitiallized use of ctx->root

2023-08-28 Thread Pavel Tikhomirov
In vfs_get_tree we explicitly check that fc->root is NULL before calling ->get_tree helper. So when mounting cgroup2 filesystem in the begining of cgroup_get_tree the fc->root is uninitializled. We were lucky that ve_hide_cgroups never dereferenced it on this code path, as mounting cgroup2 from con

[Devel] [PATCH RH9 4/4] cgroup: show and allow mounting of cgroup-v2 in containers

2023-08-28 Thread Pavel Tikhomirov
The change in is_virtualized_cgroot makes cgroup-v2 "virtualized" only when it has enabled subsystems in it. And "virtualized" means that it will be: a) shown in different cgroup related proc files in container, b) allowed to be mounted in container and c) required to have separate root directory f

[Devel] [PATCH RH9 0/4] enable cgroup-v2 in containers

2023-08-28 Thread Pavel Tikhomirov
To test it need to boot with systemd.unified_cgroup_hierarchy=1 option. https://jira.vzint.dev/browse/PSBM-149975 Signed-off-by: Pavel Tikhomirov Pavel Tikhomirov (4): cgroup: fix uninitiallized use of ctx->root mm/memcontrol: fix mem_cgroup_enough_memory on cgroup-v2 cgroup: allow to writ

[Devel] [PATCH vz7] ploop: silence ignore discard_granularity vs update in use lockdep warning

2023-08-28 Thread Alexander Atanasov
Lockdep reports circular lock dependency here &p->lock --> &plo->ctl_mutex --> sb_writers. this is only triggered by trinity and it did not happen in real world for the last 10 years. fixing it at this stage is not feasible since it could break so many things. So take the safe route and just disabl

[Devel] [PATCH rh7] vznetstat: fix statistics output when getting stats for same device in parallel

2023-08-28 Thread Konstantin Khorenko
Before this patch .get_stats() for venetdev was not defended from racing, Documentation/networking/netdevices.txt states ndo_get_stats() is to be syncronized by dev_base_lock rwlock, but we do READ stats, so can go in parallel. At the same time the algorithm of gathering per-cpu stats into a singl

Re: [Devel] [PATCH rh7] vznetstat: fix statistics output when getting stats for same device in parallel

2023-08-28 Thread Pavel Tikhomirov
On 28.08.2023 23:54, Konstantin Khorenko wrote: Before this patch .get_stats() for venetdev was not defended from racing, Documentation/networking/netdevices.txt states ndo_get_stats() is to be syncronized by dev_base_lock rwlock, but we do READ stats, so can go in parallel. At the same time