Re: [PATCH 10/16] sched: optimize __set_cpus_allowed_ptr_locked()

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

 



On Mon, Jul 18, 2022 at 12:28:38PM -0700, Yury Norov wrote:
> ---
>  kernel/sched/core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index da0bf6fe9ecd..d6424336ef2d 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -2874,7 +2874,8 @@ static int __set_cpus_allowed_ptr_locked(struct task_struct *p,
>  		cpu_valid_mask = cpu_online_mask;
>  	}
>  
> -	if (!kthread && !cpumask_subset(new_mask, cpu_allowed_mask)) {
> +	if (!kthread && new_mask != cpu_allowed_mask &&
> +			!cpumask_subset(new_mask, cpu_allowed_mask)) {

Optimize cpumask_subset() for src1p == src2p instead?

>  		ret = -EINVAL;
>  		goto out;
>  	}
> -- 
> 2.34.1
> 



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux