From nobody Thu Apr 2 15:44:06 2026 Received: from canpmsgout08.his.huawei.com (canpmsgout08.his.huawei.com [113.46.200.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F02FE285CBA for ; Wed, 11 Feb 2026 02:32:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770777181; cv=none; b=Y+LnHzfCM/9uFGQuKitC4Drj0UbclxOM7ht7jQvv+PWym4qk052YPuJElcjUFGPK7aaYw+qes3D6k3xQ6tEryNdvGFSm40CSENhvOeE9azP8QW18lmu4bSDmb4qRXyXjVgb9ju5gonthqv/z1hERoA/7Ao3Zfj7uOAliUTnR7iw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770777181; c=relaxed/simple; bh=Q6fuDK0P+N81TkjipX0GoT44QBRWhR49PbTr1JHPkRY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=p151VynUJWh5Dlp/wX1q8hjIIMB9ix7+rdpBKekRegNOYckvBCid0rxzwJ0/I9t0JigZ7Hv2Eg1Ic/Qk8CFDC6qslxC9Oe6ISMwB4p67F20Yi/gbuHJrL+Sfy3mQ7cOGql257zj1IOSScyDpAzF3JExZt8YNq0crM6muw4iNfQE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=OTIQ0wJE; arc=none smtp.client-ip=113.46.200.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="OTIQ0wJE" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=/G0zPQ+Ha/eVnvh4a1jDNVdVKvblA2MfX3viyYbYik4=; b=OTIQ0wJEpwVo3fnwFAMk1JBgkhYWktAy4Ej1w98ZLPb1x7Z4eZEAWxTdI7v6OhWvqKBMPAoZ4 J7jMP1cTrkeMhOkFvbaYWj6SflkhrdKovKvrUgzZ9qDUDYoRLdr458vaSynEJPDzuwLHhGwnBGK Qsf+QMssBbM3JPvAHolAv38= Received: from mail.maildlp.com (unknown [172.19.163.163]) by canpmsgout08.his.huawei.com (SkyGuard) with ESMTPS id 4f9j5l3bs6zmV67; Wed, 11 Feb 2026 10:28:11 +0800 (CST) Received: from kwepemr500016.china.huawei.com (unknown [7.202.195.68]) by mail.maildlp.com (Postfix) with ESMTPS id 920C240565; Wed, 11 Feb 2026 10:32:50 +0800 (CST) Received: from huawei.com (10.67.174.242) by kwepemr500016.china.huawei.com (7.202.195.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 11 Feb 2026 10:32:49 +0800 From: Chen Jinghuang To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot CC: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Subject: [RESEND] In cgroup v2, setting a smaller value for sched_rt_runtime_us fails. Date: Wed, 11 Feb 2026 02:12:15 +0000 Message-ID: <20260211021215.3610597-1-chenjinghuang2@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems500002.china.huawei.com (7.221.188.17) To kwepemr500016.china.huawei.com (7.202.195.68) For example: # cat /proc/sys/kernel/sched_rt_runtime_us 950000 # echo 940000 > /proc/sys/kernel/sched_rt_runtime_us -bash: echo: write error: Invalid argument This occurs because when the global RT quota is reduced while the root cgroup=E2=80=99s ratio remains unchanged, the root cgroup=E2=80=99s proport= ion ends up exceeding the global RT ratio. This is unreasonable: the root cgroup=E2=80= =99s ratio should be updated when the global RT ratio changes. This patch ensures the root cgroup=E2=80=99s RT quota is adjusted whenever = the global RT quota is modified. Signed-off-by: Chen Ridong Signed-off-by: Chen Jinghuang Tested-by: Madadi Vineeth Reddy --- kernel/sched/rt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index f1867fe8e5c5..30770ba7be4e 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2814,9 +2814,11 @@ long sched_group_rt_period(struct task_group *tg) static int sched_rt_global_constraints(void) { int ret =3D 0; + u64 period =3D global_rt_period(); + u64 runtime =3D global_rt_runtime(); =20 mutex_lock(&rt_constraints_mutex); - ret =3D __rt_schedulable(NULL, 0, 0); + ret =3D __rt_schedulable(&root_task_group, period, runtime); mutex_unlock(&rt_constraints_mutex); =20 return ret; @@ -2856,6 +2858,14 @@ static int sched_rt_global_validate(void) =20 static void sched_rt_do_global(void) { +#ifdef CONFIG_RT_GROUP_SCHED + if (!rt_group_sched_enabled()) + return; + + WARN_ON_ONCE(tg_set_rt_bandwidth(&root_task_group, + global_rt_period(), + global_rt_runtime())); +#endif } =20 static int sched_rt_handler(const struct ctl_table *table, int write, void= *buffer, --=20 2.34.1