Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4774776ioa; Wed, 27 Apr 2022 10:49:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzG8ZENALmak47mnmycNwjG7ObXn5+eYiWMelJ7gho6soY/Mo9zlvCv6Zh2IZ3igYZZTBtZ X-Received: by 2002:a05:6a00:1a01:b0:505:b3e5:b5fc with SMTP id g1-20020a056a001a0100b00505b3e5b5fcmr30993747pfv.53.1651081740315; Wed, 27 Apr 2022 10:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651081740; cv=none; d=google.com; s=arc-20160816; b=IwORTPWWRhBb1uBHx86dK8yHeeOYcVljhyVWfGooiL8onuTSkU1VZb8msp/3+Ac0tP 1UCpOcljzY8FQnV/S3EVcWOfEnz6SMbvb1l/RaYW53zu3SPDFapF7WztG7WE8Msmh0E+ jtcY1CJGpnY8psE7gf9hKFUvXVtT9Rcze76MXoWNDKNKOzFJBAMDczBrjkyEy93xCp30 LFuwJ8DwE2Z46hn+HW1akbcxpvtGa/KaCQbnEgkI0u8ck35UshtuOm+C/p5wUCChsWMJ S28JerxdYkzlXueuwwiuG9ZxTWXirhiQEnm72U4QKZWIqdrCPSshxsi3Po2gPvmnSQS0 fM0w== 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=KP+6tmnC4madC8mfskSZKQCCZJKxOJ8XdC9bIFtbWVA=; b=GFSbbaMmcm23yEMqvjMl5pHjnQ6sUpVqDn5kwZoclOkpRIXP2jb3auOTIehQ5S/FxL z7lyRQXSEZ8/+DRcwdO8w8/bonRaKsb0natsK/+OalJMxIAj4eUbwdiQnFQIpRvePw0K hrxpcepRDTsYZDwXc3OCWOJb8Nruq5wzsg0HownALQcrzMHXSyb57nMkC2HK/8MNE7qp ZGQQK5zVn2Jv/CXr37LCbtabaCHlHtMNNfkx6H8YFU475XZUHkUvVRbQ5/NG97PH8nCu /kfoY7pe9ojsO12DfyxXsI/2ph2EYEweLgewgvOYbj4pCjM8w+iR1xvRqnAVZ89Ry3R5 DdUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w190-20020a6262c7000000b0050cec4de7eesi1894718pfb.223.2022.04.27.10.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 10:49:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 7546B4667D; Wed, 27 Apr 2022 10:22:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244074AbiD0RZ3 (ORCPT + 99 others); Wed, 27 Apr 2022 13:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244082AbiD0RZY (ORCPT ); Wed, 27 Apr 2022 13:25:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A78B246B29; Wed, 27 Apr 2022 10:22:10 -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 69429B825F9; Wed, 27 Apr 2022 17:22:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C747C385A9; Wed, 27 Apr 2022 17:22:07 +0000 (UTC) Date: Wed, 27 Apr 2022 13:22:05 -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: <20220427132205.386be5e6@gandalf.local.home> In-Reply-To: <20220427112759.1cedda69@gandalf.local.home> References: <20220414091805.89667-1-kurt@linutronix.de> <20220414091805.89667-2-kurt@linutronix.de> <20220426175338.3807ca4f@gandalf.local.home> <87r15i9azg.fsf@kurt> <20220427112759.1cedda69@gandalf.local.home> 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 11:27:59 -0400 Steven Rostedt wrote: > 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. And I just realized what the issue is. The ring buffer only allows for 59 bits of timestamp, as there's times it needs to inject a timestamp into the buffer, which is 16 bytes, and the first 5 bits are meta data, leaving 59 bits for the timestamp. Since no timestamp came close to that before this timer, everything worked. Thus, when a full timestamp is injected, it takes off the 5 MSBs of the timestamp (which took off that 1) and that is what is happening. I can see if I can play some games to detect this and replace the top 5 bits with the saved timestamp at the head of the sub buffer. -- Steve