From patchwork Tue Mar 1 00:28:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Hart X-Patchwork-Id: 12763939 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 914A3C433EF for ; Tue, 1 Mar 2022 00:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=XitmRcEbE44AaXMSTFsw06BlCQFGCWpCc6rr0Zh9HmQ=; b=mLCFnFhm201xiA Em4B/YpH+UNwWU1VO3rIFSFNC25GXKtJONCe7xt9oLxZNgEaLuRDSCbvAJHTDspAp7alPLlt+Ixpp qK+HrUhf/X2V6LkBNNih5CCoITb5Dv03QnweDDKk6VjxW8el8Ik+kGazfKAvG/Hbir0JRCgglcc++ 1sxDDd9d2rcBZMAyYKdWeJU1Ol9q/7HWmeAPQi2sCqF4jmW1h875nmrQXsQO0t8AYn3p40jbY8NFE 8kj8Mjk7mfjkYXQIAbLc6ZBBT1GMwno43LDZ+me28gNSQgA61384klMcOlw4VrWbhLO92CP2El/yb 1SZLbJy3aGN0DvsIsjdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOqUI-00EV61-8U; Tue, 01 Mar 2022 00:35:34 +0000 Received: from mail-co1nam11on20716.outbound.protection.outlook.com ([2a01:111:f400:7eab::716] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOqUE-00EV4a-7w for linux-arm-kernel@lists.infradead.org; Tue, 01 Mar 2022 00:35:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cdw6yBYSavgk0bYLGEqnRZei6+HHd7f57u86y/Z/FwfHvMdePjDqC8U4E1Vi5kbzFxOfsVYmm0dhvghzdXCs3D8U1Onc+hw6Ug/qj7pjqySRONQT17m53VjhErtj+WnetxeCNWlr/2Y3WkKkDfHDw6XsL9PErUtNcvVGHSlllHf84qJWeH0Pz+Rh/1xW/RxPA1fmP/LNz3Gv3j0lanZXoRMC5IQsNwOvWnXe5HXqUjX1SqG37EqseMk3wi/s3Gfv6yOvbdEDB3kzO/3ekdc67sblQUjnmFrJtu1nPAT/jXe/rcERdvhr6UItLrPYH8/JA8XLgHoSkC0LBNndIYdt2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aAF8vFjLNhJbEzDGHKCXTxjvVKKIXEDDQq9K2TSV6b0=; b=m/G20gXGLIrdhzLK3Dp3hbe1HRaJRVB2E60UJeM5LAwLZ2ENAxrO3BzBaWl1ULITss15nlv/sw8VSgp9zNJn2n4pFuqfaM+HZM8V8Kj7QH0It6CAVgGLJzzNRK0MZzSnzOCv923Spot1z2HfvR4eWpCxvSx+ftYpKgZ37w8wrdDb15R5wjtPrqUDFhKvPLgqR4XvhkWo8m/i/2PTddkalnSy6E222M+Tky4GtrwgSXByyqW150mfLVexeCtttfD1N7hMSmfCtAs1acC19Ee2KPiskxxjZs4SzmYaq1Y66hURVz4cGW/Ly0XeCsLOyRr3sWehh6vJqCBQwMvHVcD0GQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aAF8vFjLNhJbEzDGHKCXTxjvVKKIXEDDQq9K2TSV6b0=; b=FIMVox74CjEW1/0q2Hgp8e5Z2Izp0Tp162GQyPZHdWySJanlSXV37KMDONZ9Xyy5iAOZCHhn17m545Jm/4Qj219cmj6P8YZYvO6MIh9hoWZEMhoVUSbVC/uwV95WMEI29+2+up67Ox2pWjeU85smo6qFCDwSVZf/H2bXeHYzeUM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SA0PR01MB6329.prod.exchangelabs.com (2603:10b6:806:ee::12) by BL0PR01MB5219.prod.exchangelabs.com (2603:10b6:208:33::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Tue, 1 Mar 2022 00:35:22 +0000 Received: from SA0PR01MB6329.prod.exchangelabs.com ([fe80::7cd6:6594:ce3c:6941]) by SA0PR01MB6329.prod.exchangelabs.com ([fe80::7cd6:6594:ce3c:6941%9]) with mapi id 15.20.5017.027; Tue, 1 Mar 2022 00:35:22 +0000 From: Darren Hart To: LKML , Linux Arm Cc: Catalin Marinas , Will Deacon , Peter Zijlstra , Vincent Guittot , Barry Song , Valentin Schneider , "D . Scott Phillips" , Ilkka Koskinen Subject: [PATCH 0/1] arm64: smp: Skip MC sched domain on SoCs with no LLC Date: Mon, 28 Feb 2022 16:28:59 -0800 Message-Id: X-Mailer: git-send-email 2.31.1 X-ClientProxiedBy: CH2PR07CA0065.namprd07.prod.outlook.com (2603:10b6:610:5b::39) To SA0PR01MB6329.prod.exchangelabs.com (2603:10b6:806:ee::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21af4431-a0bc-4e3d-72db-08d9fb1b5e3c X-MS-TrafficTypeDiagnostic: BL0PR01MB5219:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6OQUBS62zhfATWZrqksXevokiKtD57uQ6ajkUwSmtk+NYvI4KsqWovFYu5+g1gwsPU+o7/AvBFuggotoOhGN1T/s7YywPtTMjOQIUpgZaBdw4vrOYIDhq0W0LuO7arVQ815eZz7Fu7QSnikUIIsq7Q+mdiFuAnyEoOuAQyDrg5qs6LMFArAyMMkZcP7WX22tY/W4t0i+uTVJ7Cwla2ucJbCaOqb9JdtcJPeVrg9tuiPtQ/qfQvepXIdMbo9SwBl7y7O/PcxmL6QPkD41BOFqnjZsfVbAT88L24cpCNjgnLo68vrma1LUkAKKrpPU3KnlT87nJ3FisNyP7OApZYVr2XLk4xB1EhrIbUPTSCPy3fszX075X+OnIX1EHbUKlSj1t8sVHGfme4oSqgHkP2WA/iCcZx913BG32VFFg4nEYO9IWWE9jx1nDzOcIqx6UKA9XSqC4nuCtWK34s9ovdqWPQjrrYs0WubR8Sgb5GV9pP7LBHdXkHuC6j24RrDhiIMY4Y562YifADQ/lnDdV4N0W/0V+/8HwtUX+tCIX/aFyHNe1oSmWgMqrC1Ki0WKTG6Y5aPLAhJ+rFcNYb4JGVKS+tot4ROdft0TsX/9WLXekWKg4+0+ssqKk9QimhobzBKSDQZDLe0/X9d4jMV9B1uSupT5Vb4w2L/h1onsgXTdscptjMXFoaWF5XgY9yOCHl5Mr4nAgRFpRouTYfc1ga5uvg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA0PR01MB6329.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230001)(6029001)(4636009)(366004)(26005)(186003)(6512007)(5660300002)(8936002)(2616005)(38350700002)(38100700002)(107886003)(83380400001)(52116002)(508600001)(6486002)(6666004)(6506007)(110136005)(316002)(54906003)(4326008)(8676002)(86362001)(66476007)(66556008)(66946007)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FxkO9L+QNr8R8vB6WOpztgD+KJb45VltLmggoiUcNGEaTRmwPv2Vp/juAw+A3/ZFAmVic/sJ+XKvyQMb7e2bSbpre28GUrvBBNpArGQw+JC7vsBAeEk9v4lw0xNOnucJ9BuwfcFOuIm9mdPe1qkRpGB03cKyMLH5VoJKQzCYSZIQuitdxzYwpI2ifW9ULNpHjDa/Hs82t96Q9Sym5iRcPtAyaljdMuc9aEdAmDKVtXOg3aEnKDZTWC6+IucA7919vUKj97N7furUpzimCjroK2wSlqRLCJAgWwB+rhReU4Htdu7PvwZMSJDMWtZ38oXDe4sD+2kC/4TOUT50+mAvhXcrYYpmeaNjbSi3+x9rd2bgmyxQ7nnqqIttfsDw36aDutXIBfgUG+ew8c0pGapvp557bds3AhZIcS+6zTuxW7pW2tI+NtXIPChCDJ607zc5nmaf8tK8vcCV2wRmrlLuNwI6AYMZDaBH/AsM3DCR0X24XZe67lRvDYmWGZC1FKi+GYG/VVnxLshOGHTSYml1OjVfGZQ0Eh1rt/5KUb46Hs1Z61Z8mTnhpjkUeESSqsQyM9ROEdWkvbrB64T127+9hAeWtMtKx3l6ENGEUOXCDOu2v3TE0LIs3MFDtwnl8Wxp/l+ksUbGYasWSLkxdAEaT682jVz1doqplxzMYZGyzLiIIY7K0g4S8f6lB1nXJ+/Co5Sp3TFm/2ajUmMQogLcSiQmh1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21af4431-a0bc-4e3d-72db-08d9fb1b5e3c X-MS-Exchange-CrossTenant-AuthSource: SA0PR01MB6329.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2022 00:35:21.9921 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xUQN3eEzugMMQiUwMl4/Z7L+cPoS/5tfaoB8TrqtwUaRZw81MIxTXjRGnkqCeexLEGqq3jQzAw0vgYoTvyUmI+lrnPgy3iroJuheQqHLpu4yP9KGNFFzq7qXTPv5gSpN X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR01MB5219 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_163530_383182_590BF416 X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org After the feedback from Vincent and Barry, I wrote a version of this which performed the test in topology.c and added an ACPI pptt API to detect ancestry of cpu topology nodes. In the end, the new API felt forced and was inconsistent with the other APIs, and the detection loop was pretty ugly with a lot corner case cleanup. It seemed fragile and not very extensible. This version follows the approach taken by other architectures: wait until smp cpus are online and take advantage of the stored cpu_topology structure to make sched domain topology decisions. This adds a single point to test and decide on which sched domain topology should be used for an arm64 system without impacting the scheduler code, acpi code, or the construction of the cpu_topology structures. I think this is a cleaner and less invasive solution which properly encapsulates the sched domain topology decision in a way that is easy to maintain and extend over time. Vincent did mention in an earlier version that by relying on cpumasks and removing the MC sched domain, I didn't address possible future architectures which may have clusters without shared cache and an MC level with shared cache. In this version, I limit the removal of the MC level to topologies where the coregroup weight is 1 (so it doesn't impact such future architectures). I also think that by encapsulating the sched domain topology decision into a single function after smp boot, it will be simple enough for someone to support such a topology if and when it exists, allowing us to create a minimal solution to the immediate problem of BUGing on the current topology. Cc: Catalin Marinas Cc: Will Deacon Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Barry Song Cc: Valentin Schneider Cc: D. Scott Phillips Cc: Ilkka Koskinen Darren Hart (1): arm64: smp: Skip MC sched domain on SoCs with no LLC arch/arm64/kernel/smp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)