Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CDCECD0C857 for ; Tue, 13 Jan 2026 11:21:21 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1201483.1517110 (Exim 4.92) (envelope-from ) id 1vfcSQ-00021n-VG; Tue, 13 Jan 2026 11:21:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1201483.1517110; Tue, 13 Jan 2026 11:21:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vfcSQ-00021g-Qu; Tue, 13 Jan 2026 11:21:06 +0000 Received: by outflank-mailman (input) for mailman id 1201483; Tue, 13 Jan 2026 11:21:05 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vfcSP-00021a-N6 for xen-devel@lists.xenproject.org; Tue, 13 Jan 2026 11:21:05 +0000 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [2a00:1450:4864:20::333]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f261ca61-f071-11f0-b15e-2bf370ae4941; Tue, 13 Jan 2026 12:21:03 +0100 (CET) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-477a2ab455fso67996685e9.3 for ; Tue, 13 Jan 2026 03:21:03 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d8384646fsm366812425e9.15.2026.01.13.03.21.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Jan 2026 03:21:02 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f261ca61-f071-11f0-b15e-2bf370ae4941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1768303263; x=1768908063; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=Dv2fMYB5hXbUhgUcJfGY2lZ7/ed8hkB0GLSLrm4lgq0=; b=YnsVdG7xrH4KXsT6sreXz7k/IVFeLIfv+NQq8Xl/toneMO0ydQ3+Ir/wSSck8Syxd9 J1EHgi+cD+1O20MAjuQiyT4hL9pE8TGj1WOD720buNjzxwJFbMSxm8DJVDH1Kgxf+U59 P0DmkL68OHMVj8P2f/6WfcPAL3qdZfK6UZa29UD+Pjo2chBeUaRXLrmri2O+1RAFQ4SQ EfiwH+YI/qB2bnyOOvyp9z4+8xzqldPWBrkeROfbHZMw47UNhh8Q5K2lsYzdwCfJIwDw FXBVHedF4lsnxr0uN6caYtiasvZTfm0EKgiZKXNiAk8i5YuMS9kPDeBIicxAhzf4RBh1 64rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768303263; x=1768908063; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Dv2fMYB5hXbUhgUcJfGY2lZ7/ed8hkB0GLSLrm4lgq0=; b=rONbsXq7/1n71yQdsZ8aVHOpZJtU/Ypv+bxdHrowIep9XPnPE07LijWYl4bwecYIwq m16s0E+9qxF9/g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rWdvomKYNqbZi/bFpj1d5NQ9VUq1panRFoHql6VTFIYlOkgVajF2gHQ+D+xA== X-Received: by 2002:a05:600c:1992:b0:477:b734:8c53 with SMTP id 5b1f17b1804b1-47d84b18eecmr263758425e9.12.1768303263194; Tue, 13 Jan 2026 03:21:03 -0800 (PST) Message-ID: Date: Tue, 13 Jan 2026 12:21:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/5] x86/time: deal with negative deltas in get_s_time_fixed() To: Anton Markov Cc: andrew.cooper3@citrix.com, roger.pau@citrix.com, xen-devel@lists.xenproject.org References: <66a53368-9c33-436c-858e-2b2d25ae84b7@suse.com> <1f539879-3083-41d5-a2c5-c63c9161f0bf@suse.com> <4a6b6307-9014-4c4c-8c23-3673efa2d1b1@gmail.com> <794c382b-3b20-4d2a-ab70-b24d7fdf88ae@suse.com> <4b03cf36-d2d8-420c-82df-55d6a9ac9d68@suse.com> <6ea436ce-6ecb-47f8-8d8a-98b0badeb14e@suse.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObG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To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12.01.2026 17:41, Anton Markov wrote: >> >> That calls on_selected_cpus(), but send_IPI_mask() may then still resort to >> all-but-self. In that case all IPIs are sent in one go. > > Plus as said, how IPIs are sent doesn't matter for the invocation of >> time_calibration_rendezvous_tail(). They'll all run at the same time, not >> one after the other. > > At the hardware level, no one can guarantee that the processors will > simultaneously respond to the signal and execute your code nanosecond after > you send the ipi. Especially when we're talking about NUMA configurations. I'm > afraid the possible and impossible in the laws of physics is also beyond > the scope of this thread. You did read my recurring explanation beyond the IPI sending, didn't you? Of course IPI arrival may vary across cores / threads. Yet the term "rendezvous" is used because CPUs having received the IPI are then held in a waiting loop, until _all_ CPUs have made it there. Then CPU0 indicates to all of them simultaneously to move to the next step. There's going to again be some variance (especially on NUMA, where the memory write needs to propagate to all nodes), but at least within a single node that should be pretty low. The main source of variance I would expect there would by hyperthreads competing with one another in a single core. > Since further down you build upon that "IPI lag", I fear we first need to >> settle on this aspect of your theory. > > I've already provided the delay logs. It's not hard for me to repeat. Sure, I don't doubt you make those observations. But we're still trying to converge on a theory on what these may be caused by. > 2 hours of work: > >> (XEN) update stime on time calibrate 0, 8564145820102 -> 8565145861597 >> (8565145862216, 0) >> (XEN) update stime on time calibrate 1, 8564145820129 -> 8565145861609 >> (8565145863957, 0) >> (XEN) update stime on time calibrate 3, 8564145819996 -> 8565145861491 >> (8565145864800, 0) >> (XEN) update stime on time calibrate 2, 8564145820099 -> 8565145861609 >> (8565145865372, 0) >> >> 8565145861609 - 8565145861491 = 115 * 3 (3.00 GHz) = 345 lag The log entries aren't in CPU order, and CPUs 1 and 2 actually have identical values on the rhs. That doesn't quite fit what you have said so far. CPU3's value is also lower than CPU0's. > 3 hours of work: > >> (XEN) update stime on time calibrate 0, 22914730829200 -> 22915730869993 >> (22915730870665, 0) >> (XEN) update stime on time calibrate 1, 22914730829073 -> 22915730869889 >> (22915730870693, 0) >> (XEN) update stime on time calibrate 2, 22914730829052 -> 22915730869841 >> (22915730872231, 0) >> (XEN) update stime on time calibrate 3, 22914730828892 -> 22915730869696 >> (22915730872096, 0) >> >> 22915730869993 - 22915730869696 = 297 * 3 (3.00 GHz) = 891 lag While CPU numbers happen to be in sequence here, the rhs values aren't equally ordered. Also really here it is 22915730869696 - 22915730869993 = -297 * 3 (3.00 GHz) = 891 ahead > 2-3 day of work: > >> (XEN) update stime on time calibrate 0, 254477161980127 -> 254478162020920 >> (254478162021549, 0) >> (XEN) update stime on time calibrate 2, 254477161977638 -> 254478162018429 >> (254478162022187, 0) >> (XEN) update stime on time calibrate 1, 254477161978192 -> 254478162018972 >> (254478162022776, 0) >> (XEN) update stime on time calibrate 3, 254477161976832 -> 254478162017636 >> (254478162021394, 0) >> >> 254478162020920 - 254478162017636 = 3284 * 3 (3.00 GHz) = 9852 lag Similarly here. Yes, the gap increases, yet that's not a lag of CPU3 past CPU0, but exactly the other way around. > As you can see, the core lag is strictly determined by their sequence > number. As per above - no, I don't think I can see that. Or maybe I'm misreading the numbers as well as what you have been saying. Jan