Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1160044ybt; Thu, 18 Jun 2020 01:55:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws7g1X8m79GQFICpB+E70YQScwic4pW5Hg8t60nRJSBWl2v6s9u9k/7W76zn1OLTQE9csw X-Received: by 2002:a17:907:94ca:: with SMTP id dn10mr2876736ejc.348.1592470545744; Thu, 18 Jun 2020 01:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592470545; cv=none; d=google.com; s=arc-20160816; b=qKvmD3RxZxuFd2ACq2e0Ub2SH5YtofibmBQjmfa1oGHqKeTH3Cyi6DY+4x0TOaWi9J CHdsmB4ZX9VyPSusKiU+LTTSY6mbe1S/QwpoEKrWyo0k6PORC/JJ7wvJHdhXAdo1O/M1 hdM1GfGVu7vTFeS+PzGPVz8TZ93Z45HqA4WCok1FrpJs09KwjmTn/TSM8mMNha6NeF6t C2Il5NKZWftTzdK7yWUfJHJDQ1MjlZYXsSiSkKJFa5WGIny3PQIaNEdoeWAcNd9HGg3t sl3jr6N/tDEYo5/h6dTqo3UrSr+ZlW7gyXlTkXDPLzPxmOF5wCfaI+SuFNlloHaJdTIx 1U1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=2GK0IfPUAxWH1ZIxfKeoZqCPVnahudaq7KM3OQvwAOw=; b=PYgJa6M6ji+IZDlvo5h077SD9YLBDVuH6yTETVgScDuRsH3TrPkjJEds3/QzaYsqP0 7pFTNWtmIcYWxUwKOOGhE832kiD9+oZadH8ElyHc3bB9yU2W648/I1cruN373F9hqb2k 8B1GFaCUsPqorBNt19xq24ARr26WMdzrKMxXNbdn1pF11hufcw8sGylzk6ErazeIVfnW cVC0rIWiMf9O61He0m9/QskEe6D50gsuWo1d/pZ41ZykU3ebww5Wxmq1YbzPXiqIsWkm x2H9uIXJgaWDyUSXDJJi0eQlKfpShbd1FRJaSfpauKeV3Kq+VE6wO+Do5gg8KHMKo2Xq /+ag== 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 u23si1529147ejx.512.2020.06.18.01.55.22; Thu, 18 Jun 2020 01:55:45 -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 S1728752AbgFRIv2 (ORCPT + 99 others); Thu, 18 Jun 2020 04:51:28 -0400 Received: from foss.arm.com ([217.140.110.172]:46330 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728536AbgFRIv1 (ORCPT ); Thu, 18 Jun 2020 04:51:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3579931B; Thu, 18 Jun 2020 01:51:26 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A010F3F6CF; Thu, 18 Jun 2020 01:51:24 -0700 (PDT) References: <20200617121742.cpxppyi7twxmpin7@linutronix.de> <696309d91635fa965ad8436388e7ae7d098420a1.camel@redhat.com> <20200618080700.cig4x4y7n3thmneu@linutronix.de> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Sebastian Andrzej Siewior Cc: Scott Wood , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Thomas Gleixner Subject: Re: [PATCH] sched: __set_cpus_allowed_ptr(): Check cpus_mask, not cpus_ptr In-reply-to: <20200618080700.cig4x4y7n3thmneu@linutronix.de> Date: Thu, 18 Jun 2020 09:51:18 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/06/20 09:07, Sebastian Andrzej Siewior wrote: > On 2020-06-17 17:49:48 [-0500], Scott Wood wrote: >> > Makes sense, but what about the rest of the checks? Further down there is >> > >> > /* Can the task run on the task's current CPU? If so, we're done >> > */ >> > if (cpumask_test_cpu(task_cpu(p), new_mask)) >> > goto out; >> > >> > If the task is currently migrate disabled and for some stupid reason it >> > gets affined elsewhere, we could try to move it out - which AFAICT we >> > don't >> > want to do because migrate disabled. So I suppose you'd want an extra >> > bailout condition here when the task is migrate disabled. >> > >> > ISTR in RT you do re-check the affinity and potentially move the task away >> > when re-enabling migration, so that should work out all fine. >> >> On RT the above test is: >> >> /* Can the task run on the task's current CPU? If so, we're done */ >> if (cpumask_test_cpu(task_cpu(p), new_mask) || >> p->cpus_ptr != &p->cpus_mask) >> goto out; >> >> ...so we do bail out if we're migrate disabled. > > correct. There is a complete migrate_disable() patch in the RT queue > which has to wait. This patch however looked to be independent of that > and could "fix" the pointer part which is already here so I sent it. > Okay, thanks. I don't see any harm in including that extra check with the patch, but either way: Reviewed-by: Valentin Schneider >> -Scott > > Sebastian