lkml.org 
[lkml]   [2021]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v8 06/19] cpuset: Don't use the cpu_possible_mask as a last resort for cgroup v1
Date
On 02/06/21 17:47, Will Deacon wrote:
> @@ -3322,9 +3322,13 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask)
>
> void cpuset_cpus_allowed_fallback(struct task_struct *tsk)
> {
> + const struct cpumask *cs_mask;
> + const struct cpumask *possible_mask = task_cpu_possible_mask(tsk);
> +
> rcu_read_lock();
> - do_set_cpus_allowed(tsk, is_in_v2_mode() ?
> - task_cs(tsk)->cpus_allowed : cpu_possible_mask);
> + cs_mask = task_cs(tsk)->cpus_allowed;
> + if (is_in_v2_mode() && cpumask_subset(cs_mask, possible_mask))
> + do_set_cpus_allowed(tsk, cs_mask);

Since the task will still go through the is_cpu_allowed() loop in
select_fallback_rq() after this, is the subset check actually required
here?

It would have more merit if cpuset_cpus_allowed_fallback() returned whether
it actually changed the allowed mask or not, in which case we could branch
either to the is_cpu_allowed() loop (as we do unconditionally now), or to
the 'state == possible' switch case.

> rcu_read_unlock();
>
> /*
> --
> 2.32.0.rc0.204.g9fa02ecfa5-goog

\
 
 \ /
  Last update: 2021-06-04 19:12    [W:0.182 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site