From owner-freebsd-virtualization@FreeBSD.ORG Fri May 30 21:28:57 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57BEF687 for ; Fri, 30 May 2014 21:28:57 +0000 (UTC) Received: from nijmegen.renzel.net (mx1.renzel.net [195.243.213.130]) by mx1.freebsd.org (Postfix) with ESMTP id D89B72224 for ; Fri, 30 May 2014 21:28:55 +0000 (UTC) Received: from dublin.vkf.isb.de.renzel.net (unknown [10.0.0.80]) by nijmegen.renzel.net (smtpd) with ESMTP id D0E451414809 for ; Fri, 30 May 2014 23:27:01 +0200 (CEST) Received: from asbach.renzel.net (unknown [10.2.0.7]) by dublin.vkf.isb.de.renzel.net (Postfix) with ESMTP id 926191A2E9A for ; Fri, 30 May 2014 23:27:01 +0200 (CEST) Content-Type: text/plain; charset="ISO-8859-1" From: Nils Beyer Organization: VKF Renzel GmbH Date: Fri, 30 May 2014 23:27:01 +0200 User-Agent: KNode/4.12.5 Content-Transfer-Encoding: 7Bit Subject: Re: Bheve: Slow linux syscalls on AMD To: freebsd-virtualization@freebsd.org References: <5388B56D.1000501@digiware.nl> Lines: 83 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.98 at nijmegen.renzel.net X-Virus-Status: Clean X-Spam-Status: No, score=-6.5 required=7.0 tests=BAYES_00,MISSING_MID, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on nijmegen.renzel.net 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: Fri, 30 May 2014 21:28:57 -0000 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 =============================================================================== > 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 =============================================================================== Regards, Nils