[Devel] [PATCH RHEL7 COMMIT] ve: remove fairsched node only in the legacy mode

Konstantin Khorenko khorenko at virtuozzo.com
Fri May 29 04:45:19 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.7
------>
commit 72bcfd69eb80e5ca7624a6c0665494990fd06faf
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Fri May 29 15:45:19 2015 +0400

    ve: remove fairsched node only in the legacy mode
    
    Currently, we try and fail to remove the fairsched node of a UUID-named
    container from the kernel on stop:
    
      CT: 956ebfc3-3ca9-44e0-9739-ab8abbe50edc: started
      Can't remove fairsched node 1073741823 err=-2
      CT: 956ebfc3-3ca9-44e0-9739-ab8abbe50edc: stopped
    
    We should only do that for containers created via the legacy API (vzctl
    ioctl), because for UUID-named containers this is a duty of vzctl.
    
    https://jira.sw.ru/browse/PSBM-33833
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
    Acked-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 include/linux/ve.h  | 3 +++
 kernel/ve/vecalls.c | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/linux/ve.h b/include/linux/ve.h
index 8b70dbe..0029f57 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -40,6 +40,9 @@ struct ve_struct {
 	struct list_head	ve_list;
 
 	envid_t			veid;
+	bool			legacy;	/* created using the legacy API
+					   (vzctl ioctl - see do_env_create) */
+
 	unsigned int		class_id;
 	struct rw_semaphore	op_sem;
 	int			is_running;
diff --git a/kernel/ve/vecalls.c b/kernel/ve/vecalls.c
index 73ae9ef..32646b1 100644
--- a/kernel/ve/vecalls.c
+++ b/kernel/ve/vecalls.c
@@ -447,6 +447,7 @@ static int do_env_create(envid_t veid, unsigned int flags, u32 class_id,
 		goto err_devperms;
 
 	ve = cgroup_ve(ve_cgroup);
+	ve->legacy = true;
 
 	init_ve_struct(ve, class_id, data, datalen);
 
@@ -638,7 +639,7 @@ static void vzmon_stop_notifier(void *data)
 {
 	struct ve_struct *ve = data;
 
-	if (ve->veid)
+	if (ve->legacy)
 		fairsched_drop_node(ve->veid, 0);
 }
 



More information about the Devel mailing list