From owner-freebsd-current@FreeBSD.ORG Mon Nov 26 23:22:05 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 55DE07F5 for ; Mon, 26 Nov 2012 23:22:05 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id D676E8FC0C for ; Mon, 26 Nov 2012 23:22:04 +0000 (UTC) Received: by mail-ee0-f54.google.com with SMTP id c13so8188889eek.13 for ; Mon, 26 Nov 2012 15:22:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=L4zfneul40VtkmXG5xhBZe5bq4SfB7DmZJj/KPud8ho=; b=jM8BNavVW9f5O7CTinvemg4XhFVu+UJMw0zwA/IQ0mOEK0t2jlSZGiLXV74U0amGEk A/03s62D7ScBod6XQW9s8oSzH3FM3v3yS3Set3WEi8NTn6uFSS4b24KuWBkFLUoUJet3 qNKZsdZM5O3QGlvrKg9QmbX1A6iD4adCwitPgnKIdbrJeO0JIxTCJtiXUYhsFhU73MiL dw2gmjCovRi3mPMLpNL1uFHpGPvHuhgPwN7gWcN7fJhdWcSYC6JqUeI1wL1aApUVWueH OLrTdQOvUsAMirgXcYn1EK+3uioj9J9CMM6trHiV74R7TXKVEYJ6VN5/zc6X6i8d7FRo 00Ng== MIME-Version: 1.0 Received: by 10.14.209.193 with SMTP id s41mr13461253eeo.9.1353972123719; Mon, 26 Nov 2012 15:22:03 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.14.94.80 with HTTP; Mon, 26 Nov 2012 15:22:03 -0800 (PST) In-Reply-To: <50B354F4.1070706@zoho.com> References: <20121119193202.GA79496@onelab2.iet.unipi.it> <50B354F4.1070706@zoho.com> Date: Mon, 26 Nov 2012 15:22:03 -0800 X-Google-Sender-Auth: SlnlbH02tN6Wpl6kX1fEdocjk8U Message-ID: Subject: Re: syscall cost freebsd vs linux ? From: Luigi Rizzo To: Lukasz Wojcik , will.froning@gmail.com Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: current@freebsd.org 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, 26 Nov 2012 23:22:05 -0000 a quick and easy way is to run the syscall in a tight loop for a sufficient long time (1s or more) and use "time" to measure it. At 100ns per call you need about 10M cycles to do one second. cheers luigi On Mon, Nov 26, 2012 at 3:39 AM, Lukasz Wojcik wrote: > On 11/19/12 20:32, Luigi Rizzo wrote: > >> 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 ? >> >> > I'm curious about how did you measure that ? Could you write some more > about your methodology ? > > -LW > > cheers >> luigi >> ______________________________**_________________ >> freebsd-current@freebsd.org mailing list >> http://lists.freebsd.org/**mailman/listinfo/freebsd-**current >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@** >> freebsd.org " >> > > > -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------