DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Jim Harris <james.r.harris@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/2] timer: use rte_mp_msg to pass TSC hz to secondary procs
Date: Fri, 16 Aug 2019 08:56:20 +0100	[thread overview]
Message-ID: <a8a03b10-0497-5e0b-5624-b73c096dc8e7@intel.com> (raw)
In-Reply-To: <156586845525.44449.11798632267644345382.stgit@jrharri1-skx>

On 15-Aug-19 12:27 PM, Jim Harris wrote:
> rte_eal_init() is much faster in secondary processes since
> hugepages don't need to be zeroed.  But there's still
> non-trivial delays in the timer subsystem initialization
> due to the 100ms sleep used to calculate TSC hz.  So use
> the rte_mp_msg framework to allow secondary processes
> to get the TSC hz from the primary process.
> 
> This cuts rte_eal_init() execution time in a secondary
> process from 165ms to 66ms in my test program.
> 
> Signed-off-by: Jim Harris <james.r.harris@intel.com>
> ---

<snip>

> @@ -89,6 +96,65 @@ set_tsc_freq(void)
>   	eal_tsc_resolution_hz = freq;
>   }
>   
> +static void
> +set_tsc_freq_secondary(void)
> +{
> +	struct rte_mp_msg mp_req;
> +	struct rte_mp_reply mp_reply;
> +	struct timer_mp_param *r;
> +	struct timespec ts = {.tv_sec = 1, .tv_nsec = 0};
> +
> +	memset(&mp_req, 0, sizeof(mp_req));
> +	strcpy(mp_req.name, EAL_TIMER_MP);
> +	if (rte_mp_request_sync(&mp_req, &mp_reply, &ts) || mp_reply.nb_received != 1) {

If rte_mp_request_sync returns 0 but mp_reply.nb_receieved isn't set to 
1, you'll be leaking mp_reply.msgs.

-- 
Thanks,
Anatoly

  parent reply	other threads:[~2019-08-16  7:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15 11:27 Jim Harris
2019-08-15 11:27 ` [dpdk-dev] [PATCH 2/2] timer: don't check tsc flags in secondary processes Jim Harris
2019-08-16  7:56 ` Burakov, Anatoly [this message]
2019-08-16 19:01   ` [dpdk-dev] [PATCH 1/2] timer: use rte_mp_msg to pass TSC hz to secondary procs Harris, James R
2019-08-26  9:54 ` Bruce Richardson

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=a8a03b10-0497-5e0b-5624-b73c096dc8e7@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=james.r.harris@intel.com \
    /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).