From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valentin Schneider Date: Fri, 08 Oct 2021 15:22:27 +0000 Subject: Re: [PATCH 2/2] sched: Centralize SCHED_{SMT, MC, CLUSTER} definitions Message-Id: <87bl3zlex8.mognet@arm.com> List-Id: References: <20211008115347.425234-1-valentin.schneider@arm.com> <20211008115347.425234-3-valentin.schneider@arm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Barry Song <21cnbao@gmail.com> Cc: LKML , LAK , linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Peter Zijlstra , Aubrey Li , Barry Song , Tim Chen , Jonathan Cameron , Russell King , Catalin Marinas , Will Deacon , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Yoshinori Sato , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86 , "H. Peter Anvin" , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Arnd Bergmann , Linus Walleij , Geert Uytterhoeven , Andrew Morton , Anshuman Khandual , Mike Rapoport , Mark Rutland , Ard Biesheuvel , YiFei Zhu , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Kefeng Wang , Sergei Trofimovich , David Hildenbrand , Randy Dunlap , Masahiro Yamada , Kees Cook , Nathan Chancellor , Nick Desaulniers , Chris Down , Vipin Sharma , Rasmus Villemoes , Daniel Borkmann , Vlastimil Babka , Frederic Weisbecker , Hugh Dickins , Michal Hocko On 09/10/21 01:37, Barry Song wrote: > On Sat, Oct 9, 2021 at 12:54 AM Valentin Schneider > wrote: >> >> Barry recently introduced a new CONFIG_SCHED_CLUSTER, and discussions >> around that highlighted that every architecture redefines its own help text >> and dependencies for CONFIG_SCHED_SMT and CONFIG_SCHED_MC. >> >> Move the definition of those to scheduler's Kconfig to centralize help text >> and generic dependencies (i.e. SMP). Make them depend on a matching >> ARCH_SUPPORTS_SCHED_* which the architectures can select with the relevant >> architecture-specific dependency. >> >> s390 uses its own topology table (set_sched_topology()) and doesn't seem to >> cope without SCHED_MC or SCHED_SMT, so those remain untogglable. >> > > Hi Valentin, > Thanks! > I believe this is a cleaner way for Kconfig itself. But I am not quite sure this > is always beneficial of all platforms. It would be perfect if the patch has no > side effects and doesn't change the existing behaviour. But it has side effects > by changing the default N to Y on a couple of platforms. > So x86 has it default yes, and a lot of others (e.g. arm64) have it default no. IMO you don't gain much by disabling them. SCHED_MC and SCHED_CLUSTER only control the presence of a sched_domain_topology_level - if it's useless it gets degenerated at domain build time. Some valid reasons for not using them is if the architecture defines its own topology table (e.g. powerpc has CACHE and MC levels which are not gated behind any CONFIG). SCHED_SMT has an impact on code generated in sched/core.c, but that is also gated by a static key. So I'd say having them default yes is sensible. I'd even say we should change the "If unsure say N here." to "Y". From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B07A3C433EF for ; Fri, 8 Oct 2021 15:22:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 960A66101A for ; Fri, 8 Oct 2021 15:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242883AbhJHPYe (ORCPT ); Fri, 8 Oct 2021 11:24:34 -0400 Received: from foss.arm.com ([217.140.110.172]:58598 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242780AbhJHPYd (ORCPT ); Fri, 8 Oct 2021 11:24:33 -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 EF3811063; Fri, 8 Oct 2021 08:22:37 -0700 (PDT) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9B44F3F66F; Fri, 8 Oct 2021 08:22:29 -0700 (PDT) From: Valentin Schneider To: Barry Song <21cnbao@gmail.com> Cc: LKML , LAK , linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Peter Zijlstra , Aubrey Li , Barry Song , Tim Chen , Jonathan Cameron , Russell King , Catalin Marinas , Will Deacon , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Yoshinori Sato , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86 , "H. Peter Anvin" , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Arnd Bergmann , Linus Walleij , Geert Uytterhoeven , Andrew Morton , Anshuman Khandual , Mike Rapoport , Mark Rutland , Ard Biesheuvel , YiFei Zhu , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Kefeng Wang , Sergei Trofimovich , David Hildenbrand , Randy Dunlap , Masahiro Yamada , Kees Cook , Nathan Chancellor , Nick Desaulniers , Chris Down , Vipin Sharma , Rasmus Villemoes , Daniel Borkmann , Vlastimil Babka , Frederic Weisbecker , Hugh Dickins , Michal Hocko Subject: Re: [PATCH 2/2] sched: Centralize SCHED_{SMT, MC, CLUSTER} definitions In-Reply-To: References: <20211008115347.425234-1-valentin.schneider@arm.com> <20211008115347.425234-3-valentin.schneider@arm.com> Date: Fri, 08 Oct 2021 16:22:27 +0100 Message-ID: <87bl3zlex8.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On 09/10/21 01:37, Barry Song wrote: > On Sat, Oct 9, 2021 at 12:54 AM Valentin Schneider > wrote: >> >> Barry recently introduced a new CONFIG_SCHED_CLUSTER, and discussions >> around that highlighted that every architecture redefines its own help text >> and dependencies for CONFIG_SCHED_SMT and CONFIG_SCHED_MC. >> >> Move the definition of those to scheduler's Kconfig to centralize help text >> and generic dependencies (i.e. SMP). Make them depend on a matching >> ARCH_SUPPORTS_SCHED_* which the architectures can select with the relevant >> architecture-specific dependency. >> >> s390 uses its own topology table (set_sched_topology()) and doesn't seem to >> cope without SCHED_MC or SCHED_SMT, so those remain untogglable. >> > > Hi Valentin, > Thanks! > I believe this is a cleaner way for Kconfig itself. But I am not quite sure this > is always beneficial of all platforms. It would be perfect if the patch has no > side effects and doesn't change the existing behaviour. But it has side effects > by changing the default N to Y on a couple of platforms. > So x86 has it default yes, and a lot of others (e.g. arm64) have it default no. IMO you don't gain much by disabling them. SCHED_MC and SCHED_CLUSTER only control the presence of a sched_domain_topology_level - if it's useless it gets degenerated at domain build time. Some valid reasons for not using them is if the architecture defines its own topology table (e.g. powerpc has CACHE and MC levels which are not gated behind any CONFIG). SCHED_SMT has an impact on code generated in sched/core.c, but that is also gated by a static key. So I'd say having them default yes is sensible. I'd even say we should change the "If unsure say N here." to "Y". From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 882C7C433F5 for ; Sat, 9 Oct 2021 05:39:37 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACE5D60F5B for ; Sat, 9 Oct 2021 05:39:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ACE5D60F5B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HRDQb2rQfz3dZx for ; Sat, 9 Oct 2021 16:39:35 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=arm.com (client-ip=217.140.110.172; helo=foss.arm.com; envelope-from=valentin.schneider@arm.com; receiver=) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lists.ozlabs.org (Postfix) with ESMTP id 4HQsPv1T20z2ynt for ; Sat, 9 Oct 2021 02:22:41 +1100 (AEDT) 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 EDF7F6D; Fri, 8 Oct 2021 08:22:37 -0700 (PDT) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9B44F3F66F; Fri, 8 Oct 2021 08:22:29 -0700 (PDT) From: Valentin Schneider To: Barry Song <21cnbao@gmail.com> Subject: Re: [PATCH 2/2] sched: Centralize SCHED_{SMT, MC, CLUSTER} definitions In-Reply-To: References: <20211008115347.425234-1-valentin.schneider@arm.com> <20211008115347.425234-3-valentin.schneider@arm.com> Date: Fri, 08 Oct 2021 16:22:27 +0100 Message-ID: <87bl3zlex8.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain X-Mailman-Approved-At: Sat, 09 Oct 2021 16:36:15 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , Mark Rutland , Kefeng Wang , Rich Felker , linux-ia64@vger.kernel.org, Geert Uytterhoeven , linux-sh@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Linus Walleij , David Hildenbrand , x86 , linux-mips@vger.kernel.org, "James E.J. Bottomley" , Hugh Dickins , Paul Mackerras , "H. Peter Anvin" , sparclinux@vger.kernel.org, Will Deacon , Ard Biesheuvel , linux-s390@vger.kernel.org, Vincent Guittot , Arnd Bergmann , Yoshinori Sato , YiFei Zhu , Helge Deller , Aubrey Li , Daniel Bristot de Oliveira , Russell King , Christian Borntraeger , Ingo Molnar , Mel Gorman , Masahiro Yamada , Frederic Weisbecker , Kees Cook , Vasily Gorbik , Anshuman Khandual , Vlastimil Babka , Vipin Sharma , Heiko Carstens , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Steven Rostedt , Nathan Chancellor , Borislav Petkov , Sergei Trofimovich , Jonathan Cameron , Thomas Gleixner , Michal Hocko , Dietmar Eggemann , LAK , Barry Song , Ben Segall , Thomas Bogendoerfer , Daniel Borkmann , linux-parisc@vger.kernel.org, Chris Down , linuxppc-dev@lists.ozlabs.org, Randy Dunlap , Nick Desaulniers , LKML , Rasmus Villemoes , Andrew Morton , Tim Chen , "David S. Miller" , Mike Rapoport Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 09/10/21 01:37, Barry Song wrote: > On Sat, Oct 9, 2021 at 12:54 AM Valentin Schneider > wrote: >> >> Barry recently introduced a new CONFIG_SCHED_CLUSTER, and discussions >> around that highlighted that every architecture redefines its own help text >> and dependencies for CONFIG_SCHED_SMT and CONFIG_SCHED_MC. >> >> Move the definition of those to scheduler's Kconfig to centralize help text >> and generic dependencies (i.e. SMP). Make them depend on a matching >> ARCH_SUPPORTS_SCHED_* which the architectures can select with the relevant >> architecture-specific dependency. >> >> s390 uses its own topology table (set_sched_topology()) and doesn't seem to >> cope without SCHED_MC or SCHED_SMT, so those remain untogglable. >> > > Hi Valentin, > Thanks! > I believe this is a cleaner way for Kconfig itself. But I am not quite sure this > is always beneficial of all platforms. It would be perfect if the patch has no > side effects and doesn't change the existing behaviour. But it has side effects > by changing the default N to Y on a couple of platforms. > So x86 has it default yes, and a lot of others (e.g. arm64) have it default no. IMO you don't gain much by disabling them. SCHED_MC and SCHED_CLUSTER only control the presence of a sched_domain_topology_level - if it's useless it gets degenerated at domain build time. Some valid reasons for not using them is if the architecture defines its own topology table (e.g. powerpc has CACHE and MC levels which are not gated behind any CONFIG). SCHED_SMT has an impact on code generated in sched/core.c, but that is also gated by a static key. So I'd say having them default yes is sensible. I'd even say we should change the "If unsure say N here." to "Y".