From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970300AbdDTPG2 (ORCPT ); Thu, 20 Apr 2017 11:06:28 -0400 Received: from merlin.infradead.org ([205.233.59.134]:54140 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970272AbdDTPG0 (ORCPT ); Thu, 20 Apr 2017 11:06:26 -0400 Date: Thu, 20 Apr 2017 17:06:15 +0200 From: Peter Zijlstra To: Vitaly Kuznetsov Cc: x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Prarit Bhargava , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Subject: Re: [PATCH RFC] x86/smpboot: Set safer __max_logical_packages limit Message-ID: <20170420150615.ns3343rokvmc3kjt@hirez.programming.kicks-ass.net> References: <20170420132453.19652-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170420132453.19652-1-vkuznets@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 20, 2017 at 03:24:53PM +0200, Vitaly Kuznetsov wrote: > In this patch I suggest we set __max_logical_packages based on the > max_physical_pkg_id and total_cpus, So my 4 socket 144 CPU system will then get max_physical_pkg_id=144, instead of 4. This wastes quite a bit of memory for the per-node arrays. Luckily most are just pointer arrays, but still, wasting 140*8 bytes for each of them. > this should be safe and cover all > possible cases. Alternatively, we may think about eliminating the concept > of __max_logical_packages completely and relying on max_physical_pkg_id/ > total_cpus where we currently use topology_max_packages(). > > The issue could've been solved in Xen too I guess. CPUID returning > x86_max_cores can be tweaked to be the lowerest(?) possible number of > all logical packages of the guest. This is getting ludicrous. Xen is plain broken, and instead of fixing it, you propose to somehow deal with its obviously crack induced behaviour :-(