Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp902458imm; Wed, 6 Jun 2018 07:37:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJIKz8/WDuCimpswhxYbpYa0xlhh9f+lDFoivap23e7ztvFnyEkTBM2QBoLlx3yOLotLc5D X-Received: by 2002:a17:902:be03:: with SMTP id r3-v6mr3552856pls.319.1528295830170; Wed, 06 Jun 2018 07:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528295830; cv=none; d=google.com; s=arc-20160816; b=Du956Jbp2EmTqKhokojXRetNEAQT7b53YB0FIi/Gwc3zKO4bRzUbeqt5WNYDqD4w6l 53E9t+tsIJ14c/a0/jSK3Us1bfpfTXbUbwxTI+TqLPAlHpm5hf+YFQ0w/iZk/NoU2CHn 9N/3X/XXXq4vMpfKhDAsW9eEYtiN/4pjgDy2l6pL8I2fIopsDjbJm7zZFnIgmsgTAfnl yOF76cfDMP/g1CtgO8Wc1vEP+XbEvXUM66r5iq8GSMWXjZEM5aLPJtO5zKtqAqYrN/kc SocZfPD/MZ75lGwy9wCMhD20UmNmzWzeR7e5XR045eS/X+gWNcz5XVCuaeZa8Pbs6tHv EElg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=GDoR1PO6NEDv8TPdhpe/QME/dK9CEjhDyr5x6VAs0IQ=; b=k174V2kLlQSXUbg97JGxW6in5+uSqOnMuQMJ6DzgHgLx7nw+nj44j7Hl0uQ2rZE1P+ g4GHHP1H75suOKml66Xu1C/m4MNtg9q8mkpSQMQtOpbUem/yCoQY2RerwbALZ9OVCYsk IokNRlxZ1U4efnNwUZWxBjhJkDWtw/nIWi1rH7828y+oR2m9fxkuGFSEmAizQYBerPYc 9X+A1f9hp/cEVK7hsloYxqV3YAckx5dHQ8bOo9ugJAfWfzKTQNKrNKTpWDpPTqoKBVms GnQe8HJAc6kEtuWBpE0K4cZ++r+AEbUGY71MTwKhjzlOnaBOfrudc05Zlw2bf9NjYq/P aFeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 i11-v6si23080814pgc.350.2018.06.06.07.36.56; Wed, 06 Jun 2018 07:37:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752074AbeFFOgb (ORCPT + 99 others); Wed, 6 Jun 2018 10:36:31 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:41118 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987AbeFFOga (ORCPT ); Wed, 6 Jun 2018 10:36:30 -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 404B080D; Wed, 6 Jun 2018 07:36:30 -0700 (PDT) Received: from [192.168.100.244] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A6EA23F5A0; Wed, 6 Jun 2018 07:36:29 -0700 (PDT) Subject: Re: [PATCH] arm64: topology: Avoid checking numa mask for scheduler MC selection To: Sudeep Holla Cc: Will.Deacon@arm.com, Catalin.Marinas@arm.com, Robin.Murphy@arm.com, Morten.Rasmussen@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, geert@linux-m68k.org, linux-acpi@vger.kernel.org, ard.biesheuvel@linaro.org References: <20180605190837.493505-1-jeremy.linton@arm.com> <3c8a541d-78a1-389a-112c-494f7c1a543d@arm.com> From: Jeremy Linton Message-ID: <120c2793-8826-4a7c-cf5c-cb6661602b5a@arm.com> Date: Wed, 6 Jun 2018 09:36:27 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <3c8a541d-78a1-389a-112c-494f7c1a543d@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/06/2018 05:05 AM, Sudeep Holla wrote: > > > On 05/06/18 20:08, Jeremy Linton wrote: >> The numa mask subset check has problems if !CONFIG_NUMA, over hotplug >> operations or during early boot. Lets disable the NUMA siblings checks >> for the time being, as NUMA in socket machines have LLC's that will >> assure that the scheduler topology isn't "borken". >> > > ^ broken ? (not sure if usage of borken is intentional :)) Well that is what the scheduler says when it doesn't like the topology. > >> Futher, as a defensive mechanism during hotplug, lets assure that the > > ^ Further Sure. > >> LLC siblings are also masked. >> > > Also add the symptoms of the issue we say as Geert suggested me. > Something like: > " 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." > > You can add Reported-by: Geert... ? ok. > >> Signed-off-by: Jeremy Linton >> --- >> arch/arm64/kernel/topology.c | 11 ++++------- >> 1 file changed, 4 insertions(+), 7 deletions(-) >> >> diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c >> index 7415c166281f..f845a8617812 100644 >> --- a/arch/arm64/kernel/topology.c >> +++ b/arch/arm64/kernel/topology.c >> @@ -215,13 +215,8 @@ 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)); >> + const cpumask_t *core_mask = &cpu_topology[cpu].core_sibling; >> >> - /* 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; >> @@ -239,8 +234,10 @@ 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) >> + if (cpuid_topo->llc_id == cpu_topo->llc_id) { >> cpumask_set_cpu(cpu, &cpuid_topo->llc_siblings); >> + cpumask_set_cpu(cpuid, &cpu_topo->llc_siblings); >> + } >> >> if (cpuid_topo->package_id != cpu_topo->package_id) >> continue; >> > > Looks good to me for now. I might need to tweek it a bit when I add the > support to update topology on hotplug. But that's for latter. For now, > > Reviewed-by: Sudeep Holla >