DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Hari Haran <info2hariharan@gmail.com>
Cc: users@dpdk.org
Subject: Re: rte_rdtsc() - what is the performance impact of using rte_rdtsc() time
Date: Tue, 3 Oct 2023 10:17:58 -0700	[thread overview]
Message-ID: <20231003101758.212f1352@hermes.local> (raw)
In-Reply-To: <CAPbxCtpjzFRhPNUk_35qS3U8fxAUkCWGcXm0+fqPOPmvsNXBtQ@mail.gmail.com>

On Tue, 3 Oct 2023 15:49:00 +0530
Hari Haran <info2hariharan@gmail.com> wrote:

> >
> > The problem is that rte_rdtsc() stops speculative execution so doing
> > lots of TSC instructions can hurt performance.
> >
> > To correlate TSC timestamp to system time, you need to compute the offsets
> > once at startup. Alternatively, don't use rte_rdtsc() and instead use
> > clock_gettime() with the monotonic timer and the C library does the
> > calculation
> > for you.
> >  
> 
> 
> As part of query 1 and based on your response, I am asking below query
> 
> But usage of clock_gettime() (kernel function) in lcore is advisable one?
> My understanding is,
> shall avoid usage of kernel function in lcore. Correct me if I am wrong?

clock_gettime() is a virtual system call (VDSO) on most Linux platforms.
But it is still slower than simple rte_rdtsc().

Internally clock_gettime VDSO 

      reply	other threads:[~2023-10-03 17:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 14:55 Hari Haran
2023-09-05 23:29 ` Stephen Hemminger
2023-10-03 10:19   ` Hari Haran
2023-10-03 17:17     ` Stephen Hemminger [this message]

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=20231003101758.212f1352@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=info2hariharan@gmail.com \
    --cc=users@dpdk.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).