Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1541864imm; Thu, 19 Jul 2018 03:41:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcTuo00J3EGHY03fAYcVs8BKDwCxlhpbXNpGd/I0m8Ms65mvicPwCA+SX97opULFApILVMx X-Received: by 2002:a63:f:: with SMTP id 15-v6mr9549125pga.430.1531996906953; Thu, 19 Jul 2018 03:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531996906; cv=none; d=google.com; s=arc-20160816; b=lGIXP/bO4ZK2DJ7vHlVdNmGAceDOblPq7KXsvUcyU5ohC1BksN4iMJQlLIOEjNjjaB Di1Eo9a8jOaYNS8pQjWvTq22CniMcdBHtAYHSMoAwOgQXu52D8fn6pZex9Jbw2G74nvK /jrGb86/XWmV/A4bWUA7nC7nq/nnJUv/QGLpWgdz9UCBi6Txh6dEEZsE1sCsBzi6Pf7O J5+Xbj2EEaaH/QkDT3uOeBy5zlGBIpUBNMud8+lWL6df9vM4lYRass2Zp9kdQDCZVsBI ZoTS8II972mnEnZuqvhXZrAsbWRiOldAGLZRA1s1J15u8gOyM46qW+DFW0MKI2hc6h87 lx+Q== 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=g8wrvPkHwVUGWtSaRwgkHhKtR8VQQou89nvraJQkADE=; b=if/+df7apSJYdyKzwKbQ3ZRGP86+EK+R20SHLTu7jd24ay/hfyXju7qQCMYF0MWDLN 3psmFu23toGVB0dqWX1J4jlaY7im0aOIiGN7ybUI5QdA/1/n5YZnVi3KE7a+epxkJGcU uK2arfDZbDjWRKocA8ies6a+PRanc5RcdbYvZHk5XwGns6MnwQdHMeSuVaTSSIWis8CV D8j79lhcNZgcwZyxtDzVI/yBQC/ZkZZTEB6WWC1m+Zc88aqaP6/A1R8zAfT0suNWDrOL cNVS/vKLlZ/phTlkU0caGYcAzQ3eoW7soqp8Y6cGTFY/LOn/5ljQkt30YzEH2XCDB0kS nqvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=xIKTj9yB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 6-v6si5345824plb.409.2018.07.19.03.41.10; Thu, 19 Jul 2018 03:41:46 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=xIKTj9yB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730456AbeGSLWN (ORCPT + 99 others); Thu, 19 Jul 2018 07:22:13 -0400 Received: from merlin.infradead.org ([205.233.59.134]:35104 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727335AbeGSLWN (ORCPT ); Thu, 19 Jul 2018 07:22:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=g8wrvPkHwVUGWtSaRwgkHhKtR8VQQou89nvraJQkADE=; b=xIKTj9yBUQej/LxkEwhjNzR91 oyepp6bLjV6q9OksEWCxy26m/hfKIBtQxcAYOoEyHyns/jUGlW12GdljDDcw6Nub4bE9lHxHC5+U5 tP1u2kXkHfux9qt3hnum56C31AoQw5c5TiYUk8VFhxXu5Qqg46pzq/5yxxfYI13ucOsgGGgy9bVqw NaXW1cXiT7iJ4ZcZ8kavTdZYt+1cVxPRQnfDCn3Ztxsf94jwQjon3Jaescfe7Y3WrHIk2M3EbLPUU PhOfCzGLeG3JKTm1xadCrtzODWJXdCyCghsD6MjWJlJf/hz/b1Sa7ugQOgGXM1FLKt4HTdsM9m22k RQXRXijyg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fg6Kw-0002SL-Fx; Thu, 19 Jul 2018 10:39:06 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D09DE20289330; Thu, 19 Jul 2018 12:39:03 +0200 (CEST) Date: Thu, 19 Jul 2018 12:39:03 +0200 From: Peter Zijlstra To: Pavel Tatashin 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, boris.ostrovsky@oracle.com, jgross@suse.com, pbonzini@redhat.com Subject: Re: [PATCH v14 24/25] sched: early boot clock Message-ID: <20180719103903.GB2494@hirez.programming.kicks-ass.net> References: <20180718022211.6259-1-pasha.tatashin@oracle.com> <20180718022211.6259-25-pasha.tatashin@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180718022211.6259-25-pasha.tatashin@oracle.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 17, 2018 at 10:22:10PM -0400, Pavel Tatashin wrote: > diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c > index 0e9dbb2d9aea..7a8a63b940ee 100644 > --- a/kernel/sched/clock.c > +++ b/kernel/sched/clock.c > @@ -202,7 +202,15 @@ static void __sched_clock_gtod_offset(void) > > void __init sched_clock_init(void) > { > + unsigned long flags; > + > sched_clock_running = 1; > + > + /* Adjust __gtod_offset for contigious transition from early clock */ > + local_irq_save(flags); > + sched_clock_tick(); > + local_irq_restore(flags); > + __sched_clock_gtod_offset(); I think we want to keep __sched_clock_gtod_offset() inside the IRQ disabled region. And I just looked at my patch: https://lkml.kernel.org/r/20180626090003.GA2458@hirez.programming.kicks-ass.net and that had a comment about how we wanted to set the gtod offset _before_ setting sched_clock_running, yet here you do it the other way around. Hmm? > } > /* > * We run this as late_initcall() such that it runs after all built-in drivers, > @@ -356,7 +364,7 @@ u64 sched_clock_cpu(int cpu) > return sched_clock() + __sched_clock_offset; > > if (unlikely(!sched_clock_running)) > - return 0ull; > + return sched_clock(); > > preempt_disable_notrace(); > scd = cpu_sdc(cpu);