diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-10-01 16:03:49 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-10-01 16:03:49 +0000 |
commit | 4bcd0a58316fc859b2e03a05faa1db731f8541d6 (patch) | |
tree | 0d60963c78fffd223957f9f8ec4c98c74db9026c /sys/arch/alpha/include | |
parent | face7fc54071ecc5a37898fac0b0798c24bbf6b9 (diff) |
Make the alpha pmap (more) mpsafe by protecting both the pmap itself and the
pv lists with a mutex. This should make pmap_enter(9), pmap_remove(9) and
pmap_page_protect(9) safe to use without holding the kernel lock. This
largely reverts rev. 1.75, but now of course the pmap locks are defined
to actually call mtx_enter(9) and mtx_leave(9).
ok visa@
Diffstat (limited to 'sys/arch/alpha/include')
-rw-r--r-- | sys/arch/alpha/include/pmap.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/arch/alpha/include/pmap.h b/sys/arch/alpha/include/pmap.h index 861ed9e58e1..5d1f7df6997 100644 --- a/sys/arch/alpha/include/pmap.h +++ b/sys/arch/alpha/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.36 2015/02/15 21:34:33 miod Exp $ */ +/* $OpenBSD: pmap.h,v 1.37 2015/10/01 16:03:48 kettenis Exp $ */ /* $NetBSD: pmap.h,v 1.37 2000/11/19 03:16:35 thorpej Exp $ */ /*- @@ -98,6 +98,7 @@ struct pmap { TAILQ_ENTRY(pmap) pm_list; /* list of all pmaps */ pt_entry_t *pm_lev1map; /* level 1 map */ int pm_count; /* pmap reference count */ + struct mutex pm_mtx; /* lock on pmap */ struct pmap_statistics pm_stats; /* pmap statistics */ unsigned long pm_cpus; /* mask of CPUs using pmap */ unsigned long pm_needisync; /* mask of CPUs needing isync */ @@ -300,12 +301,14 @@ do { \ * pmap-specific data stored in the vm_page structure. */ struct vm_page_md { + struct mutex pvh_mtx; struct pv_entry *pvh_list; /* pv entry list */ int pvh_attrs; /* page attributes */ }; #define VM_MDPAGE_INIT(pg) \ do { \ + mtx_init(&(pg)->mdpage.pvh_mtx, IPL_VM); \ (pg)->mdpage.pvh_list = NULL; \ (pg)->mdpage.pvh_attrs = 0; \ } while (0) |