Re: [PATCH v3 1/3] sched/core: Warn if cpumask has a mix of isolcpus and housekeeping CPUs

From: Peter Zijlstra
Date: Fri Oct 26 2018 - 04:49:57 EST


On Fri, Oct 26, 2018 at 12:12:21AM +0530, Srikar Dronamraju wrote:
> @@ -4778,6 +4779,16 @@ long sched_setaffinity(pid_t pid, const struct cpumask *in_mask)
>
> cpuset_cpus_allowed(p, cpus_allowed);
> cpumask_and(new_mask, in_mask, cpus_allowed);
> + hk_mask = housekeeping_cpumask(HK_FLAG_DOMAIN);
> +
> + /*
> + * Warn if the cpumask provided has CPUs that are part of isolated and
> + * housekeeping_cpumask
> + */
> + if (!cpumask_subset(new_mask, hk_mask) &&
> + cpumask_intersects(new_mask, hk_mask))
> + pr_warn("pid %d: Mix of isolcpus and non-isolcpus provided\n",
> + p->pid);
>
> /*
> * Since bandwidth control happens on root_domain basis,

That is horribly coding style, and completely pointless. Also user
trigerable printl like that should be rate limited at the very least.