Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Mar 2003 08:57:59 +0100
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Nate Lawson <nate@root.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: cvs commit: src/sys/sys devicestat.h 
Message-ID:  <78207.1047196679@critter.freebsd.dk>
In-Reply-To: Your message of "Sat, 08 Mar 2003 23:50:06 PST." <Pine.BSF.4.21.0303082347200.90870-100000@root.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.21.0303082347200.90870-100000@root.org>, Nate Lawson wri
tes:

>> Yes, these structures will be mmap'ed from kernel to userland and user
>> land will (likely) memcpy() them to private storage as snapshot'ing.
>> To be able to tell if you have an atomic snapshot, the two counters
>> must be identical.
>
>How about a mtx covering the structure and a read from the device returns
>the structure under lock?

The goal is to avoid locking in the kernel and put the overhead in
userland.  Remember, most of the time nobody cares about the statistics
so they should be cheap.

-- 
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?78207.1047196679>