Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp536203img; Mon, 18 Mar 2019 08:36:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqydxgElvObNxeEpr0P77kVbWOTp+b/TlkKbE91mNMXeJmfhKRqfo7iRP9mwa29CRFdJa2rT X-Received: by 2002:a17:902:1029:: with SMTP id b38mr20235589pla.204.1552923387682; Mon, 18 Mar 2019 08:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552923387; cv=none; d=google.com; s=arc-20160816; b=jaJQVebAQpF4JTWMtShq5y+kfOGXL1uK+1JxJUp0CxdJBxXP/Pf+fx0yIGXfUhYGka hink5rXLhdJg4w6SybAI8hQoGUdrrQsqHswHF5EKLTC8Xt0qLG0yhD36yq8YgkhK0+VB tKszYLk90p3wCIRNKFyuWmE74I9urzyNDg5MdDtWKEXi9mo4qNBxxMpgE9k+lsKTRpVD k3PN1ciqApqiDYe+A72eJFmzC4WCIyeamXrGL367hpgK/yFthbEgD/KfQ7j16wTmStX8 AofuGQjwQT7bhS8DIggKjDZ+N96yFuSlnb/XUXvuQcl7UB7f7ZRN2OLopjW8lntwJElu U92A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject; bh=7VF28WCfOGGZPVGX+L0c8sasPJ/f+/ApzCfwbI9BaX4=; b=OFbE7bTNK8s3NqvkVEJkeStCM+auX2SDFSWs0BlbXVKNqqq24U4Yx4mxluZRBgXyp1 6ieoCVzstmVTArrQy98iBOTAHUvyBRkDey74MMDdWDk9Iu4kEn7ntLO1zmUAIP45UPen V+2jK+yeeBl5d5Q0+N2Q7R5aweTL/YGxWHVFq5uTYhALtPkOAtmCo6QBtiA3XZC95ngp AixLTXlxRTUBs1IT/h23rcrcF770dXIZDdmmCiA+bkcmJbjTyb5Z2bQaJ18Y1Iv4rv86 Ahhc19MznxkCr++DY1nXo2AbT0nUvFFsCRM3w5KO/oRUB+2+BT3ztfKcFq8oHOVZEeqw 0HEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e18si4529596pfn.164.2019.03.18.08.36.12; Mon, 18 Mar 2019 08:36:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727357AbfCRPfU (ORCPT + 99 others); Mon, 18 Mar 2019 11:35:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34370 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbfCRPfU (ORCPT ); Mon, 18 Mar 2019 11:35:20 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0CAB37E79; Mon, 18 Mar 2019 15:35:19 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-19.bos.redhat.com [10.18.17.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA85D5D704; Mon, 18 Mar 2019 15:35:17 +0000 (UTC) Subject: Re: [PATCH 2/2] Revert "x86/hpet: Reduce HPET counter read contention" To: Zhenzhong Duan , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Srinivas Eeda , x86@kernel.org References: <1552552932-21821-1-git-send-email-zhenzhong.duan@oracle.com> <1552552932-21821-2-git-send-email-zhenzhong.duan@oracle.com> <20190315092529.GU5996@hirez.programming.kicks-ass.net> <09d5ca8b-9cee-c013-01b4-bd2e78672b57@redhat.com> From: Waiman Long Openpgp: preference=signencrypt Autocrypt: addr=longman@redhat.com; prefer-encrypt=mutual; keydata= xsFNBFgsZGsBEAC3l/RVYISY3M0SznCZOv8aWc/bsAgif1H8h0WPDrHnwt1jfFTB26EzhRea XQKAJiZbjnTotxXq1JVaWxJcNJL7crruYeFdv7WUJqJzFgHnNM/upZuGsDIJHyqBHWK5X9ZO jRyfqV/i3Ll7VIZobcRLbTfEJgyLTAHn2Ipcpt8mRg2cck2sC9+RMi45Epweu7pKjfrF8JUY r71uif2ThpN8vGpn+FKbERFt4hW2dV/3awVckxxHXNrQYIB3I/G6mUdEZ9yrVrAfLw5M3fVU CRnC6fbroC6/ztD40lyTQWbCqGERVEwHFYYoxrcGa8AzMXN9CN7bleHmKZrGxDFWbg4877zX 0YaLRypme4K0ULbnNVRQcSZ9UalTvAzjpyWnlnXCLnFjzhV7qsjozloLTkZjyHimSc3yllH7 VvP/lGHnqUk7xDymgRHNNn0wWPuOpR97J/r7V1mSMZlni/FVTQTRu87aQRYu3nKhcNJ47TGY evz/U0ltaZEU41t7WGBnC7RlxYtdXziEn5fC8b1JfqiP0OJVQfdIMVIbEw1turVouTovUA39 Qqa6Pd1oYTw+Bdm1tkx7di73qB3x4pJoC8ZRfEmPqSpmu42sijWSBUgYJwsziTW2SBi4hRjU h/Tm0NuU1/R1bgv/EzoXjgOM4ZlSu6Pv7ICpELdWSrvkXJIuIwARAQABzR9Mb25nbWFuIExv bmcgPGxsb25nQHJlZGhhdC5jb20+wsF/BBMBAgApBQJY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PrsZ72CxVC2NEJjJwwnRBStjJOGQX4lV1uhN1XsZjBbRHdKF2W9g weim8xU= Organization: Red Hat Message-ID: <06512b71-c163-7851-1881-31a4c35fc495@redhat.com> Date: Mon, 18 Mar 2019 11:35:17 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 18 Mar 2019 15:35:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/18/2019 04:44 AM, Zhenzhong Duan wrote: > > On 2019/3/15 22:17, Waiman Long wrote: >> On 03/15/2019 05:25 AM, Peter Zijlstra wrote: >>> On Thu, Mar 14, 2019 at 04:42:12PM +0800, Zhenzhong Duan wrote: >>>> This reverts commit f99fd22e4d4bc84880a8a3117311bbf0e3a6a9dc. >>>> >>>> It's unnecessory after commit "acpi_pm: Fix bootup softlockup due >>>> to PMTMR >>>> counter read contention", the simple HPET access code could be >>>> restored. >>>> >>>> On a general system with good TSC, TSC is the final default >>>> clocksource. >>>> So the potential performce loss is only at bootup stage before TSC >>>> replacing HPET, we didn't observe obvious delay of bootup. >>> The timeline here is: >>> >>>   - Len took out SKX from native_calibrate_tsc >>>     b51120309348 ("x86/tsc: Fix erroneous TSC rate on Skylake Xeon") >>> >>>     This causes the TSC to run through the calibration code, which >>>     completes _after_ SMP bringup. >>> >>>   - This then caused HPET to be used during SMP bringup, which resulted >>>     in Waiman doing the patch you now propose removing. >>> >>>     Because large (multi-socket) SKX machines would barely boot. >>> >>>     f99fd22e4d4b ("x86/hpet: Reduce HPET counter read contention") >>> >>>   - Now, I figured that was all crazy to begin with, and introduced >>>     clocksource_tsc_early, such that we can run at the guestimate TSC >>>     frequency until we've completed calibration and then swap to the >>> real >>>     TSC clocksource. >>> >>>     aa83c45762a2 ("x86/tsc: Introduce early tsc clocksource") >>>     (and assorted fixes) >>> >>> This means that we now only use HPET for a very short time in early >>> boot, _IFF_ TSC is stable. >>> >>> Now, given the amount of wreckage we still see with TSC, I'm very >>> reluctant to revert this patch. Because the moment TSC goes out the >>> window, we're back on HPET, and this patch does make a huge difference. >>> >>> Yes, its sad, gross and nasty... but the same is true for TSC still >>> being >>> a trainwreck. >>> >>> So NAK. >> I concur. In the uncontended case, the overhead is mostly just the >> additional cmpxchg instruction for acquiring the spinlock. Even then, it >> isn't significant when compared with the time needed to actually read >> from the HPET. Without that code, any fallback to HPET for whatever >> reason will likely see degradation in performance especially on systems >> with large number of CPUs. > > Thank Peter and Waiman for reply. > > I see, we still care the performance on a system with wreckage TSC. > > > So now we come back to the old question, do we care the softlockup > > and the performance when pmtmr is chosed for whatever reason? > > For which I had provide two different fixes: > > https://lkml.org/lkml/2019/1/22/1172 > > and > > https://lkml.org/lkml/2019/3/15/101 > I think what Thomas was asking is to provide a REALISTIC use case where TSC is wrecked and HPET is somehow not used and we have to fall back to use PM timer. If such use case exists, I am sure Thomas will be happy to take it. Cheers, Longman