Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
dba6fb891c
2 muutettua tiedostoa jossa 9 lisäystä ja 26 poistoa
  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) {
 	FILE *f;
 	int res = -1;
-	const char *cgroup_task_fname = NULL;
 
 	/*
 	 * /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");
 	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);
 
-	f = fopen(cgroup_task_fname, "w");
+	f = fopen("/sys/fs/cgroup/cpu/tasks", "w");
 	if (f == NULL) {
 		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) 2006-2021 Red Hat, Inc.
+.\" * Copyright (c) 2006-2020 Red Hat, Inc.
 .\" *
 .\" * All rights reserved.
 .\" *
@@ -32,7 +32,7 @@
 .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" * 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
 corosync.conf - corosync executive configuration file
 
@@ -800,14 +800,8 @@ meaning maximal / minimal priority (so minimal / maximal nice value).
 .TP
 move_to_root_cgroup
 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
 allow_knet_handle_fallback