lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201203084723.GG2414@hirez.programming.kicks-ass.net>
Date:   Thu, 3 Dec 2020 09:47:23 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Scott Wood <swood@...hat.com>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Mel Gorman <mgorman@...e.de>, linux-kernel@...r.kernel.org,
        linux-rt-users@...r.kernel.org,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: Re: [PATCH] sched/fair: Don't migrate with src_cpu == dst_cpu

On Thu, Dec 03, 2020 at 12:04:49AM -0600, Scott Wood wrote:
> Besides being a waste of time to try to move tasks to where they already
> are, this avoids triggering the WARN_ON_ONCE(is_migration_disabled(p))
> in set_task_cpu().
> 
> Signed-off-by: Scott Wood <swood@...hat.com>
> ---
> Patch is against tip/master.  Assertion was seen by running rteval on the
> RT tree.
> 
>  kernel/sched/fair.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index e7e21ac479a2..f443626164d4 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -7574,7 +7574,8 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
>  
>  		/* Prevent to re-select dst_cpu via env's CPUs: */
>  		for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) {
> -			if (cpumask_test_cpu(cpu, p->cpus_ptr)) {
> +			if (cpu != env->src_cpu &&
> +			    cpumask_test_cpu(cpu, p->cpus_ptr)) {
>  				env->flags |= LBF_DST_PINNED;
>  				env->new_dst_cpu = cpu;
>  				break;

Do we have _any_ clue as to how we ended up in that situation? The above
sounds like it should be a WARN and we should avoid getting here in the
first place.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ