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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
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.
>
> Removing r212281 (and r212282) restores that stability. Is there a race
> condition that this update exposes by reducing lock strength?
>
> The most common failure with this code included produces a back-trace
> similar to the one attached,
>
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)
#ifdef HWPMC_HOOKS
/* downgrade the lock to prevent a LOR with the pmc-sx lock */
- vm_map_lock_downgrade(map);
- if (pkm.pm_address != (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 != (uintptr_t)NULL) {
+ vm_map_lock_downgrade(map);
+ if (pkm.pm_address != (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);
}
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)
iEYEARECAAYFAkyM/XQACgkQC3+MBN1Mb4g4QACgvXM8hMci7wFPLrvZijoHBGt6
mVEAoMu0QVgJiDk3VxgWgDSU9JuBNq0Q
=SORO
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100912161901.GD2465>
