Date: Tue, 18 Mar 2003 01:20:20 -0800 (PST) From: Poul-Henning Kamp <phk@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern subr_devstat.c Message-ID: <200303180920.h2I9KKwb080467@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
phk 2003/03/18 01:20:20 PST
FreeBSD src repository
Modified files:
sys/kern subr_devstat.c
Log:
Make devstat fully Giant agnostic:
Add a mutex and protect the allocation and traversal of the list with it.
When we allocate a page for devstat use we drop the mutex and use
M_WAITOK this is not nice, but under the given circumstances the
best we can do.
In the sysctl handler for returning the devstat entries we do not want to
hold the mutex across copyout(9) calls, so we keep a very careful eye on
the devstat_generation count, and abandon with EBUSY if it changes under
our feet.
Specifically test for BIO_WRITE, rather than default non-read,non-deletes
as write. Make the default be DEVSTAT_NO_DATA.
Add atomic increments of the sequence[01] fields so applications using the
mmap'ed view stand a chance of detecting updates in progress.
Reviewed by: ken
Revision Changes Path
1.40 +135 -42 src/sys/kern/subr_devstat.c
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303180920.h2I9KKwb080467>
