Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp666437pxb; Tue, 5 Apr 2022 17:58:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJX1KGhDa6CV8ayrG5XlCeTQjjzAZThZnyCyuNNWSZVAHPtsx7aNnO18dEskpjkjy7AtHj X-Received: by 2002:aa7:d8da:0:b0:41c:ce44:dfcd with SMTP id k26-20020aa7d8da000000b0041cce44dfcdmr6310060eds.142.1649206660352; Tue, 05 Apr 2022 17:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206660; cv=none; d=google.com; s=arc-20160816; b=iIbBHxq2UurvQqjG7kYmqSCpU8SL7qDsjLUpZFMIKHNep6lrG2w6mgmcG09SUukqhj xwxCVPqMDYOI/OXMRbTX6DsJTIB7izDyge5s8rAv+I3lxI6sIiIeM/d9yUWrgSIJxelo qHdKpVP7WR3hgNAqrw2ZuTZZtmY4UJegMew89n1SyePLicP3wtLMn1JSPDad68ZZ1j7p RtoqypQMWdb/zh6pejZKeN5vh9IvR2lD7lQNTfNrQBlmCMzXCuvN9nOlUe7c9HkYyqv4 lyqG8Pn7XI2ARhZZD0MFST0O4UWa6FdEZEAHk5JTvGvyy5xt+q1Os42aSDd2J4EhyrCr T6aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=l+xUYv6gdZsjBlMimQWLTKtSrNhHai4I0pW5bOZsXo4=; b=xCRXbK8NFC4StSr2Gkc3ta5JCDaTaD69m++hCy5skUpROEYl87X0zqQ3GyE1qT9TzS d7KPzzZorIPzfMUjXFL+PJlznyXm1XjUiyUcDzacWFcQa0TopRMnsoQW8YWI6FqFfFZG sKj6Ppm7FgYQqsilTB64TbTL0vD2ZwuBXyKksd9N9QbY7nk56IykcjaQtAq4fsy5zYOY Hui1kxJBPoDs/Try0WCsbhXKdbEYmf0v7ttRzbiLbJAdGFkxD2KddNlHHY2RSn1QDZlz L7apdddbjih9w+ZkO60NKAI947w2IyAGrvY62crcr3BM8alok1/yi9IouY5J8h5bd0Up 8yHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=o7a0WX1+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a056402274a00b0041cdf19f8c0si3744863edd.569.2022.04.05.17.57.11; Tue, 05 Apr 2022 17:57:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=o7a0WX1+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353038AbiDELNm (ORCPT + 99 others); Tue, 5 Apr 2022 07:13:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238287AbiDEIa1 (ORCPT ); Tue, 5 Apr 2022 04:30:27 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB36C245B7; Tue, 5 Apr 2022 01:22:03 -0700 (PDT) Date: Tue, 05 Apr 2022 08:22:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1649146922; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l+xUYv6gdZsjBlMimQWLTKtSrNhHai4I0pW5bOZsXo4=; b=o7a0WX1+82rPz7+R5wyQMyN3+HOr4Wz8RKw9ysNFrG2V4/gXB5JnAYrkH/Zt1Pi9F0zmwc GUlQ6ROOqYycGL2PUCJCoaBad7NzII8NZJsO+gErN3hVlneu8J67pwwp64tW0EqAre8WDD 7hTu647GjwUr1glcwuI8VKPU3pgO8WEVc5rPuk4Xb//uDWZIk7+rRqoCUw+2evSOKlKhKK I2GcWs+mgTqGvXnWMD0XOl5+ZR0cVjegjTp4kN8NU0PBMsqztoqQ6ISB9PnKXUDd8oPs2X itBr3axY2d64RGTudrqgHFTx07wnJLMoiYCX2u921By3yCPthIENtkdWKe3BgA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1649146922; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l+xUYv6gdZsjBlMimQWLTKtSrNhHai4I0pW5bOZsXo4=; b=SuCYPPCkjJFGlSdOxpigCfqddH5Qmj0Tzj8uylBk29udUPKWXbi41L7A3cCHdFWfEdupsy suz3BgVXaufUsxDw== From: "tip-bot2 for Sebastian Andrzej Siewior" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched: Teach the forced-newidle balancer about CPU affinity limitation. Cc: Sebastian Andrzej Siewior , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <164914692120.389.11878203217805894208.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/urgent branch of tip: Commit-ID: 386ef214c3c6ab111d05e1790e79475363abaa05 Gitweb: https://git.kernel.org/tip/386ef214c3c6ab111d05e1790e79475363abaa05 Author: Sebastian Andrzej Siewior AuthorDate: Thu, 17 Mar 2022 15:51:32 +01:00 Committer: Peter Zijlstra CommitterDate: Tue, 05 Apr 2022 09:59:36 +02:00 sched: Teach the forced-newidle balancer about CPU affinity limitation. try_steal_cookie() looks at task_struct::cpus_mask to decide if the task could be moved to `this' CPU. It ignores that the task might be in a migration disabled section while not on the CPU. In this case the task must not be moved otherwise per-CPU assumption are broken. Use is_cpu_allowed(), as suggested by Peter Zijlstra, to decide if the a task can be moved. Fixes: d2dfa17bc7de6 ("sched: Trivial forced-newidle balancer") Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/YjNK9El+3fzGmswf@linutronix.de --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 017ee78..51efaab 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6006,7 +6006,7 @@ static bool try_steal_cookie(int this, int that) if (p == src->core_pick || p == src->curr) goto next; - if (!cpumask_test_cpu(this, &p->cpus_mask)) + if (!is_cpu_allowed(p, this)) goto next; if (p->core_occupation > dst->idle->core_occupation)