Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2264138rwd; Fri, 16 Jun 2023 01:16:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7b/ZyBj4hnlLwt7a0VUlgfjOv1Jh4YU0VgDEWRVXm8DhlcTcA+QCvWEbAmtfTM/YyR+zbr X-Received: by 2002:a92:cf0e:0:b0:340:67df:56ea with SMTP id c14-20020a92cf0e000000b0034067df56eamr1646730ilo.9.1686903380461; Fri, 16 Jun 2023 01:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686903380; cv=none; d=google.com; s=arc-20160816; b=Cpk3gmOUZcdHYPC1e8pkoef6+qEjM82a7hIhlWre5rp6TceGMBN4vO79gEvXYHgOXX Cng5mpvjmrW6NCFY8tVAWnepo80rxtJvkGen9dQE6l12YkDSrvgQ/kK17JBeU+6GH2Dx mSOsGACmMwifEIHB0x024H+7FZzE7iG52iKZjh5yWZfKf1HCNmfQuR6hXfbBrvFzl5t6 GXt1oY64I9xcOaHXinG7UhH3f6Ah5bcbHXKfsXmITVppeBUxYhKrnmWiI2rOMLy2lvBS tDV5JJW5NTlJdC/hp5FE+fQHrfy1hTAkgLdUU8FOS00HZcJNdnu7u4LJRZJw6ob48952 ZAHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/h7ptSjmrjGNVXx3sl40Rmz9oev998DxwHWJ5AOlooM=; b=zsgesxYkL563I/ksNV+Q9Im6N1beGbCpIdB0OdZ1jsyvvKrc9IT09JYE9NP3e7VZn1 PXzdqlAoaGlBWnSX5acJuOixCAKUO1nILNa5IlYJAA3EGttVIDgnBcdkj/HKsAVpshOP iBvv7m6Wjef/VDIPOrwDm/OyrCQYJhfqDfWUbHmdy/O12BohODAmKtsvbO+SM/advcRq TtjoU/39IaJJzkOPz6sdUJzunn/L1EAu5s02qeN2vUB5hJy0yq/2yAXoENEwbmWx6i40 xDv1BH20WhstSphzoAi2w0X/sdjQKH2w1TN6tK5BcEY/YYVm21FpwMxF+Mmum+wUOMzu 5fXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=J9WJ9fdt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v16-20020a63d550000000b005348885119asi10713159pgi.523.2023.06.16.01.16.05; Fri, 16 Jun 2023 01:16:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=J9WJ9fdt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231860AbjFPICv (ORCPT + 99 others); Fri, 16 Jun 2023 04:02:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233756AbjFPICs (ORCPT ); Fri, 16 Jun 2023 04:02:48 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 899381FD7 for ; Fri, 16 Jun 2023 01:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/h7ptSjmrjGNVXx3sl40Rmz9oev998DxwHWJ5AOlooM=; b=J9WJ9fdtVfm/SeEXznFC+bef/U 07yl+nwkohaQqMts4p/xQ+1ReyMp4oQAXiZn9dukLEgWN4mdjG8OShJLmuRZmGebyrqerfJuchipU tuzaFiDPprUUJEgZdPwH5cMcmJtBE1hXjXJ9CHpD96r8nm8JYbcBUIx3giO5y+xJVLqLaPI+7fHwD xGVTHt6BJ+E3YgV38HY4710KLktfuMTjP1g3LVsfu5UYSb1T19Mu282SaloYiIDirh51jyeKLPDIn PpTd3BuQu7zNLfnsRDfv+lTGn9PuwaPST9JiilU7M6Q3/60hm7BVjMvCWq64+l4k4pFEm4jhqAb1a CTquXZKw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qA4Pg-008h60-MB; Fri, 16 Jun 2023 08:02:32 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 6C0E3300208; Fri, 16 Jun 2023 10:02:31 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 56FCB2008E47B; Fri, 16 Jun 2023 10:02:31 +0200 (CEST) Date: Fri, 16 Jun 2023 10:02:31 +0200 From: Peter Zijlstra To: "Zhang, Rui" Cc: "Tang, Feng" , "Chen, Tim C" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "hpa@zytor.com" , "mingo@redhat.com" , "tglx@linutronix.de" , "x86@kernel.org" , "paulmck@kernel.org" , "Woodhouse, David" , "linux-kernel@vger.kernel.org" Subject: Re: [Patch v2 2/2] x86/tsc: use logical_packages as a better estimation of socket numbers Message-ID: <20230616080231.GZ4253@hirez.programming.kicks-ass.net> References: <20230613052523.1106821-1-feng.tang@intel.com> <20230613052523.1106821-2-feng.tang@intel.com> <20230615092021.GE1683497@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 16, 2023 at 06:53:21AM +0000, Zhang, Rui wrote: > On Thu, 2023-06-15 at 11:20 +0200, Peter Zijlstra wrote: > > So I have at least two machines where I boot with 'possible_cpus=#' > > because the BIOS MADT is reporting a stupid number of CPUs that > > aren't > > actually there. > > Does the MADT report those CPUs as disabled but online capable? > can you send me a copy of the acpidmp? Sent privately, it's a bit big. > I had a patch to parse MADT and count the number of physical packages > by decoding all the valid APICIDs in MADT. > I'm wondering if the patch still works on this machine. I can certainly give it a spin; it has IPMI serial-over-ethernet that works. Brilliant dev machine. > > So I think I'm lucky and side-stepped this nonsense, but if someone > > were > > to use nr_cpus= for this same purpose, they get screwed over and get > > the > > watchdog. Sad day for them I suppose. > > what if using package_count_from_MADT? So I'm thinking that if you cap possible_mask the actual logical packages is the right number. Suppose you have a machine with 8 sockets, but limit possible_mask to only 1 socket. Then TSC will actually be stable, it doesn't matter you have 7 idle sockets that are not synchronized. Then again, perhaps if you limit it to 2 sockets you're still in trouble, I'm not entirely sure how the TSC sync stuff comes apart on these large systems.