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: pgpRGcRQOlYVk.pgp
Description: PGP signature

Reply via email to