Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4156256img; Tue, 26 Mar 2019 04:15:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMsZaVEcasCLNcnxoxnxM/aJeLdjXu5ZdD3vmVZOaUb/Nlkr0NAgZ7BB5O5y2/B7axTiU3 X-Received: by 2002:aa7:91c8:: with SMTP id z8mr17962575pfa.110.1553598924979; Tue, 26 Mar 2019 04:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553598924; cv=none; d=google.com; s=arc-20160816; b=XDUJv5s/kob5DU+n7rRLjNH/h6KmoNBg7feRExPr/NctE5GNihIVGzIm2YxSDrYQ8w vwsoAgGGutdEsXAtx/LprLzpcspt3n1Bt7UiTX/BAroHZd0DrD7zFVqs5mALEycPACpw QlKBiMsNyqCLZFx6taFCKR7GTGlVSXLIQcilCBfWMaMHeF1J+86fXfKdEpHl9NkcyzXr q53sqMP3h1yNRL2a22XRIGzQW5PM8uvPDBEDNGoGcqykffOA+3uTB7YVppo0xAwFLAyp cKlfRyzTX9gVKwbWVPU/kTx6WGxcKSeEqbHEh9OAHe0X6c4Ak7eZoSWynknvlvKZArx+ rahA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=BAX8rjklETavDwoJeL9kPKGls/o7c6a+BAH6B9/B4Ts=; b=oLMuGbRB2G/RsT98ZivJ9cc+cQDuMQo4RsxLsqR54exO7DL5uqedChepJ9bSE6jm1O rMYv2ED4/1Vtj09jTRKbEdbHFC8CWtdphdNCw1TaInMK6bzSSfqLl4GMVHt6D51K4U7S h4NOI+TLEwaRlzkYsnFI2cIBTMrrAE32X6GLM1WR5hlnWiPw2XITywzQcYHstVN6ZtJR 1fBc/wvcZix5sy6+4gK65wx3x/R+qs5/FJPXcDK7RIRno9OIQoOwRop5i94dg5oOn6z2 PuPTHQ1kDRi2Xch1EfbM+5kk2FmAt/PwuD0ksdltInd7SWjzkNcCjrlGHHOY146LePbd 2RRQ== ARC-Authentication-Results: i=1; mx.google.com; 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 d8si15247203pgv.53.2019.03.26.04.15.08; Tue, 26 Mar 2019 04:15:24 -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; 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 S1730722AbfCZLNJ (ORCPT + 99 others); Tue, 26 Mar 2019 07:13:09 -0400 Received: from ms01.santannapisa.it ([193.205.80.98]:58947 "EHLO mail.santannapisa.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726042AbfCZLNJ (ORCPT ); Tue, 26 Mar 2019 07:13:09 -0400 Received: from [10.30.3.200] (account l.abeni@santannapisa.it HELO luca64) by santannapisa.it (CommuniGate Pro SMTP 6.1.11) with ESMTPSA id 137621757; Tue, 26 Mar 2019 12:13:06 +0100 Date: Tue, 26 Mar 2019 12:12:56 +0100 From: luca abeni To: Dario Faggioli Cc: Boris Ostrovsky , thibodux@gmail.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, oleksandr_andrushchenko@epam.com, tglx@linutronix.de, jgross@suse.com, ryan.thibodeaux@starlab.io Subject: Re: [PATCH] x86/xen: Add "xen_timer_slop" command line option Message-ID: <20190326121256.76ceed71@luca64> In-Reply-To: References: <1553279397-130201-1-git-send-email-ryan.thibodeaux@starlab.io> <52bfeae7c256faec444b69efe58d363ad60c3fc5.camel@suse.com> <20190323114151.5cebf31b@sweethome> <20190325130530.56603806@luca64> <69e40698-f7ae-11c3-e4b7-dda4f1fadcf6@oracle.com> Organization: Scuola Superiore S. Anna X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, On Tue, 26 Mar 2019 10:13:32 +0100 Dario Faggioli wrote: > On Mon, 2019-03-25 at 09:43 -0400, Boris Ostrovsky wrote: > > On 3/25/19 8:05 AM, luca abeni wrote: > > > > > > The picture shows the latencies measured with an unpatched guest > > > kernel > > > and with a guest kernel having TIMER_SLOP set to 1000 (arbitrary > > > small > > > value :). > > > All the experiments have been performed booting the hypervisor > > > with a > > > small timer_slop (the hypervisor's one) value. So, they show that > > > decreasing the hypervisor's timer_slop is not enough to measure > > > low latencies with cyclictest. > > > > I have a couple of questions: > > * Does it make sense to make this a tunable for other clockevent > > devices > > as well? > > > So, AFAIUI, the thing is as follows. In clockevents_program_event(), > we keep the delta between now and the next timer event within > dev->max_delta_ns and dev->min_delta_ns: > > delta = min(delta, (int64_t) dev->max_delta_ns); > delta = max(delta, (int64_t) dev->min_delta_ns); > > For Xen (well, for the Xen clock) we have: > > .max_delta_ns = 0xffffffff, > .min_delta_ns = TIMER_SLOP, > > which means a guest can't ask for a timer to fire earlier than 100us [...] I know this is not fully related with the current discussion, but in these days I had a look at the code again, and... The comment for TIMER_SLOP in arch/x86/xen/time.c says: /* Xen may fire a timer up to this many ns early */ Isn't the comment wrong? shouldn't it be "...many ns late" instead of "early"? Thanks, Luca