From owner-freebsd-emulation@FreeBSD.ORG Wed Apr 30 16:43:55 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7837106566B for ; Wed, 30 Apr 2008 16:43:55 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.233]) by mx1.freebsd.org (Postfix) with ESMTP id 55D008FC12 for ; Wed, 30 Apr 2008 16:43:55 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so586667wxd.7 for ; Wed, 30 Apr 2008 09:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; bh=FWBypJaPDzZTmJBgGtS3ffqrcxVRiNW1LueTXzPU7BY=; b=q9LH/0r03WgM7V0Y3hxYsTBLxYOuapVnsjIi9CXxMMFw+4kNC8PfNOu8t6ORSo1BEp43Eo+EtFgJYMlfhbUlIX6a0WaKAaTFnXcw3Wk0UX5U2krJ4cAtOGFe13TlvDlkNaudeLv8vb1DNVDrxIrwlkLYXQtHRTy9FJyyJLm113c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; b=SAHAt9ChLMo0lrh6NiD5fukoqutz+f9JzpFb1HXyVvelPcQ/R8TGcE9T9Jo+Xq7UOIciFyaWF7LMrEW50s53FOuYjt4Aefb3HM7MEsaEQhnrgP3Vyk5m2iLJv3ZSVqIG0lEkTRGUIw/H39KuKE94AP8NMEVNWlkDj10y3zTl2FE= Received: by 10.90.49.3 with SMTP id w3mr1293270agw.106.1209572122719; Wed, 30 Apr 2008 09:15:22 -0700 (PDT) Received: from kan.dnsalias.net ( [24.218.183.247]) by mx.google.com with ESMTPS id 20sm1863562agb.12.2008.04.30.09.15.19 (version=SSLv3 cipher=OTHER); Wed, 30 Apr 2008 09:15:20 -0700 (PDT) Date: Wed, 30 Apr 2008 12:15:13 -0400 From: Alexander Kabaev To: Roman Divacky Message-ID: <20080430121513.33f9452b@kan.dnsalias.net> In-Reply-To: <20080430081806.GA81772@freebsd.org> References: <20080430081806.GA81772@freebsd.org> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/oMoL4G7hkGvU_V/NDbF/fiK"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: emulation@freebsd.org Subject: Re: [PATCH]: robust futexes X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2008 16:43:55 -0000 --Sig_/oMoL4G7hkGvU_V/NDbF/fiK Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 30 Apr 2008 10:18:06 +0200 Roman Divacky wrote: > hi >=20 > I implemented robust futexes in linuxulator and I need to get it > reviewed/tested. The best way to test it is (according to linux > documnetation) to run yum and kill -9 it while it runs.=20 >=20 > The patch is here: > http://www.vlakno.cz/~rdivacky/linux_robust_futex.patch >=20 > the patch should be ok as I followed linux code very closely (most of > the code runs in userspace so kernel has very well defined work). I > tested it lightly on i386. >=20 > I'd like to commit this quite soon so please help. >=20 > thnx! >=20 > roman Hi, some comments: linux_emul.c: @@ -86,6 +86,7 @@ em =3D malloc(sizeof *em, M_LINUX, M_WAITOK | M_ZERO); em->pid =3D child; em->pdeath_signal =3D 0; + em->robust_futexes =3D NULL; M_ZERO is not quite zero enough? :) linux_futex.c in release_futexes: + head =3D em->robust_futexes; + + if (fetch_robust_entry(&entry, &head->list.next, &pi)) + return; Aren't you taking a fault in copyin unconditionally if em->robust_mutexes happens to be NULL? Why not check is for NULL first? Also, is sched_relinguish really necessary after each each futex recovery _except_ from the 'pending' futex one? i386/conf/GENERIC: Does not belong in this patch, probably included in by mistake. --=20 Alexander Kabaev=09 --Sig_/oMoL4G7hkGvU_V/NDbF/fiK Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iD8DBQFIGJsRQ6z1jMm+XZYRAoi3AJ41OmXtruMzZkjWq0hilw/1tfQpiwCgjNF0 Nnb/0RgrsIZstavXc/cajNE= =0rK3 -----END PGP SIGNATURE----- --Sig_/oMoL4G7hkGvU_V/NDbF/fiK--