Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4666346yba; Wed, 10 Apr 2019 02:16:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9T+7ip1P9bI3egdnH1y5H8lEPF/bEgIHdqiYTqUq5uTVDbaubZpzM2gVkVXzoUMyZXBDh X-Received: by 2002:a17:902:8d89:: with SMTP id v9mr42598659plo.230.1554887766269; Wed, 10 Apr 2019 02:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554887766; cv=none; d=google.com; s=arc-20160816; b=1HLQfAv/RMKyH65fuMPEpg6j0CuIa6KRgHYU0xKVJvomWbtvy9Q/u29mWnWMD0/gGl J0Iom4Agir7y3VC3EZOGCkyUznl0DOj8Eo3uVYBUFWitnvA2OLwKhhPo/DsUflwv6jFj TFV2biIaFJTySeIND3HN9b3Q81jRYj64h6y4HpAVCF8CkYnjknKKyGSJQo80rkkkbME/ Qn78mJlfoFxJvb6HeatcgdS/nnda/c1Zanu0DJDo9P9F4QdSsRXAh4fn8k++gczi8L2A zTsRm9qdwHpUFP77lSUU8rOL9VU5/x78gSUpZ5KHGl/73JbrWnZxMXTCNBIqnJmklhpu 1D9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:openpgp:from:references:cc:to :dkim-signature; bh=u9cNHVBQFOA3+ERbAVlBwxB1+QVUR47dBgKSjAPMWFk=; b=uaUdrjfYKdL/8q9uQqj3uPq3BUKboR4IeuRqVs3+FrfL7o8KQbHHx9vXl5PtLiKaI7 jfn3vv6OVLvLJSFM39xKThXt87HIsl0w9H75k/M/Zg9DQAQ8tNNC88sDuuEz+sCq4ES3 BGFska37HtEeW/l6NyARY4strn74pqRhLRlEb2HN3TcwS939a4juamoiKcPRXhMJd+VQ yP58cHjF8DhlrMWaIpkCYrqoa/2IUzgsGv5iYrdAZB4lG7zmeL5FvihqIu0euZTYipTm 2FN8HiH5jEy8y8X5ZNne4Kv7gqFkf43q+bPajmsQiKmUUi+8Sx6WPSramLUsaa51q1Ou FLkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kDbQcOKE; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l33si32575024pld.309.2019.04.10.02.15.50; Wed, 10 Apr 2019 02:16:06 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kDbQcOKE; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727261AbfDJIMB (ORCPT + 99 others); Wed, 10 Apr 2019 04:12:01 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40904 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727017AbfDJIMA (ORCPT ); Wed, 10 Apr 2019 04:12:00 -0400 Received: by mail-pl1-f196.google.com with SMTP id b3so933712plr.7 for ; Wed, 10 Apr 2019 01:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:references:from:openpgp:autocrypt:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=u9cNHVBQFOA3+ERbAVlBwxB1+QVUR47dBgKSjAPMWFk=; b=kDbQcOKED2zn7VgZnX+QUXzluE6rOeD/GqTTLoJfi+gM1sPJCIJx2cprhj7IF/tfXY pobIHtIHZlr3JR2bcQW9NtPPUcZ4Jam5dVJKJVGitl3oO3A4WE8N/n+6BC54WUkdtYFa Fw15qzgXO0J+aFBqOCoi2mT/rdxBalUdZQkz9TUur2EUF5ld3HvbQrbJ/RgKz1CqhucA 4Ap+0o9vJcOTruUVYZrma1fpAqk3uiKjR/Ak72tUYLBsoZUFjS2Z5X8lEDB6a71ijlJE LTRzthTilY1yna2hM/KEO8z8DeBtKxrJUz9lDRAwHwAz3N5lxiFeUljyeUdzd5106o6y n/jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:openpgp:autocrypt:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=u9cNHVBQFOA3+ERbAVlBwxB1+QVUR47dBgKSjAPMWFk=; b=M3dRxfiKT49aBt69/qWyCyOoieol3qMMcYGQGXyc2uvOnODG+xF9xCis6cX45c0zQV SXeuI7ZNwBuCIMEYmFJfDj5zvb18Vt7bV00SRrzrxfWe+zGBfASi/J19ReHQoegbrufI wbbpUfk3flwDtx7Ozri1YRTr9tJt1b8X+u1+a2kny5UOUcq9+wLeiZOJ7wLRwQTn2AzU cAS+agefd+s/jXJ4yK7Z7zdDgLrgYjojjvwJ6Y/64i8dRH3t9UloneENuJEmeNaPcazU ppNgnSGBsUYECO0wKkk86TaJgwK14xn7qiDYDlO+f3ecieMvfcYUglWHWrzMIpH/qB5X j+og== X-Gm-Message-State: APjAAAUULKrZT+2IK20OrywFAMqmEVAEPwAfy/FzYIhQ6CcnyEmpZKsd wpkUC80T/lCT/yh7NlaOXHnk/Xvrdcs= X-Received: by 2002:a17:902:f094:: with SMTP id go20mr42153419plb.159.1554883918998; Wed, 10 Apr 2019 01:11:58 -0700 (PDT) Received: from Vicamos-MacBook-Pro-3.local (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id i15sm18521965pfr.8.2019.04.10.01.11.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 01:11:57 -0700 (PDT) To: Thomas Gleixner Cc: Ingo Molnar , Borislav Petkov , x86@kernel.org, Pavel Tatashin , Peter Zijlstra , "Rafael J. Wysocki" , Dou Liyang , Daniel Vacek , Mike Travis , Xiaoming Gao , You-Sheng Yang , "H. Peter Anvin" , Chuanhua Lei , Juergen Gross , linux-kernel@vger.kernel.org References: <20190408104012.26791-1-vicamo@gmail.com> From: You-Sheng Yang Openpgp: preference=signencrypt Autocrypt: addr=vicamo@gmail.com; keydata= mQINBFxnlfIBEAC2RZLjA5pfvBm/uOPB++2AC5Z+hie/zQnaiwoS+4p1pVeZ80lTPdS57b89 H0k3mD6cwF7lLPmUeL6Gi4vriRsiZNiU9ZWS3AVol1YsAQhidJ5aSGOLn1Vhari9NQYwPYjM +MzbzBtjdaUolvBAGqmWFNUtJ2+C43CSKUykDFxHz5NeYE78z3g/2R4MdIvlTO0vQRQM0eNf prpdriEUjHBbMGZFkHNA0cO9WqyT/hztlwEZkP+nGje+oBeNKNlxCy1zXtQPBrFwlisWLycj DF4St3YzMm6Yv7l4Jz+dO7EUkJcKTlhA6QimF4o0u61ebZ9szemrMHkcK+inRwNVlfILZvIO LOUUks7ExzvtxD66mIrjgqcGcKAU9plc7lSqUWvfKHgiWwU/56Sb8y4BprsWKiGEUWytUGu1 SZclJIibcyG0Ookxx43y00YvCCJAy7svkfJJMu7W6+9vpaTAdvUz5GOr9qncxrHXNR2JD9uy f0S7DXVKDBDhgmrNt2bg1FeP/Y9Nz2U/9SMeV6zNwZBwHos5AxAlY3x0IAAk+GZ6gpjdUXY2 GTb1Y1l9RUp/untzo76ytRs6m8BAdwRjWdBAgQ7xMZFpWTD2Unhi45QAXtHd+W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+464dcUmp1Hcpf4PNiS+e9Kj6wgb4BNz0/DWtMby3yJpiu3Vjpgwl2 XrYK6J7j97Lsy/ndgkptXAlGEHjsV/+zKZgCJg== Subject: Re: [PATCH] x86/tsc: mark tsc reliable on CoffeeLake Message-ID: Date: Wed, 10 Apr 2019 16:11:53 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/4/8 8:03 PM, Thomas Gleixner wrote: > On Mon, 8 Apr 2019, You-Sheng Yang wrote: > >> From: You-Sheng Yang >> >> On Intel CoffeeLake it's observed tsc is always marked unstable >> unexpectedly after entering idle state Package C10(PC10), and then clock >> source is switched to hpet. This patch marks tsc as reliable when CPUID >> matches CoffeeLake. > > This lacks a proper analysis: > > 1) Why is it marked unstable Usually the differences between wd_nsec and cs_nsec in function clocksource_watchdog in kernel/time/clocksource.c would be less than a few thousand nanoseconds. However, when CPU is entering deeper idle state, PC10, the hpet clocksource readings starts to give inaccurate values for unknown reason, and the differences to cs_nsec varies from a few hundred nanoseconds to several hundred millisecond, which is larger than WATCHDOG_THRESHOLD (62.5ms) and finally results in tsc being marked unreliable. No HPET overflow is found when this occurs. > 2) Why is it correct to set that for coffeelake So far this strange behaviour is only found on coffeelake. Besides this, no much I can tell actually. This could be probably wrong, but may serve as a start to bring up some more discussion/investigation to solve the problem. I would be more than willing to help verifying further appropriate fixes. Thank you. You-Sheng Yang