DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v4] timer: don't check tsc flags in secondary processes
@ 2019-08-19  9:42 Jim Harris
  2019-08-19 17:10 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Harris @ 2019-08-19  9:42 UTC (permalink / raw)
  To: dev, anatoly.burakov

check_tsc_flags() parses /proc/cpuinfo and prints
warning messages if any cores don't have constant_tsc
and nonstop_tsc.  It has no functional meaning.
This consumes a noticeable amount of time in
secondary processes - on my test system, it consumes
21ms out of the 66ms total execution time for
rte_eal_init().

So let's just skip checking these flags in secondary
processes.  Since the primary process is already
parsing the entirety of /proc/cpuinfo, the warning
printed in the primary process should be sufficient.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
---
 lib/librte_eal/linux/eal/eal_timer.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/librte_eal/linux/eal/eal_timer.c b/lib/librte_eal/linux/eal/eal_timer.c
index 76ec17034..ce447d43b 100644
--- a/lib/librte_eal/linux/eal/eal_timer.c
+++ b/lib/librte_eal/linux/eal/eal_timer.c
@@ -198,6 +198,15 @@ check_tsc_flags(void)
 	char line[512];
 	FILE *stream;
 
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+		/* This function just prints warnings if TSC is not constant
+		 * and has no functional meaning.  It also checks *all* cores
+		 * on the system, not just the ones configured for this process.
+		 * So don't bother rechecking again in secondary processes.
+		 */
+		return;
+	}
+
 	stream = fopen("/proc/cpuinfo", "r");
 	if (!stream) {
 		RTE_LOG(WARNING, EAL, "WARNING: Unable to open /proc/cpuinfo\n");


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH v4] timer: don't check tsc flags in secondary processes
  2019-08-19  9:42 [dpdk-dev] [PATCH v4] timer: don't check tsc flags in secondary processes Jim Harris
@ 2019-08-19 17:10 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2019-08-19 17:10 UTC (permalink / raw)
  To: Jim Harris; +Cc: dev, anatoly.burakov

On Mon, 19 Aug 2019 02:42:10 -0700
Jim Harris <james.r.harris@intel.com> wrote:

> check_tsc_flags() parses /proc/cpuinfo and prints
> warning messages if any cores don't have constant_tsc
> and nonstop_tsc.  It has no functional meaning.
> This consumes a noticeable amount of time in
> secondary processes - on my test system, it consumes
> 21ms out of the 66ms total execution time for
> rte_eal_init().
> 
> So let's just skip checking these flags in secondary
> processes.  Since the primary process is already
> parsing the entirety of /proc/cpuinfo, the warning
> printed in the primary process should be sufficient.
> 
> Signed-off-by: Jim Harris <james.r.harris@intel.com>

Since all it does is print a warning, I would argue the code is useless
anyway and should just be removed. The warning doesn't provide any 
indication of what to do for users; or even tell them what the effect is.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-19 17:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19  9:42 [dpdk-dev] [PATCH v4] timer: don't check tsc flags in secondary processes Jim Harris
2019-08-19 17:10 ` Stephen Hemminger

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).