Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5007094imm; Tue, 26 Jun 2018 04:29:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKWIpHBFQwjlftUtdco4SyvCP+S8LNF25cKRBtt00RJWz8Wb7bUGhW/iAg8YmHPHdf1Y7Db X-Received: by 2002:a65:410d:: with SMTP id w13-v6mr1011797pgp.414.1530012579546; Tue, 26 Jun 2018 04:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530012579; cv=none; d=google.com; s=arc-20160816; b=Dpr3j50jFtIdGa6NGQxABJp2BV3MvispSuSwHpI4umZBqpKvinkNjMJHm9R9AVs5Ow ywbz+d+xq9RTPLkLxHzi+Iyo42qAwiQhsSvn/Y9IIrywrs/dB81BsvWD0UYa1AX51EIr fY9wGxXU8MgFJ/flwMsObZkeBs4KEAfRog2PiASz48zJW/m7m38olpnsQ73/NFXMY4vc We2RaEpIMslMTz+jKkru7JtFKuqFKeRUfhHh7TfHZ8N4Wz5Ikyg7ZJPAOKZVy6epT6nB mB+DaKnl45OC5fhooIneMM7EOypJFuvRZI2OWSCUlEAppaO7d0+Zx2okyQE8IbgV37Z+ xRFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=dy9THHLyv2DDW000Xhe0GuH1RZXO63QpIAr1lF7KC9M=; b=WcqiJhch19YDI0CBD7bpbfdPw2N/69fr+r7iYOM++G9qrAz3Wbjg5dQrxmMQMPgXX9 w+0Dv567DNgSJ56FLHY/IhCyCyyE58n37Rw0wVgTrVy3womji6UXpvOccmtgKgodGTjM cSwZLGa2WiSNRhDvBxpwdMNpZ3NBDm+4FSZHbLxfVsFOouIlBiPr3zwMLBxLVsbV80TM M6zc8GyexpHDq+LK/CblPHM2++NfVjBlRr2It2ixCZaDOxvuEcEulA6DeN/xICEk76OW Y9WAS6C8++jnhX7ah/scy5Dbm86i8mNHVZsgpru2zN9S7gCqpSuSWgGe7J+EY2nYQHWT JquA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ikMPNtkK; 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 f5-v6si1574838pln.414.2018.06.26.04.29.24; Tue, 26 Jun 2018 04:29:39 -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=ikMPNtkK; 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 S934638AbeFZL2R (ORCPT + 99 others); Tue, 26 Jun 2018 07:28:17 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:34480 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934276AbeFZL2N (ORCPT ); Tue, 26 Jun 2018 07:28:13 -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 w5QBO080040475; Tue, 26 Jun 2018 11:27:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=dy9THHLyv2DDW000Xhe0GuH1RZXO63QpIAr1lF7KC9M=; b=ikMPNtkKO5JKS6tVnP+3VbG+sgCa56N39cX0j30olkyG9qnbgJpB0xpJkJcmvWqPEHk4 3qpcZXqOLAbD7vbrt+vaxg3j/URKm0htsnoESeVRdF7SXuyPkRyecG1NsicMKWGFe3pw eSO+/3EhO6AlBcFQ4OabsEMiDyD9aprrw4J7+TuFsUmqIBe+hJs2OgYM8B97t3JC1zyq dS2TBIHii2un/efJjbO/TXQ/i6y2Ca5LCF0hPS5ZmJHy6l8fYKiUMQ5IxDkpZYRlq2+E 6g9lbOv2eBhXnvX9+FvhiVQIqtNWjwKU0e77pb/ESHkoy77xn9+t62fYPhQxkAt1mNO+ UA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2jum57r30f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Jun 2018 11:27:14 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w5QBRCQV027198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Jun 2018 11:27:12 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5QBRAHS024359; Tue, 26 Jun 2018 11:27:10 GMT Received: from xakep.localdomain (/73.69.118.222) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 26 Jun 2018 04:27:08 -0700 Date: Tue, 26 Jun 2018 07:27:05 -0400 From: Pavel Tatashin To: Peter Zijlstra 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, tglx@linutronix.de, hpa@zytor.com, douly.fnst@cn.fujitsu.com, prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org Subject: Re: [PATCH v12 10/11] sched: early boot clock Message-ID: <20180626112705.4dxrsd5acvobla5y@xakep.localdomain> References: <20180621212518.19914-1-pasha.tatashin@oracle.com> <20180621212518.19914-11-pasha.tatashin@oracle.com> <20180625085543.GT2494@hirez.programming.kicks-ass.net> <20180625192320.kzmqkvmfh5aeuhhx@xakep.localdomain> <20180626090003.GA2458@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180626090003.GA2458@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180622 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8935 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=676 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806260129 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > How's something like this? That moves sched_clock_init() to right before > we enable IRQs for the first time (which is after we've started the > whole timekeeping business). > > The thing is, sched_clock_init_late() reall is far too late, we need to > switch to unstable before we bring up SMP. OK, sure. > - sched_clock_postinit(); > + sched_clock_init(); Yes, we can move sched_clock_init(). But placing it after time_init() would work on all arches with unstable clock except for x86. See comment above time_init x86: arch/x86/kernel/time.c 99/* 100 * Initialize TSC and delay the periodic timer init to 101 * late x86_late_time_init() so ioremap works. 102 */ 103void __init time_init(void) 104{ 105 late_time_init = x86_late_time_init; 106} Only After this: > > late_time_init() > > x86_late_time_init() > > x86_init.timers.timer_init() > > hpet_time_init() Only after this call we finally start > > getting clock interrupts, and can get precise output from > > sched_clock_local(). We start getting timer interrupts. Is it acceptable to move sched_clock_init() after late_time_init()? Thank you, Pavel