Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2273307imu; Sun, 18 Nov 2018 20:15:55 -0800 (PST) X-Google-Smtp-Source: AJdET5eVGruqW2meAMv4ALireyROC4tLSd0bzV7uvnpwsVsVasyDEGHG/Xa0SE8vsm0gVkOCeS7F X-Received: by 2002:a63:82c6:: with SMTP id w189mr18944431pgd.344.1542600955678; Sun, 18 Nov 2018 20:15:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542600955; cv=none; d=google.com; s=arc-20160816; b=XRmMFlqwW5Q1r2AWS32wREDScAc0SycZAl+01OUrjRZrM7KTBOBiTWXeTIu6F6uZ39 pNx1XF13vpMOJIgBwV3zpkyEsOzqDEuReNvPfJDFIP+ccn1Il4vdyNso3wsC3GTgzcer Og5y5vyYn9oejFEQ04maumBQmGX8jNQN7wIakdrjhqAzR9u1rTA6Kx1GUNWKVunSABQg hLtpRxjf/PVgLdItHDbzlPOlNSX0GhNUzgAJj/fYfMLMweVk/tY2+E0w8aPM3fNfQYqZ TD+Pz4f6Ohu2UkSOD0/K+QmgHJi2bM61ZqdEtF3Pfa8QhwVs1F39J7jQggg3F9zucQxV aLWw== 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; bh=+W0yIpBdd30OHER5vCmOioewNdRtiNo4eMXVWe4Ki04=; b=xzKGxGdYE4BShfEeMxLFoh7UCWl0I7Q3/+IsjsJ1yfH/7mb5REbHo3vJG4RkAd0DKO hJYdvQx529RhsJOQD3Ec4FoSv6xlEq2TUWaDIthJtEtT+Tv2wYBTOu0mb/S2mqfPYRsJ lAtZNfKew+ydn9mVW8gHfOuGZeGqpOEADQwZi1tPCP+eBTHSIsXNFi80SR0zr6gekgFP Rw0OmlZ/viDvNUH/WJE9qq0KGwMv21TbJ/KXjGX591Fi8P4pyUl7UdKNdll+L0BdnbhB B+JrpV/yoAl+9f4fXNPNaA6t/q9NHvQSnsNbcIDi8Ya5YmE0g0Icgb7piMwb9ETviBeE wqng== 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 l4si34084473pgr.346.2018.11.18.20.15.37; Sun, 18 Nov 2018 20:15:55 -0800 (PST) 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 S1728185AbeKSOgX (ORCPT + 99 others); Mon, 19 Nov 2018 09:36:23 -0500 Received: from foss.arm.com ([217.140.101.70]:50372 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727281AbeKSOgX (ORCPT ); Mon, 19 Nov 2018 09:36:23 -0500 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 AACE91596; Sun, 18 Nov 2018 20:14:03 -0800 (PST) Received: from [10.162.0.72] (unknown [10.162.0.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 657F43F5A0; Sun, 18 Nov 2018 20:14:01 -0800 (PST) Subject: Re: [PATCH 4/7] node: Add memory caching attributes To: Keith Busch , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org Cc: Greg Kroah-Hartman , Rafael Wysocki , Dave Hansen , Dan Williams References: <20181114224921.12123-2-keith.busch@intel.com> <20181114224921.12123-5-keith.busch@intel.com> From: Anshuman Khandual Message-ID: <91698cef-cdcd-5143-884f-3da5536e156f@arm.com> Date: Mon, 19 Nov 2018 09:44:00 +0530 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: <20181114224921.12123-5-keith.busch@intel.com> Content-Type: text/plain; charset=utf-8 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 11/15/2018 04:19 AM, Keith Busch wrote: > System memory may have side caches to help improve access speed. While > the system provided cache is transparent to the software accessing > these memory ranges, applications can optimize their own access based > on cache attributes. Cache is not a separate memory attribute. It impacts how the real attributes like bandwidth, latency e.g which are already captured in the previous patch. What is the purpose of adding this as a separate attribute ? Can you explain how this is going to help the user space apart from the hints it has already received with bandwidth, latency etc properties. > > In preparation for such systems, provide a new API for the kernel to > register these memory side caches under the memory node that provides it. Under target memory node interface /sys/devices/system/node/nodeY/target* ? > > The kernel's sysfs representation is modeled from the cpu cacheinfo > attributes, as seen from /sys/devices/system/cpu/cpuX/cache/. Unlike CPU > cacheinfo, though, a higher node's memory cache level is nearer to the > CPU, while lower levels are closer to the backing memory. Also unlike > CPU cache, the system handles flushing any dirty cached memory to the > last level the memory on a power failure if the range is persistent. Lets assume that a CPU has got four levels of caches L1, L2, L3, L4 before reaching memory. L4 is the backing cache for the memory and L1-L3 is from CPU till the system bus. Hence some of them will be represented as CPU caches and some of them will be represented as memory caches ? /sys/devices/system/cpu/cpuX/cache/ --> L1, L2, L3 /sys/devices/system/node/nodeY/target --> L4 L4 will be listed even if the node is memory only ?