From owner-cvs-src@FreeBSD.ORG Tue Nov 30 12:24:35 2004 Return-Path: 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 986B416A4CE; Tue, 30 Nov 2004 12:24:35 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 852EB43D2D; Tue, 30 Nov 2004 12:24:35 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from [127.0.0.1] (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iAUCOUiI049517; Tue, 30 Nov 2004 12:24:32 GMT (envelope-from davidxu@freebsd.org) Message-ID: <41AC667E.7030108@freebsd.org> Date: Tue, 30 Nov 2004 20:24:30 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040921 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Xu References: <200411301202.iAUC2rAd085211@repoman.freebsd.org> In-Reply-To: <200411301202.iAUC2rAd085211@repoman.freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_umtx.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2004 12:24:35 -0000 Thanks to jhb@, he had reviewed earlier version for me. David Xu wrote: >davidxu 2004-11-30 12:02:53 UTC > > FreeBSD src repository > > Modified files: > sys/kern kern_umtx.c > Log: > 1. use per-chain mutex instead of global mutex to reduce > lock collision. > 2. Fix two race conditions. One is between _umtx_unlock and signal, > also a thread was marked TDF_UMTXWAKEUP by _umtx_unlock, it is > possible a signal delivered to the thread will cause msleep > returns EINTR, and the thread breaks out of loop, this causes > umtx ownership is not transfered to the thread. Another is in > _umtx_unlock itself, when the function sets the umtx to > UMTX_UNOWNED state, a new thread can come in and lock the umtx, > also the function tries to set contested bit flag, but it will > fail. Although the function will wake a blocked thread, if that > thread breaks out of loop by signal, no contested bit will be set. > > Revision Changes Path > 1.17 +212 -115 src/sys/kern/kern_umtx.c > > > >