DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mattias Rönnblom" <hofors@lysator.liu.se>
To: "Stephen Hemminger" <stephen@networkplumber.org>,
	"Mattias Rönnblom" <mattias.ronnblom@ericsson.com>
Cc: dev@dpdk.org, Erik Gabriel Carrillo <erik.g.carrillo@intel.com>,
	David Marchand <david.marchand@redhat.com>,
	maria.lingemark@ericsson.com,
	Stefan Sundkvist <stefan.sundkvist@ericsson.com>
Subject: Re: [RFC 2/2] eal: add high-performance timer facility
Date: Thu, 9 Mar 2023 16:20:59 +0100	[thread overview]
Message-ID: <072a67ab-6627-bda2-a50f-bda5bda93aac@lysator.liu.se> (raw)
In-Reply-To: <20230305092508.6922b4b4@hermes.local>

On 2023-03-05 18:25, Stephen Hemminger wrote:
> On Tue, 28 Feb 2023 10:39:16 +0100
> Mattias Rönnblom <mattias.ronnblom@ericsson.com> wrote:
> 
>> The htimer library attempts at providing a timer facility with roughly
>> the same functionality, but less overhead and better scalability than
>> DPDK timer library.
>>
>> The htimer library employs per-lcore hierachical timer wheels and a
>> message-based synchronization/MT-safety scheme.
>>
>> Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
> 
> I like this but:
>    - need to have one timer infrastructure, having multiple will lead to confusion
>      and overlap in user applications. I.e can they be mixed, what happens if X and Y...
> 
>    - best to keep original API available.
> 

My thoughts on this is that we first converge on the proper future API, 
and then you see how close it is to <rte_timer.h>, and if a shim layer 
or something of that sort is feasible.

>    - ok to drop the rte_alt_timer since it was always experimental.
> 
>    - would be good to have API using consistent known time (nanoseconds?) rather
>      than TSC cycles.
> 

I will update the RFC to use nanoseconds, at least as the default time unit.

>    - there could be use cases for REALTIME as well as MONOTONIC types.

The current HTW implementation requires monotonic time (i.e., time can't 
go backwards). Realtime clocks typically aren't monotonically increasing.

A naive implementation of backward time travel would be to just 
rescheduled all timers.

Would you use one HTW instance per clock?

This makes me think you want a small <rte_time.h> (!= <rte_timer.h>) 
time source API as well. It would, among other things, define the clock 
ids to use in the rte_htimer_mgr_add() calls. It would also be a good 
place in case you want to cache the result of rdtsc instructions (to 
have a more course-grained, but more efficient, clock source).

Maybe rte_get_timer_cycles()/hz() (as opposed to rte_get_tsc_cycles()) 
is a minimalistic attempt in this direction already?

  reply	other threads:[~2023-03-09 15:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28  9:39 [RFC 0/2] Add " Mattias Rönnblom
2023-02-28  9:39 ` [RFC 1/2] eal: add bitset type Mattias Rönnblom
2023-02-28 18:46   ` Tyler Retzlaff
2023-03-02  6:31     ` Mattias Rönnblom
2023-03-02 20:39       ` Tyler Retzlaff
2023-02-28  9:39 ` [RFC 2/2] eal: add high-performance timer facility Mattias Rönnblom
2023-03-05 17:25   ` Stephen Hemminger
2023-03-09 15:20     ` Mattias Rönnblom [this message]
2023-02-28 16:01 ` [RFC 0/2] Add " Morten Brørup
2023-03-01 11:18   ` Mattias Rönnblom
2023-03-01 13:31     ` Morten Brørup
2023-03-01 15:50       ` Mattias Rönnblom
2023-03-01 17:06         ` Morten Brørup
2023-03-15 17:03 ` [RFC v2 " Mattias Rönnblom
2023-03-15 17:03   ` [RFC v2 1/2] eal: add bitset type Mattias Rönnblom
2023-03-15 17:20     ` Stephen Hemminger
2023-03-15 18:27       ` Mattias Rönnblom
2023-03-15 17:03   ` [RFC v2 2/2] eal: add high-performance timer facility Mattias Rönnblom
2023-03-16  3:55     ` Tyler Retzlaff
2023-03-17  1:58     ` Stephen Hemminger
2023-03-22 12:18     ` Morten Brørup
2023-04-03 12:04       ` Mattias Rönnblom
2023-04-04  7:32         ` Morten Brørup
2023-03-24 16:00     ` Morten Brørup
2023-07-06 22:41     ` Stephen Hemminger
2023-07-12  8:58       ` Mattias Rönnblom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=072a67ab-6627-bda2-a50f-bda5bda93aac@lysator.liu.se \
    --to=hofors@lysator.liu.se \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=maria.lingemark@ericsson.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=stefan.sundkvist@ericsson.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).