Subject: Re: NetBSD/alpha MP stability and other bugs
To: Stephen Jones <smj@cirr.com>
From: Michael L. Hitch <mhitch@lightning.msu.montana.edu>
List: port-alpha
Date: 04/10/2007 11:37:52
On Sun, 1 Apr 2007, Stephen Jones wrote:

> Do Michael's patches actually work/resolve issues?  if so, how many years
> does it take before it gets checked into the code?  I think a really big
> problem is that these patches can become irrelevant because work stops
> on the older branch and none of the post release fixes get rolled into 3.x
> or 4.x.  That is sort of boggling how that works.  I wonder how many weekly
> builds occur with absolutely no changes.
...
> I'd really like to see Michael Hitches 'fixes' incorporated ..

   I don't what these 'fixes' would be.  As I've said before, any SMP 
locking patches I had have been incorporated in the tree for 20 months. 
If there are still locking issues, they are unknown to me and will require 
someone to provide more information on the state of the machine when they 
occur.


=============================================
   The HEAD commit:
==============================================
Subject: CVS commit: src/sys/arch/alpha/alpha
To: None <source-changes@NetBSD.org>
From: Jason R Thorpe <thorpej@netbsd.org>
List: source-changes
Date: 07/26/2005 04:11:54

Module Name:	src
Committed By:	thorpej
Date:		Tue Jul 26 04:11:54 UTC 2005

Modified Files:
 	src/sys/arch/alpha/alpha: pmap.c

Log Message:
1. Disable the lazy allocation of lev1map in pmap_enter(), instead doing
    it in pmap_create(), and freeing the lev1map in pmap_destroy().  This
    means that pm_lev1map is consistent for the life of the pmap.
2. pmap_extract() now uses vtophys() for the kernel pmap.  This avoids
    having to lock the kernel pmap, since kernel PT pages are never freed.
3. Because of (1), pmap_asn_alloc() no longer needs to operate on a locked
    pmap; pm_lev1map will never change over the life of the pmap, and all
    other access to the pmap is done in per-CPU fields or with atomic
    operations.
4. Because of (3), pmap_activate() no longer needs to lock the pmap
    to do its work, thus eliminating the deadlock with sched_lock described
    in PR port-alpha/25599.  This is safe because we are guaranteed that
    the pmap is still alive, since by definition an LWP that uses that it
    is about to run.

Thanks to Michael Hitch for the analysis, and Michael and Ragge for 
testing.


To generate a diff of this commit:
cvs rdiff -r1.210 -r1.211 src/sys/arch/alpha/alpha/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

=====================================================================
   That change was pulled up to the netbsd-3 branch and is in 3.0 and 
associated releases:
=====================================================================

Subject: CVS commit: [netbsd-3] src/sys/arch/alpha/alpha
To: None <source-changes@NetBSD.org>
From: Matthias Scheler <tron@netbsd.org>
List: source-changes
Date: 07/30/2005 17:43:39

Module Name:	src
Committed By:	tron
Date:		Sat Jul 30 17:43:39 UTC 2005

Modified Files:
 	src/sys/arch/alpha/alpha [netbsd-3]: pmap.c

Log Message:
Pull up revision 1.211 (requested by thorpej in ticket #626):
1. Disable the lazy allocation of lev1map in pmap_enter(), instead doing
    it in pmap_create(), and freeing the lev1map in pmap_destroy().  This
    means that pm_lev1map is consistent for the life of the pmap.
2. pmap_extract() now uses vtophys() for the kernel pmap.  This avoids
    having to lock the kernel pmap, since kernel PT pages are never freed.
3. Because of (1), pmap_asn_alloc() no longer needs to operate on a locked
    pmap; pm_lev1map will never change over the life of the pmap, and all
    other access to the pmap is done in per-CPU fields or with atomic
    operations.
4. Because of (3), pmap_activate() no longer needs to lock the pmap
    to do its work, thus eliminating the deadlock with sched_lock described
    in PR port-alpha/25599.  This is safe because we are guaranteed that
    the pmap is still alive, since by definition an LWP that uses that it
    is about to run.
Thanks to Michael Hitch for the analysis, and Michael and Ragge for
testing.


To generate a diff of this commit:
cvs rdiff -r1.208 -r1.208.8.1 src/sys/arch/alpha/alpha/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

======================================================================
   It was also pulled up into the netbsd-2 branch and is present in the 
2.0.3 and 2.1 releases:
======================================================================

Subject: CVS commit: [netbsd-2] src/sys/arch/alpha/alpha
To: None <source-changes@NetBSD.org>
From: Jeff Rizzo <riz@netbsd.org>
List: source-changes
Date: 08/07/2005 15:07:04

Module Name:	src
Committed By:	riz
Date:		Sun Aug  7 15:07:04 UTC 2005

Modified Files:
 	src/sys/arch/alpha/alpha [netbsd-2]: pmap.c

Log Message:
Pull up revision 1.211 (requested by thorpej in ticket #5528):
1. Disable the lazy allocation of lev1map in pmap_enter(), instead
doing
it in pmap_create(), and freeing the lev1map in pmap_destroy().
This
means that pm_lev1map is consistent for the life of the pmap.
2. pmap_extract() now uses vtophys() for the kernel pmap.  This avoids
having to lock the kernel pmap, since kernel PT pages are never
freed.
3. Because of (1), pmap_asn_alloc() no longer needs to operate on a
locked
pmap; pm_lev1map will never change over the life of the pmap,
and all
other access to the pmap is done in per-CPU fields or with atomic
operations.
4. Because of (3), pmap_activate() no longer needs to lock the pmap
to do its work, thus eliminating the deadlock with sched_lock
described
in PR port-alpha/25599.  This is safe because we are guaranteed
that
the pmap is still alive, since by definition an LWP that uses
that it
is about to run.
Thanks to Michael Hitch for the analysis, and Michael and Ragge for
testing.


To generate a diff of this commit:
cvs rdiff -r1.207 -r1.207.6.1 src/sys/arch/alpha/alpha/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Subject: CVS commit: [netbsd-2-0] src/sys/arch/alpha/alpha
To: None <source-changes@NetBSD.org>
From: Jeff Rizzo <riz@netbsd.org>
List: source-changes
Date: 08/07/2005 15:08:16

Module Name:	src
Committed By:	riz
Date:		Sun Aug  7 15:08:16 UTC 2005

Modified Files:
 	src/sys/arch/alpha/alpha [netbsd-2-0]: pmap.c

Log Message:
Pull up revision 1.211 (requested by thorpej in ticket #5528):
1. Disable the lazy allocation of lev1map in pmap_enter(), instead
doing
it in pmap_create(), and freeing the lev1map in pmap_destroy().
This
means that pm_lev1map is consistent for the life of the pmap.
2. pmap_extract() now uses vtophys() for the kernel pmap.  This avoids
having to lock the kernel pmap, since kernel PT pages are never
freed.
3. Because of (1), pmap_asn_alloc() no longer needs to operate on a
locked
pmap; pm_lev1map will never change over the life of the pmap,
and all
other access to the pmap is done in per-CPU fields or with atomic
operations.
4. Because of (3), pmap_activate() no longer needs to lock the pmap
to do its work, thus eliminating the deadlock with sched_lock
described
in PR port-alpha/25599.  This is safe because we are guaranteed
that
the pmap is still alive, since by definition an LWP that uses
that it
is about to run.
Thanks to Michael Hitch for the analysis, and Michael and Ragge for
testing.


To generate a diff of this commit:
cvs rdiff -r1.207 -r1.207.2.1 src/sys/arch/alpha/alpha/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


--
Michael L. Hitch			mhitch@montana.edu
Computer Consultant
Information Technology Center
Montana State University	Bozeman, MT	USA