Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4800826ybc; Fri, 15 Nov 2019 10:15:58 -0800 (PST) X-Google-Smtp-Source: APXvYqz2iyLOzrhWBMHPhqeJQ9hOp3StBSdpYJjEKYrQWDKsYcaNPCITTAev5g5OLH8rhPLYp90G X-Received: by 2002:a05:600c:2383:: with SMTP id m3mr15612525wma.66.1573841758014; Fri, 15 Nov 2019 10:15:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573841757; cv=none; d=google.com; s=arc-20160816; b=HSlydkxjNzauLVqhthOkEtzN/t4KwdcRXVznhPapinskSIpGh4t+NW+vZu+VcoBdsN AWo6WFwYal4GHbS+Kk39JNDwOVhQYHIMk+ibA/s2hHNyDG9uyh5sjvoUWFUziGh22n8b xomAypmGGaxruvnYxARwTCSWkTqRk7YzpMmDMM49oiAn58MB4729xLxFb5Guq9R2LIq8 jyl7MTZgpkANN7hVxQDOcAkHyRgDzjqwa85RK8rwcLBAn+yfT42VXftHMu8PuUvrqlys 1O+q9kNWfLRKP9Jm2LHdU0TFi/Uo0PoelfA865FPSTcwPSOfKfW4iC5Tey1Z1FPeoDZO t5SA== 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=ve/biqOTOzwYyJynjYUfBPZuesjOhizbVrUfgabTGm8=; b=uKjf7NEWfksXfz2VlyfqjWmS11+gD7euVYFjmOrXJGoVS9OfrXTE8G7osDTnGtbMR+ GmwKRE/mBGXyY/kJs7H/Ylp2l839IeqCVYFFcPZePE23qeTSenANIZzsO2y3V71q802g LWz5RpZpaW1BDunXE8Xmpr3HGff9+tW5fha/uoevN7wJ2if9r7C1NX9X0uVfuqWDccE3 YL6XxqItRjPrlHP3GlcJVosI3BeCi+ABQEGkdWrEDZgDjrYa9J8Ekist207ucdqQdPS8 2I8u/N0orjqXxx9uguvYxr0zgzhXtnLRvaJM41/4oxX6tpQ/m2VRz3ZOcW9NTJDhoY8i LJLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a40si6875792eda.86.2019.11.15.10.15.32; Fri, 15 Nov 2019 10:15:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727016AbfKOSNY convert rfc822-to-8bit (ORCPT + 99 others); Fri, 15 Nov 2019 13:13:24 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:44270 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726075AbfKOSNY (ORCPT ); Fri, 15 Nov 2019 13:13:24 -0500 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 1iVg5i-00051Y-UY; Fri, 15 Nov 2019 19:13:07 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 6C7BE1C08AC; Fri, 15 Nov 2019 19:13:06 +0100 (CET) Date: Fri, 15 Nov 2019 18:13:06 -0000 From: "tip-bot2 for Valentin Schneider" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/topology, cpuset: Account for housekeeping CPUs to avoid empty cpumasks Cc: mkoutny@suse.com, Valentin Schneider , "Peter Zijlstra (Intel)" , Dietmar.Eggemann@arm.com, Linus Torvalds , Thomas Gleixner , hannes@cmpxchg.org, lizefan@huawei.com, morten.rasmussen@arm.com, qperret@google.com, tj@kernel.org, vincent.guittot@linaro.org, Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: <20191104003906.31476-1-valentin.schneider@arm.com> References: <20191104003906.31476-1-valentin.schneider@arm.com> MIME-Version: 1.0 Message-ID: <157384158622.12247.6135151696743651397.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: 8BIT 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: 48a723d23b0d957e5b5861b974864e53c6841de8 Gitweb: https://git.kernel.org/tip/48a723d23b0d957e5b5861b974864e53c6841de8 Author: Valentin Schneider AuthorDate: Mon, 04 Nov 2019 00:39:06 Committer: Ingo Molnar CommitterDate: Fri, 15 Nov 2019 11:02:20 +01:00 sched/topology, cpuset: Account for housekeeping CPUs to avoid empty cpumasks Michal noted that a cpuset's effective_cpus can be a non-empy mask, but because of the masking done with housekeeping_cpumask(HK_FLAG_DOMAIN) further down the line, we can still end up with an empty cpumask being passed down to partition_sched_domains_locked(). Do the proper thing and don't just check the mask is non-empty - check that its intersection with housekeeping_cpumask(HK_FLAG_DOMAIN) is non-empty. Reported-by: Michal Koutný Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Cc: Dietmar.Eggemann@arm.com Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: hannes@cmpxchg.org Cc: lizefan@huawei.com Cc: morten.rasmussen@arm.com Cc: qperret@google.com Cc: tj@kernel.org Cc: vincent.guittot@linaro.org Fixes: cd1cb3350561 ("sched/topology: Don't try to build empty sched domains") Link: https://lkml.kernel.org/r/20191104003906.31476-1-valentin.schneider@arm.com Signed-off-by: Ingo Molnar --- kernel/cgroup/cpuset.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index c87ee64..e4c1078 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -798,8 +798,14 @@ static int generate_sched_domains(cpumask_var_t **domains, cpumask_subset(cp->cpus_allowed, top_cpuset.effective_cpus)) continue; + /* + * Skip cpusets that would lead to an empty sched domain. + * That could be because effective_cpus is empty, or because + * it's only spanning CPUs outside the housekeeping mask. + */ if (is_sched_load_balance(cp) && - !cpumask_empty(cp->effective_cpus)) + cpumask_intersects(cp->effective_cpus, + housekeeping_cpumask(HK_FLAG_DOMAIN))) csa[csn++] = cp; /* skip @cp's subtree if not a partition root */