Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7189024rwi; Mon, 24 Oct 2022 10:59:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7278sfEjjVKB+7nFpn9VYNg6gcgZYaPxA2a0OhMdOqy9FmYuiYRgkjfhZp2Lnoh6yffQWd X-Received: by 2002:a17:90b:4b89:b0:20a:c168:6865 with SMTP id lr9-20020a17090b4b8900b0020ac1686865mr39804978pjb.130.1666634379704; Mon, 24 Oct 2022 10:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666634379; cv=none; d=google.com; s=arc-20160816; b=GfQWzhbfZr+URy9YbXRqbqxpzxP6WOeszXFDW/9OkeFQxVg+HNbVbJLWXvUqCSrrDc 7MCwQGrGH/5yBuzsJc2mSSLbAq4bEn8U412Oc9L8y1vAYvvq4hf5dJzTf/JGTUPhGVSb da5+Bm3Av1vYvmPPwSrKkBrN3BP6RA0/VLyox6UkwoQ8VgAttkydmK2rEMi6GnKm6MOr muIqxM2pwyUFF9MuMdeervE3iLuvOpg0G0TddywoFd8ay63TGi3ovxNtrM6ENNs+tZQl E8/I39G80DCzuKZrvYZIhmgRES0JQzF/XjXJEf4nAr9FPQw5v7RHfj1zRAGS/LQ34BYk FAFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9kgh8ZYD3bWF80GfsDnN+vLQdPY3RgefyITz7gcqpwg=; b=0gy9ke7e1z0gpNeuBaPM3e7/4eFRGklrNu0TZ0Ezne+8BVzPhrd6nwsBsXbJiScAbs AaawDIO5fyAs6IjjpqBoDBBudtpNA46ECGdbjf65iyfGNJXPhFPUXe/3quf/TjJKm4wF SOLUUJVLOjnv5IVDjU9SZ6bBRnsaVZ0iVNCDgPvyMphER1o/iGYkQWRWaVslV+hmQt33 5quyrJ0MZkKLp3hsFyzt5u1nNk/XMIJyuxO54WNkyLaI67DNcK5Vy2mkF4LFGMbR4e// FCaJbXikUHRVfCPJt+jWXCzREr1MFkfoSmfj/qCYYidHAYCwDI0uBzI5gN1HY/8CP6pp cl3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bMOZLLlV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z198-20020a6333cf000000b0043b383d0d3asi92326pgz.824.2022.10.24.10.59.27; Mon, 24 Oct 2022 10:59:39 -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=@intel.com header.s=Intel header.b=bMOZLLlV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233518AbiJXRJn (ORCPT + 99 others); Mon, 24 Oct 2022 13:09:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231265AbiJXRIz (ORCPT ); Mon, 24 Oct 2022 13:08:55 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 748A11EEFA for ; Mon, 24 Oct 2022 08:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666626247; x=1698162247; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=scPGQVBLMaQrG09DIbO3cleczY2v35W9feMZEkD75Ak=; b=bMOZLLlVv+yD50YxnWchp55MIQiW3Asf09PyHnMNLFcIt7WBfLCG4HxL UlCgDdb8XJ+RYwSERT88Q3rWS1z+Dk8c44zqVdYcwVLhT0CYXY432HMVi nG+MrFBXQe8fhPve3an51+SVbku/UrguFuIozNwSvz70tB4hFEZgxpaSm bpd9dYJyV3wqjh7bQV7CmWtmvIOSq9t4oZJOiye6vuD/BXXTwfdnzr8tS LylVREQOPSqvWyiFj/HT/kRHWVeGA9CA5qBjvjby80b/7s9BYIJxblj3s avdTNb38/1xMV7e/PW+xaUNRWW9iMScFnYQkG+hqDVl4xlJY5dQEj9vQ4 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="371669524" X-IronPort-AV: E=Sophos;i="5.95,209,1661842800"; d="scan'208";a="371669524" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2022 08:42:31 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="609238440" X-IronPort-AV: E=Sophos;i="5.95,209,1661842800"; d="scan'208";a="609238440" Received: from csun9-mobl.amr.corp.intel.com (HELO [10.209.104.152]) ([10.209.104.152]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2022 08:42:30 -0700 Message-ID: Date: Mon, 24 Oct 2022 08:42:30 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v1 1/2] x86/tsc: use logical_package as a better estimation of socket numbers Content-Language: en-US To: Zhang Rui , Feng Tang , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Peter Zijlstra , x86@kernel.org, linux-kernel@vger.kernel.org Cc: tim.c.chen@intel.com, Xiongfeng Wang , liaoyu15@huawei.com References: <20221021062131.1826810-1-feng.tang@intel.com> <63dca468-c94d-844a-5b19-09c03cf84911@intel.com> <6636557f617ea5a1a1ab6f30f7aea0ececdd2a36.camel@intel.com> From: Dave Hansen In-Reply-To: <6636557f617ea5a1a1ab6f30f7aea0ececdd2a36.camel@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 10/22/22 09:12, Zhang Rui wrote: >>> I'm not sure if we have a perfect solution here. >> Are the implementations fixable? > currently, I don't have any idea. > >> Or, at least tolerable? That would be great to figure out before we start throwing more patches around. >> For instance, I can live with the implementation being a bit goofy >> when >> kernel commandlines are in play. We can pr_info() about those cases. > My understanding is that the cpus in the last package may still have > small cpu id value. This means that the 'logical_packages' is hard to > break unless we boot with very small CPU count and happened to disable > all cpus in one/more packages. Feng is experiencing with this and may > have some update later. > > If this is the case, is this a valid case that we need to take care of? Well, let's talk through it a bit. What is the triggering event and what's the fallout? Is the user on a truly TSC stable system or not? What kind of maxcpus= argument do they need to specify? Is it something that's likely to get used in production or is it most likely just for debugging? What is the maxcpus= fallout? Does it over estimate or under estimate the number of logical packages? How many cases outside of maxcpus= do we know of that lead to an imprecise "logical packages" calculation? Does this lead to the TSC being mistakenly marked stable when it is not, or *not* being marked stable when it is? Let's get all of that info in one place and make sure we are all agreed on the *problem* before we got to the solution space.