From owner-cvs-all@FreeBSD.ORG Wed Feb 6 01:02:13 2008 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 A461F16A41A; Wed, 6 Feb 2008 01:02:13 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A143013C457; Wed, 6 Feb 2008 01:02:13 +0000 (UTC) (envelope-from jeff@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 m1612DwD041090; Wed, 6 Feb 2008 01:02:13 GMT (envelope-from jeff@repoman.freebsd.org) Received: (from jeff@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1612DTh041089; Wed, 6 Feb 2008 01:02:13 GMT (envelope-from jeff) Message-Id: <200802060102.m1612DTh041089@repoman.freebsd.org> From: Jeff Roberson Date: Wed, 6 Feb 2008 01:02:13 +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/sys proc.h rwlock.h src/sys/kern kern_rwlock.c subr_turnstile.c 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: Wed, 06 Feb 2008 01:02:13 -0000 jeff 2008-02-06 01:02:13 UTC FreeBSD src repository Modified files: sys/sys proc.h rwlock.h sys/kern kern_rwlock.c subr_turnstile.c Log: Adaptive spinning in write path with readers and writer starvation avoidance. - Move recursion checking into rwlock inlines to free a bit for use with adaptive spinners. - Clear the RW_LOCK_WRITE_SPINNERS flag whenever the lock state changes causing write spinners to restart their loop. - Write spinners are limited by a count while readers hold the lock as there is no way to know for certain whether readers are running still. - In the read path block if there are write waiters or spinners to avoid starving writers. Use a new per-thread count, td_rw_rlocks, to skip starvation avoidance if it might cause a deadlock. - Remove or change invalid assertions in turnstiles. Reviewed by: attilio (developed parts of the patch as well) Sponsored by: Nokia Revision Changes Path 1.35 +172 -156 src/sys/kern/kern_rwlock.c 1.171 +3 -8 src/sys/kern/subr_turnstile.c 1.502 +2 -1 src/sys/sys/proc.h 1.15 +6 -3 src/sys/sys/rwlock.h