From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout07.his.huawei.com (canpmsgout07.his.huawei.com [113.46.200.222]) (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 600203B42FD for ; Wed, 1 Jul 2026 08:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.222 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782894541; cv=none; b=AMXtmW01+elB4+YznrXFzyF66D5gGtJXD3oMNpZkIEEP/NLp0xJe55N5BAlHjyaD899ptCrb6TDV9f7dSkT2eS8rWPTZG1GzcwB9/6e0stXD+LiEnLDNLs2FSX+1QhMJhTonJC28pUIfvVQVTrDvdK+i+2G1kw+jA7pbS17fqrw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782894541; c=relaxed/simple; bh=bGXIfGnR8DQcFsk7JbIOSY3QbzQznRrXvNO+imS6UcE=; h=Message-ID:Date:MIME-Version:Subject:From:To:CC:References: In-Reply-To:Content-Type; b=h0VGzPZpNGQiceK35dgJBoL/Z72vNnWEqWl0/hdPQzy1Ju1jaW2+m3OR3ccQMBOuQJgec0hiZ+YpBwvGYrdtmhO+0UUugTQXpoM20jGPOZRb05cMfRPLi/FDylkNpGsA6zeb7UPnMCcDRHHWb9+985Ytjp4FeibsySNrWMvFXiM= 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=JRFi7u95; arc=none smtp.client-ip=113.46.200.222 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="JRFi7u95" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=QRTjIRrqOOrvyjbs1op2K8r3kh4MkCIhbQpfKZPkTzY=; b=JRFi7u952+SVkK1WHbjGGKzWlU0tvZyEosNo0azk1oov3h7uqAJTD2idMzD3UppcxhWtR0HiT 9hPJdHdAmq4MLZ/k72XPxC4avjaAxB8e1wI6f/h3QSNZV3SAJ2wPZrbPaDc94KTz6aNoNi3AA9m Hw8ELK44OSvtdEE1HYpfyUE= Received: from mail.maildlp.com (unknown [172.19.163.200]) by canpmsgout07.his.huawei.com (SkyGuard) with ESMTPS id 4gqtGl3VvNzLlSC; Wed, 1 Jul 2026 16:19:43 +0800 (CST) Received: from kwepemr500016.china.huawei.com (unknown [7.202.195.68]) by mail.maildlp.com (Postfix) with ESMTPS id 2984D40575; Wed, 1 Jul 2026 16:28:53 +0800 (CST) Received: from [10.67.111.161] (10.67.111.161) 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, 1 Jul 2026 16:28:52 +0800 Message-ID: <99b284ff-f968-42e8-b03e-d320cf0f9407@huawei.com> Date: Wed, 1 Jul 2026 16:28:51 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] In cgroup v2, setting a smaller value for sched_rt_runtime_us fails. From: chenjinghuang 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 References: <20260625110323.2980246-1-chenjinghuang2@huawei.com> In-Reply-To: <20260625110323.2980246-1-chenjinghuang2@huawei.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemr500016.china.huawei.com (7.202.195.68) On 6/25/2026 7:03 PM, Chen Jinghuang wrote: > 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 > Sorry, I forgot that sched_rt_runtime_us is currently set to 1000000, so it should be the following case: # cat /proc/sys/kernel/sched_rt_runtime_us 1000000 # 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-chenjinghuang2@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; > + > + u64 period = global_rt_period(); > + u64 runtime = global_rt_runtime(); > > scoped_guard(mutex, &rt_constraints_mutex) > - return __rt_schedulable(NULL, 0, 0); > + return __rt_schedulable(&root_task_group, period, runtime); > #endif > return 0; > } Gently ping!