Re: r212281 breaks KDE

From: Kostik Belousov <kostikbel_at_gmail.com>
Date: Sun, 12 Sep 2010 19:19:01 +0300
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
_at__at_ -597,13 +597,15 _at__at_ 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);
 }

Received on Sun Sep 12 2010 - 14:19:12 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:07 UTC