Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp446824ybt; Wed, 17 Jun 2020 05:22:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh5Mm/U3gVA1slhGhh1fpaHOZqZVc4Rw1bl0s0V6uEFWUmwM4TqYx0jodZ24xjLs9rMaO2 X-Received: by 2002:aa7:d952:: with SMTP id l18mr6859219eds.151.1592396530118; Wed, 17 Jun 2020 05:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592396530; cv=none; d=google.com; s=arc-20160816; b=PN5615qh2+Kx6l4zyZZgfyQ5hFxioEeyD1zivd/G/L0j+/30hvMmn40ziWesUKg611 mWx12Q0IYAYXt1KZP58gwn/RYe5lN0eA9l/sJxgaqZGfy9aStbkuKUJREuiOjmzWw8Vh Rd8z+oCZycBXVvf7MxFecmgnX9fIbbBbh+U7oI+I3sEnnRR/njd0CbdE0aZ++Quve6GE l3DQcIFPeQnbQbk7mkxVpk5y0l+H4Af58xEEXkvrDOam7BB4HTZFalcmZNvf7wwWbSKQ wsxPzDnoB0ExparfrjQaKgukAoQW+qY9b3rbzz02F1Cm37nR5bbp8gbX51AKXu6CxZNo dteQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=vKfzf54XwyYWw37qFaQVeMfT58m7veh2hBYKQVUgpIk=; b=0QAYFFo2z8rjg/EjhZAeOkMNfb/OyugfzqoiFpHGjih8F1P45g+SkFMOKjzKtihyz4 H4klz8HRrOxNChlsem9Lu5EWU/RRaRpuSjJ8o1JMPQ6AtBmEuRAho5EkcDglrmeoW/yo mncUob7kW/toF8+X20kZRNJdDfpMBOOaCtZdp158ky7t0vvvztWdaAX7/XMuNWWTImDo w6ephryB/bUIJ/45fXphDU2jXfStyizKDlin/HqMNRBTiR1qVgOXGPXSGqiZ7Fe3JDD2 WyT2KqkXouTU6tD52t7hamlheQy0so2kGIQDEk2V4Be/L30TYl0lmVtmge4mfq2/4Qmy SfSg== 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 y11si13464427edp.319.2020.06.17.05.21.47; Wed, 17 Jun 2020 05:22:10 -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 S1726565AbgFQMRq (ORCPT + 99 others); Wed, 17 Jun 2020 08:17:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbgFQMRp (ORCPT ); Wed, 17 Jun 2020 08:17:45 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84D93C061573 for ; Wed, 17 Jun 2020 05:17:45 -0700 (PDT) Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1jlX0g-0000OW-Dk; Wed, 17 Jun 2020 14:17:42 +0200 Date: Wed, 17 Jun 2020 14:17:42 +0200 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Thomas Gleixner , Scott Wood Subject: [PATCH] sched: __set_cpus_allowed_ptr(): Check cpus_mask, not cpus_ptr Message-ID: <20200617121742.cpxppyi7twxmpin7@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Scott Wood 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 --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1637,7 +1637,7 @@ static int __set_cpus_allowed_ptr(struct goto out; } - if (cpumask_equal(p->cpus_ptr, new_mask)) + if (cpumask_equal(&p->cpus_mask, new_mask)) goto out; /*