From owner-freebsd-current@FreeBSD.ORG Mon Nov 19 19:40:08 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6BBFEDE for ; Mon, 19 Nov 2012 19:40:08 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 769F48FC12 for ; Mon, 19 Nov 2012 19:40:08 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 17F4173027; Mon, 19 Nov 2012 20:32:02 +0100 (CET) Date: Mon, 19 Nov 2012 20:32:02 +0100 From: Luigi Rizzo To: current@freebsd.org Subject: syscall cost freebsd vs linux ? Message-ID: <20121119193202.GA79496@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 19:40:08 -0000 today i was comparing the performance of some netmap-related code on FreeBSD and Linux (RELENG_9 vs 3.2) and i was surprised to see that our system calls are significantly slower. On comparable hardware (i7-2600k vs E5-1650) the syscall getppid() takes about 95ns on FreeBSD and 38ns on linux. (i make sure not to use gettimeofday(), which in linux is through vdso, and getpid(), which is cached by glibc). Any idea on why there is this difference and whether/how we can reduce it ? cheers luigi