From owner-cvs-src-old@FreeBSD.ORG Wed Sep 2 17:34:09 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A063106570A for ; Wed, 2 Sep 2009 17:34:09 +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 27D138FC1C for ; Wed, 2 Sep 2009 17:34:09 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n82HY9Hr016745 for ; Wed, 2 Sep 2009 17:34:09 GMT (envelope-from attilio@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n82HY9MI016744 for cvs-src-old@freebsd.org; Wed, 2 Sep 2009 17:34:09 GMT (envelope-from attilio@repoman.freebsd.org) Message-Id: <200909021734.n82HY9MI016744@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to attilio@repoman.freebsd.org using -f From: Attilio Rao Date: Wed, 2 Sep 2009 17:33:51 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern kern_lock.c kern_sx.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2009 17:34:09 -0000 attilio 2009-09-02 17:33:51 UTC FreeBSD src repository Modified files: sys/kern kern_lock.c kern_sx.c Log: SVN rev 196772 on 2009-09-02 17:33:51Z by attilio Fix some bugs related to adaptive spinning: In the lockmgr support: - GIANT_RESTORE() is just called when the sleep finishes, so the current code can ends up into a giant unlock problem. Fix it by appropriately call GIANT_RESTORE() when needed. Note that this is not exactly ideal because for any interation of the adaptive spinning we drop and restore Giant, but the overhead should be not a factor. - In the lock held in exclusive mode case, after the adaptive spinning is brought to completition, we should just retry to acquire the lock instead to fallthrough. Fix that. - Fix a style nit In the sx support: - Call GIANT_SAVE() before than looping. This saves some overhead because in the current code GIANT_SAVE() is called several times. Tested by: Giovanni Trematerra Revision Changes Path 1.146 +11 -2 src/sys/kern/kern_lock.c 1.70 +1 -1 src/sys/kern/kern_sx.c