Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1515300ybt; Thu, 2 Jul 2020 07:24:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyha4pJABbsSIktjGOzurNX4YHXevoFxCZQesmKOhiaYpOGhgyikgXlJR5szc92iHK5Y9Uu X-Received: by 2002:aa7:c305:: with SMTP id l5mr29779221edq.163.1593699841128; Thu, 02 Jul 2020 07:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593699841; cv=none; d=google.com; s=arc-20160816; b=Ki3HwofkUqgdN+tyqpzZC5kN3EGS2ewXCF6qBpnRiasmrupodI9QJsbo9SLb98lt7k RfnsiHnSxbW+xq+DZH3ZmjV3RQ4k7eVu8vWzW6S6ZHmQY99MBrXWWFS0SB0sLSINfv+L Pv4UtMS/gavPKlq45J1KMwa3p+5SzBpa4KoEelcWCkWUKBfqiGErW1nNGD2i4pyu/kHG +du1wDCCfgofE/Q7dd4jEOAfzPdLIQ2NFXk1F7QQL9Mar2r6MmulW3hsKUK90j9lKJDR xsJViYqEAgx4mYE36lzcwOONJib1Ac8uNiewqiyVUrA2ivg1htgaC9lzFHpbx0/0vL66 bjiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=x2l3UQ1LnNvnh7vdkqLglXGyJtnaXge3J21AHjk9zjY=; b=J+5nPy9CkZ9UZmqi3ik4rOH1r137haTj73X7zevrm+QtNLnqSrtoAaOCZRELrMVQSY cTpqRKzBJ8hnY4OvSFEeZ0eF324n1lgM1xWxfNAWRaNuTfZPGzlVs7RNluqFoIaF8g4E WmWG9bVIUQJ6Sinp/m0CiB6eiqQwXGc6Amzw5j5Djixmfv0MjnWK81wcXP65+ogDnqTj uNzXMA3TnUMP4X1Qmb2PLL9AnGTH5jKnj2bMtMz39lkB0oouiF9Hbs7ddgkxhPu8rttb Mv0dCUivgsLsTS9eca854lnTySQjAh9TJ0eDrGZnhtXkUJ/XBE1ciuOYz7taf8kB5Aul 7HHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=JCIWj9l8; 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 k23si6050474ejk.35.2020.07.02.07.23.37; Thu, 02 Jul 2020 07:24:01 -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; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=JCIWj9l8; 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 S1729556AbgGBOUs (ORCPT + 99 others); Thu, 2 Jul 2020 10:20:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728651AbgGBOUs (ORCPT ); Thu, 2 Jul 2020 10:20:48 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49165C08C5C1 for ; Thu, 2 Jul 2020 07:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=x2l3UQ1LnNvnh7vdkqLglXGyJtnaXge3J21AHjk9zjY=; b=JCIWj9l8B+Tkd7lJF/AyeT9+BF RE6tfRd4AZ6VMNSVcHPf3mREt1c9NTlTdSrI3OJxTW4qfr2HjatHBF+md1xyY7COPSmCM08LqS9rX 46tgLGVKgvisjJJ59JE7pXxYAbWWSyPa1A9/AtQT5Ce+Z150U7OR3Ho/cxE/DPbFPesf0VaoMTEea gT8ErM8gDJLKmotbXSApWrFto551L1nceFKLrkVyLoQITk6lW0Aqwo6jUo5fVB4WFL7/lxflBnah/ bEiG0As7gRldfVNsHvoSUhtcHPsXWm1zoy6sxkShVn1WGJDFKuoGDKkzvTL5Nn6RojGhYCd6hfjSV XhSMO8PA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jr04y-00013f-Ck; Thu, 02 Jul 2020 14:20:44 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1E9293059DE; Thu, 2 Jul 2020 16:20:43 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0657820108659; Thu, 2 Jul 2020 16:20:43 +0200 (CEST) Date: Thu, 2 Jul 2020 16:20:42 +0200 From: Peter Zijlstra To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, morten.rasmussen@arm.com Subject: Re: [PATCH v3 3/7] sched/topology: Verify SD_* flags setup when sched_debug is on Message-ID: <20200702142042.GI4817@hirez.programming.kicks-ass.net> References: <20200701190656.10126-1-valentin.schneider@arm.com> <20200701190656.10126-4-valentin.schneider@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200701190656.10126-4-valentin.schneider@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 01, 2020 at 08:06:51PM +0100, Valentin Schneider wrote: > @@ -29,6 +29,7 @@ static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level, > struct cpumask *groupmask) > { > struct sched_group *group = sd->groups; > + int flags = sd->flags; unsigned long flags = sd->flags; > > cpumask_clear(groupmask); > > @@ -43,6 +44,22 @@ static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level, > printk(KERN_ERR "ERROR: domain->groups does not contain CPU%d\n", cpu); > } > > + for (; flags; flags &= flags - 1) { > + unsigned int idx = __ffs(flags); for_each_set_bit(idx, &flags, SD_MAX_BIT) { Yes, it's a bit yuck, but far more readable imo. > + unsigned int flag = BIT(idx); > + unsigned int meta_flags = sd_flag_debug[idx].meta_flags; > + > + if ((meta_flags & SDF_SHARED_CHILD) && sd->child && > + !(sd->child->flags & flag)) > + printk(KERN_ERR "ERROR: flag %s set here but not in child\n", > + sd_flag_debug[idx].name); > + > + if ((meta_flags & SDF_SHARED_PARENT) && sd->parent && > + !(sd->parent->flags & flag)) > + printk(KERN_ERR "ERROR: flag %s set here but not in parent\n", > + sd_flag_debug[idx].name); > + } > + > printk(KERN_DEBUG "%*s groups:", level + 1, ""); > do { > if (!group) { > -- > 2.27.0 >