From owner-freebsd-current@FreeBSD.ORG Tue Nov 27 00:02:46 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 B5091801 for ; Tue, 27 Nov 2012 00:02:46 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by mx1.freebsd.org (Postfix) with ESMTP id 664D58FC0C for ; Tue, 27 Nov 2012 00:02:46 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id t11so3805281qaa.13 for ; Mon, 26 Nov 2012 16:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RlONd/HKoVEVcGX/15wf1Ig2srAyxlrF1tufA1Xuu58=; b=cjxnq08ufJgEUTRdfpdrHAu5aT+0Jy0Mj8eNNYIgawdozmu+VLofVc01hPUu6k8P97 7B6ZgtIqUpe33pp81Pr5NzgbF88HdZZ8l1BY6KIny1WtNEEwpf3LQvhni82L1DIVL7E+ PLtLKgjYif7ges3xGPlEgZ1yELBhCXHvQf8QDdn2QGoBHdbsamxB+jW3wW6EoHIYLL9G 4lyxkaVdZRuC6Bh8VHhWP5X/ZASDb9rO82EVf4gqpak90IvyPQPfHhjomayOH22ODXof UQAKW7Y4DmeBvybS3E3qxOaFV08sh6pyfjy8L1UsmGlJ3SnDEVfGDh8vBZH6nF0Fsg9f u3Cg== MIME-Version: 1.0 Received: by 10.224.208.132 with SMTP id gc4mr14372184qab.67.1353974565454; Mon, 26 Nov 2012 16:02:45 -0800 (PST) Received: by 10.229.78.96 with HTTP; Mon, 26 Nov 2012 16:02:45 -0800 (PST) In-Reply-To: <50B354F4.1070706@zoho.com> References: <20121119193202.GA79496@onelab2.iet.unipi.it> <50B354F4.1070706@zoho.com> Date: Tue, 27 Nov 2012 03:02:45 +0300 Message-ID: Subject: Re: syscall cost freebsd vs linux ? From: Sergey Kandaurov To: Lukasz Wojcik Content-Type: text/plain; charset=ISO-8859-1 Cc: Luigi Rizzo , 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: Tue, 27 Nov 2012 00:02:46 -0000 On 26 November 2012 15:39, 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 ? There is a nice tool at /usr/src/tools/tools/syscall_timing -- wbr, pluknet