[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250210105240.FTbUbs_F@linutronix.de>
Date: Mon, 10 Feb 2025 11:52:40 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Shrikanth Hegde <sshegde@...ux.ibm.com>
Cc: linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev,
Ben Segall <bsegall@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Ingo Molnar <mingo@...hat.com>, Juri Lelli <juri.lelli@...hat.com>,
Mel Gorman <mgorman@...e.de>, Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
Valentin Schneider <vschneid@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Will Deacon <will@...nel.org>
Subject: Re: [PATCH v2 1/9] sched: Add a generic function to return the
preemption string.
On 2025-02-08 13:31:27 [+0530], Shrikanth Hegde wrote:
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index 165c90ba64ea9..bd2664755b09a 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -7646,10 +7646,57 @@ PREEMPT_MODEL_ACCESSOR(lazy);
> > #else /* !CONFIG_PREEMPT_DYNAMIC: */
> > +#define preempt_dynamic_mode -1
> > +
> > static inline void preempt_dynamic_init(void) { }
> > #endif /* CONFIG_PREEMPT_DYNAMIC */
> > +const char *preempt_modes[] = {
> > + "none", "voluntary", "full", "lazy", NULL,
> > +};
> > +
> > +const char *preempt_model_str(void)
> > +{
> > + bool brace = IS_ENABLED(CONFIG_PREEMPT_RT) &&
> > + (IS_ENABLED(CONFIG_PREEMPT_DYNAMIC) ||
> > + IS_ENABLED(CONFIG_PREEMPT_LAZY));
> > + static char buf[128];
> > +
> > + if (IS_ENABLED(CONFIG_PREEMPT_BUILD)) {
> > + struct seq_buf s;
> > +
> > + seq_buf_init(&s, buf, 128);
> > + seq_buf_puts(&s, "PREEMPT");
> > +
> > + if (IS_ENABLED(CONFIG_PREEMPT_RT))
> > + seq_buf_printf(&s, "%sRT%s",
> > + brace ? "_{" : "_",
> > + brace ? "," : "");
> > +
> > + if (IS_ENABLED(CONFIG_PREEMPT_DYNAMIC)) {
> > + seq_buf_printf(&s, "(%s)%s",
> > + preempt_dynamic_mode > 0 ?
> > + preempt_modes[preempt_dynamic_mode] : "undef",
> > + brace ? "}" : "");
> > + return seq_buf_str(&s);
> > + }
> > +
> > + if (IS_ENABLED(CONFIG_PREEMPT_LAZY)) {
> > + seq_buf_printf(&s, "LAZY%s",
> > + brace ? "}" : "");
> > + return seq_buf_str(&s);
> > + }
> > +
> > + return seq_buf_str(&s);
> > + }
> > +
> > + if (IS_ENABLED(CONFIG_PREEMPT_VOLUNTARY_BUILD))
> > + return "VOLUNTARY";
> > +
> > + return "NONE";
> > +}
>
> nit: This means when it preempt=full, it is going to show PREEMPT or
> PREEMPT_RT. Maybe that could be put into changelog or add code similar to
> lazy for full as well, so it is easier for user to know if it is in
> preempt=full model. In all other models, there is a suffix like PREEMPTLAZY.
> Dynamic modes looks good.
Sorry, I can't follow. With PREEMPT_RT enabled, it will show einer
PREEMPT or PREEMPT_RT. It will add lazy if you pass preempt=lazy. It is
either 'full' or 'lazy'.
You can't have VOLUNTARY+lazy or VOLUNTARY+RT.
What do I miss?
Sebastian
Powered by blists - more mailing lists