Browse Source

Revert "main: Add support for cgroup v2"

This reverts commit 57e6b86b53010dd2612b0a6a4e04917673062ecf.

We are in process of finding better solution so reverting for now.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Jan Friesse 4 years ago
parent
commit
dba6fb891c
2 changed files with 9 additions and 26 deletions
  1. 5 16
      exec/main.c
  2. 4 10
      man/corosync.conf.5

+ 5 - 16
exec/main.c

@@ -1173,7 +1173,6 @@ error_close:
 static int corosync_move_to_root_cgroup(void) {
 static int corosync_move_to_root_cgroup(void) {
 	FILE *f;
 	FILE *f;
 	int res = -1;
 	int res = -1;
-	const char *cgroup_task_fname = NULL;
 
 
 	/*
 	/*
 	 * /sys/fs/cgroup is hardcoded, because most of Linux distributions are now
 	 * /sys/fs/cgroup is hardcoded, because most of Linux distributions are now
@@ -1184,25 +1183,15 @@ static int corosync_move_to_root_cgroup(void) {
 	 */
 	 */
 	f = fopen("/sys/fs/cgroup/cpu/cpu.rt_runtime_us", "rt");
 	f = fopen("/sys/fs/cgroup/cpu/cpu.rt_runtime_us", "rt");
 	if (f == NULL) {
 	if (f == NULL) {
-		/*
-		 * Try cgroup v2
-		 */
-		f = fopen("/sys/fs/cgroup/cgroup.procs", "rt");
-		if (f == NULL) {
-			log_printf(LOG_DEBUG, "cpu.rt_runtime_us or cgroup.procs doesn't exist -> "
-			    "system without cgroup or with disabled CONFIG_RT_GROUP_SCHED");
+		log_printf(LOGSYS_LEVEL_DEBUG, "cpu.rt_runtime_us doesn't exists -> "
+		    "system without cgroup or with disabled CONFIG_RT_GROUP_SCHED");
 
 
-			res = 0;
-			goto exit_res;
-		} else {
-			cgroup_task_fname = "/sys/fs/cgroup/cgroup.procs";
-		}
-	} else {
-		cgroup_task_fname = "/sys/fs/cgroup/cpu/tasks";
+		res = 0;
+		goto exit_res;
 	}
 	}
 	(void)fclose(f);
 	(void)fclose(f);
 
 
-	f = fopen(cgroup_task_fname, "w");
+	f = fopen("/sys/fs/cgroup/cpu/tasks", "w");
 	if (f == NULL) {
 	if (f == NULL) {
 		log_printf(LOGSYS_LEVEL_WARNING, "Can't open cgroups tasks file for writing");
 		log_printf(LOGSYS_LEVEL_WARNING, "Can't open cgroups tasks file for writing");
 
 

+ 4 - 10
man/corosync.conf.5

@@ -1,6 +1,6 @@
 .\"/*
 .\"/*
 .\" * Copyright (c) 2005 MontaVista Software, Inc.
 .\" * Copyright (c) 2005 MontaVista Software, Inc.
-.\" * Copyright (c) 2006-2021 Red Hat, Inc.
+.\" * Copyright (c) 2006-2020 Red Hat, Inc.
 .\" *
 .\" *
 .\" * All rights reserved.
 .\" * All rights reserved.
 .\" *
 .\" *
@@ -32,7 +32,7 @@
 .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" * THE POSSIBILITY OF SUCH DAMAGE.
 .\" * THE POSSIBILITY OF SUCH DAMAGE.
 .\" */
 .\" */
-.TH COROSYNC_CONF 5 2021-05-03 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
+.TH COROSYNC_CONF 5 2021-04-09 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
 .SH NAME
 .SH NAME
 corosync.conf - corosync executive configuration file
 corosync.conf - corosync executive configuration file
 
 
@@ -800,14 +800,8 @@ meaning maximal / minimal priority (so minimal / maximal nice value).
 .TP
 .TP
 move_to_root_cgroup
 move_to_root_cgroup
 Should be set to yes (default) if corosync should try to move itself to root
 Should be set to yes (default) if corosync should try to move itself to root
-cgroup. This feature is available only for systems with cgroups v1 with RT
-sched enabled (Linux with CONFIG_RT_GROUP_SCHED kernel option) and cgroups v2.
-
-It's worth noting that currently (May 3 2021) cgroup2 doesn’t yet
-support control of realtime processes and the cpu controller can only be
-enabled when all RT processes are in the root cgroup. So when move_to_root_cgroup
-is disabled and systemd is used, it may be impossible to make systemd options
-like CPUQuota working correctly until corosync is stopped.
+cgroup. This feature is available only for systems with cgroups with RT
+sched enabled (Linux with CONFIG_RT_GROUP_SCHED kernel option).
 
 
 .TP
 .TP
 allow_knet_handle_fallback
 allow_knet_handle_fallback