Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2600964ybg; Fri, 31 Jul 2020 05:07:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrarmew0FtZF/DXjGy3+yvKWTqMTIHL5oP+mDotlyYDnPg6A07WWybU6D/XNETPOcBealv X-Received: by 2002:a17:906:3e54:: with SMTP id t20mr3643911eji.471.1596197270333; Fri, 31 Jul 2020 05:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596197270; cv=none; d=google.com; s=arc-20160816; b=uUZQqYotUSFvqHoGf+0O4W9vsZYflBcb+qPyZhBhThyk9vIJZfBmMwmWrb9h2s4GN/ 69m5fQgXSQVGqeox7jI2Sx/mL+ISJAGSK0Pw+2vdcxI3jNYVG9gxLf/1e+2Y3QksMRwl 1nIRelb5FT7VmuB10Eac3hBUuP+iJd87WdXajMqDNirtQclNFIRR43LxV5BND8qGNN2n vMJ0l+r6lqhotmT795dNsmCe06m00SPqgcZoo2yR7D+N8Qh/usetChtVFuq4YZzuZFAO mHP0SmOh8foXZ15iPD+5Had+TIXGBp3lYxJem3jWjp2MtZq+PrzJWW+rSxCjjq31azCR GiKg== 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:mime-version :message-id:date:subject:cc:to:from; bh=xiUPVISTqzR6e0M7CWo17nKO31ufmOZAbxosrehU6y4=; b=sikxGaTQY+hJTWXF6jMpP8DpRBr6Sx+dZg1dDM17bKYp3fkGAep3KTV2BycqB7yiZT hPCfI8Ncqe60cqibnrUyqwlrY6db828dAGTCdDoAvwoVfJ/WRdYShyrcyI+2ow6LoyNX x05f+uxVQljWBmczGOisu680unMk773p0WgBkR4Usf0JXdXicUVyJddA9lDXNwLLB6UM 7V7F+nkgAFKmJwU/MruBdFqUDaUYWzf/zhY9is2ibFkzwVxATtuVjj+pmuXRNIeaAQ+Y xrxvA8tHzJp4c1wkHWQO7DNkDGcHI2pO2VwDzahzy27G9jgA5qPKsH3A41jwkRzfP5u+ w+Lw== 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 g6si5530768edl.330.2020.07.31.05.07.27; Fri, 31 Jul 2020 05:07:50 -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 S1732873AbgGaMFF (ORCPT + 99 others); Fri, 31 Jul 2020 08:05:05 -0400 Received: from foss.arm.com ([217.140.110.172]:56156 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732669AbgGaMFE (ORCPT ); Fri, 31 Jul 2020 08:05:04 -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 DF3D91FB; Fri, 31 Jul 2020 05:05:03 -0700 (PDT) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C538F3F71F; Fri, 31 Jul 2020 05:05:02 -0700 (PDT) From: Valentin Schneider To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, Quentin Perret Subject: [PATCH v4 00/10] sched: Instrument sched domain flags Date: Fri, 31 Jul 2020 12:54:52 +0100 Message-Id: <20200731115502.12954-1-valentin.schneider@arm.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I've repeatedly stared at an SD flag and asked myself "how should that be set up in the domain hierarchy anyway?". I figured that if we formalize our flags zoology a bit, we could also do some runtime assertions on them - this is what this series is all about. Patches ======= The idea is to associate the flags with metaflags that describes how they should be set in a sched domain hierarchy ("if this SD has it, all its {parents, children} have it") or how they behave wrt degeneration - details are in the comments and commit logs. The good thing is that the debugging bits go away when CONFIG_SCHED_DEBUG isn't set. The bad thing is that this replaces SD_* flags definitions with some unsavoury macros. This is mainly because I wanted to avoid having to duplicate work between declaring the flags and declaring their metaflags. o Patches 1-3 are topology cleanups / fixes o Patches 4-6 instrument SD flags and add assertions o Patches 7-10 leverage the instrumentation to factorize domain degeneration Revisions ========= v3 -> v4 -------- o Reordered the series to have fixes / cleanups first o Added SD_ASYM_CPUCAPACITY propagation (Quentin) o Made ARM revert back to the default sched topology (Dietmar) o Removed SD_SERIALIZE degeneration special case (Peter) o Made SD_NUMA and SD_SERIALIZE have SDF_NEEDS_GROUPS As discussed on v3, I thought this wasn't required, but thinking some more about it there can be cases where that changes the current behaviour. For instance, in the following wacky triangle: 0\ 30 | \ 20 | 2 | / 1/ 30 there are two unique distances thus two NUMA topology levels, however the first one for node 2 would have the same span as its child domain and thus should be degenerated. If we don't give SD_NUMA and SD_SERIALIZE SDF_NEEDS_GROUPS, this domain wouldn't be denegerated since its child *doesn't* have either SD_NUMA or SD_SERIALIZE (it's the first NUMA domain), and we'd have this weird NUMA domain lingering with a single group. v2 -> v3 -------- o Reworded comment for SD_OVERLAP (it's about the groups, not the domains) o Added more flags to the SD degeneration mask o Added generation of an SD flag mask for the degeneration functions (Peter) RFC -> v2 --------- o Rebased on top of tip/sched/core o Aligned wording of comments between flags o Rectified some flag descriptions (Morten) o Added removal of SD_SHARE_POWERDOMAIN (Morten) Valentin Schneider (10): ARM, sched/topology: Remove SD_SHARE_POWERDOMAIN ARM: Revert back to default scheduler topology. sched/topology: Propagate SD_ASYM_CPUCAPACITY upwards sched/topology: Split out SD_* flags declaration to its own file sched/topology: Define and assign sched_domain flag metadata sched/topology: Verify SD_* flags setup when sched_debug is on sched/topology: Add more flags to the SD degeneration mask sched/topology: Remove SD_SERIALIZE degeneration special case sched/topology: Introduce SD metaflag for flags needing > 1 groups sched/topology: Use prebuilt SD flag degeneration mask arch/arm/kernel/topology.c | 26 ------ include/linux/sched/sd_flags.h | 156 +++++++++++++++++++++++++++++++++ include/linux/sched/topology.h | 36 +++++--- kernel/sched/topology.c | 54 ++++++------ 4 files changed, 204 insertions(+), 68 deletions(-) create mode 100644 include/linux/sched/sd_flags.h -- 2.27.0