Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Sep 2010 19:19:01 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Michael Butler <imb@protected-networks.net>
Cc:        current@freebsd.org
Subject:   Re: r212281 breaks KDE
Message-ID:  <20100912161901.GD2465@deviant.kiev.zoral.com.ua>
In-Reply-To: <4C8CE6F1.3030400@protected-networks.net>
References:  <4C8CE6F1.3030400@protected-networks.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--ZNveOOYjKturpEFp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Sep 12, 2010 at 10:42:57AM -0400, Michael Butler wrote:
> For the last week, on and off, I've been looking for something that
> caused KDE to be horridly unstable, i.e. machine freezes with and
> without a core-dump.
>=20
> Removing r212281 (and r212282) restores that stability. Is there a race
> condition that this update exposes by reducing lock strength?
>=20
> The most common failure with this code included produces a back-trace
> similar to the one attached,
>=20

Does the following change make any difference to you ?

diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index 63dfb67..d13e488 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -597,13 +597,15 @@ munmap(td, uap)
=20
 #ifdef HWPMC_HOOKS
 	/* downgrade the lock to prevent a LOR with the pmc-sx lock */
-	vm_map_lock_downgrade(map);
-	if (pkm.pm_address !=3D (uintptr_t) NULL)
-		PMC_CALL_HOOK(td, PMC_FN_MUNMAP, (void *) &pkm);
-	vm_map_unlock_read(map);
-#else
-	vm_map_unlock(map);
+	if (pkm.pm_address !=3D (uintptr_t)NULL) {
+		vm_map_lock_downgrade(map);
+		if (pkm.pm_address !=3D (uintptr_t)NULL)
+			PMC_CALL_HOOK(td, PMC_FN_MUNMAP, (void *)&pkm);
+		vm_map_unlock_read(map);
+		vm_map_lock(map);
+	}
 #endif
+	vm_map_unlock(map);
 	/* vm_map_delete returns nothing but KERN_SUCCESS anyway */
 	return (0);
 }

--ZNveOOYjKturpEFp
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkyM/XQACgkQC3+MBN1Mb4g4QACgvXM8hMci7wFPLrvZijoHBGt6
mVEAoMu0QVgJiDk3VxgWgDSU9JuBNq0Q
=SORO
-----END PGP SIGNATURE-----

--ZNveOOYjKturpEFp--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100912161901.GD2465>