From nobody Mon Jun 29 15:22:42 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 27CC836A34F for ; Thu, 25 Jun 2026 11:26:54 +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=1782386816; cv=none; b=ryQcOaJbyZAAZDdFsld3QPTrQ5lJIUqHU91bsA8cRXAXVtijZ0sAB6kjylzH9V3vxg1Jz4gufRXn5MsGl7hua7prYh4v1yObthHd49Xt2BARM7S83uA08UyoN3mDRNGCNmtIdx3IPihJ9N1Jw7zhefldAOJw0LJ16LrCn8Geq2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782386816; c=relaxed/simple; bh=CVllByFDeTExdIggVAqYAQlEkmxFqkHJ6QyE6pmn5qg=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=BmeOcMQ8iocL6JmZdzQDuHQwOv8DaTvTW2PfBbpqLbvIkZ5cumMF+Wn/xFXNeBKH5ryQxZYyT+SsvRTWW1FhwZ1btS0I4B7dJ6cCWpRDTWhTaAyanbwgKgj89R5V9chS9IQc0w57Rffy0KwsKR6/AKNxiaWtZxXQGK0+kIL8G6I= 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=oN2Hv/iB; 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="oN2Hv/iB" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=0NlMPBuHeQSUNDNX3zeOhUZyEJQwDqeeJRpfhEWeVYI=; b=oN2Hv/iBfFjs4hbnB3t5nyqn5seCUYo4ChabLzmQzgdFtt5/FByLpCWyaEO9uZtf4iJddCmQC 8wfeV/LQiHDgNcRFXc14tF7cJFsARSGZzDEgO6HzuRlslW5wa9IC7WDVhtIdgGNZErvlws1+8/9 /hQu7tt3kf6JW+w5q4rpb6Q= Received: from mail.maildlp.com (unknown [172.19.163.15]) by canpmsgout08.his.huawei.com (SkyGuard) with ESMTPS id 4gmGVq10kgzmV6k; Thu, 25 Jun 2026 19:17:39 +0800 (CST) Received: from kwepemr500016.china.huawei.com (unknown [7.202.195.68]) by mail.maildlp.com (Postfix) with ESMTPS id 53A8F40571; Thu, 25 Jun 2026 19:26:45 +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; Thu, 25 Jun 2026 19:26:44 +0800 From: Chen Jinghuang To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot CC: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , , Ridong Chen , Madadi Vineeth Reddy Subject: [PATCH v2] In cgroup v2, setting a smaller value for sched_rt_runtime_us fails. Date: Thu, 25 Jun 2026 11:03:23 +0000 Message-ID: <20260625110323.2980246-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-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemr500016.china.huawei.com (7.202.195.68) Content-Type: text/plain; charset="utf-8" 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 With CONFIG_RT_GROUP_SCHED enabled, reducing the global RT quota causes the unchanged root cgroup quota to exceed the new global limit. The root cgroup quota should be updated accordingly when the global quota changes. Adjust the root cgroup's RT quota whenever the global RT quota is modified. Signed-off-by: Chen Jinghuang Reviewed-by: Ridong Chen Tested-by: Madadi Vineeth Reddy --- Change since v1: https://lore.kernel.org/all/20260320013419.2493925-1-chenj= inghuang2@huawei.com/ - Rebase the patch onto mainline. --- kernel/sched/rt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index e474c31d8fe6..b1b082e365af 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2858,9 +2858,12 @@ static int sched_rt_global_validate(void) #ifdef CONFIG_RT_GROUP_SCHED if (!rt_group_sched_enabled()) return 0; +=09 + u64 period =3D global_rt_period(); + u64 runtime =3D global_rt_runtime(); =20 scoped_guard(mutex, &rt_constraints_mutex) - return __rt_schedulable(NULL, 0, 0); + return __rt_schedulable(&root_task_group, period, runtime); #endif return 0; } --=20 2.34.1