lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 Mar 2015 15:56:01 +0300
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	Linux Kernel <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux@...musvillemoes.dk, Peter Zijlstra <peterz@...radead.org>,
	Tejun Heo <tj@...nel.org>,
	Denis Vlasenko <vda.linux@...glemail.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: + lib-vsprintfc-even-faster-decimal-conversion.patch added to -mm tree

On Fri, Mar 13, 2015 at 3:49 PM, Alexey Dobriyan <adobriyan@...il.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 :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ