Re: kvm_read() vs ioctl performance

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Sat, 22 Mar 2008 13:32:21 +0000
In message <416202.18656.qm_at_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_at_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.
Received on Sat Mar 22 2008 - 12:32:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:29 UTC