From owner-cvs-src-old@FreeBSD.ORG Sun May 31 06:59:12 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 33AA21065670 for ; Sun, 31 May 2009 06:59:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5198FC1A for ; Sun, 31 May 2009 06:59:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n4V6xC2w016836 for ; Sun, 31 May 2009 06:59:12 GMT (envelope-from dchagin@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n4V6xBaW016835 for cvs-src-old@freebsd.org; Sun, 31 May 2009 06:59:11 GMT (envelope-from dchagin@repoman.freebsd.org) Message-Id: <200905310659.n4V6xBaW016835@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to dchagin@repoman.freebsd.org using -f From: Dmitry Chagin Date: Sun, 31 May 2009 06:58:35 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/sys/amd64/linux32 linux32_sysvec.c src/sys/compat/linux linux_futex.c src/sys/i386/linux linux_sysvec.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: Sun, 31 May 2009 06:59:12 -0000 dchagin 2009-05-31 06:58:35 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/amd64/linux32 linux32_sysvec.c sys/compat/linux linux_futex.c sys/i386/linux linux_sysvec.c Log: SVN rev 193152 on 2009-05-31 06:58:35Z by dchagin MFC r191719: Reimplement futexes. Old implemention used Giant to protect the kernel data structures, but at the same time called malloc(M_WAITOK), that could cause the calling thread to sleep and lost Giant protection. User-visible result was the missed wakeup. New implementation uses one sx lock per futex. The sx protects the futex structures and allows to sleep while copyin or copyout are performed. Unlike linux, we return EINVAL when FUTEX_CMP_REQUEUE operation is requested and either caller specified futexes are equial or second futex already exists. This is acceptable since the situation can only occur from the application error, and glibc falls back to old FUTEX_WAKE operation when FUTEX_CMP_REQUEUE returns an error. Approved by: kib (mentor) Revision Changes Path 1.31.2.11 +3 -3 src/sys/amd64/linux32/linux32_sysvec.c 1.10.2.6 +450 -359 src/sys/compat/linux/linux_futex.c 1.150.2.9 +3 -3 src/sys/i386/linux/linux_sysvec.c