From owner-freebsd-virtualization@FreeBSD.ORG Sat May 31 00:01:09 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA15F8E3 for ; Sat, 31 May 2014 00:01:09 +0000 (UTC) Received: from smtp.digiware.nl (smtp.digiware.nl [31.223.170.169]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 517592D5E for ; Sat, 31 May 2014 00:01:08 +0000 (UTC) Received: from rack1.digiware.nl (unknown [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id 14B6E1534D1; Sat, 31 May 2014 02:01:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at digiware.nl Received: from smtp.digiware.nl ([127.0.0.1]) by rack1.digiware.nl (rack1.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gnIMp2pK6-L5; Sat, 31 May 2014 02:01:01 +0200 (CEST) Received: from [192.168.10.9] (vaio [192.168.10.9]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 9E96A153434; Sat, 31 May 2014 02:01:01 +0200 (CEST) Message-ID: <53891BC1.9050701@digiware.nl> Date: Sat, 31 May 2014 02:01:05 +0200 From: Willem Jan Withagen User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Nils Beyer , freebsd-virtualization@freebsd.org Subject: Re: Bheve: Slow linux syscalls on AMD References: <5388B56D.1000501@digiware.nl> <20140530212900.6B74B6BF@hub.freebsd.org> In-Reply-To: <20140530212900.6B74B6BF@hub.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 00:01:09 -0000 On 30-5-2014 23:27, Nils Beyer wrote: > Hi Willem, > > Willem Jan Withagen wrote: >> 1) I'm looking for a better basic syscall in Linux that is not cache, >> faked or otherwise tweaked to nog give what I want. >> Would really be nice if there was a NOP_syscall, just go in and out of >> kernel space..... > > Hmm, I've tried your test with "getuid". Seems not to be cached. Here's the > diff: > > =============================================================================== > # diff 0.orig.c 0.c > 24c24 > < j=getpid(); > --- >> (void)getuid(); > 38c38 > < printf("Average time for System call getpid : %f\n",avgTimeSysCall); > --- >> printf("Average time for System call getuid : %f\n",avgTimeSysCall); > =============================================================================== > > > And here is the result: > > =============================================================================== > # strace -c ./0 > Average time for System call getuid : 10564.581055 > Average time for Function call : 2.285000 > % time seconds usecs/call calls errors syscall > ------ ----------- ----------- --------- --------- ---------------- > 100.00 0.004590 0 1000000 getuid > 0.00 0.000000 0 1 read > 0.00 0.000000 0 2 write > 0.00 0.000000 0 2 open > 0.00 0.000000 0 2 close > 0.00 0.000000 0 3 fstat > 0.00 0.000000 0 9 mmap > 0.00 0.000000 0 3 mprotect > 0.00 0.000000 0 1 munmap > 0.00 0.000000 0 1 brk > 0.00 0.000000 0 1 1 access > 0.00 0.000000 0 1 execve > 0.00 0.000000 0 1 arch_prctl > ------ ----------- ----------- --------- --------- ---------------- > 100.00 0.004590 1000027 1 total > =============================================================================== Looks a bit like mine on i386 real hardware: root@ubuntu-i386-14:~/src/tests# strace -c ./syscall-getuid Average time for System call getuid : 272.023010 Average time for Function call : 7.169000 % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 100.00 0.018939 0 1000000 getuid32 0.00 0.000000 0 1 read 0.00 0.000000 0 2 write 0.00 0.000000 0 2 open 0.00 0.000000 0 2 close 0.00 0.000000 0 1 execve 0.00 0.000000 0 3 3 access 0.00 0.000000 0 1 brk 0.00 0.000000 0 4 gettimeofday 0.00 0.000000 0 1 munmap 0.00 0.000000 0 3 mprotect 0.00 0.000000 0 7 mmap2 0.00 0.000000 0 3 fstat64 0.00 0.000000 0 1 set_thread_area ------ ----------- ----------- --------- --------- ---------------- 100.00 0.018939 1000031 3 total >> 3) Can somebody do the same test on an intel plaform and see what the >> results are. > > Here is the result from a bhyved CentOS on an Intel i3: > > =============================================================================== > # strace -c ./0.orig > Average time for System call getpid : 3.776000 > Average time for Function call : 2.326000 > % time seconds usecs/call calls errors syscall > ------ ----------- ----------- --------- --------- ---------------- > -nan 0.000000 0 1 read > -nan 0.000000 0 2 write > -nan 0.000000 0 2 open > -nan 0.000000 0 2 close > -nan 0.000000 0 3 fstat > -nan 0.000000 0 9 mmap > -nan 0.000000 0 3 mprotect > -nan 0.000000 0 1 munmap > -nan 0.000000 0 1 brk > -nan 0.000000 0 1 1 access > -nan 0.000000 0 1 getpid > -nan 0.000000 0 1 execve > -nan 0.000000 0 1 arch_prctl > ------ ----------- ----------- --------- --------- ---------------- > 100.00 0.000000 28 1 total > =============================================================================== Right no long calls at all.... So the question remains: Why is it taking so long on the AMD platform. --WjW