From owner-freebsd-current@FreeBSD.ORG Sat Mar 22 13:32:23 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87C5F106564A for ; Sat, 22 Mar 2008 13:32:23 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 5341A8FC24 for ; Sat, 22 Mar 2008 13:32:23 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.64.3]) by phk.freebsd.dk (Postfix) with ESMTP id 9D81E17107; Sat, 22 Mar 2008 13:32:21 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.2/8.14.2) with ESMTP id m2MDWLi6011009; Sat, 22 Mar 2008 13:32:21 GMT (envelope-from phk@critter.freebsd.dk) To: Barney Cordoba From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sat, 22 Mar 2008 06:26:46 MST." <416202.18656.qm@web63914.mail.re1.yahoo.com> Date: Sat, 22 Mar 2008 13:32:21 +0000 Message-ID: <11008.1206192741@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Julian Elischer , current@freebsd.org Subject: Re: kvm_read() vs ioctl performance X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 22 Mar 2008 13:32:23 -0000 In message <416202.18656.qm@web63914.mail.re1.yahoo.com>, Barney Cordoba writes : >I can't easily follow this driver, given the superior >comments :) Look at the mmap() function. >My concern is this: stats may be updated in iterations >of 100K+ times per second, while stats are only >gathered once every few seconds. Even a tiny addition >to the kernel cpu cycles can make it a "cut off your >head to stop a nosebleed" scenario. I don't want to >lose cpu cycles for the sake of saving a fraction of a >ms every few minutes. The point about using shared memory, is that it is just that: shared memory. The memory the kernel writes to, is the same memory the userland reads from. There is _no_ overhead anywhere. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.