NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-arm/38950 (shark, hpcarm kernels prone to hard hangs on process exit)



On Friday 20 June 2008 04:35:01 Rafal Boni wrote:

>  This just occurred to me after having filed this in the "I don't
> have time to think about it right now" bin.  The issue here is that
> the pmap code is using the last-active-lwp as a proxy for
> last-active-pmap.  What we should do is just save the pmap pointed to
> by the last-active-lwp vs. the lwp itself.

While that may solve the problem, it may well work against the intention 
of "last-active-pmap", which is to reduce the impact of 
context-switching between user-mode processes/lwps.

A simple fix would be to add the following to pmap_deactivate():

Index: pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/arm32/pmap.c,v
retrieving revision 1.177
diff -u -r1.177 pmap.c
--- pmap.c      17 Jun 2008 08:04:26 -0000      1.177
+++ pmap.c      23 Jun 2008 14:55:07 -0000
@@ -3882,6 +3882,14 @@
 pmap_deactivate(struct lwp *l)
 {

+       /*
+        * If the process is exiting, make sure pmap_activate() does
+        * a full MMU context-switch and cache flush, which we might
+        * otherwise skip. See PR port-arm/38950.
+        */
+       if (l->l_proc->p_sflag & PS_WEXIT)
+               pmap_previous_active_lwp = NULL;
+
        l->l_proc->p_vmspace->vm_map.pmap->pm_activated = false;
 }


Cheers, Steve


Home | Main Index | Thread Index | Old Index