Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2301651imm; Sat, 23 Jun 2018 14:40:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJsh9VNjmp/q8OLaU3BKCEwXHtV+hAnZsU0lxBlMdzmnZuAuopQ4caS86cIr3q/m/zOmAcF X-Received: by 2002:a65:4e82:: with SMTP id b2-v6mr5870594pgs.438.1529790053759; Sat, 23 Jun 2018 14:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529790053; cv=none; d=google.com; s=arc-20160816; b=iXFJEqYIkI+ixgVBZ9QU3oGK5f+0JGAGMiXGrJK7mJdgPmgo5l4oLAQQ1ih4i8vwO+ G8ABnHWOSsMn5IHdys9MD5JU90RJcVaDCAUddqCnHVJZTCf8/Qo7aY52I8LHh7mXNxBe JCfckVUzROiew2Q3XztJTAddxrI/jOXIHM+heuKwS8QS6zSrFBOKT74c3P9qro+6LSlj qyFBHj5kXSsPsj4BdjUwzZe/6IBsc9kCqw+seNVfWX8QNx0bdanYbD4F8v3cE07L0NMS ZsZlNY75BYWscp6OOrmR4hsrhn3ZkxUHGTnDIEyDy0CZdqbHQpbkjXl3tJo9Nn3fXX3i BOpg== 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:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=9aoRzr6dnDZJ1AwQvvbtyTPpOvubfIpqEEpOoyFmbq4=; b=qSPQUKkXOATVGfWyjz9OKzHCziwA48TZ1Hrj2JW+wz9YrL+DNZBnBb+d+bKhgrRSBr 5OU2bUDECM57r+sDzRWg0l6EC45pegs+eMWFgkV8dRvhssXjx4rSUQGShfC0JmKeb8bj an9p9DoxRO1Cyyo6IMPCWwOJrQ7khY8h8gJju2gC+LwWQurBh24vEogjz8VJirziN0aC f3nBqySWEdKXK8M4gFBBG4cgtbXIhLjq+13g0nhceevw0lTmy4a1tB0d4076cpLl0M9i oa0OiEKv24UDvT4VrlyCGAy9JZIlzxtDRkHJZarq6Mo1swfrAT4GBJ4ypbqd87WIwfz0 GErw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b="RbKVJhF/"; 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 b6-v6si8444419pgv.595.2018.06.23.14.40.37; Sat, 23 Jun 2018 14:40:53 -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=@oracle.com header.s=corp-2017-10-26 header.b="RbKVJhF/"; 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 S1751706AbeFWVjy (ORCPT + 99 others); Sat, 23 Jun 2018 17:39:54 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:35758 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751471AbeFWVjx (ORCPT ); Sat, 23 Jun 2018 17:39:53 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5NKkTK8168889; Sat, 23 Jun 2018 21:38:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=9aoRzr6dnDZJ1AwQvvbtyTPpOvubfIpqEEpOoyFmbq4=; b=RbKVJhF/Oqo0QtJkByJVlQIhwUax7eqgDLbDWxQiHlkzTDR7EWMhlIk51aPhFhFPw1Q6 k4bypLetTf7l0FtVJF1pdG1rLQwv6q8u82Sy1jmCOgSbJwrXP7Fd7NVPwrOR+CglxY0z f5aIcOeVVx9f1qGri1iiDd5hQ3hikNgOo7XecEklWaX2SUTFta7nM4K/MGb8+DagcDGu agFGKmBVayrEm8aSe0U879Lb9ZHFWjxktGsTdnkeMRFeIT51Z5EzOmzi51QVBl95DiRX l4p5/CzMJuhrO01DPKLkDDgx+Ihe9gpvg4Hbmh6LwxAfUUVqskHVsMK85/XStKtzW+Wj vg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2jsfg0rvme-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 23 Jun 2018 21:38:58 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5NLcuj0002054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 23 Jun 2018 21:38:56 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w5NLcsH5017309; Sat, 23 Jun 2018 21:38:54 GMT Received: from [10.39.237.95] (/10.39.237.95) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 23 Jun 2018 14:38:54 -0700 Subject: Re: [PATCH v12 11/11] x86/tsc: use tsc early To: Thomas Gleixner Cc: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux@armlinux.org.uk, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, douly.fnst@cn.fujitsu.com, peterz@infradead.org, prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org References: <20180621212518.19914-1-pasha.tatashin@oracle.com> <20180621212518.19914-12-pasha.tatashin@oracle.com> From: Pavel Tatashin Message-ID: <640e2de9-22e3-24bd-4987-5b02344aa727@oracle.com> Date: Sat, 23 Jun 2018 17:38:45 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8933 signatures=668703 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806230241 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/23/2018 12:56 PM, Thomas Gleixner wrote: > On Thu, 21 Jun 2018, Pavel Tatashin wrote: >> /* >> * Scheduler clock - returns current time in nanosec units. >> */ >> @@ -1354,6 +1364,7 @@ void __init tsc_early_delay_calibrate(void) >> lpj = tsc_khz * 1000; >> do_div(lpj, HZ); >> loops_per_jiffy = lpj; >> + sched_clock_early_init(tsc_khz); >> } >> >> void __init tsc_init(void) >> @@ -1382,6 +1393,7 @@ void __init tsc_init(void) >> if (!tsc_khz) { >> mark_tsc_unstable("could not calculate TSC khz"); >> setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER); >> + static_branch_disable(&__use_tsc); > > This wants a proper comment. Yes, I will add a comment. Basically, this change is for a rare scenario where early in boot we were able to get TSC frequency but failed to do so later in boot when we tried to calculate it more precisely. Though, I am not sure if this is actually possible. However, if this is indeed possible, we will get into the same continuity problem as the one that is solved in "x86/tsc: prepare for early sched_clock". So, I guess we would have to modify either "jiffies_64" or __sched_clock_offset if we want to take care of this corner case. Thank you, Pavel