Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4683793ioa; Wed, 27 Apr 2022 08:55:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9CvvdtDPrct+4VVo63ibZFhe9RANLZGwbAEvYOy/MGNZzfgrpSz7T8qa5EQA5k5e+P006 X-Received: by 2002:a17:90b:17c9:b0:1da:4359:768b with SMTP id me9-20020a17090b17c900b001da4359768bmr3209630pjb.22.1651074926673; Wed, 27 Apr 2022 08:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651074926; cv=none; d=google.com; s=arc-20160816; b=nqcc0BE9gzo+TxqjAM+sjhpA6OuOkXzkCDZALYqy9y79EeLpbmj5B/80cf7ps5AtgP DyjjUDNONVl8iyy5uHlzqCIYEhHFgUveu4H8M4zHtjnGyt2Q9Itb1nQftXQtArtMHv6M BcPiV+IdZgBiOpkCOxbKkH6uocSyL3AGddElYKg0j+lTOEhTsZcIGG8n5uxp3yk20Z5u gWs7Nczb8AqoHyN6j5/KHpHXZiHgyJj1zDR7vB23SHWuJ01MDmIPpmW457y+UTjvfveE meWmQ9vbW4Od+Oz3PRVB9UhCnPAhJWMROGx3NdGk9Uq402TenWnFPTjDIYvLC99KPmF1 Ak7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=MWZCV6q+tMaMcmNe8c8DL8HCpAANQ8uI561Lxx3pF68=; b=U1a+aYEDYpM+otJloqLafHLkiAHJz7rA01K/oY6ndv3aqnzlL2pllzVhT7OQ0GeQcb r0ywp1Pu0lKSHQzLUK/9Ghu96kNpMJllTy2/NL2N8eJuCb6hkW6dWSfoAnRDrtCR0IJY MKa3O47YmubIuP3ver0cDXqYN9BiIP+HdX7qi9Gs0CunXc8fBvgF2GiLgW2gvuS6P8vp xdoReYRjM682NWsVHBYBhtLPoIN9ZgoizUoPGgjC6y9EMKAYucAtjbMq9BY+sRPvH0ik SH9QLqBbLlIUL9y7ehdi3gumxRVrpXnPtoZRgEZLOYzboT/bIXsGgtjc6gr9GYFNpbLD xJ1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q21-20020a056a00151500b0050d49448114si1888926pfu.286.2022.04.27.08.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:55:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 16DC43A910A; Wed, 27 Apr 2022 08:28:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239824AbiD0PbW (ORCPT + 99 others); Wed, 27 Apr 2022 11:31:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239819AbiD0PbR (ORCPT ); Wed, 27 Apr 2022 11:31:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98CD939D24C; Wed, 27 Apr 2022 08:28:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B3124B8284F; Wed, 27 Apr 2022 15:28:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A997C385A7; Wed, 27 Apr 2022 15:28:01 +0000 (UTC) Date: Wed, 27 Apr 2022 11:27:59 -0400 From: Steven Rostedt To: Kurt Kanzenbach Cc: John Stultz , Thomas Gleixner , Stephen Boyd , Ingo Molnar , Jonathan Corbet , Richard Cochran , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] timekeeping: Introduce fast accessor to clock tai Message-ID: <20220427112759.1cedda69@gandalf.local.home> In-Reply-To: <87r15i9azg.fsf@kurt> References: <20220414091805.89667-1-kurt@linutronix.de> <20220414091805.89667-2-kurt@linutronix.de> <20220426175338.3807ca4f@gandalf.local.home> <87r15i9azg.fsf@kurt> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 Wed, 27 Apr 2022 10:38:59 +0200 Kurt Kanzenbach wrote: > Looking at the other functions used for tracing: > > - ktime_get_mono_fast_ns - no annotations > - ktime_get_raw_fast_ns - no annotations > - ktime_get_boot_fast_ns - notrace > - ktime_get_tai_fast_ns - notrace Yeah, all should be notrace. > > Seems a little bit inconsistent. > > > > > That said, I hit this too: > > > > less-5071 [000] d.h2. 498087876.351330: do_raw_spin_trylock <-_raw_spin_lock > > less-5071 [000] d.h4. 498087876.351334: ktime_get_mono_fast_ns <-ktime_get_tai_fast_ns > > less-5071 [000] d.h5. 498087876.351334: ktime_get_mono_fast_ns <-ktime_get_tai_fast_ns > > less-5071 [000] d.h3. 498087876.351334: rcu_read_lock_sched_held <-lock_acquired > > less-5071 [000] d.h5. 498087876.351337: ktime_get_mono_fast_ns <-ktime_get_tai_fast_ns > > kworker/u8:1-45 [003] d.h7. 1651009380.982749: ktime_get_mono_fast_ns <-ktime_get_tai_fast_ns > > kworker/u8:1-45 [003] d.h7. 1651009380.982749: ktime_get_mono_fast_ns <-ktime_get_tai_fast_ns > > kworker/u8:1-45 [003] d.h5. 1651009380.982749: rcu_read_lock_held_common <-rcu_read_lock_sched_held > > kworker/u8:1-45 [003] d.h7. 498087876.375905: ktime_get_mono_fast_ns <-ktime_get_tai_fast_ns > > kworker/u8:1-45 [003] d.h7. 498087876.375905: ktime_get_mono_fast_ns <-ktime_get_tai_fast_ns > > kworker/u8:1-45 [003] d.h5. 498087876.375905: update_cfs_group <-task_tick_fair > > kworker/u8:1-45 [003] d.h7. 498087876.375909: ktime_get_mono_fast_ns <-ktime_get_tai_fast_ns > > > > The clock seems to be toggling between 1651009380 and 498087876 causing the > > ftrace ring buffer to shutdown (it doesn't allow for time to go backwards). > > > > This is running on a 32 bit x86. > > Hm. The only problem is that the TAI offset may change. That should only > happen if the time is set or similar. For the TSN use case I've ran > ptp4l and phc2sys. phc2sys in the default configuration sets the offset > hard once and uses frequency adjustments from that point on. I didn't > observe any time jumps. Nevertheless, my test systems is based on > arm64. I'll do some testing on x86. I'm able to trigger this on x86 64bit too. One thing I noticed, is that the two numbers I have (from a different trace, but very similar to the above) $ printf "%llx\n" 498151194674148935 6e9c9df4afd3647 $ printf "%llx\n" 1651072699280995911 16e9c9df4afd3647 That is, the last nibble either is 0 or 1, causing the change? 06e9c9df4afd3647 16e9c9df4afd3647 The numbers are the same except for that last nibble. -- Steve