From nobody Tue Dec 16 20:02:14 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F19A5C71145 for ; Thu, 24 Aug 2023 04:39:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239012AbjHXEj1 (ORCPT ); Thu, 24 Aug 2023 00:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238980AbjHXEiu (ORCPT ); Thu, 24 Aug 2023 00:38:50 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4BA810E4 for ; Wed, 23 Aug 2023 21:38:47 -0700 (PDT) Received: from kwepemm600010.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RWVfy1kvRzrSK3; Thu, 24 Aug 2023 12:37:14 +0800 (CST) Received: from huawei.com (10.175.101.6) by kwepemm600010.china.huawei.com (7.193.23.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 24 Aug 2023 12:38:44 +0800 From: Liu Chao To: CC: , , , , , , Subject: [PATCH] sched: Increase MAX_SHARES Date: Thu, 24 Aug 2023 05:37:53 +0100 Message-ID: <20230824043753.2049500-1-liuchao173@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600010.china.huawei.com (7.193.23.86) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When the number of CPUs is large, such as 320 CPUs, create two cgroups in /sys/fs/cgroup/cpu/: system.slice and machine.slice. system.slice uses 0.5 CPU, and machine.slice uses the reset 319.5 CPUs. The cpu.shares of system.slice is set to 1024 by default, so in order to achieve this effect, machine.slice needs to be set to 319.5 * 1024 / 0.5 =3D 654336, which is greater than 1<<18, so it is increased to 1<<20. Signed-off-by: Liu Chao --- kernel/sched/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 0f871e9b169c..2cc1cc7dd71a 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -482,7 +482,7 @@ struct task_group { * limitation from this.) */ #define MIN_SHARES (1UL << 1) -#define MAX_SHARES (1UL << 18) +#define MAX_SHARES (1UL << 20) #endif =20 typedef int (*tg_visitor)(struct task_group *, void *); --=20 2.23.0