Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042AbdF0OzD (ORCPT ); Tue, 27 Jun 2017 10:55:03 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:23614 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751716AbdF0Oyx (ORCPT ); Tue, 27 Jun 2017 10:54:53 -0400 X-IronPort-AV: E=Sophos;i="5.39,401,1493676000"; d="scan'208";a="229738708" Subject: Re: [PATCH 1/2] x86/CPU/AMD: Present package as die instead of socket To: Thomas Gleixner , Suravee Suthikulpanit References: <1498545653-6755-1-git-send-email-suravee.suthikulpanit@amd.com> <1498545653-6755-2-git-send-email-suravee.suthikulpanit@amd.com> <20170627104803.wlhsqhaylbeqod37@pd.tnic> Cc: Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org, leo.duran@amd.com, yazen.ghannam@amd.com, Peter Zijlstra From: Brice Goglin Message-ID: <595271BA.1000905@gmail.com> Date: Tue, 27 Jun 2017 16:54:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1749 Lines: 46 Le 27/06/2017 16:21, Thomas Gleixner a ?crit : > On Tue, 27 Jun 2017, Suravee Suthikulpanit wrote: >> On 6/27/17 17:48, Borislav Petkov wrote: >>> On Tue, Jun 27, 2017 at 01:40:52AM -0500, Suravee Suthikulpanit wrote: >>>> However, this is not the case on AMD family17h multi-die processor >>>> platforms, which can have up to 4 dies per socket as shown in the >>>> following system topology. >>> So what exactly does that mean? A die is a package on ZN and you can have up >>> to 4 packages on a physical socket? >> Yes. 4 packages (or 4 dies, or 4 NUMA nodes) in a socket. > And why is this relevant at all? > > The kernel does not care about sockets. Sockets are electromechanical > components and completely irrelevant. > > The kernel cares about : > > Threads - Single scheduling unit > > Cores - Contains one or more threads > > Packages - Contains one or more cores. The cores share L3. > > NUMA Node - Contains one or more Packages which share a memory > controller. > > I'm not aware of x86 systems which have several Packages > sharing a memory controller, so Package == NUMA Node > (but I might be wrong here). You often have multiple NUMA nodes inside a single package. That's what we see in sysfs on Intel (since haswell, when Cluster-on-Die is enabled) and on AMD (since magny-cours). Kernel "packages" contains cores whose "physical_package_id" are the same. Documentation says: physical_package_id: physical package id of cpu#. Typically corresponds to a physical socket number, but the actual value is architecture and platform dependent. I don't know if it's possible on x86 to have different physical_package_ids for different cores on a single socket. Brice