Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5722910yba; Tue, 30 Apr 2019 21:25:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVQFPYEdraKzdy7oLcUDYbHkOCt7RF1/ncRHu1SKF6SDzr5tco6brAOhmbUKg7ZEtvjQFU X-Received: by 2002:a62:62c3:: with SMTP id w186mr74440581pfb.73.1556684744712; Tue, 30 Apr 2019 21:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556684744; cv=none; d=google.com; s=arc-20160816; b=U23iC+edIrpOPzmdBhlkcoOJgxq4LdmMTwmG893k43buVn4gL+dWpqf4caOLUOna7B xk0hrmeNMVrT9RbBO1C57xeP9akWCTd5KOM1MQC3T8tJe7Yeo+MzMsTJw2x1m3JwMvkk ps+EqGQ0+KS8Mq5AkTeh546Am1/8/giSgxyy2KH8ZJhvFy3EuJi5vCknh5cpezBQa0vP YcWL5Wc2z7ttEqi1Dgu+MW0GWOB95eYNrFwHtLD764BxMtKElFy3eUqjQfJiItKROoeg si2D9eIlheVzkAF4KYop5L9xBoSdBvC/QTH00AknsCz+AUWMaZZUixIZoCmf7yYQZyME iTHA== 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 :dkim-signature; bh=6+vxEoGuhOqrP8QRMx3WfeqWYO+yDAELb4vIHp9rT1I=; b=lTBHRVpgFnuhMWIqe/5ODkYIUL2Uc4D4NWlkE+gUUIM4cljYLcW8vvDi6621hmusg5 wgcEpdcCaRrMOgxRABamJjT/VjebdKFEx7Ku/aREx0OCLL7+Pv2HD5YI09CvkJag/EbH qTrCSYMk/w9XqzZoytql1Vzh49xN/stFFMth5Dvkp69AXMVI9BpUDSGUKLBQdzibNZhZ wPM3H8MlwGphHb87UqJw908V9LrWemRxnl2IQghGTQdXC8kRTGq0XG4rrOiU9tTcpFGF X6i1Kt6Lk3AbeZmv6If4d5UYEbuSJwXbcDZm9rZqypThFVWrXHwbpsGUhb4wVoaTfxwI XH0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Kw8apbqV; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d18si37560918pgo.525.2019.04.30.21.25.29; Tue, 30 Apr 2019 21:25:44 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Kw8apbqV; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726005AbfEAEYe (ORCPT + 99 others); Wed, 1 May 2019 00:24:34 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:39161 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725298AbfEAEYe (ORCPT ); Wed, 1 May 2019 00:24:34 -0400 Received: by mail-it1-f196.google.com with SMTP id t200so8368572itf.4 for ; Tue, 30 Apr 2019 21:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=6+vxEoGuhOqrP8QRMx3WfeqWYO+yDAELb4vIHp9rT1I=; b=Kw8apbqVYns321ok/Z7aFHim+N12Ow1gn+FjePKHWyzFF+4iJUPy6FqVJKcJRo1YRZ gAaZjny46QUhvL8Sz87P/ETs18qOdSWu/m8T5ZKK4ltEYHEvR4NN27/Q2sTqL2azBlyr IdBj9YbtKCiWFO/4odqUuKk1OfDXLQrpmLV8EQb34+GH4tOAe1bmg0TuqJKez/PC9DbD oaOB1shiOe7BNqox7poi5Ax1CDsejTCHMSBLYeQ6Ife+397lClb/5O8jwg/wRVf4mRMR eVTkW1+EV3dCXJoQ6YRXIPKFxzo7Id7tJhGsqojwMXhFwEPfu+m5cqItYApcpDAqzkLz ShMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=6+vxEoGuhOqrP8QRMx3WfeqWYO+yDAELb4vIHp9rT1I=; b=ZdtopnymHS/v+VxcFfAY0rc/+cuV4nNWMyXMFHVNCaIJRS/n363HCvlQCE1m+V66aE It3GF5X9q5WZNo0eHPs4R51JOJYtWrZLLmCuYOWqN+tSF7otPKblcyk4TZl9qFDDWsel RxqwLEJLxwE3UxEzTREFuBJizg5JTdH1IIsffJQH6eFbR3aI9GOTKLrs1SRiF5VR9b+7 1b61UEimQ/HKmnVdiNaWZC+E8pkvYiXWADvzGHrCJmgQxEp27CLMQfiVD2So/wiC6FSW MsU0HLwhnzys/aAu/ul3OMWFT8pgsCVuu2jI3yOubrIDG6ec2oguaM7f7o9FFMTSaydv efdQ== X-Gm-Message-State: APjAAAWwnEa2HzWfDndovZuZ8kTYkTPV7GEPjdzioEQb6loAjcN/8iCm oRK1MZg725nyuYmHiyRzURPIv0m5 X-Received: by 2002:a24:c685:: with SMTP id j127mr7103801itg.21.1556684673656; Tue, 30 Apr 2019 21:24:33 -0700 (PDT) Received: from nuc8.lan (h69-131-112-51.cntcnh.dsl.dynamic.tds.net. [69.131.112.51]) by smtp.gmail.com with ESMTPSA id b8sm2569728itb.20.2019.04.30.21.24.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 21:24:32 -0700 (PDT) From: Len Brown To: x86@kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 0/18] v4 multi-die/package topology support Date: Wed, 1 May 2019 00:24:09 -0400 Message-Id: <20190501042427.13156-1-lenb@kernel.org> X-Mailer: git-send-email 2.18.0-rc0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series does 4 things. 1. Parse the new CPUID.1F leaf to discover multi-die/package topology 2. Export multi-die topology inside the kernel 3. Update 4 places (coretemp, pkgtemp, rapl, perf) that that need to know the difference between die and package-scope MSR. 4. Export multi-die topology to user-space via sysfs These changes should have 0 impact on cache topology, NUMA topology, Linux scheduler, or system performance. These topology changes primarily impact parts of the kernel and some applications that care about package MSR scope. Also, some software is licensed per package, and other tools, such as benchmark reporting software sometimes cares about packages. --- Updates since v3: None! Earlier today I sent the correct v3 e-mail header, pointing to the correct git branch, but ran git-send-email from the wrong directory and it happily spammed you with a copy of the old 14-patch v1 series. Sorry about that! --- Updates since v2: All review feedback has been addressed. In response to brice, peterz and Morten Rasmussen, used the word "cpu" rather than "thread" for the new sysfs attributes. In response to tglx, replaced access to cpuinfo_x86.x86_max_dies, with macro topology_max_die_per_package(). In doing so, deleted this new per-cpu field entirely, as a global is sufficient. Also, appended 3 patches from Kan Liang, updating the perf code to be multi-die aware. These patches are similar to the preceding power and temperature patches. I believe that with these patches, this series now includes all needed multi-die kernel support. --- The following changes since commit 085b7755808aa11f78ab9377257e1dad2e6fa4bb: Linux 5.1-rc6 (2019-04-21 10:45:57 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git x86 for you to fetch changes up to 6c4891c7f2f1eacfcab00bf5d84b5ac119f654b9: perf/x86/intel/cstate: Support multi-die/package (2019-04-30 16:49:26 -0400) ---------------------------------------------------------------- Kan Liang (3): perf/x86/intel/uncore: Support multi-die/package perf/x86/intel/rapl: Support multi-die/package perf/x86/intel/cstate: Support multi-die/package Len Brown (10): x86 topology: Fix doc typo topology: Simplify cputopology.txt formatting and wording x86 smpboot: Rename match_die() to match_pkg() x86 topology: Add CPUID.1F multi-die/package support x86 topology: Create topology_max_die_per_package() cpu topology: Export die_id x86 topology: Define topology_die_id() x86 topology: Define topology_logical_die_id() topology: Create package_cpus sysfs attribute topology: Create core_cpus and die_cpus sysfs attributes Zhang Rui (5): powercap/intel_rapl: Simplify rapl_find_package() powercap/intel_rapl: Support multi-die/package thermal/x86_pkg_temp_thermal: Support multi-die/package powercap/intel_rapl: update rapl domain name and debug messages hwmon/coretemp: Support multi-die/package Documentation/cputopology.txt | 80 +++++++++++++++---------- Documentation/x86/topology.txt | 6 +- arch/x86/events/intel/cstate.c | 14 +++-- arch/x86/events/intel/rapl.c | 10 ++-- arch/x86/events/intel/uncore.c | 20 ++++--- arch/x86/include/asm/processor.h | 4 +- arch/x86/include/asm/smp.h | 1 + arch/x86/include/asm/topology.h | 17 ++++++ arch/x86/kernel/cpu/common.c | 1 + arch/x86/kernel/cpu/topology.c | 88 ++++++++++++++++++++++------ arch/x86/kernel/smpboot.c | 75 +++++++++++++++++++++++- arch/x86/xen/smp_pv.c | 1 + drivers/base/topology.c | 22 +++++++ drivers/hwmon/coretemp.c | 9 +-- drivers/powercap/intel_rapl.c | 75 +++++++++++++----------- drivers/thermal/intel/x86_pkg_temp_thermal.c | 8 +-- include/linux/topology.h | 6 ++ 17 files changed, 322 insertions(+), 115 deletions(-)