linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/isolation: Allow "isolcpus=" to skip unknown sub-parameters
@ 2020-02-04 16:16 Peter Xu
  2020-02-05 12:27 ` Ming Lei
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Peter Xu @ 2020-02-04 16:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: peterx, Ming Lei, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Luiz Capitulino, Thomas Gleixner

The "isolcpus=" parameter allows sub-parameters to exist before the
cpulist is specified, and if it sees unknown sub-parameters the whole
parameter will be ignored.  This design is incompatible with itself
when we add more sub-parameters to "isolcpus=", because the old
kernels will not recognize the new "isolcpus=" sub-parameters, then it
will invalidate the whole parameter so the CPU isolation will not
really take effect if we start to use the new sub-parameters while
later we reboot into an old kernel. Instead we will see this when
booting the old kernel:

    isolcpus: Error, unknown flag

The better and compatible way is to allow "isolcpus=" to skip unknown
sub-parameters, so that even if we add new sub-parameters to it the
old kernel will still be able to behave as usual even if with the new
sub-parameter is specified.

Ideally this patch should be there when we introduce the first
sub-parameter for "isolcpus=", so it's already a bit late.  However
late is better than nothing.

CC: Ming Lei <ming.lei@redhat.com>
CC: Ingo Molnar <mingo@redhat.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Juri Lelli <juri.lelli@redhat.com>
CC: Luiz Capitulino <lcapitulino@redhat.com>
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 kernel/sched/isolation.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 008d6ac2342b..d5defb667bbc 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -169,8 +169,12 @@ static int __init housekeeping_isolcpus_setup(char *str)
 			continue;
 		}
 
-		pr_warn("isolcpus: Error, unknown flag\n");
-		return 0;
+		str = strchr(str, ',');
+		if (str)
+			/* Skip unknown sub-parameter */
+			str++;
+		else
+			return 0;
 	}
 
 	/* Default behaviour for isolcpus without flags */
-- 
2.24.1


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

end of thread, other threads:[~2020-04-02 13:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 16:16 [PATCH] sched/isolation: Allow "isolcpus=" to skip unknown sub-parameters Peter Xu
2020-02-05 12:27 ` Ming Lei
2020-02-05 13:34   ` Peter Xu
2020-02-14 19:40 ` Peter Xu
2020-02-14 20:28   ` Thomas Gleixner
2020-03-09 15:19     ` Peter Xu
2020-03-31 20:57       ` Peter Xu
2020-04-01 20:30 ` Thomas Gleixner
2020-04-01 23:01   ` Peter Xu
2020-04-01 23:29     ` Thomas Gleixner
2020-04-02  0:50       ` Peter Xu
2020-04-02  8:40         ` Thomas Gleixner
2020-04-02 13:14           ` Peter Xu

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).