Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp513744imm; Thu, 13 Sep 2018 03:35:56 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaQNySCAXm+8WRGsGoFJbAN7sLsWq2LVojCb7msKW/T/0P5cJ1ABq0v/i3/NEXpkM+nY9k8 X-Received: by 2002:a17:902:4324:: with SMTP id i33-v6mr6475970pld.43.1536834956765; Thu, 13 Sep 2018 03:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536834956; cv=none; d=google.com; s=arc-20160816; b=F/WLaxwkO2wwncdYky+HpAylB4T/AKojoBY5ybHG3kcLPbHMp+eDho1OWAPZ+9vEuT 1T3jXP/KM+YnKqB64yik628Jltaob9LCRhW/oXPEkZaJDEummtGDLjExzi06zk/lGpqY uF2XGIao+PIH1n44wwmZzJ22Dt4xG+bKbiFeV3Vkn3hAzpJaW4YxkvLjyev9QXmVd/oZ lFGwWurZ8Diuhvlv7s1hDWC2hjiLA1v4vdIZm3zvRgwd5m4XYWRz5P+tJmI8JSwUg4s0 lUirDzKr7bHIpcPT9Lb4cTzvoCpSYl0mKiiNa/P9r4uYs08TYoF0vFS3wpbDjS1l9tFL pbxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=g/+KsiL/5NiJwAB6jJUghMu4Tm3M7cVIW357yJlvZEA=; b=Z7hhdl8uDzRgMpl0lDpNXcG0TwdWWvl/YPs2mZ6VoRXsNJXWVCF596PPv8uXKngcwq NIwqqG9bnl1d2aTF7of5tTHOMS7/ioeBqh10VpAHAQQ7PAPuDuRueBXd4iMmsE0Jf+Ck 0ik0f1n1H4pLUnTZI9Vw4yycsc8HI75Elec2Y3A/Ek/yqjTrjnEBZgI6MHkvx/YB1F3p hrWqEnt2RnoBPI9fhOGye4Q9vWznleZLBrJqe43yVjPJeOX16Eo9WzUmNFAn+cvtAurM jLnqgH+ah2EJI4sgKshHBfJGxvKsTnPlUQ5Cof2Y0+w8hRoDa3f5U71ngP9U3uiBdG6f V+Cg== 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 z20-v6si3760007pgj.159.2018.09.13.03.35.41; Thu, 13 Sep 2018 03:35:56 -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 S1727441AbeIMPo0 (ORCPT + 99 others); Thu, 13 Sep 2018 11:44:26 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45758 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726912AbeIMPo0 (ORCPT ); Thu, 13 Sep 2018 11:44:26 -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 2237E80D; Thu, 13 Sep 2018 03:35:35 -0700 (PDT) Received: from e107155-lin (e107155-lin.emea.arm.com [10.4.12.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 161B83F557; Thu, 13 Sep 2018 03:35:32 -0700 (PDT) Date: Thu, 13 Sep 2018 11:35:25 +0100 From: Sudeep Holla To: James Morse , Brice Goglin Cc: Jeffrey Hugo , Sudeep Holla , Jeremy Linton , rjw@rjwysocki.net, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, vkilari@codeaurora.org Subject: Re: [PATCH] ACPI/PPTT: Handle architecturally unknown cache types Message-ID: <20180913103525.GA7777@e107155-lin> References: <1536694334-5811-1-git-send-email-jhugo@codeaurora.org> <4f253bf4-ef2d-849f-b793-9b0530e72aab@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 13, 2018 at 10:39:10AM +0100, James Morse wrote: > Hi Brice, > > On 13/09/18 06:51, Brice Goglin wrote: > > Le 12/09/2018 ? 11:49, Sudeep Holla a ?crit?: > >>> Yes.? Without this change, we hit the lscpu error in the commit message, > >>> and get zero output about the system.? We don't even get information > >>> about the caches which are architecturally specified or how many cpus > >>> are present.? With this change, we get what we expect out of lscpu (and > >>> also lstopo) including the cache(s) which are not architecturally > >>> specified. > >>> > >> lscpu and lstopo are so broken. They just assume everything on CPU0. > >> If you hotplug them out, you start seeing issues. So reading and file > >> that doesn't exist and then bail out on other essential info though they > >> are present, hmmm ... > > > > Can you elaborate? > > > > I am not sure cpu0 is supposed to be offlineable on Linux. There's no > > "online" file in /sys/devices/system/cpu/cpu0. That's why former lstopo > > doesn't like CPU0 being hotplugged out. We are actually making that case > > work for another non-standard corner case. But offlining "cpu0" this is > > considered "normal", somebody must add that missing "online" sysfs > > attribute for "cpu0" (change > > https://elixir.bootlin.com/linux/latest/source/drivers/base/cpu.c#L375). > > On x86 you can't normally offline CPU0, its something to do with certain > interrupts always being routed to CPU0, (oh, and hibernate). > You should be able to enable this behaviour with 'cpu0_hotplug' on the kernel > command line. > > (Kconfig's CONFIG_BOOTPARAM_HOTPLUG_CPU0 and CONFIG_DEBUG_HOTPLUG_CPU0 are also > worth a look) > > On arm64 at least, cpu0 is just like the others, and can be offlined. > Thanks James, for providing all the details. To add to the issues I spotted with lscpu/lstopo around topology, it ignores the updates to topology sibling masks when CPUs are hotplugged in and out. We have following in lscpu: add_summary_n(tb, _("Core(s) per socket:"), cores_per_socket ?: desc->ncores / desc->nsockets); Now when cores_per_socket = 1, (i.e when we don't have procfs entry), if ncores = (ncores_max - few_cpus_hotplugged_out), core(s) per socket will get computed as less than the actual number. IMO lscpu should be used only when all CPUs are online and it should have a warning when all cores are not online. > > By the way, did anybody actually see an error with lstopo when there's > > no "type" attribute for L3? I can't reproduce any issue, we just skip > > that specific cache entirely, but everything else appears. If you guys > > want to make that "no_cache" cache appear, I'll make it a Unified cache > > unless you tell me what to show :) IIUC, Jeffrey Hugo did see error as per his initial message: " This fixes the following lscpu issue where only the cache type sysfs file is missing which results in no output providing a poor user experience in the above system configuration. lscpu: cannot open /sys/devices/system/cpu/cpu0/cache/index3/type: No such file or directory " -- Regards, Sudeep [1] https://www.spinics.net/lists/arm-kernel/msg661101.html