linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/features: Expand the space of sched features
@ 2022-08-01  9:46 Cruz Zhao
  2022-08-01 12:46 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Cruz Zhao @ 2022-08-01  9:46 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid
  Cc: linux-kernel

With the increase of sched features, the available space decreases
gradually. In order to prevent features overflow, this patch expands
the space of sched features from 32 to 64.

Signed-off-by: Cruz Zhao <CruzZhao@linux.alibaba.com>
---
 kernel/sched/core.c  | 2 +-
 kernel/sched/sched.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 1899990..afe76fb 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -122,7 +122,7 @@
  */
 #define SCHED_FEAT(name, enabled)	\
 	(1UL << __SCHED_FEAT_##name) * enabled |
-const_debug unsigned int sysctl_sched_features =
+const_debug u64 sysctl_sched_features =
 #include "features.h"
 	0;
 #undef SCHED_FEAT
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index a6f071b..ac97f0a 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1999,7 +1999,7 @@ enum {
  * To support run-time toggling of sched features, all the translation units
  * (but core.c) reference the sysctl_sched_features defined in core.c.
  */
-extern const_debug unsigned int sysctl_sched_features;
+extern const_debug u64 sysctl_sched_features;
 
 #ifdef CONFIG_JUMP_LABEL
 #define SCHED_FEAT(name, enabled)					\
@@ -2029,7 +2029,7 @@ enum {
  */
 #define SCHED_FEAT(name, enabled)	\
 	(1UL << __SCHED_FEAT_##name) * enabled |
-static const_debug __maybe_unused unsigned int sysctl_sched_features =
+static const_debug __maybe_unused u64 sysctl_sched_features =
 #include "features.h"
 	0;
 #undef SCHED_FEAT
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sched/features: Expand the space of sched features
  2022-08-01  9:46 [PATCH] sched/features: Expand the space of sched features Cruz Zhao
@ 2022-08-01 12:46 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2022-08-01 12:46 UTC (permalink / raw)
  To: Cruz Zhao
  Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid, linux-kernel


* Cruz Zhao <CruzZhao@linux.alibaba.com> wrote:

> With the increase of sched features, the available space decreases
> gradually. In order to prevent features overflow, this patch expands
> the space of sched features from 32 to 64.
> 
> Signed-off-by: Cruz Zhao <CruzZhao@linux.alibaba.com>
> ---
>  kernel/sched/core.c  | 2 +-
>  kernel/sched/sched.h | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 1899990..afe76fb 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -122,7 +122,7 @@
>   */
>  #define SCHED_FEAT(name, enabled)	\
>  	(1UL << __SCHED_FEAT_##name) * enabled |
> -const_debug unsigned int sysctl_sched_features =
> +const_debug u64 sysctl_sched_features =


Have you run into this? We have 27 features listed, so this shouldn't be 
happening right now - and this patch just bloats the word for no good 
reason.

Also, doesn't it generate a build warning/error in that case?

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-01 12:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-01  9:46 [PATCH] sched/features: Expand the space of sched features Cruz Zhao
2022-08-01 12:46 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).