[Devel] [PATCH RH9 v3 5/8] dm/dm-qcow2: add llseek_hole

2023-09-05 Thread Andrey Zhadchenko
Implement llseek_hole() for dm-qcow2 target. Iterate over ranges with cluster granularity until hole or data is found. To reduce code duplication, we should use already existing parse_metadata() We can pretend that seek request is read request for metadata purposes and than interpret parsing result

[Devel] [PATCH RH9 v3 0/8] allow to seek holes in block devices

2023-09-05 Thread Andrey Zhadchenko
We need to be able to know if and where the image is sparse during backups. Implement blockdev and dm infrastructure, add an ability to find holes for dm-qcow2, dm-ploop, dm-push-backup After this patches llseek with SEEK_HOLES and SEEK_DATA can be used with block devices Feature: dm: implement SE

[Devel] [PATCH RH9 v3 1/8] block/fops: add llseek_hole to blockdevops

2023-09-05 Thread Andrey Zhadchenko
Add new function for block_device_operations, which will be used for SEEK_HOLE and SEEK_DATA llseek calls Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop https://jira.vzint.dev/browse/PSBM-145746 Signed-off-by: Andrey Zhadchenko --- v2: fix critical bug: do not (SEEK_HOLE | SEEK_DATA)

[Devel] [PATCH RH9 v3 8/8] dm/dm-ploop: add llseek_hole

2023-09-05 Thread Andrey Zhadchenko
Implement find_hole() for dm-ploop target. Iterate over clusters until we find hole or data by using ploop_bat_entries() which will do all our work Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop https://jira.vzint.dev/browse/PSBM-145746 Signed-off-by: Andrey Zhadchenko --- v3: remove

[Devel] [PATCH RH9 v3 7/8] dm/dm-ploop: allow to check if cluster is locked

2023-09-05 Thread Andrey Zhadchenko
When looking for SEEK_HOLE, we would like to check if cluster is locked without valid pio Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop https://jira.vzint.dev/browse/PSBM-145746 Signed-off-by: Andrey Zhadchenko --- drivers/md/dm-ploop-map.c | 2 +- 1 file changed, 1 insertion(+), 1

[Devel] [PATCH RH9 v3 2/8] dm: add llseek_hole infrastructure

2023-09-05 Thread Andrey Zhadchenko
Add new function to target_type, so any dm devices may realize it Implement intermediate llseek_hole() on device-mapper layer, do some simple checks. Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop https://jira.vzint.dev/browse/PSBM-145746 Signed-off-by: Andrey Zhadchenko --- v2: fix

[Devel] [PATCH RH9 v3 3/8] dm/push_backup: add llseek_hole proxy

2023-09-05 Thread Andrey Zhadchenko
push_backup dm module llseek_hole() should just call the same function from it's origin bdev Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop https://jira.vzint.dev/browse/PSBM-145746 Signed-off-by: Andrey Zhadchenko --- drivers/md/dm-push-backup.c | 12 1 file changed, 12

[Devel] [PATCH RH9 v3 6/8] dm/dm-ploop: reinforce some defines

2023-09-05 Thread Andrey Zhadchenko
Add braces around arguments so callers can use equations while calling these macros. Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop https://jira.vzint.dev/browse/PSBM-145746 Signed-off-by: Andrey Zhadchenko --- drivers/md/dm-ploop.h | 8 1 file changed, 4 insertions(+), 4 de

[Devel] [PATCH RH9 v3 4/8] dm/dm-qcow2: add calc_front_qio_bytes() helper

2023-09-05 Thread Andrey Zhadchenko
Move code that calculates qio front bytes type and amount into a new helper. Increase code clarity. This will be used later for llseek_hole() Feature: dm: implement SEEK_HOLE for dm-qcow2 and dm-ploop https://jira.vzint.dev/browse/PSBM-145746 Signed-off-by: Andrey Zhadchenko --- v3: reworked the

[Devel] [PATCH RHEL7 COMMIT] cgroup_freezer: fix memory allocation context when checking freeze timeouts

2023-09-05 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-1160.99.1.vz7.211.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-1160.99.1.vz7.211.1 --> commit cc4f26d75e24dfe70f62795e9e0f46dd022751d3 Author: Alexander Atanasov Date: Fri Sep 1 15:44:59 2023 +0300 cgr

[Devel] [PATCH RHEL7 COMMIT] ploop: silence lockdep warning in setting discard_granularity via sysfs

2023-09-05 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-1160.99.1.vz7.211.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-1160.99.1.vz7.211.1 --> commit 8c4e10404a5959f22e588379e5440f07e3261b9c Author: Alexander Atanasov Date: Wed Aug 30 20:08:05 2023 +0300 pl

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

2023-09-05 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 (5): cgroup: fix uninitiallized use of ctx->root mm/memcontrol: fix available memory calculation in mem_cgroup_enough_memory

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

2023-09-05 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 v2 1/5] cgroup: fix uninitiallized use of ctx->root

2023-09-05 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 v2 5/5] cgroup: show and allow mounting of cgroup-v2 in containers

2023-09-05 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 v2 2/5] mm/memcontrol: fix available memory calculation in mem_cgroup_enough_memory

2023-09-05 Thread Pavel Tikhomirov
The idea of mem_cgroup_enough_memory check is to return ENOMEM on allocations when container memory cgroup is close to OOM. In vz7 we have: free = memcg->memsw.limit - page_counter_read(&memcg->memsw); In vz9: free = memcg->memsw.max - page_counter_read(&memcg->memory); The error here is mems

[Devel] [PATCH RH9 v2 3/5] mm/memcontrol: fix mem_cgroup_enough_memory on cgroup-v2

2023-09-05 Thread Pavel Tikhomirov
In cgroup-v2 memsw is not used anymore, instead we have swap and memory separated from one another. So let's replace memsw to mem+swap. https://jira.vzint.dev/browse/PSBM-149975 Signed-off-by: Pavel Tikhomirov --- v2: should use mem+swap instead of just mem here --- mm/memcontrol.c | 7 ++-