From owner-cvs-src-old@FreeBSD.ORG Fri May 1 15:38:13 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 37B7C106568C for ; Fri, 1 May 2009 15:38:13 +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 232A28FC0C for ; Fri, 1 May 2009 15:38:13 +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 n41FcD4K069557 for ; Fri, 1 May 2009 15:38:13 GMT (envelope-from dchagin@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n41FcDgc069556 for cvs-src-old@freebsd.org; Fri, 1 May 2009 15:38:13 GMT (envelope-from dchagin@repoman.freebsd.org) Message-Id: <200905011538.n41FcDgc069556@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to dchagin@repoman.freebsd.org using -f From: Dmitry Chagin Date: Fri, 1 May 2009 15:36:02 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD 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: Fri, 01 May 2009 15:38:13 -0000 dchagin 2009-05-01 15:36:02 UTC FreeBSD src repository Modified files: sys/amd64/linux32 linux32_sysvec.c sys/compat/linux linux_futex.c sys/i386/linux linux_sysvec.c Log: SVN rev 191719 on 2009-05-01 15:36:02Z by dchagin 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) MFC after: 1 month Revision Changes Path 1.47 +3 -3 src/sys/amd64/linux32/linux32_sysvec.c 1.20 +450 -359 src/sys/compat/linux/linux_futex.c 1.163 +3 -3 src/sys/i386/linux/linux_sysvec.c