From owner-cvs-src Mon Mar 10 10:53:42 2003 Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7248737B404; Mon, 10 Mar 2003 10:53:41 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13E3443F75; Mon, 10 Mar 2003 10:53:40 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.8/8.12.8) with ESMTP id h2AIrXuP003234; Mon, 10 Mar 2003 19:53:33 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: "Sam Leffler" Cc: "John Baldwin" , src-committers@FreeBSD.org, cvs-src@FreeBSD.org, "Nate Lawson" Subject: Re: cvs commit: src/sys/sys devicestat.h From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 10 Mar 2003 10:47:30 PST." <15bf01c2e735$825f1eb0$52557f42@errno.com> Date: Mon, 10 Mar 2003 19:53:33 +0100 Message-ID: <3233.1047322413@critter.freebsd.dk> Sender: owner-cvs-src@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <15bf01c2e735$825f1eb0$52557f42@errno.com>, "Sam Leffler" writes: >> This is disk statistics, it's not really worth that effort. The >> data in the structure will not get corrupted, bue one of our >> readings may. So what... > >All the more reason why I question the complexity. Are there really going >to be that many clients polling for statistics that using a system call is >bad? Using mmap is _simpler_ (and cheaper: it saves ctx-switches) than using sysctl or ioctl and it puts the entire burden in the userland process. That is IMO a good thing. The complexity only comes in if we want to guarantee that userland can detect inconsistent readings of a given struct. I have no intention of giving that guarantee. I will put the two counter elements there, which gives a very high probability that inconsistent readings will be detected, but I give no guarantee. -- 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. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-src" in the body of the message