Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752445AbdF0PtS (ORCPT ); Tue, 27 Jun 2017 11:49:18 -0400 Received: from mail-by2nam01on0071.outbound.protection.outlook.com ([104.47.34.71]:47306 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752670AbdF0Ps6 (ORCPT ); Tue, 27 Jun 2017 11:48:58 -0400 From: "Duran, Leo" To: "'Thomas Gleixner'" , "Suthikulpanit, Suravee" CC: Borislav Petkov , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "Ghannam, Yazen" , Peter Zijlstra Subject: RE: [PATCH 1/2] x86/CPU/AMD: Present package as die instead of socket Thread-Topic: [PATCH 1/2] x86/CPU/AMD: Present package as die instead of socket Thread-Index: AQHS7xBkV4oBSeGdVkqrXOQu4LK/EKI4h5KAgAAm3wCAABSjAIAAEzOg Date: Tue, 27 Jun 2017 15:48:55 +0000 Message-ID: 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> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linutronix.de; dkim=none (message not signed) header.d=none;linutronix.de; dmarc=none action=none header.from=amd.com; x-originating-ip: [165.204.77.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR12MB1737;20:3iniH9an5+GwPqytrzGxH/5BXDj3BVZTkrAgwGSMfZpDFUNN32SURsh+p8pkjUqu0BfOGFYlecG0lv1NNF114JJHHlJlCtDQWhnq9Z5jcrHwjJsnGHp4JSE6oEQJJgrTPYrOjd3u05orKhHmahK6GQqMTbiSPILiNpUwWxBlQD6MsfwMCYWvjooc6VBfqQRRU/LzvTpSN7WOUSB3Wqs6ySuximRKnyXd0KJ+CgZudklyLYS8NLH+Um+icjiMBlqB x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(39450400003)(39840400002)(39410400002)(39860400002)(39850400002)(39400400002)(24454002)(377454003)(13464003)(2906002)(66066001)(25786009)(6436002)(53936002)(50986999)(7696004)(5660300001)(8676002)(3660700001)(478600001)(76176999)(6116002)(7736002)(53546010)(54356999)(81166006)(99286003)(14454004)(3280700002)(86362001)(189998001)(6506006)(6636002)(55016002)(8936002)(54906002)(2950100002)(305945005)(4326008)(2900100001)(102836003)(229853002)(38730400002)(33656002)(93886004)(6246003)(77096006)(74316002)(9686003)(3846002)(122556003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1737;H:DM5PR12MB1243.namprd12.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-ms-office365-filtering-correlation-id: d7961558-2ee5-4412-e86e-08d4bd7404a1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254075)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506067)(300135500095);SRVR:DM5PR12MB1737; x-ms-traffictypediagnostic: DM5PR12MB1737: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(236129657087228)(9452136761055)(767451399110)(247924648384137); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR12MB1737;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR12MB1737; x-forefront-prvs: 0351D213B3 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jun 2017 15:48:55.5939 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1737 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v5RFnV60012081 Content-Length: 3126 Lines: 76 Hi Thomas, et al, Just a quick comment below. Leo. > -----Original Message----- > From: Thomas Gleixner [mailto:tglx@linutronix.de] > Sent: Tuesday, June 27, 2017 9:21 AM > To: Suthikulpanit, Suravee > Cc: Borislav Petkov ; x86@kernel.org; linux- > kernel@vger.kernel.org; Duran, Leo ; Ghannam, > Yazen ; Peter Zijlstra > Subject: Re: [PATCH 1/2] x86/CPU/AMD: Present package as die instead of > socket > > 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). > > Platform - Contains one or more Numa Nodes [Duran, Leo] That is my understanding of intent as well... However, regarding the L3: The sentence 'The cores share L3.' under 'Packages' may give the impression that all cores in a package share an L3. In our case, we define a Package a group of cores sharing a memory controller, a 'Die' in hardware terms. Also, it turns out that within a Package we may have separate groups of cores each having their own L3 (in hardware terms we refer to those as a 'Core Complex'). Basically, in our case a Package may contain more than one L3 (i.e., in hardware terms, there may more than one 'Core complex' in a 'Die'). The important point is that all logical processors (threads) that share an L3 have a common "cpu_llc_id". > > All the kernel is interested in is the above and the NUMA Node distance so it > knows about memory access latencies. No sockets, no MCMs, that's all > completely useless for the scheduler. > > So if the current CPUID stuff gives you the same phycial package ID for all > packages in a MCM, then this needs to be fixed at the CPUID/ACPI/BIOS > level and not hacked around in the kernel. > > The only reason why a MCM might need it's own ID is, when it contains > infrastructure which is shared between the packages, but again that's > irrelevant for the scheduler. That'd be only relevant to implement a driver for > that shared infrastructure. > > Thanks, > > tglx