Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp1206704ima; Fri, 1 Feb 2019 18:51:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN5qMLRNBtjKAolAB8st7sdcPfTc0TXL3luOjhAUSXMFx/a+0NJ2N7YEjjFD4Pjhwj5uymn4 X-Received: by 2002:a17:902:5066:: with SMTP id f35mr42483882plh.78.1549075916336; Fri, 01 Feb 2019 18:51:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549075916; cv=none; d=google.com; s=arc-20160816; b=DOQO8PGShfiEbzTW02Sbk5Wkg8gDYmmw7cq9Db4OKtJNhXsgDWO/boQNbfxUx9+JMl vbbHaoYNf64RN0QcOrr3RB73fSNwCai2CBUeUkbusGhprvEx6/03TlAVJxT53ut4mNBI brsih6CFnvpKDOaR7nMKaCWJXlhh2ztoeWfVMlD+i5Trv1CQp3DzmDEKtXzgQ7T0PSYD tZLZjlN7UjfdYjDgGCjI2l73Dg+PphP17OaCFpsUdyfnH9UeCKPylx9WbT/vHIxYkms9 tQ2v0Xzk1tteRdzmp8/LZnXB29NyyvblihmA8IcJflf6vHs60NoI4qFpOnASWFfb/q/L J1Lg== 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:in-reply-to :mime-version:user-agent:date:message-id:organization:from :references:cc:to:subject:reply-to:dkim-signature; bh=5SyRWrX99SQGWL9Dm9iSP84Xge+Qfg3ORLwR4lyHxiM=; b=okwS++oQRZmMCr8cc3aqZfLLRVs1wRWIp2ovHGY7DLpjgNXTyqQBI8biSt3tqFnZve IH4/UyWRePwiUhdlJS4D/Ayxsjf4Wq/uvxdeQ0C9nW+hAhmIC8fUq5pMGbs0ysbtu2PE LA0phBIc2Be75svhmfvDJo0Sz/3iS+JYM6YCVEJH6pCkzW9MSCDUOf69tUYKN+K6qesO nVzNqpkU24qIXW2pRJSVP10eq0xTpnL3MVfHqAgzFiVcVZjfFje32FjAusNQ40P3tIYg 9inYxrseQN3X/M1uP06j6ZYel/SgCxe+lGjBg7dQHOWTkR4nyAFgNkHzfXGNz1PMD/uw j/oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=sJUHo+KO; 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18si9569573plz.105.2019.02.01.18.51.40; Fri, 01 Feb 2019 18:51:56 -0800 (PST) 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=@oracle.com header.s=corp-2018-07-02 header.b=sJUHo+KO; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726629AbfBBCvO (ORCPT + 99 others); Fri, 1 Feb 2019 21:51:14 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:50384 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbfBBCvO (ORCPT ); Fri, 1 Feb 2019 21:51:14 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x122oMcc118355; Sat, 2 Feb 2019 02:51:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=reply-to : subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=5SyRWrX99SQGWL9Dm9iSP84Xge+Qfg3ORLwR4lyHxiM=; b=sJUHo+KOOtb1+v2oDeLsneFBGcIUyDQ8ZLDNRz1DGTtVzMW81VlL9+Ke8AGp+/UAWdwm maFiva4O+VSrd7NN9IYd0lpP78Czlj+UvC/N8qmX/QhTj8d+CdpLtyq+Sou+b/HxD56A rUCmM/L/jGXizBG3s8csm6t4NmvWxL+Cw+OV/0WAHLde/BIntW/sB05q7kUxY5FPsKgo YGNhRpaZv91S+mACldMGNgXEqIm9Nbikhz8YFzE5YwoPaTidpsHKdb4485QseuzdfGja bjWjDOi69kJm5MUpc6Q4jwo1JcI/+tZAgZSPUsak/1JQlIZ4qHPmELdqOfE1x57kuatV 5g== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2q8g6rsjj2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 02 Feb 2019 02:51:01 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x122p09R031673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 2 Feb 2019 02:51:00 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x122p0qf006426; Sat, 2 Feb 2019 02:51:00 GMT Received: from [10.191.0.151] (/10.191.0.151) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 01 Feb 2019 18:50:59 -0800 Reply-To: zhenzhong.duan@oracle.com Subject: Re: [PATCH] acpi_pm: Reduce PMTMR counter read contention To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Daniel Lezcano , Waiman Long , Srinivas Eeda , kin.cho@oracle.com References: <1548141807-25825-1-git-send-email-zhenzhong.duan@oracle.com> <019e583c-7bcb-c234-200c-fcdb6c49fbb0@oracle.com> From: Zhenzhong Duan Organization: Oracle Message-ID: <853e8cf6-aba9-0200-8e39-e362848399ba@oracle.com> Date: Sat, 2 Feb 2019 10:52:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9154 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902020019 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/1/31 22:26, Thomas Gleixner wrote: > On Thu, 31 Jan 2019, Zhenzhong Duan wrote: > >> On 2019/1/30 16:06, Thomas Gleixner wrote: >>> On Tue, 22 Jan 2019, Zhenzhong Duan wrote: >>> >>>> On a large system with many CPUs, using PMTMR as the clock source can >>>> have a significant impact on the overall system performance because >>>> of the following reasons: >>>> 1) There is a single PMTMR counter shared by all the CPUs. >>>> 2) PMTMR counter reading is a very slow operation. >>>> >>>> Using PMTMR as the default clock source may happen when, for example, >>>> the TSC clock calibration exceeds the allowable tolerance and HPET >>>> disabled by nohpet on kernel command line. Sometimes the performance >>> >>> The question is why would anyone disable HPET on a larger machine when the >>> TSC is wreckaged? >> >> There may be broken hardware where TSC is wreckaged. > > I know that. > >>> I'm not against the change per se, but I really want to understand why we >>> need all the complexity for something which should never be used in a real >>> world deployment. >> >> Hmm, it's a strong word of "never be used". Customers may happen to use >> nohpet(sanity test?) and report bug to us. Sometimes they does report a bug >> that reproduce with their customed config. There may also be BIOS setting HPET >> disabled. > > And because the customer MAY do completely nonsensical things (and there > are a lot more than the HPET) the kernel has to handle all of them? Ok, then. I don't have more suggestion to convince you. I just think of a simple fix as below. I think it will work for both hpet and pmtmr. We will test it when the env is available. --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1353,6 +1353,7 @@ static int change_clocksource(void *data) write_seqcount_end(&tk_core.seq); raw_spin_unlock_irqrestore(&timekeeper_lock, flags); + tick_clock_notify(); return 0; } @@ -1371,7 +1372,6 @@ int timekeeping_notify(struct clocksource *clock) if (tk->tkr_mono.clock == clock) return 0; stop_machine(change_clocksource, clock, NULL); - tick_clock_notify(); return tk->tkr_mono.clock == clock ? 0 : -1; } Thanks Zhenzhong