[dpdk-dev] [PATCH] timer: add lfence before TSC read

2014-01-27 Thread Sangjin Han
Why LFENCE, rather than CPUID? I guess LFENCE does not prevent out-of-order execution for non-load instructions across it. This link has detailed information on RDTSC, RDTSCP, and CPUID: http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/ia-32-ia-64-benchmark-code-execution-p

[dpdk-dev] [PATCH] timer: add lfence before TSC read

2014-01-27 Thread didier.pallard
Yes, i will add a new function that includes the lfence; for the performance penalty, we did not see noticable performance impact on our full software, so we did not see any reason to use 2 functions, but it's certainly because we make a very limited number of calls to rdtsc and it's true that

[dpdk-dev] [PATCH] timer: add lfence before TSC read

2014-01-27 Thread Thomas Monjalon
24/01/2014 12:42, Fran?ois-Fr?d?ric Ozog: > IMHO, adding the lfence for all cases is introducing an un-necessary > performance penalty. > > What about adding rte_rdtsc_sync() or rte_rdtsc_serial() with the comment > about the rdtsc instruction behavior so that developers can choose which > form th

[dpdk-dev] [PATCH] timer: add lfence before TSC read

2014-01-24 Thread Ananyev, Konstantin
[mailto:dev-boun...@dpdk.org] On Behalf Of Fran?ois-Fr?d?ric Ozog Sent: Friday, January 24, 2014 11:43 AM To: 'Didier Pallard'; dev at dpdk.org Subject: Re: [dpdk-dev] [PATCH] timer: add lfence before TSC read Hi, Most of the time rdtsc is used for timestamping and a few cycles incorrect ar

[dpdk-dev] [PATCH] timer: add lfence before TSC read

2014-01-24 Thread François-Frédéric Ozog
> Objet?: [dpdk-dev] [PATCH] timer: add lfence before TSC read > > According to Intel Developer's Manual: > > "The RDTSC instruction is not a serializing instruction. It does not > necessarily wait until all previous instructions have been executed before > reading th

[dpdk-dev] [PATCH] timer: add lfence before TSC read

2014-01-24 Thread Didier Pallard
According to Intel Developer's Manual: "The RDTSC instruction is not a serializing instruction. It does not necessarily wait until all previous instructions have been executed before reading the counter. Simi- larly, subsequent instructions may begin execution before the read operation is per