Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3903947imm; Mon, 30 Jul 2018 05:37:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd8/bkEMRBAAPBnzCrrxpDYzvceK4N51eLFAEYHMreyTo2HtUPZAGZcAayKR8xEQNjN4YRy X-Received: by 2002:a62:3b89:: with SMTP id w9-v6mr17755325pfj.80.1532954269364; Mon, 30 Jul 2018 05:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532954269; cv=none; d=google.com; s=arc-20160816; b=P7fmVMbARzSA8SFFemntnr3hiY9q3t7ChWjhmuzGh4mxQGrVVogoijoaDcwLBba8CL KfpVCC2RMRVMJxzp9NqmnZs8EtqagEur1fazbbvLBsoUIHvpLGNRUY8wzPI97aEsCOUj PVLvec9yQxAqgtCoCKOZUKTGU3Lxm6ryq57J3LvLzpYMri3/bS7u1PCasJIsAKhzNx8N QR/jJaUeUMvjNTKNayQ8G8TU36/Oq8/4P89Apf4j8+HQN8Xdm6d+Pl2KzzaqO2WjTQcB wuwRVDPHaUzpiC9KU53PpeSf78dcuUW3c5XHXjEPZZjt01MD6S01dlacO/Nlh9fle3so sxdg== 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=4ystWmHe7vNSfKbzUzfcHrDeBsx2W8bP/adi721Qdtg=; b=hf9igkQcau/DczqfucTBlo/8F3xgVxi+bh61aIgMjKaZcMu1/nNKU10irKU7aeEZTI nVCTmcUSIBC2ORPSFw2JNdIEMtP4eT2/LLjjKLj1KEFMf88XDDUkqvWgFZSuPN2Wxulg ZwO5z9k8lGyriiab0HHZjt6sJoWSKjxp3EIh/kBk/l0ZJU6FbfZT6rX4nsqK2HmwRVYY WUMEMgOsqim9FPZ+rceU62c7qhE+pagVC/4nB5OPWWLVryRauJmLLWv6hFqh0eedflY3 Uzi1DwR70phxTRqZ8QnKaKJIiXAp44/h+hN0CjdX3FqapWNtx4zVBCPv/r3pvX2Ouayr ucyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="kVQccG/k"; 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 f10-v6si10564017pfn.85.2018.07.30.05.37.34; Mon, 30 Jul 2018 05:37:49 -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=bombadil.20170209 header.b="kVQccG/k"; 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 S1729138AbeG3OLZ (ORCPT + 99 others); Mon, 30 Jul 2018 10:11:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48970 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728798AbeG3OLY (ORCPT ); Mon, 30 Jul 2018 10:11:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=4ystWmHe7vNSfKbzUzfcHrDeBsx2W8bP/adi721Qdtg=; b=kVQccG/kG5dHjNy9yF21cWdyE yqXmc6Cn+t/TrkkJozb9EAQtERxgzeDfns0P7/JwZGwcya+GxEddXthLFnF21x2+oGATCHaMMf9tg dymMlrjtTem9wCfahEZtHBI7mtavo207AgUOkuO5RTdJPIc0dniIioyhq0sCYq5dbUnaTBawnWhoR QRLEiqoP+kAbgiZ4wTQ9iSKstIxQJIK66HrP1TCHOakWVN/Gxs9v7hcV+PTWfjND6FkmYUaEVij6G RU4LPh0gVizViRF55m4HDD7KVdi+rfEK4YylkoXXqLsXh/jcWmanJrpi1l+XvAsHrQpNbyHZ2rwtA JzivsMKTg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fk7Pe-00042v-8N; Mon, 30 Jul 2018 12:36:34 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EABD52026831C; Mon, 30 Jul 2018 14:36:31 +0200 (CEST) Date: Mon, 30 Jul 2018 14:36:31 +0200 From: Peter Zijlstra To: Pavel Tatashin Cc: Guenter Roeck , LKML , mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/timers] sched/clock: Enable sched clock early Message-ID: <20180730123631.GO2476@hirez.programming.kicks-ass.net> References: <20180719205545.16512-24-pasha.tatashin@oracle.com> <20180724195215.GA22496@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 24, 2018 at 10:41:19PM -0400, Pavel Tatashin wrote: > If we need it, we can surround the sched_clock_register() with > local_irq_disable/local_irq_enable: > > diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c > index cbc72c2c1fca..5015b165b55b 100644 > --- a/kernel/time/sched_clock.c > +++ b/kernel/time/sched_clock.c > @@ -243,8 +243,11 @@ void __init generic_sched_clock_init(void) > * If no sched_clock() function has been provided at that point, > * make it the final one one. > */ > - if (cd.actual_read_sched_clock == jiffy_sched_clock_read) > + if (cd.actual_read_sched_clock == jiffy_sched_clock_read) { > + local_irq_disable(); > sched_clock_register(jiffy_sched_clock_read, BITS_PER_LONG, HZ); > + local_irq_enable(); > + } > > update_sched_clock(); I'm thinking maybe disable IRQs for that entire function, instead of just the register call.