Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1358419ybx; Thu, 31 Oct 2019 09:25:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgo74YwD278zi6X8KsrH0LNdHm/xIiOe4fNEPvWsUuH1+qNyEWi+Etk1Aj4tns3MJwDTdQ X-Received: by 2002:a17:906:6bcd:: with SMTP id t13mr4813859ejs.231.1572539110894; Thu, 31 Oct 2019 09:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572539110; cv=none; d=google.com; s=arc-20160816; b=HdDBZidb1UeGcDRz8zHFtpEVmzk1Fx8SEvUnhA50us3VgDazgZl2h6kys1r2CryVrq fY+6QAvbQDWkULl3t/AjWLwIZyrEX5ewvN9Xk+ebSiycB6mgqu/pjV0KhQjRKYQZ8G3/ OPRhAPklap5FRlYLdHISr6DKvncGOVqHnTIUF5f0nLJzONhhQ3ytUDZsCa4TACK9ocyZ D+WNByD9oXMlsFMCJaCeZboyqPR5Wyu/WY8WAMl3fp0vegzHtx3HUVLR06/5ZusZd48I bfYMlMCDXyC93nxSXOwyAlpsteNCYDHy0KEe6cj7gXmkxe5k1lApUcMG2VYufmc+nl74 /QFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=a7VjgmZRHPBnZ9xlitiI/mxp75SMn+7rkc9StuMwcIQ=; b=BszXMstI9Z7xx0/rSuPvRYYtsP6qKbTM9GenCY4Pye8MH6ltIXXa9zrRsLABSeqGUI Qa8JRWSweNf3vPzWVOIDyp9bohb1UNT/it4lMhYsZ3/+V2znwv0TY2QFd+psv7NZgF7d Kk/ErTf3JqG0PE7A2s4TRhLBDXeOIaDEpk2/tgapODBlxTNzP792aPDbNJYooWCsTlog +DuXTQ6FzzE1zJRrr4rDnqBheHsVJhbNR2CrmIo3ReL5/9e3TW2K1DMm4uBb3PCWeczX wC/TK1hNkBn28Wdah46ofQWzdvCvgfImA1b5gJdMbw945tXJ27vzhz4ZIewQU4OryssA ELow== 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 pv15si4032232ejb.346.2019.10.31.09.24.47; Thu, 31 Oct 2019 09:25:10 -0700 (PDT) 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 S1728579AbfJaQXl (ORCPT + 99 others); Thu, 31 Oct 2019 12:23:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:50060 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728428AbfJaQXk (ORCPT ); Thu, 31 Oct 2019 12:23:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 94264B833; Thu, 31 Oct 2019 16:23:38 +0000 (UTC) Date: Thu, 31 Oct 2019 17:23:34 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, lizefan@huawei.com, tj@kernel.org, hannes@cmpxchg.org, mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, Dietmar.Eggemann@arm.com, morten.rasmussen@arm.com, qperret@google.com, stable@vger.kernel.org Subject: Re: [PATCH v4 1/2] sched/topology: Don't try to build empty sched domains Message-ID: <20191031162334.GA18570@blackbody.suse.cz> References: <20191023153745.19515-1-valentin.schneider@arm.com> <20191023153745.19515-2-valentin.schneider@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: <20191023153745.19515-2-valentin.schneider@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 23, 2019 at 04:37:44PM +0100, Valentin Schneider wrote: > Prevent generate_sched_domains() from returning empty cpumasks, and add > some assertion in build_sched_domains() to scream bloody murder if it > happens again. Good catch. It makes sense to prune the empty domains in generate_sched_domains already. > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index c52bc91f882b..c87ee6412b36 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -798,7 +798,8 @@ static int generate_sched_domains(cpumask_var_t **dom= ains, > cpumask_subset(cp->cpus_allowed, top_cpuset.effective_cpus)) > continue; > =20 > - if (is_sched_load_balance(cp)) > + if (is_sched_load_balance(cp) && > + !cpumask_empty(cp->effective_cpus)) > csa[csn++] =3D cp; If I didn't overlook anything, cp->effective_cpus can contain CPUs exluded by housekeeping_cpumask(HK_FLAG_DOMAIN) later, i.e. possibly still returning domains with empty cpusets. I'd suggest moving the emptiness check down into the loop where domain cpumasks are ultimately constructed. Michal --9jxsPFA5p3P2qPhR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEEoQaUCWq8F2Id1tNia1+riC5qSgFAl27Cn4ACgkQia1+riC5 qSjwiw//aWG1NlJLTWdANaPNkP7nuGfeAYzGU/S0B9laDxFk9ADU3V43MjwxmExI WIHDWQqzNlmbsbsQgIh4jQd2RnkKoV84bQVbEM3HPCsQcpGtpq5djPKIOXgAkEI4 yS4gIMiYhbTD0wcjEtiRA8+WNMWKgNUa96Tdg3s6q9JfdrrROJm07taXI3L3YXFM w/N4Sj/XIMxgFEZunwU46ZoEihxPq7QwoChCE8qCXB9dPEbaftj3g0GlDSYQhXhu POS2IrraxRC5msvr/Ehu51zom7uvS/B+29dXOfF/jq2zk8cdspSzgFTsSGrUQ+eI cXI990mwxlT3XYi2fzmQZ6f3oTQhrQIS8Cjm0aGDY1vPbvH7Aacygcvu262jY0RF aQW/jQeqH7daCsFZn99bbHFnTUPF/eCw02yI0JHkO+sQXnsH2w5bJ14l69QpHkXs N7xqNgWVSwmfSecUKnpAq9VfQW473rs/nNGU3XsZrcErF4QhmCPwfMaw63YdYi5T bOxvfg1luMnDMbkjKeBawTxJuUjvB0LGm6c2t/wvsHoMo+CVMxWTzfZmrcoh/0Es rwLdn2pA+LVEmSdYsPndQo5xWBLns1muoa1vCvafthmHSGkEN1eLT03ZhXHwf1MK feIc5qyw4KHNJtYYa8qQYCwQAJ8EB6mglSqbt4/qRWGBbr3a5wg= =5/6w -----END PGP SIGNATURE----- --9jxsPFA5p3P2qPhR--