Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3424745ybt; Tue, 23 Jun 2020 01:50:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+0vwyV2wdm7DfN989H9LmO+HNBXVZsE0NDt47oJEaZcHcUZWGrbeVb24KJKEDjJgzgdCn X-Received: by 2002:a05:6402:b37:: with SMTP id bo23mr21186462edb.24.1592902244390; Tue, 23 Jun 2020 01:50:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592902244; cv=none; d=google.com; s=arc-20160816; b=g+2Ik7P5oFEds3FDIzUQls7rPhI8UQiKe+gnZpi05T9gQmHfEg9geswwNQDDlY4fM2 VOrfMUQHWoWafWIKN+Zic9yswGNUgQtoJO21f3n3KuBGnrsYhj5JERF5YddXHgY2KcUu 9cqAjSDT4JkaIurHyU+oGAx+JHWdjTOZZHvasqX6G9BUe0874+1ykxgEM7PLq9cnuJx4 JsBe6KVNo+zUBoIwvwhbwcsLT7gymUSo44p8yuBZGmgP1l40xjXgV8oOkzV3vy2OVTz8 /uk+vOtOOoyU+y+2LS2PmqW0Cn7XQQfrnHAEzEYPxU2J3O5j59ttgxBSRz1xiB3l/3ih t6gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=GwPrlMUN6SYM865ZlIVBZHaDaV6SvhsFLWedWU/dvO0=; b=nPmP/oZ9sDa78Bx0K+EkjkAgOOyiYpuIInrLHZI3dSZ7kxW1w1U5BMN/KkBvc9oNcO n51aQdA99HDx7xfx+yslENKE+o2kylquy5KVnKutUCN9q8D1BFHP9rychzFzeuT9VN7j z7yT8qOCyLtjoyW5CyVd8DCqZbeVgxS3tiywvGjFAe7wvnjR3CypGZuXZtzocSBfi0OF HOIUov4RsvJwyT0iRcNAXpiKYaCJMslJ/b9rRzXiYkORZOTXGzhpaGBdX8qwhI3sQPTd 0Ve3HYJXxF4WhyyTkQlpX29Dq+5EVBHeL62zi2I7XKI1KE1dVhyNT23e6Oulng4xs+Ah pkeQ== ARC-Authentication-Results: i=1; mx.google.com; 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 d11si10322694edx.237.2020.06.23.01.50.21; Tue, 23 Jun 2020 01:50:44 -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; 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 S1731921AbgFWIsd (ORCPT + 99 others); Tue, 23 Jun 2020 04:48:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731735AbgFWIsb (ORCPT ); Tue, 23 Jun 2020 04:48:31 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6039CC061573; Tue, 23 Jun 2020 01:48:31 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jnebS-0005SE-Cp; Tue, 23 Jun 2020 10:48:26 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id F420A1C0475; Tue, 23 Jun 2020 10:48:25 +0200 (CEST) Date: Tue, 23 Jun 2020 08:48:25 -0000 From: "tip-bot2 for Scott Wood" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/core: Check cpus_mask, not cpus_ptr in __set_cpus_allowed_ptr(), to fix mask corruption Cc: Scott Wood , Sebastian Andrzej Siewior , "Peter Zijlstra (Intel)" , Ingo Molnar , x86 , LKML In-Reply-To: <20200617121742.cpxppyi7twxmpin7@linutronix.de> References: <20200617121742.cpxppyi7twxmpin7@linutronix.de> MIME-Version: 1.0 Message-ID: <159290210579.16989.15942398303650124692.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org 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: 16568f1f4fd4decee6935751d5ada1f963e5bd5f Gitweb: https://git.kernel.org/tip/16568f1f4fd4decee6935751d5ada1f963e5bd5f Author: Scott Wood AuthorDate: Wed, 17 Jun 2020 14:17:42 +02:00 Committer: Ingo Molnar CommitterDate: Tue, 23 Jun 2020 10:42:30 +02:00 sched/core: Check cpus_mask, not cpus_ptr in __set_cpus_allowed_ptr(), to fix mask corruption This function is concerned with the long-term CPU mask, not the transitory mask the task might have while migrate disabled. Before this patch, if a task was migrate-disabled at the time __set_cpus_allowed_ptr() was called, and the new mask happened to be equal to the CPU that the task was running on, then the mask update would be lost. Signed-off-by: Scott Wood Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lkml.kernel.org/r/20200617121742.cpxppyi7twxmpin7@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 8f36032..9eeac94 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1637,7 +1637,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, goto out; } - if (cpumask_equal(p->cpus_ptr, new_mask)) + if (cpumask_equal(&p->cpus_mask, new_mask)) goto out; /*