From owner-cvs-src Tue Mar 18 1:20:24 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 D81F637B401; Tue, 18 Mar 2003 01:20:20 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B1E343FA3; Tue, 18 Mar 2003 01:20:20 -0800 (PST) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h2I9KK0U080468; Tue, 18 Mar 2003 01:20:20 -0800 (PST) (envelope-from phk@repoman.freebsd.org) Received: (from phk@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h2I9KKwb080467; Tue, 18 Mar 2003 01:20:20 -0800 (PST) Message-Id: <200303180920.h2I9KKwb080467@repoman.freebsd.org> From: Poul-Henning Kamp Date: Tue, 18 Mar 2003 01:20:20 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern subr_devstat.c X-FreeBSD-CVS-Branch: HEAD 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 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-src" in the body of the message