From owner-cvs-all@FreeBSD.ORG Tue Nov 20 00:37:46 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A9F316A468; Tue, 20 Nov 2007 00:37:46 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 489BE13C502; Tue, 20 Nov 2007 00:37:46 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lAK0bkqE067510; Tue, 20 Nov 2007 00:37:46 GMT (envelope-from attilio@repoman.freebsd.org) Received: (from attilio@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lAK0bkoM067509; Tue, 20 Nov 2007 00:37:46 GMT (envelope-from attilio) Message-Id: <200711200037.lAK0bkoM067509@repoman.freebsd.org> From: Attilio Rao Date: Tue, 20 Nov 2007 00:37:46 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern kern_timeout.c src/sys/sys callout.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2007 00:37:46 -0000 attilio 2007-11-20 00:37:45 UTC FreeBSD src repository Modified files: sys/kern kern_timeout.c sys/sys callout.h Log: Add the function callout_init_rw() to callout facility in order to use rwlocks in conjuction with callouts. The function does basically what callout_init_mtx() alredy does with the difference of using a rwlock as extra argument. CALLOUT_SHAREDLOCK flag can be used, now, in order to acquire the lock only in read mode when running the callout handler. It has no effects when used in conjuction with mtx. In order to implement this, underlying callout functions have been made completely lock type-unaware, so accordingly with this, sysctl debug.to_avg_mtxcalls is now changed in the generic debug.to_avg_lockcalls. Note: currently the allowed lock classes are mutexes and rwlocks because callout handlers run in softclock swi, so they cannot sleep and they cannot acquire sleepable locks like sx or lockmgr. Requested by: kmacy, pjd, rwatson Reviewed by: jhb Revision Changes Path 1.107 +57 -52 src/sys/kern/kern_timeout.c 1.32 +10 -3 src/sys/sys/callout.h