diff options
| author | susans <none@none> | 2007-05-17 14:24:19 -0700 |
|---|---|---|
| committer | susans <none@none> | 2007-05-17 14:24:19 -0700 |
| commit | 3230aa086e19b239f0306ae02bd82e788031cfef (patch) | |
| tree | 6dcc37af1dd8c1a96e28574bba234d7d30ddfe50 /usr/src | |
| parent | 6b60931c06941531e2bac4709902c411f22362f3 (diff) | |
| download | illumos-joyent-3230aa086e19b239f0306ae02bd82e788031cfef.tar.gz | |
6521370 Panic in segspt_free_pages
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/uts/common/vm/seg_spt.c | 8 | ||||
| -rw-r--r-- | usr/src/uts/common/vm/vm_anon.c | 24 |
2 files changed, 24 insertions, 8 deletions
diff --git a/usr/src/uts/common/vm/seg_spt.c b/usr/src/uts/common/vm/seg_spt.c index 610eaaae3e..a68276a1b5 100644 --- a/usr/src/uts/common/vm/seg_spt.c +++ b/usr/src/uts/common/vm/seg_spt.c @@ -710,14 +710,6 @@ segspt_free_pages(struct seg *seg, caddr_t addr, size_t len) * these were created by segspt. */ if (pp->p_szc != 0) { - /* - * For DISM swap is released in shm_rm_amp. - */ - if ((sptd->spt_flags & SHM_PAGEABLE) == 0 && - ap->an_pvp != NULL) { - panic("segspt_free_pages: pvp non NULL"); - /*NOTREACHED*/ - } if (root == 0) { ASSERT(curnpgs == 0); root = 1; diff --git a/usr/src/uts/common/vm/vm_anon.c b/usr/src/uts/common/vm/vm_anon.c index a6846c83b3..2d90f568ad 100644 --- a/usr/src/uts/common/vm/vm_anon.c +++ b/usr/src/uts/common/vm/vm_anon.c @@ -2689,6 +2689,7 @@ anon_map_createpages( anoff_t ap_off; size_t pgsz; lgrp_t *lgrp; + kmutex_t *ahm; /* * XXX For now only handle S_CREATE. @@ -2731,6 +2732,29 @@ anon_map_createpages( pp = anon_pl[0]; ppa[p_index++] = pp; + /* + * an_pvp can become non-NULL after SysV's page was + * paged out before ISM was attached to this SysV + * shared memory segment. So free swap slot if needed. + */ + if (ap->an_pvp != NULL) { + page_io_lock(pp); + ahm = &anonhash_lock[AH_LOCK(ap->an_vp, + ap->an_off)]; + mutex_enter(ahm); + if (ap->an_pvp != NULL) { + swap_phys_free(ap->an_pvp, + ap->an_poff, PAGESIZE); + ap->an_pvp = NULL; + ap->an_poff = 0; + mutex_exit(ahm); + hat_setmod(pp); + } else { + mutex_exit(ahm); + } + page_io_unlock(pp); + } + addr += PAGESIZE; index++; npgs--; |
