From: Peter Zijlstra <peterz@infradead.org>
To: yaozhenguo <yaozhenguo1@gmail.com>
Cc: mingo@redhat.com, vincent.guittot@linaro.org,
linux-kernel@vger.kernel.org, yaozhenguo@jd.com
Subject: Re: [PATCH] sched: change MAX_SHARES to NR_CPUS
Date: Tue, 12 Aug 2025 12:00:35 +0200 [thread overview]
Message-ID: <20250812100035.GG4067720@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250812092810.38728-1-yaozhenguo@jd.com>
On Tue, Aug 12, 2025 at 05:28:10PM +0800, yaozhenguo wrote:
> From: ZhenguoYao <yaozhenguo1@gmail.com>
>
> As the number of cores in modern CPUs continues to increase,
> 256 * 1024 is no longer sufficient to meet the requirements.
> Therefore, MAX_SHARES is being modified to NR_CPUS * 1024.
You forgot to explain why this needs to scale with CPUs, you also forgot
to provide an argument for why this will not introduce numerical issues.
> Signed-off-by: ZhenguoYao <yaozhenguo1@gmail.com>
> ---
> 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 be9745d104f7..5c219e34f48d 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -510,7 +510,7 @@ struct task_group {
> * limitation from this.)
> */
> #define MIN_SHARES (1UL << 1)
> -#define MAX_SHARES (1UL << 18)
> +#define MAX_SHARES (NR_CPUS * 1024UL)
> #endif
>
> typedef int (*tg_visitor)(struct task_group *, void *);
> --
> 2.43.5
>
next prev parent reply other threads:[~2025-08-12 10:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 9:28 [PATCH] sched: change MAX_SHARES to NR_CPUS yaozhenguo
2025-08-12 10:00 ` Peter Zijlstra [this message]
2025-08-12 12:04 ` Zhenguo Yao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250812100035.GG4067720@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=vincent.guittot@linaro.org \
--cc=yaozhenguo1@gmail.com \
--cc=yaozhenguo@jd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox