From patchwork Tue Jun 5 14:35:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 137754 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1039214lji; Tue, 5 Jun 2018 07:35:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIYzNn5mEttR7eSxI1NUnwOICoYFvUFeKjA3ohnI/57Ro2d4cEXB1jSR3aWLnApzY97V+YT X-Received: by 2002:a17:902:8f84:: with SMTP id z4-v6mr27011076plo.194.1528209315285; Tue, 05 Jun 2018 07:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528209315; cv=none; d=google.com; s=arc-20160816; b=DR+Fjgy0B9UJlbyPV9nBwB8tQ2xXG9P1QuTwoOteFQDKVOovaGNWmjpX4HqgXEnJ35 uD8EudlBdYsE/ow15CayaoC0ZVHaDfjix/k5VUmiqLPd/AcvOHbKUcgh5p5vcZ7ds5zv CM+W5XUhUyBP7omuk/jacBEJ3Jd2jst1Lj+zIScvBYU+mS3h5OY4+i65zRmEiM/XsfcY ZNs44JkVyZWbVXR0k0uaBO7hZRvWnId/5nO99OKFLJsaMv9vmkYiPZBvuofMUpNZunwG F35QCWFoIk+QYCsBEfIzhkH6T9/AeaYREiZcr166WNGaK/YVVV7zmBVhykzjINpFkeFp jk7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=lmNv57+kYwq7cDNJ6jLbfAAR1lPYueI9biZogtOqrBE=; b=SgQZplWoFHX//6AbP9aeu2XJuyBDs6ELJT3JI9j03xhUfp3Evuz1bq9rV1NdHgIj60 1VTySYDVOD2POmKmAQXZYRfY2LpEQaUfu/F+D2jMExdsXgVgasp+nGRs7JuMb4tR1QcH EZW2jpSvqig1PDPTEfG5Vl/cfQbtXZslANQecoAGmDr6O1yYhknAwv3+8IFGL2K6p5X3 CPNs8GtSCS+z/qGHSO0/PzAYt6bVxWzxtYI91tfcye9n+k5wd4xRKZ+lXHQxJYb6IATj d4Eux7ttcplP7qB/QqhSMzmz+1nPbEGV9uYndMK3bfW1ORr9Z2NHohgYq0Kbxj8e42CO 66sg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 n15-v6si9285706pgf.45.2018.06.05.07.35.14; Tue, 05 Jun 2018 07:35:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752038AbeFEOfM (ORCPT + 8 others); Tue, 5 Jun 2018 10:35:12 -0400 Received: from foss.arm.com ([217.140.101.70]:56730 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751958AbeFEOfM (ORCPT ); Tue, 5 Jun 2018 10:35:12 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B711B1596; Tue, 5 Jun 2018 07:35:11 -0700 (PDT) Received: from usa.arm.com (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C8D533F557; Tue, 5 Jun 2018 07:35:09 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org, "Rafael J . Wysocki" , Catalin Marinas , Jeremy Linton Cc: Sudeep Holla , Morten Rasmussen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Hanjun Guo , Geert Uytterhoeven , Will Deacon Subject: [PATCH v2 1/3] Revert "arm64: topology: divorce MC scheduling domain from core_siblings" Date: Tue, 5 Jun 2018 15:35:02 +0100 Message-Id: <1528209304-3280-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org This reverts commit 37c3ec2d810f87eac73822f76b30391a83bded19. Currently on ARM64 platforms, we don't update the CPU topology masks on each hotplug operation. However, the updates to cpu_coregroup_mask done as part of ACPI PPTT support, in particular the commit being reverted makes use of cpumask_of_node which returns the cpu_oneline_mask instead of core_sibling as core_sibling masks are not updated for CPU hotplug operations and the comparision to find NUMA in package or LLC siblings fails. This often leads to system hang or crash during CPU hotplug and system suspend operation. This is mostly observed on HMP systems where the CPU compute capacities are different and ends up in different scheduler domains. Since cpumask_of_node is returned instead core_sibling, the scheduler is confused with incorrect cpumasks(e.g. one CPU in two different sched domains at the same time) on CPU hotplug. The original commit is technically correct and since it depends on the not yet supported feature, let's revert this for now. We can put it back once we have the support for CPU topology masks update on hotplug merged. Reported-by: Geert Uytterhoeven Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Sudeep Holla --- arch/arm64/include/asm/topology.h | 2 -- arch/arm64/kernel/topology.c | 36 +----------------------------------- 2 files changed, 1 insertion(+), 37 deletions(-) v1->v2: - Updated commit log to describe the observations made as a consequence of the issue as suggested by Geert's -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index df48212f767b..6b10459e6905 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -8,10 +8,8 @@ struct cpu_topology { int thread_id; int core_id; int package_id; - int llc_id; cpumask_t thread_sibling; cpumask_t core_sibling; - cpumask_t llc_siblings; }; extern struct cpu_topology cpu_topology[NR_CPUS]; diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 7415c166281f..047d98e68502 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -13,7 +13,6 @@ #include #include -#include #include #include #include @@ -215,19 +214,7 @@ EXPORT_SYMBOL_GPL(cpu_topology); const struct cpumask *cpu_coregroup_mask(int cpu) { - const cpumask_t *core_mask = cpumask_of_node(cpu_to_node(cpu)); - - /* Find the smaller of NUMA, core or LLC siblings */ - if (cpumask_subset(&cpu_topology[cpu].core_sibling, core_mask)) { - /* not numa in package, lets use the package siblings */ - core_mask = &cpu_topology[cpu].core_sibling; - } - if (cpu_topology[cpu].llc_id != -1) { - if (cpumask_subset(&cpu_topology[cpu].llc_siblings, core_mask)) - core_mask = &cpu_topology[cpu].llc_siblings; - } - - return core_mask; + return &cpu_topology[cpu].core_sibling; } static void update_siblings_masks(unsigned int cpuid) @@ -239,9 +226,6 @@ static void update_siblings_masks(unsigned int cpuid) for_each_possible_cpu(cpu) { cpu_topo = &cpu_topology[cpu]; - if (cpuid_topo->llc_id == cpu_topo->llc_id) - cpumask_set_cpu(cpu, &cpuid_topo->llc_siblings); - if (cpuid_topo->package_id != cpu_topo->package_id) continue; @@ -307,10 +291,6 @@ static void __init reset_cpu_topology(void) cpu_topo->core_id = 0; cpu_topo->package_id = -1; - cpu_topo->llc_id = -1; - cpumask_clear(&cpu_topo->llc_siblings); - cpumask_set_cpu(cpu, &cpu_topo->llc_siblings); - cpumask_clear(&cpu_topo->core_sibling); cpumask_set_cpu(cpu, &cpu_topo->core_sibling); cpumask_clear(&cpu_topo->thread_sibling); @@ -331,8 +311,6 @@ static int __init parse_acpi_topology(void) is_threaded = read_cpuid_mpidr() & MPIDR_MT_BITMASK; for_each_possible_cpu(cpu) { - int i, cache_id; - topology_id = find_acpi_cpu_topology(cpu, 0); if (topology_id < 0) return topology_id; @@ -347,18 +325,6 @@ static int __init parse_acpi_topology(void) } topology_id = find_acpi_cpu_topology_package(cpu); cpu_topology[cpu].package_id = topology_id; - - i = acpi_find_last_cache_level(cpu); - - if (i > 0) { - /* - * this is the only part of cpu_topology that has - * a direct relationship with the cache topology - */ - cache_id = find_acpi_cpu_cache_topology(cpu, i); - if (cache_id > 0) - cpu_topology[cpu].llc_id = cache_id; - } } return 0; From patchwork Tue Jun 5 14:35:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 137756 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1039607lji; Tue, 5 Jun 2018 07:35:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ7GQlmMvouas1iZ9B1hI/8D0/9xUTeED5rCaGUQij4oFoGLsBagxqPQ5wsGJshf1zfEojb X-Received: by 2002:a17:902:274a:: with SMTP id j10-v6mr27241628plg.393.1528209333463; Tue, 05 Jun 2018 07:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528209333; cv=none; d=google.com; s=arc-20160816; b=zSsMQ1Bj62pgAa3AfnmJNr2Y7D7TU8qU6KUjbM3UJCNMfkgg5xer94O4SROc8S7ES2 IP70nuxWDhIsTPuHByatv4s/eiDqgXlVv9FmtLyJq1UH96e0ckeMepNrTf5bUF/3PDPk AJ34EI/vnHObIzwea+NSBqGyMKZqRv5xl8wwyOtiSZWbfcU+etFKGjJW2eeRoWcxnw4p /0F82mt8517FIHz9nuiJz/6zqJo740M95RAMBDQQmkqao94bEt3Xh9LGufeABgEFlrcK f0m4QTW1I8na7LzNzHKduuwlkAQYq+2sFtOAeICC7Cg7qjjk3lYYy/ANKz0X2nIp3LEa BbTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=B9PqbFJZznrKXPjAFzNoNSFm3HMh8Qr82c1/YB08v5s=; b=H9CO2/QgGZYX7rV++LEgrrYL6Zns5op/fsZFabbIcSYNgP3Jzb4ID1PHa8DzAFtwQ4 H58tx8e10j3jJOxpNawKUSS9S7TW7VgR20/5fwcAhktnylGxC3/0id3itpho4EIOQk0H csp+rf5O0I77KJOYGoI8SscgJKo6XYPT4R0TrUU8/248F2apa4IWQ7emqmDziRtVZmtH B4gV5r35OfbYsZYvZXyS3J24OFddlapulmcvRZDV1jS1o9WRc4cL0Byzq7TCl02GMAZ3 sCymYFzPdqkhtXAflRgqzuPhnOZbXBeTNZMxP1cuo8cDVSje29KHLBC4NpPBImKcU/3D xXhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 j12-v6si9852183pgf.359.2018.06.05.07.35.33; Tue, 05 Jun 2018 07:35:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752461AbeFEOfb (ORCPT + 8 others); Tue, 5 Jun 2018 10:35:31 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56764 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752335AbeFEOfQ (ORCPT ); Tue, 5 Jun 2018 10:35:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F3F3215B2; Tue, 5 Jun 2018 07:35:15 -0700 (PDT) Received: from usa.arm.com (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 097233F557; Tue, 5 Jun 2018 07:35:13 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org, "Rafael J . Wysocki" , Catalin Marinas , Jeremy Linton Cc: Sudeep Holla , Morten Rasmussen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Hanjun Guo , Geert Uytterhoeven , Will Deacon Subject: [PATCH v2 3/3] arm64: disable ACPI PPTT support temporarily Date: Tue, 5 Jun 2018 15:35:04 +0100 Message-Id: <1528209304-3280-3-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528209304-3280-1-git-send-email-sudeep.holla@arm.com> References: <1528209304-3280-1-git-send-email-sudeep.holla@arm.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Currently, ARM64 doesn't support updating the CPU topology masks on CPU hotplug operations. ACPI PPTT support rely on that missing feature which is technically not incorrect. Instead of reverting all the PPTT support, let's keep it simple and disable ACPI PPTT support on ARM64 for time-being until the topology updates are added for CPU hotplug operations. Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Sudeep Holla --- arch/arm64/Kconfig | 1 - 1 file changed, 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 9fd4a8ccce07..98a5c78a80f9 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -7,7 +7,6 @@ config ARM64 select ACPI_REDUCED_HARDWARE_ONLY if ACPI select ACPI_MCFG if ACPI select ACPI_SPCR_TABLE if ACPI - select ACPI_PPTT if ACPI select ARCH_CLOCKSOURCE_DATA select ARCH_HAS_DEBUG_VIRTUAL select ARCH_HAS_DEVMEM_IS_ALLOWED