Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5277593imm; Wed, 12 Sep 2018 03:50:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbFQWJVSOg+pNCRQ8v92hpmEc5dO53fD24m0Ks51hpqjKungAm+7tzQKp+Er0UyQv4pa22g X-Received: by 2002:a17:902:848d:: with SMTP id c13-v6mr1547095plo.194.1536749420677; Wed, 12 Sep 2018 03:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536749420; cv=none; d=google.com; s=arc-20160816; b=hVQfXv3r38DgCUdq9CW1mrTIR5D2/0fZs5OrhT3MopOB9wlijwBpFxTF3dT8DdQxwo agEK20jX3nIec63y4LvzF6rmDEmpHBZQ7/4Pyi45YzHgKws3JHKKfSntpSYKHGyrIWI3 p++t7GIlG74lDNnj0EBgI8atYRV2bhY+CLqG4KFNDV7piuMHVVw9REChv1K+QPIZkgcs zhQ1NLaS43VERm391qabzPC/tqXGzpk6XGIauJbEqqyjfsKUay8X/Q1SDzrLnL/2JbhR Gnf9WWQB3XULvc+UtSHgpA6e1QwXzuw77qoaARrGGrz3ZYw4boMdB1LdhC6k0s6WAx50 7xIQ== 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:organization:from:references:to:subject:cc; bh=csyJ44zt/keM55d57nQe5vLeb8u/TZLqcXZj3rglvPs=; b=s3/d08/NdWazs/tn3SxHl95QnfWvVwdtIvFHdlNNq3p7Qp1PujHhmwbbqtnbaO7eHy YDkMj8UnlUWqEbk2bH6ize16ZJ7Ke/UnLrKSijYo1Maof4n6MCctZe8nrtdCT1zPFXxl EKnqoxe7d6qlv0iG/GRq+NyyNWyBbta0n5ejzrKNvR2Y28Fl3AR5KgMKKBG1YBmU5nJH OqxeGgQthznJUO5vuEOP7EuwvWZZJFpEqFym+FJ2PS5HDEax14a9RP50IFHg3GvSRf/A K61Ghxc3q8+YococURVZDtUKEkz/45CMHDDkB/SEJt0Nh7Rk6ID41/O7vyMxK8zxewEd AWpQ== 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 v8-v6si627515pff.248.2018.09.12.03.50.04; Wed, 12 Sep 2018 03:50:20 -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 S1727801AbeILPx5 (ORCPT + 99 others); Wed, 12 Sep 2018 11:53:57 -0400 Received: from foss.arm.com ([217.140.101.70]:57488 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbeILPx5 (ORCPT ); Wed, 12 Sep 2018 11:53:57 -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 E555C7A9; Wed, 12 Sep 2018 03:49:57 -0700 (PDT) Received: from [10.4.12.116] (e107155-lin.emea.arm.com [10.4.12.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 706DA3F614; Wed, 12 Sep 2018 03:49:56 -0700 (PDT) Cc: Sudeep Holla , linux-kernel@vger.kernel.org, vkilari@codeaurora.org Subject: Re: [PATCH] ACPI/PPTT: Handle architecturally unknown cache types To: Jeffrey Hugo , Jeremy Linton , rjw@rjwysocki.net, linux-acpi@vger.kernel.org References: <1536694334-5811-1-git-send-email-jhugo@codeaurora.org> From: Sudeep Holla Organization: ARM Message-ID: Date: Wed, 12 Sep 2018 11:49:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/09/18 21:38, Jeffrey Hugo wrote: > On 9/11/2018 2:16 PM, Jeremy Linton wrote: >> Hi Jeffrey, >> >> (+Sudeep) >> [..] >> >> If you look at the next line of code following this comment its going >> to update the cache type for fully populated PPTT nodes. Although with >> the suggested change its only going to activate if someone completely >> fills out the node and fails to set the valid flag on the cache type. > > Yes, however that case doesn't apply to the scenario we are concerned > about, doesn't seem to be fully following the PPTT spec, and seems odd > that Linux just assumes that a "fully specified" cache is unified. > Agreed, but adding code that will never get used is also not so good. Do you have systems where this is needed ? >> What I suspect is happening in the reported case is that the nodes in >> the PPTT table are missing fields we consider to be important. Since >> that data isn't being filled out anywhere else, so we leave the cache >> type alone too. This has the effect of hiding sysfs nodes with >> incomplete information. >> >> Also, the lack of the DATA/INST fields is based on the assumption that >> the only nodes which need their type field updated are outside of the >> CPU core itself so they are pretty much guaranteed to be UNIFIED. Are >> you hitting this case? >> > > 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 ... > I guess I still don't understand why its important for PPTT to list, for > example, the sets/ways of a cache in all scenarios.  In the case of a > "transparent" cache (implementation defined as not reported per section > D3.4.2 of the ARM ARM where the cache cannot be managed by SW), there > may not be valid values for sets/ways.  I would argue its better to not > report that information, rather than provide bogus information just to > make Linux happy, which may break other OSes and provide means for which > a user to hang themselves. > While I agree presenting wrong info is not good, but one of the reasons the cache info is present is to provide those info for some applications to do optimization based on that(I am told so and not sure if just type and size will be good enough) and you seem to agree with that below. > However, in the case of a transparent cache, the size/type/level/write > policy/etc (whatever the firmware provider deems relevant) might be > valuable information for the OS to make scheduling decisions, and is > certainly valuable for user space utilities for cross-machine/data > center level job scheduling. > -- Regards, Sudeep