Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp325263pxu; Thu, 3 Dec 2020 00:51:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3fnFDhZ0oX4UHO5AHJVvf+oLKdtTGpv4KmhNV+MDQtsYdsQ/R3G0OUl9CuAe8vZT1DUXz X-Received: by 2002:aa7:c98d:: with SMTP id c13mr1970990edt.188.1606985466585; Thu, 03 Dec 2020 00:51:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606985466; cv=none; d=google.com; s=arc-20160816; b=FcUOeMWeJkTYQJront4pwaLnuu8bUQuX7ueL42Gb+NVyHvhOSFKD8GaTp9wP3peglX TB6opnpEyKD9J+DATYd9WaMs8vEUm2Tc217pEAQuYL7RMSdlDS9I11vRlAa24Rey2JOC AEf7NzaNjd2DSPWjgKuaVbQxKIk5jyisyzBHpNyqVOg1o5yVecEGBNzuBi2YUSzMfL4k pzZpcr7uuSmrRB+OMZqruloohxAgW7a33lZ4bESN/yDzAdPWJYJFJ6e5PMsbDHvM67II cjUUQDyOwEO4HrJdHAqjl75FuU+Ir97HPqBp4AJ9m3AHu9NjOXuXmetsYWNDgXDcMEAy BSJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rHEL9BvX3SUky5t36TE/Zf15Wkba6MgcWFvLSPnTlI4=; b=ZUgWRvaYnC6BSNIhqdO1H2J2JgFDh5sB9uaf/O5a6D3ROy/94POPUm5IDYTAEGHga+ s1A2xKwCswWXKmerSClHVA12My3uc9dvYptcedw+FHXpHV7g1sUS6KLW2J1hGMKYhOM2 vw+U4O+fZDNSriJBnqcIUO8jvvZMCvNJzUnsf8A2oyzWYamzjXbNRBgS7Bc/f+9AKSyU zjITR0knkVvHpEZUP/Wbm96CmJn9D3iOk16P1qyU36tuc4COLrzqKo0ihs0DU5S9H2vY CbXiAuWl/ysGvMYgm02QDsYv6RVsAeMVjGqEcUs67OqrE2ugxzrTO1J2MdLRbFKgN96t mFVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="icSp/DC4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d64si531199edd.257.2020.12.03.00.50.43; Thu, 03 Dec 2020 00:51:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="icSp/DC4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730019AbgLCIsR (ORCPT + 99 others); Thu, 3 Dec 2020 03:48:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726505AbgLCIsQ (ORCPT ); Thu, 3 Dec 2020 03:48:16 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81CECC061A4D; Thu, 3 Dec 2020 00:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rHEL9BvX3SUky5t36TE/Zf15Wkba6MgcWFvLSPnTlI4=; b=icSp/DC4tvyvPQZinddAfp6WvS 5+gmgakzGziniji1CH54cCFqN6T8XqkWzrVT/aTmGv3jfsLX4hweB8hjBCaGKx4I8wHb+kCKSqh5p hc81uObxhgkWPicW95Qczj9mqwTIhdei3NphHrCUeA50S1aI7VhpQonCnnsUm01C50LIX5usUqIXO uAe6n03LfPfJS6FzmBB1AoYE5K8qPMIlIXMLDGpFC/jYhJWg0w8o02s+r8FuY1jaLIb1gl2cjFbH4 AdREWHTbSzyAjMz/bqiIjmHc0OXDxVRqbZY/XS1xAvJnkZoe7L8uSM3Rz5JOXP55F89X8R5JAjyit 2ku7W9RA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkkGs-0000ql-9J; Thu, 03 Dec 2020 08:47:26 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B86B0302753; Thu, 3 Dec 2020 09:47:23 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 985FD20270BBE; Thu, 3 Dec 2020 09:47:23 +0100 (CET) Date: Thu, 3 Dec 2020 09:47:23 +0100 From: Peter Zijlstra To: Scott Wood Cc: Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Mel Gorman , linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Sebastian Andrzej Siewior Subject: Re: [PATCH] sched/fair: Don't migrate with src_cpu == dst_cpu Message-ID: <20201203084723.GG2414@hirez.programming.kicks-ass.net> References: <20201203060449.3352126-1-swood@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201203060449.3352126-1-swood@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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.