lkml.org 
[lkml]   [2018]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/3] sched/core: Don't mix isolcpus and housekeeping CPUs
On Fri, Oct 26, 2018 at 12:12:22AM +0530, Srikar Dronamraju wrote:
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 3064e0f..37e62b8 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -1003,7 +1003,19 @@ static int migration_cpu_stop(void *data)
> */
> void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_mask)
> {
> - cpumask_copy(&p->cpus_allowed, new_mask);
> + const struct cpumask *hk_mask = housekeeping_cpumask(HK_FLAG_DOMAIN);
> +
> + /*
> + * If the cpumask provided has CPUs that are part of isolated and
> + * housekeeping_cpumask, then restrict it to just the CPUs that
> + * are part of the housekeeping_cpumask.
> + */
> + if (!cpumask_subset(new_mask, hk_mask) &&
> + cpumask_intersects(new_mask, hk_mask))
> + cpumask_and(&p->cpus_allowed, new_mask, hk_mask);
> + else
> + cpumask_copy(&p->cpus_allowed, new_mask);
> +
> p->nr_cpus_allowed = cpumask_weight(new_mask);

NAK, I already explained that.

\
 
 \ /
  Last update: 2018-10-26 10:50    [W:0.048 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site