[GIT pull] sched/urgent for 5.7-rc2

From: Thomas Gleixner
Date: Sun Apr 19 2020 - 09:58:16 EST


Linus,

please pull the latest sched/urgent branch from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-urgent-2020-04-19

up to: e0d648f9d883: sched/vtime: Work around an unitialized variable warning


Two fixes for the scheduler:

- Work around an uninitializaed variable warning where GCC can't figure it
out.

- Allow 'isolcpus=' to skip unknown subparameters so that older kernels
work with the commandline of a newer kernel. Improve the error output
while at it.

Thanks,

tglx

------------------>
Borislav Petkov (1):
sched/vtime: Work around an unitialized variable warning

Peter Xu (1):
sched/isolation: Allow "isolcpus=" to skip unknown sub-parameters


kernel/sched/cputime.c | 4 ++--
kernel/sched/isolation.c | 21 +++++++++++++++++++--
2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index dac9104d126f..ff9435dee1df 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -1003,12 +1003,12 @@ u64 kcpustat_field(struct kernel_cpustat *kcpustat,
enum cpu_usage_stat usage, int cpu)
{
u64 *cpustat = kcpustat->cpustat;
+ u64 val = cpustat[usage];
struct rq *rq;
- u64 val;
int err;

if (!vtime_accounting_enabled_cpu(cpu))
- return cpustat[usage];
+ return val;

rq = cpu_rq(cpu);

diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 008d6ac2342b..808244f3ddd9 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -149,6 +149,9 @@ __setup("nohz_full=", housekeeping_nohz_full_setup);
static int __init housekeeping_isolcpus_setup(char *str)
{
unsigned int flags = 0;
+ bool illegal = false;
+ char *par;
+ int len;

while (isalpha(*str)) {
if (!strncmp(str, "nohz,", 5)) {
@@ -169,8 +172,22 @@ static int __init housekeeping_isolcpus_setup(char *str)
continue;
}

- pr_warn("isolcpus: Error, unknown flag\n");
- return 0;
+ /*
+ * Skip unknown sub-parameter and validate that it is not
+ * containing an invalid character.
+ */
+ for (par = str, len = 0; *str && *str != ','; str++, len++) {
+ if (!isalpha(*str) && *str != '_')
+ illegal = true;
+ }
+
+ if (illegal) {
+ pr_warn("isolcpus: Invalid flag %.*s\n", len, par);
+ return 0;
+ }
+
+ pr_info("isolcpus: Skipped unknown flag %.*s\n", len, par);
+ str++;
}

/* Default behaviour for isolcpus without flags */