Re: [PATCH 1/2] cpuset: Fix cpuset_cpus_allowed() to not filter offline CPUs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 31 Jan 2023 22:17:18 +0000 Will Deacon <will@xxxxxxxxxx>
>  
> +static const struct cpumask *__cs_cpus_allowed(struct cpuset *cs)
> +{
> +	const struct cpumask *cs_mask = cs->cpus_allowed;
> +	if (!parent_cs(cs))
> +		cs_mask = cpu_possible_mask;
> +	return cs_mask;
> +}
> +
> +static void cs_cpus_allowed(struct cpuset *cs, struct cpumask *pmask)
> +{
> +	do {
> +		cpumask_and(pmask, pmask, __cs_cpus_allowed(cs));
> +		cs = parent_cs(cs);
> +	} while (cs);
> +}

If it is not typo, why is it needed here to spiral the cs hierarchy up,
given the same spiralup below?

>  void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask)
>  {
>  	unsigned long flags;
> +	struct cpuset *cs;
>  
>  	spin_lock_irqsave(&callback_lock, flags);
> -	guarantee_online_cpus(tsk, pmask);
> +	rcu_read_lock();
> +
> +	cs = task_cs(tsk);
> +	do {
> +		cpumask_copy(pmask, task_cpu_possible_mask(tsk));
> +		cs_cpus_allowed(cs, pmask);
> +
> +		if (cpumask_intersects(pmask, cpu_online_mask))
> +			break;
> +
> +		cs = parent_cs(cs);
> +	} while (cs);
> +
> +	rcu_read_unlock();
>  	spin_unlock_irqrestore(&callback_lock, flags);
>  }
>  
> -- 
> 2.39.1.456.gfc5497dd1b-goog




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux