From nobody Mon Dec 1 22:02:15 2025 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A110B3101BF for ; Mon, 1 Dec 2025 12:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764592944; cv=none; b=aurJQcp93UXLBYeJDOf1a6XF6QduMOde5RKhzB7VEqjpMXqurwX7zfQPLmlsbUXqzWqYtI/Ay5ZI7xZTZ7LUDqif+9sQ0HteQmGHuPGDazQkFeIyv813ge99W3nAybXSIQxyA2jY6STHbuMLR8MwWIYVSOIwt/pLrjwTC5O/HBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764592944; c=relaxed/simple; bh=kRAV6Sip3ySWqNXeYhykc+OTIYsWrhmYevq/Ew7UNKE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nk5P3sCK/E0r6YPTm46KSP/g/uUvvmX+pbtBB6dJxgTUJ6LTAIM7Z8+Ix+AqDqVjMMfhqm15TFP4WfTAWZ8cZgZj+2Ej67NtXV86Pj05epeCuR0qbb1idYRRWvX1TtKUb0riit5WNbO69CznzNstbKw3LFTD/qwYfUFR8D4ilLo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PiiK99UR; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PiiK99UR" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-b734fcbf1e3so503911266b.3 for ; Mon, 01 Dec 2025 04:42:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764592941; x=1765197741; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VfOen1xVY5o2YZPHr+01crG7DyOloUam5Y6+uPIg3QY=; b=PiiK99UR3qqBEFID0pIKWiFAD4iVDqHfEKe9uA0sKQDzUyJInOVSSiQm1qhkjUHhEM E1lxc/3g2TwofIVPSTpJoRZkdC9olxNzzh+eXHj8JfaelKQcbYe56HSkZTqqapcVCCAx A3+Dnyr1UAImtvPIDFIfWA4kFPcHQewSrOuyFXYjzRqcBau8GUM00XM8u39v88f3Nxkq V/P+MZuvTRAMaI5IVi42irETvgwrFZefVxTmrAJcFpSYWtYCy5kpD9nF6tCdIOPBXSkL EuUOruvhqg1c6qlua0iCuQNwDkcEwXY4o7aA1ZB9ahBWtjNH95IViiei6P/Qlnfi7r78 fYZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764592941; x=1765197741; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VfOen1xVY5o2YZPHr+01crG7DyOloUam5Y6+uPIg3QY=; b=dCd6FrOWKC7dUfE/LMA/SsxWxK6L4YkX0jBsYBYgJE/miJlC1qibx/lus7OCsZvN7C s2wy5pHfBP3IriwGbVJfWVDc1eGiXKzuOkWsVUyTUXEo7ueoYHp+oWgRF9SL88hTJta5 N9DI6ctKiXgYGWiaUppOMZ+eZE73i9ap9+OiGyKRhky2T7Gm0dIM7o7CQBTffBuJ1+PT co5gx6bE6lJ4BrraXzDbosS0ZkacyxR7szG7aDW8hCbWp2hERHoIIJC7EAo+z+lKNdUP MbjqLtLmLEiR4IAA6qwBjf+nbEqzVRZ5eKm/FJWtT2M3iL0d4TtovWTeYG3Jyb6kejcx ZtPQ== X-Gm-Message-State: AOJu0Yzdp3YVKzkyYjmKpScxTHINLOKK4Q6GWCtMZy6dtYpN3v/MqJpD WVJE305ixwwMyKP0U5qjINZJjaUdbHlrXdelpRPJigwKs/+gij3fv96x X-Gm-Gg: ASbGncuad4mrSospnKThKt8G0eJRiDnJfcK9TwGLwXXcoAMzEj39CK36zecOe7iQNrR EqpGZMuaygfuP8w7LIdZ6vq5FiD5TbiVaUF0FBb0U+LHYgtrv44Qmws20VKMatNXYxW9wpHgTlb hl0a8c9fvC0oqDTn4/EAR9dcktERx4rkljxGrhq36A4DIOVm94YxBGKjnQ7IJd48RcC/Z7W0J19 Zjg0AnfPV56Ci9DI2oF39+KK+46vaIks3xs3lQHypTUltIZGUUNr7A2SMTovGoBCKGwJndK899q oCHgDo/U2Un3rUZmxMEtp+Xs3SK+jY5ahXvmG4Sc5q8qQZTk3f7dki5G9UvnfpFbK0MeMsZcRVB EckhcZe8yYui03PHEnbrIIf94kTvPwf3cZhQloaWEJQdvJ1QpzxIbbsx7mRq4FPVRhyAJJ62D8/ 3q+X2a9oNR X-Google-Smtp-Source: AGHT+IFdNSsgg3zRaL/0BOhdvYKvXkkw/hl5etSqVwSeQlm5MysW2vLwi3lhern/ERSLTj7Ef2fVCg== X-Received: by 2002:a17:907:948e:b0:b76:6aca:f1f3 with SMTP id a640c23a62f3a-b7671589e26mr4355707166b.19.1764592940736; Mon, 01 Dec 2025 04:42:20 -0800 (PST) Received: from victus-lab ([193.205.81.5]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b76f59e8612sm1173738266b.52.2025.12.01.04.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Dec 2025 04:42:20 -0800 (PST) From: Yuri Andriaccio To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider Cc: linux-kernel@vger.kernel.org, Luca Abeni , Yuri Andriaccio Subject: [RFC PATCH v4 15/28] sched/rt: Allow zeroing the runtime of the root control group Date: Mon, 1 Dec 2025 13:41:48 +0100 Message-ID: <20251201124205.11169-16-yurand2000@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251201124205.11169-1-yurand2000@gmail.com> References: <20251201124205.11169-1-yurand2000@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In HCBS, the root control group follows the already existing rules for rt-task scheduling. As such, it does not make use of the deadline servers to account for runtime, or any other HCBS specific code and features. While the runtime of SCHED_DEADLINE tasks depends on the global bandwidth reserved for rt_tasks, the runtime of SCHED_FIFO/SCHED_RR tasks is limited by the activation of fair-servers (as the RT_THROTTLING mechanism has been removed in favour of them), thus their maximum bandwidth depends solely on the fair-server settings (which are thightly related to the global bandwidth reserved for rt-tasks) and the amount of SCHED_OTHER workload to run (recall that if no SCHED_OTHER tasks are running, the FIFO/RR tasks may fully utilize the CPU). The values of runtime and period in the root cgroup's cpu controller do not affect, by design of HCBS, the fair-server settings and similar (consequently they do not affect the scheduling of FIFO/RR tasks in the root cgroup), but they are just used to reserve a portion of the SCHED_DEADLINE bandwidth to the scheduling of rt-cgroups. These values only affect child cgroups, their deadline servers and their assigned FIFO/RR tasks. Signed-off-by: Yuri Andriaccio --- kernel/sched/rt.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index b0a6da20b5..928f53c1b0 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2134,13 +2134,6 @@ static int tg_set_rt_bandwidth(struct task_group *tg, static DEFINE_MUTEX(rt_constraints_mutex); int i, err =3D 0; - /* - * Disallowing the root group RT runtime is BAD, it would disallow the - * kernel creating (and or operating) RT threads. - */ - if (tg =3D=3D &root_task_group && rt_runtime =3D=3D 0) - return -EINVAL; - /* No period doesn't make any sense. */ if (rt_period =3D=3D 0) return -EINVAL; @@ -2227,6 +2220,10 @@ static int sched_rt_global_constraints(void) int sched_rt_can_attach(struct task_group *tg) { + /* Allow executing in the root cgroup regardless of allowed bandwidth */ + if (tg =3D=3D &root_task_group) + return 1; + /* Don't accept real-time tasks when there is no way for them to run */ if (rt_group_sched_enabled() && tg->dl_bandwidth.dl_runtime =3D=3D 0) return 0; -- 2.51.0