Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2238373pxf; Sat, 20 Mar 2021 08:42:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/3EzOPtBOcNMMAHmf/uzs69oGOreMx3HVwK02FPjZnT/yHUPvQXNhAJZT0IKS10GjEVZV X-Received: by 2002:a17:906:4f02:: with SMTP id t2mr10172525eju.121.1616254937907; Sat, 20 Mar 2021 08:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616254937; cv=none; d=google.com; s=arc-20160816; b=c19pEIGFx4RlVcLBGbIuhGOCQPZCf8BpXq7eOZC3V4PFO1Gi0JjVzIRKndXZLRVvHe hO+tEtPn5OcQ83I8QKt62OKGJx10oAwLDllNYgBkwIAtUgK/QxuMnsVjlSJzQU2hkxFd 4qQY3bR4EgPMyMC3YETpwNbuPa+FIE7yvGogKbyj5ELHDYgcSWtvxAXAgja/vgBUHFrk KVEP62vIXq//8HkSDK+XfLyRfo6k1eI6qPpyTLr2K/8cqfPHpSeqBVSrI/wzj8mws76G OV+5sOMHo/9jdrpXjn+nLL8xISUFZNjwMkxvajDNZOlvFqhuhTxc6Zxs+gQHaIY5ANwI xR7w== 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=m/lHHBauPJoTi+xzkV1LtzuzjqXxwKLqACh+FHnxGBU=; b=r+GYkHVlnr/Z+ECjzXTSiU+4LKwBpWjgG2xAoKZ5L/PqzWY5RQdAIfV74k72LMacNQ tUFy6NiMKFSYd6btfjU9jG9XB96GATlTFy3UQeKJ/eO0v/Ap/YgcBKypb26rj32jen+j wBkb6WrC+XO8ku1MMT80pvhVkw0gj6rmCp0JWpaELlxpCeLDhKQ9zv03Rj/x0Q/4MV0a IOrpK6WDieuTaiQSmg7Qyyabn5rd79fFpkHd2+pb6opqa4jXRbyALkawQe5Z02ICV1Pc H2Q3bbaxHp+7EcEgiNdg8HCf5X3BCd08RZ2bpKsiG7aNN89BBngJZFrr1oVKmndXOXy9 u+BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=LgNJtdgg; 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 l25si6932112ejg.664.2021.03.20.08.41.55; Sat, 20 Mar 2021 08:42:17 -0700 (PDT) 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=desiato.20200630 header.b=LgNJtdgg; 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 S229922AbhCTPgh (ORCPT + 99 others); Sat, 20 Mar 2021 11:36:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbhCTPgG (ORCPT ); Sat, 20 Mar 2021 11:36:06 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C377C061574 for ; Sat, 20 Mar 2021 08:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=m/lHHBauPJoTi+xzkV1LtzuzjqXxwKLqACh+FHnxGBU=; b=LgNJtdggLE5+sv3lPkc+znvkby 3o9HPbUyjQXWz0D67uM5Hq8DXEOqfzoPS1BriJnayxUccdPFZFBjJ8GZ59MQIgLT0UmmSjOZfq+t7 XPzE9jr9i6pNjTTXWAVsY9xuPt63vpo6PVBzWywa+1SOde3Y/fWZq9zE8SWuNxYyjQoXfG9X5N95I BJGd3JjkKCXJ18sJxxR0bcGNxGiugyVAiqU5Hilm748jEQEzRw2CdZj8/6Cfzd9qSFExBx/fi1raS Wkoazp9qBq+EkitD6KfVbG2f0fjFyXms8tIxNANJ0S/Dc+P1T7wJ3qKAXUh0/onqcQlZATJ/vJcsj RLdL+jYw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lNdcx-008zTy-0R; Sat, 20 Mar 2021 15:34:59 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id D57BF9864FF; Sat, 20 Mar 2021 16:34:57 +0100 (CET) Date: Sat, 20 Mar 2021 16:34:57 +0100 From: Peter Zijlstra To: "Joel Fernandes (Google)" Cc: Nishanth Aravamudan , Julien Desfossez , Tim Chen , Vineeth Pillai , Aaron Lu , Aubrey Li , tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, torvalds@linux-foundation.org, fweisbec@gmail.com, keescook@chromium.org, Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , vineeth@bitbyteword.org, Chen Yu , Christian Brauner , Agata Gruza , Antonio Gomez Iglesias , graf@amazon.com, konrad.wilk@oracle.com, dfaggioli@suse.com, rostedt@goodmis.org, benbjiang@tencent.com, Alexandre Chartre , James.Bottomley@hansenpartnership.com, OWeisse@umich.edu, Dhaval Giani , chris.hyser@oracle.com, Josh Don , Hao Luo , Tom Lendacky , Aubrey Li , Aubrey Li Subject: Re: [PATCH 1/6] sched: migration changes for core scheduling Message-ID: <20210320153457.GX4746@worktop.programming.kicks-ass.net> References: <20210319203253.3352417-1-joel@joelfernandes.org> <20210319203253.3352417-2-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210319203253.3352417-2-joel@joelfernandes.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 19, 2021 at 04:32:48PM -0400, Joel Fernandes (Google) wrote: > @@ -7530,8 +7543,9 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) > * We do not migrate tasks that are: > * 1) throttled_lb_pair, or > * 2) cannot be migrated to this CPU due to cpus_ptr, or > - * 3) running (obviously), or > - * 4) are cache-hot on their current CPU. > + * 3) task's cookie does not match with this CPU's core cookie > + * 4) running (obviously), or > + * 5) are cache-hot on their current CPU. > */ > if (throttled_lb_pair(task_group(p), env->src_cpu, env->dst_cpu)) > return 0; > @@ -7566,6 +7580,13 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) > return 0; > } > > + /* > + * Don't migrate task if the task's cookie does not match > + * with the destination CPU's core cookie. > + */ > + if (!sched_core_cookie_match(cpu_rq(env->dst_cpu), p)) > + return 0; > + > /* Record that we found atleast one task that could run on dst_cpu */ > env->flags &= ~LBF_ALL_PINNED; > This one is too strong.. persistent imbalance should be able to override it.