Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2446562rwl; Thu, 6 Apr 2023 10:17:41 -0700 (PDT) X-Google-Smtp-Source: AKy350bcFJ74f0jg0uWgZyUZnXggGPkZeMQfw6P99lsLAdbz22Y6kjupfIhBNwPxFhwqR2uYhnNk X-Received: by 2002:a17:906:4a89:b0:92f:2c64:9d43 with SMTP id x9-20020a1709064a8900b0092f2c649d43mr7219401eju.68.1680801461330; Thu, 06 Apr 2023 10:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680801461; cv=none; d=google.com; s=arc-20160816; b=eNDTDwDst7wAF5TLQzZ2BQVkw5Ye4Xu22ebfBeZBdlkNK4ihVnMENgvyfAkHAfZZs+ /TQLELAxZLBpWyPjxvtB0EWtpYK9tRlTI2XXR+dWfn9txraZUmvorIPQsmjMPPOazeo9 xVXUK8DXB8JwrLeuRwmEs7eZSFO/zrC3vfI/qgYIwtqDAvulTptcMz7Xkyw1b/xqJgG2 L/laMFkaGvSf85+esb+7izsnzG89MS5imtxwNOZ5xRpR6+qzCf+8ZVKsjxWvNTDKaH7v q44uMsmCMD0FAd4ReSpS03nyZfvBso2ExCnI3D8g6FuureDHYfQA0WnUkp0z66rRJdeb fqvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=ZeWqjwkXqctFtm5vJqndU1KAum2etTHdfAsXlyM8ELw=; b=NDQqB181z3ODp6nxJz+PbLFwg238WUdJy1aRtPc3y8oTVaHf3f5H5Ctf21koDq6r09 mWoMpmhkubQiS6y5rV0gXLlCSLNPdHofKVbW7bWCTdekcPGjYXbDiDuzj/aKqGxCK8EM FJUl+hxx19y0r4eFSmXJV6kXXqP8t0LkenDHWpQNTileKLgiq9H0vikfVvnhMEy+P7zP rZujZsL4s1V4p97DOaYyYcSmRtdXvo8XLbMkMbGeNsn/KAhIK66mNR0ADr7aoZYGGwBg AvnIW7V7J1W69DOFq3qAFZRAdpge2PqF6G47dB+G7CioMpi9gZGvgM2aPKsD8CuNd7x/ uB+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oFb5THzE; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z13-20020aa7c64d000000b00502682409a2si1326731edr.690.2023.04.06.10.17.16; Thu, 06 Apr 2023 10:17:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oFb5THzE; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239216AbjDFRNs (ORCPT + 99 others); Thu, 6 Apr 2023 13:13:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236914AbjDFRNq (ORCPT ); Thu, 6 Apr 2023 13:13:46 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B8676A6B for ; Thu, 6 Apr 2023 10:13:45 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1680801223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZeWqjwkXqctFtm5vJqndU1KAum2etTHdfAsXlyM8ELw=; b=oFb5THzEJEI8+gj6mu22TwoEOBqwAwuc/M4bp7NOfkKqgPfveoYRLdISk8HxDg1Zg9dMie Zc82erZ35RYySe+CSujLZxVHibqjfafumZMKWvkQqhlpWzv2mE98i/uhFREF7AazxJtW2+ sWvzgz6tQmVBPFr5g/G8uvrjKZ2nTL1klqJNzphPb1MXMQOeL1SBXHkm30OHvw9NvnLDpp oY99EqXdlWc/9TtU4CI3UVLAVEFzz5HEOWNda07ICz+ptKxDNAvhEMM/3YsxOwlgrJnusy lU3Y/VXTl88MGtq54bFUQ46l/WHxvkCnir3yJKoWzY89Ro3uhar6vuxlYqFgMQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1680801223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZeWqjwkXqctFtm5vJqndU1KAum2etTHdfAsXlyM8ELw=; b=uQ7P+ZBWVNw5KCEkupnBEdm95k8ARZqCFHfrkwci84xGR51RM3b98A93TRP+i+Ug7nMRZI +notRYmEzUWmBPCg== To: Sebastian Andrzej Siewior Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, Ingo Molnar , Pavel Tatashin Subject: Re: [RFC] tick_sched_timer() is not properly aligned, fixed by chance In-Reply-To: <20230406150254.ZrawA2Y-@linutronix.de> References: <20230406095735.0_14edn3@linutronix.de> <20230406105529.GB392176@hirez.programming.kicks-ass.net> <87mt3lqnde.ffs@tglx> <20230406150254.ZrawA2Y-@linutronix.de> Date: Thu, 06 Apr 2023 19:13:41 +0200 Message-ID: <87jzypq6gq.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 06 2023 at 17:02, Sebastian Andrzej Siewior wrote: > On 2023-04-06 13:08:29 [+0200], Thomas Gleixner wrote: > The first one added is hpet. It points to "jiffies" as name and > jiffies_read() as ->read(). > > Before the change/ with PeterZ change I get from ktime_get() for > base/nsec something like: > |[ 0.004000] tick_next_period Name: jiffies jiffies_read+0x0/0x10 > |[ 0.004000] tick_next_period base/nsec: -401771248 405771248 > |[ 0.004000] tick_next_period hpet 4000000 > > base/nsec is different on each boot but it always ends up with 4000000. > With the optimisation, ktime_get() is: > | [ 1.179079] tick_next_period base/nsec: 647439581 518613145 > | [ 1.179646] tick_next_period hpet 1166052726 > > so something is using it during init. And this is > read_persistent_wall_and_boot_offset() Duh, yes. I remember now. That was done to take the TSC "uptime" into account, which is sensible. So making tick_next_period aligned to TICK_NSEC in tick_setup_device() is the right thing to do in general then. Thanks, tglx