lkml.org 
[lkml]   [2015]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: + lib-vsprintfc-even-faster-decimal-conversion.patch added to -mm tree
From
On Fri, Mar 13, 2015 at 3:49 PM, Alexey Dobriyan <adobriyan@gmail.com> wrote:
> Legend is "number avg+-1sigma min-max". Every number is CPU cycles.
> Great care was taken to remove interrupt noise.

To reproduce numbers:
* apply the patch which adds sys_nr_irq() system call.
* recompile without cpufreq, reboot with isolcpus=,
* shift interrupts off free CPU

* use new system call
static inline uint64_t sys_nr_irq(void)
{
uint64_t rv;

asm volatile ("syscall" : "=a" (rv) : "0" (323) : "memory",
"cc", "rcx", "r11");
return rv;
}

* use measurement code
static inline void rdtsc(uint32_t *edx, uint32_t *eax)
{
asm volatile ("rdtsc" : "=d" (*edx), "=a" (*eax));
}
static inline void lfence(void)
{
asm volatile ("lfence" ::: "memory");
}
static inline uint64_t time_init(uint64_t *x)
{
uint32_t edx, eax;

*x = sys_nr_irq();

lfence();
rdtsc(&edx, &eax);
return ((uint64_t)edx << 32) | eax;
}

static inline uint64_t time_fini(uint64_t *x)
{
uint32_t edx, eax;

lfence();
rdtsc(&edx, &eax);

*x = sys_nr_irq();

return ((uint64_t)edx << 32) | eax;
}
----------------------------------------
* drop measurement where interrupt interfered
i = 0;
while (i < N) {
uint64_t t0, t1;
uint64_t x0, x1;

t0 = time_init(&x0);
f();
t1 = time_fini(&x1);

if (x1 != x0)
continue;

T[i] = t1 - t0;
i++;
}
------------------------------------
* average results how you were taught in school :-)


\
 
 \ /
  Last update: 2015-03-13 14:01    [W:0.050 / U:2.724 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site