Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4962198ybi; Tue, 30 Jul 2019 11:12:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQhZJxWEonUEsM19JAv5uKdN+7JF1Ht+L9VBK8b4MnVSy4JyZIObyyxfhjXEF/aQNcjio7 X-Received: by 2002:a17:902:758d:: with SMTP id j13mr114667165pll.197.1564510372078; Tue, 30 Jul 2019 11:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564510372; cv=none; d=google.com; s=arc-20160816; b=1K4zc9tZBKUylowww+lgaT8thNAUNzxOuhYjkWovGODdU5IPuy4bLRTWnM5idDdDQb 1HNC95OOe8UP0Sn9G4xW/aYfO6FjUS4/GPkKiGq1tFn1KzJvxkPQxp57FnFeEn2c8XMq yw1PPQ2FDNZ/x7jJRyvRZ0QlVO+wRPohJ5thQPTvZw7oX8n7A+AtnFRd+ZSlWcouvwoK QdMQrpg895d3hFjVqRPFXrXfBMBycH/0/JM6JLY46Bob9Wn1/PjS35jpbNwjd7Y1I7dM n19dvCFIUoG/DbArcdlC0L4XddjF1RnfYSYCXk+3sVXrNbZBsK3BHX0trfonvoJcc/DS 34vw== 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; bh=XAgRevl98esGxt5VUCi8WR8cDuog+Ao7JxKj0DcjWrc=; b=tOxb/mCXAMWFILeLEO33CxIzVfps9S5l4Z881ShRTN2K+xnYEd7BZ+KTLYrrpmoq+e kegu16+HnhwqNZ7pfS9f+q5ECSGz22QNAV4IN81BMR/Akj6YPIOJVL/vs8lDVdtEnmeU kkShEbuNji8G9tsWMYIWL1jWtKxE1Rn8tOFhTRmw+FpSlhod3otSwLVxgiqlkfSvqkS7 /xTpK/bq0FJ1xELRfeAvQCXB/o6o1+gopSQ6r5FfvRSPsmsAjxSVFFmN0hMGLxLEhj+5 JYEPdD/zANr9qae17yKluJr1pxjfzJ/Bwn3aP7f6m0/H6PWq+5d8sn05Zkax35qX0EOQ cmbw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si31048457pfe.217.2019.07.30.11.12.37; Tue, 30 Jul 2019 11:12:52 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731006AbfG3RcL (ORCPT + 99 others); Tue, 30 Jul 2019 13:32:11 -0400 Received: from mga01.intel.com ([192.55.52.88]:35736 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729238AbfG3RcK (ORCPT ); Tue, 30 Jul 2019 13:32:10 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2019 10:32:09 -0700 X-IronPort-AV: E=Sophos;i="5.64,327,1559545200"; d="scan'208";a="162655268" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2019 10:32:09 -0700 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, bp@alien8.de, tony.luck@intel.com Cc: kuo-lang.tseng@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre Subject: [PATCH V2 00/10] x86/CPU and x86/resctrl: Support pseudo-lock regions spanning L2 and L3 cache Date: Tue, 30 Jul 2019 10:29:34 -0700 Message-Id: X-Mailer: git-send-email 2.17.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since V1: - Rebase onto v5.3-rc2 Dear Maintainers, Cache pseudo-locking involves preloading a region of physical memory into a reserved portion of cache that no task or CPU can subsequently fill into and from that point on will only serve cache hits. At this time it is only possible to create cache pseudo-locked regions in either L2 or L3 cache, supporting systems that support either L2 Cache Allocation Technology (CAT) or L3 CAT because CAT is the mechanism used to manage reservations of cache portions. This series introduces support for cache pseudo-locked regions that can span L2 and L3 cache in preparation for systems that may support CAT on L2 and L3 cache. Only systems with L3 inclusive cache is supported at this time because if the L3 cache is not inclusive then pseudo-locked memory within the L3 cache would be evicted when migrated to L2. Because of this constraint the first patch in this series introduces support in cacheinfo.c for resctrl to discover if the L3 cache is inclusive. All other patches in this series are to the resctrl subsystem. In support of cache pseudo-locked regions spanning L2 and L3 cache the term "cache pseudo-lock portion" is introduced. Each portion of a cache pseudo-locked region spans one level of cache and a cache pseudo-locked region can be made up of one or two cache pseudo-lock portions. On systems supporting L2 and L3 CAT where L3 cache is inclusive it is possible to create two types of pseudo-locked regions: 1) A pseudo-locked region spanning just L3 cache, consisting out of a single pseudo-locked portion. 2) A pseudo-locked region spanning L2 and L3 cache, consisting out of two pseudo-locked portions. In an L3 inclusive cache system a L2 pseudo-locked portion is required to be matched with an L3 pseudo-locked portion to prevent a cache line from being evicted from L2 when it is evicted from L3. Patches 2 to 8 to the resctrl subsystem are preparing for the new feature and should result in no functional change, but some comments do refer to the new feature. Support for pseudo-locked regions spanning L2 and L3 cache is introduced in patches 9 and 10. Your feedback will be greatly appreciated. Regards, Reinette Reinette Chatre (10): x86/CPU: Expose if cache is inclusive of lower level caches x86/resctrl: Remove unnecessary size compute x86/resctrl: Constrain C-states during pseudo-lock region init x86/resctrl: Set cache line size using new utility x86/resctrl: Associate pseudo-locked region's cache instance by id x86/resctrl: Introduce utility to return pseudo-locked cache portion x86/resctrl: Remove unnecessary pointer to pseudo-locked region x86/resctrl: Support pseudo-lock regions spanning resources x86/resctrl: Pseudo-lock portions of multiple resources x86/resctrl: Only pseudo-lock L3 cache when inclusive arch/x86/kernel/cpu/cacheinfo.c | 42 +- arch/x86/kernel/cpu/resctrl/core.c | 7 - arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 37 +- arch/x86/kernel/cpu/resctrl/internal.h | 39 +- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 444 +++++++++++++++++++--- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 61 ++- include/linux/cacheinfo.h | 4 + 7 files changed, 512 insertions(+), 122 deletions(-) -- 2.17.2