From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-f45.google.com (mail-vk0-f45.google.com [209.85.213.45]) by dpdk.org (Postfix) with ESMTP id 63838593A for ; Wed, 14 Oct 2015 14:09:32 +0200 (CEST) Received: by vkaw128 with SMTP id w128so28030368vka.0 for ; Wed, 14 Oct 2015 05:09:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=WjWMM8UbFc5ciaVJduT6uatt1sCW8IgFUpgRIHn0MkQ=; b=ZjPduL8w18wj4HhSDk7fBGusbodMLnDZ3qkStOikHB+/xc9ONYKgtv5p5biU8Wf3MU Y47Z2Ln/bQM9bdfHWDw1HBgLUoz6BLJ+2HPJZcXbfEui2/w5HsfcjrLFi1X6rZgOpnNF I/r35y02AZYeSMop/rPP5qKMjffG63h7wTEhtdSgOdLHh9RjxRA7ysMv4RAVBNuDZ5aD 7vLvyKVcVW3mrY5GsQPOwCQ/PnKUZNvpZA5JdCbUvwfX4sJu/CdKgMJvnpqDTIuUboS9 4w/MTp3YotvaXlssUMggzKyMhtFV8GNL4b1XQ1Jl89olvuyhfcVFbdH6ohAW8e7nG970 A6KA== X-Gm-Message-State: ALoCoQmw6JU/tf9Rifa5V6tRuaa0S+9EPQRTnKUg0tDEWzivyirg0PboLOEAm75+LwLCFRz0uhiJ MIME-Version: 1.0 X-Received: by 10.31.48.73 with SMTP id w70mr1358407vkw.138.1444824571733; Wed, 14 Oct 2015 05:09:31 -0700 (PDT) Received: by 10.103.69.17 with HTTP; Wed, 14 Oct 2015 05:09:31 -0700 (PDT) In-Reply-To: <20151013173320.46e07232@xeon-e3> References: <1433472396-18852-1-git-send-email-wolkayang@gmail.com> <20151013173320.46e07232@xeon-e3> Date: Wed, 14 Oct 2015 07:09:31 -0500 Message-ID: From: Jay Rolette To: Stephen Hemminger Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: DPDK Subject: Re: [dpdk-dev] [PATCH] rte_alarm: modify it to make it not to be affected by discontinuous jumps in the system time X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2015 12:09:32 -0000 Back when this was first submitted in June, I mentioned that CLOCK_MONOTONIC_RAW was ~10x slower than CLOCK_MONOTONIC: http://dpdk.org/ml/archives/dev/2015-June/018687.html It's not completely free from NTP frequency adjustments, but it won't have any discontinuities. That's what we've been using in our tree since then... Jay On Tue, Oct 13, 2015 at 7:33 PM, Stephen Hemminger < stephen@networkplumber.org> wrote: > On Fri, 5 Jun 2015 10:46:36 +0800 > Wen-Chi Yang wrote: > > > Due to eal_alarm_callback() and rte_eal_alarm_set() use gettimeofday() > > to get the current time, and gettimeofday() is affected by jumps. > > > > For example, set up a rte_alarm which will be triggerd next second ( > > current time + 1 second) by rte_eal_alarm_set(). And the callback > > function of this rte_alarm sets up another rte_alarm which will be > > triggered next second (current time + 2 second). > > Once we change the system time when the callback function is triggered, > > it is possiblb that rte alarm functionalities work out of expectation. > > > > Replace gettimeofday() with clock_gettime(CLOCK_MONOTONIC_RAW, &now) > > could avoid this phenomenon. > > > > Signed-off-by: Wen-Chi Yang > > Agreed, this should be applied. > Does BSD version have same problem? > > Acked-by: Stephen Hemminger > >