[Devel] [PATCH VZ10 7/8] ve/cgroup: expose ve.mnt_nr cgroup file
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Wed Apr 29 16:41:41 MSK 2026
Expose the existing per-ve atomic ve->mnt_nr counter as a read-only
ve.mnt_nr cgroup file, alongside ve.netns_avail_nr.
The counter is bumped/decremented by ve_mount_nr_inc/dec for every
mount accounted to this ve; until now it was only readable from
kernel space. Exposing it lets userspace and selftests observe per-ve
mount accounting for diagnostics and regression coverage of
clone(CLONE_NEWVE | CLONE_NEWNS) ownership wiring.
https://virtuozzo.atlassian.net/browse/VSTOR-129744
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Feature: ve: ve generic structures
---
kernel/ve/ve.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 106fc225c60d..198c82f010cc 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -1276,6 +1276,11 @@ static u64 ve_netns_avail_nr_read(struct cgroup_subsys_state *css, struct cftype
return atomic_read(&css_to_ve(css)->netns_avail_nr);
}
+static u64 ve_mnt_nr_read(struct cgroup_subsys_state *css, struct cftype *cft)
+{
+ return atomic_read(&css_to_ve(css)->mnt_nr);
+}
+
static u64 ve_netif_max_nr_read(struct cgroup_subsys_state *css, struct cftype *cft)
{
return css_to_ve(css)->netif_max_nr;
@@ -1762,6 +1767,10 @@ static struct cftype ve_cftypes[] = {
.name = "netns_avail_nr",
.read_u64 = ve_netns_avail_nr_read,
},
+ {
+ .name = "mnt_nr",
+ .read_u64 = ve_mnt_nr_read,
+ },
{
.name = "netif_max_nr",
.flags = CFTYPE_NOT_ON_ROOT,
--
2.53.0
More information about the Devel
mailing list