Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751892AbcDNCK0 (ORCPT ); Wed, 13 Apr 2016 22:10:26 -0400 Received: from mail-by2on0107.outbound.protection.outlook.com ([207.46.100.107]:52889 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750886AbcDNCKZ (ORCPT ); Wed, 13 Apr 2016 22:10:25 -0400 Authentication-Results: infradead.org; dkim=none (message not signed) header.d=none;infradead.org; dmarc=none action=none header.from=hpe.com; Message-ID: <570EFC04.60006@hpe.com> Date: Wed, 13 Apr 2016 22:10:12 -0400 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Peter Zijlstra CC: Ingo Molnar , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , , , Jiang Liu , Borislav Petkov , Andy Lutomirski , Scott J Norton , Douglas Hatch , Randy Wright Subject: Re: [PATCH v4] x86/hpet: Reduce HPET counter read contention References: <1460486768-34024-1-git-send-email-Waiman.Long@hpe.com> <20160413061813.GB4705@gmail.com> <570E67B1.3000708@hpe.com> <20160414002503.GQ2906@worktop> In-Reply-To: <20160414002503.GQ2906@worktop> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [72.71.243.105] X-ClientProxiedBy: CY1PR14CA0016.namprd14.prod.outlook.com (10.163.13.154) To DF4PR84MB0316.NAMPRD84.PROD.OUTLOOK.COM (10.162.193.30) X-MS-Office365-Filtering-Correlation-Id: 9d6737bf-4b6b-4083-af8d-08d36409eebf X-Microsoft-Exchange-Diagnostics: 1;DF4PR84MB0316;2:0Wu9TTjuTI4ttkU5dbd0u3uIzgl9MdY061GeFco0g1A70sgG+4gbIp6BoZLiVeWmwxC/cOaHPMj+Mb3B4jTVkrEx3vqfnbBBgnVMjWh7dMnvyM3sJ5mzNziIIL4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0rGZv7DuFjl+nR0vEE71voeOmMfL1sfnAaR/Fbt6wu5aPduznXfwhCPTLgm22JpCf1/kIDp768ZRkVSDARtvV/snIqLlCTTUdolhagITOYr+9ixRmnJyKfdMGf7GPU6/Na5MfjRHHzRHRhBn58Cr1M7nOJXXwsSi5njSwBybJkHrlDzKXrskoioePor6xuKDhb616nUUzNvb/+hJ5hidqVwYh+A616PV0QrtImkYbIQy2b1ZsfKpFWMVqisKhI1Yj1LC7JS3er8hRp78sZGSkCtqE0F1kxJJU6Ah7lgHOAcNE9p27B1eZtNUt2ZdKTR1vH4QjC8iQ0HIsN/86osJn7CK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:DF4PR84MB0316;BCL:0;PCL:0;RULEID:;SRVR:DF4PR84MB0316; X-Forefront-PRVS: 0912297777 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(24454002)(377454003)(5008740100001)(81166005)(230700001)(2906002)(64126003)(33656002)(1096002)(2950100001)(66066001)(3846002)(586003)(36756003)(4326007)(6116002)(76176999)(54356999)(47776003)(92566002)(189998001)(50986999)(77096005)(117156001)(4001350100001)(5004730100002)(42186005)(23756003)(50466002)(110136002)(86362001)(93886004);DIR:OUT;SFP:1102;SCL:1;SRVR:DF4PR84MB0316;H:[192.168.142.156];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DF4PR84MB0316;23:Ada/cfOfciHFBuBngB/YCyDLv3QSy+VLxoRXK4BEIMTkFIdOC3Mz16rkB9MPAArCdaGm6XeFcRd45gnNe+AiX5F/+oek5PHVkm1jNtYz0tErbFX7TQMFfmx+OX0Km238Xb+XMWWz2k5iHLmnSRwdYJ3rU1ufTd26h3yuL+DXsalJnfNYqK9wptbg7ilximZaRs61EJrM3J3GrRtmzr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pamDiagnosticMetadata: NSPM X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2016 02:10:19.3331 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR84MB0316 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2209 Lines: 46 On 04/13/2016 08:25 PM, Peter Zijlstra wrote: > On Wed, Apr 13, 2016 at 11:37:21AM -0400, Waiman Long wrote: >> The TSC clocksource, on the other hand, is per cpu. So there won't be much >> contention in accessing it. Normally TSC will be used the default clock >> source. However, if there is too much variation in the actual clock speeds >> of the individual CPUs, > Does the system actually have a clock rate skew? Not an offset? No, the system that I was able talking about didn't have this issue. I did see some prototype machines that had the clock skew problem due to firmware issue. >> it will cause the TSC calibration to fail and revert >> to use hpet as the clock source. During bootup, hpet will usually be >> selected as the default clock source first. After a short time, the TSC will >> take over as the default clock source. Problem can happen during that short >> period of transition time too. In fact, we have 16-socket Broadwell-EX >> systems that has this soft lockup problem once in a few reboot cycles which >> prompted me to find a solution to fix it. > This 16 socket system is a completely broken trainwreck. Trying to use > HPET with _that_ many CPUs is absolutely insane. > > Please tell your hardware engineers to fix the TSC clock domain. I was talking about the way the clock source was brought up. If you look at the bootup kernel log, you will see something like (from a 4-socket system): [ 5.777423] clocksource: Switched to clocksource hpet [ 5.823689] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns [ 7.870387] tsc: Refined TSC clocksource calibration: 2493.990 MHz [ 7.872299] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x23f30c707d3, max_idle_ns: 440795252535 ns [ 8.871787] clocksource: Switched to clocksource tsc The TSC calibration itself takes some time and it needs a prior clock source (hpet) as a reference. It is during that transition period between hpet and TSC as default clocksource that the 16-socket system may hit a soft lockup occasionally. I don't think it is a hardware issue. That system was using TSC as the clock source when it booted up correctly. Cheers, Longman