Lines Matching defs:amp

176 	struct anon_map *amp = buf;
178 rw_init(&amp->a_rwlock, NULL, RW_DEFAULT, NULL);
179 cv_init(&amp->a_purgecv, NULL, CV_DEFAULT, NULL);
180 mutex_init(&amp->a_pmtx, NULL, MUTEX_DEFAULT, NULL);
181 mutex_init(&amp->a_purgemtx, NULL, MUTEX_DEFAULT, NULL);
189 struct anon_map *amp = buf;
191 rw_destroy(&amp->a_rwlock);
192 cv_destroy(&amp->a_purgecv);
193 mutex_destroy(&amp->a_pmtx);
194 mutex_destroy(&amp->a_purgemtx);
327 * amp size is <= anon hdr size.
1673 anon_disclaim(struct anon_map *amp, ulong_t index, size_t size,
1684 struct anon_hdr *ahp = amp->ahp;
1689 ASSERT(RW_READ_HELD(&amp->a_rwlock));
1709 anon_array_enter(amp, index, &cookie);
1973 struct anon_map *amp,
2015 if ((ap = anon_get_ptr(amp->ahp, start_idx)) != NULL) {
2038 (void) anon_set_ptr(amp->ahp, start_idx, ap,
2054 ap = anon_get_ptr(amp->ahp, start_idx);
2083 !anon_szcshare(amp->ahp, start_idx)) {
2106 if ((ap = anon_get_ptr(amp->ahp, an_idx)) !=
2135 return (anon_map_privatepages(amp, start_idx, szc, seg,
2147 if ((ap = anon_get_ptr(amp->ahp, an_idx)) == NULL) {
2239 anon_share(amp->ahp, an_idx, npgs)) {
2286 (void) anon_set_ptr(amp->ahp, an_idx, ap, ANON_SLEEP);
2317 return (anon_map_privatepages(amp, start_idx, szc, seg, addr, prot,
2375 !anon_szcshare(amp->ahp, start_idx)) {
2542 struct anon_map *amp,
2580 ASSERT(amp != NULL);
2581 ap = anon_get_ptr(amp->ahp, start_idx);
2612 ASSERT(!anon_share(amp->ahp, start_idx, pgcnt));
2682 oldap = anon_get_ptr(amp->ahp, an_idx);
2770 (void) anon_set_ptr(amp->ahp, an_idx, ap, ANON_SLEEP);
2845 struct anon_map *amp,
2886 ANON_LOCK_ENTER(&amp->a_rwlock, RW_WRITER);
2898 ap = anon_get_ptr(amp->ahp, index);
2903 ANON_LOCK_EXIT(&amp->a_rwlock);
2956 anon_pages(amp->ahp, index, pg_cnt) == 0) {
3002 ANON_LOCK_EXIT(&amp->a_rwlock);
3007 ASSERT(anon_get_ptr(amp->ahp, index) == NULL);
3008 (void) anon_set_ptr(amp->ahp, index, ap, ANON_SLEEP);
3041 ANON_LOCK_EXIT(&amp->a_rwlock);
3051 ASSERT(anon_get_ptr(amp->ahp, index) == NULL);
3052 (void) anon_set_ptr(amp->ahp, index, ap, ANON_SLEEP);
3067 ANON_LOCK_EXIT(&amp->a_rwlock);
3190 struct anon_map *amp,
3212 ASSERT(RW_WRITE_HELD(&amp->a_rwlock));
3217 ASSERT(szc == amp->a_szc);
3222 if (anon_try_demote_pages(amp->ahp, start_idx, szc, ppa, 1)) {
3234 ap = anon_get_ptr(amp->ahp, an_idx);
3250 err = anon_map_privatepages(amp, start_idx, szc, seg, addr, prot, ppa,
3290 anon_shmap_free_pages(struct anon_map *amp, ulong_t sidx, size_t len)
3293 pgcnt_t pages = page_get_pagecnt(amp->a_szc);
3294 struct anon_hdr *ahp = amp->ahp;
3300 ASSERT(ANON_WRITE_HELD(&amp->a_rwlock));
3301 ASSERT(amp->refcnt <= 1);
3302 ASSERT(amp->a_szc > 0);
3314 amp->a_szc, NULL, 0)) {
3330 amp->a_szc);
3340 if (!anon_try_demote_pages(ahp, sidx, amp->a_szc, NULL, 0)) {
3346 anon_free_pages(ahp, sidx, pages << PAGESHIFT, amp->a_szc);
3351 * This routine should be called with amp's writer lock when there're no other
3352 * users of amp. All pcache entries of this amp must have been already
3354 * attaching to this amp.
3357 anonmap_purge(struct anon_map *amp)
3359 ASSERT(ANON_WRITE_HELD(&amp->a_rwlock));
3360 ASSERT(amp->refcnt <= 1);
3362 if (amp->a_softlockcnt != 0) {
3363 seg_ppurge(NULL, amp, 0);
3378 * shamp_reclaim() may still be referencing this amp.
3380 ASSERT(amp->a_phead.p_lnext == &amp->a_phead);
3381 ASSERT(amp->a_phead.p_lprev == &amp->a_phead);
3383 mutex_enter(&amp->a_purgemtx);
3384 while (amp->a_softlockcnt != 0) {
3385 ASSERT(amp->a_phead.p_lnext == &amp->a_phead);
3386 ASSERT(amp->a_phead.p_lprev == &amp->a_phead);
3387 amp->a_purgewait = 1;
3388 cv_wait(&amp->a_purgecv, &amp->a_purgemtx);
3390 mutex_exit(&amp->a_purgemtx);
3392 ASSERT(amp->a_phead.p_lnext == &amp->a_phead);
3393 ASSERT(amp->a_phead.p_lprev == &amp->a_phead);
3394 ASSERT(amp->a_softlockcnt == 0);
3404 struct anon_map *amp;
3407 amp = kmem_cache_alloc(anonmap_cache, kmflags);
3408 if (amp == NULL) {
3413 amp->ahp = anon_create(btopr(size), flags);
3414 if (amp->ahp == NULL) {
3416 kmem_cache_free(anonmap_cache, amp);
3419 amp->refcnt = 1;
3420 amp->size = size;
3421 amp->swresv = swresv;
3422 amp->locality = 0;
3423 amp->a_szc = 0;
3424 amp->a_sp = NULL;
3425 amp->a_softlockcnt = 0;
3426 amp->a_purgewait = 0;
3427 amp->a_phead.p_lnext = &amp->a_phead;
3428 amp->a_phead.p_lprev = &amp->a_phead;
3430 return (amp);
3434 anonmap_free(struct anon_map *amp)
3436 ASSERT(amp->ahp != NULL);
3437 ASSERT(amp->refcnt == 0);
3438 ASSERT(amp->a_softlockcnt == 0);
3439 ASSERT(amp->a_phead.p_lnext == &amp->a_phead);
3440 ASSERT(amp->a_phead.p_lprev == &amp->a_phead);
3442 lgrp_shm_policy_fini(amp, NULL);
3443 anon_release(amp->ahp, btopr(amp->size));
3444 kmem_cache_free(anonmap_cache, amp);
3602 anon_array_enter(struct anon_map *amp, ulong_t an_idx, anon_sync_obj_t *sobj)
3617 ASSERT(RW_READ_HELD(&amp->a_rwlock));
3618 an_idx = P2ALIGN(an_idx, page_get_pagecnt(amp->a_szc));
3619 hash = ANON_ARRAY_HASH(amp, an_idx);
3623 ap_slot = anon_get_slot(amp->ahp, an_idx);
3632 anon_array_try_enter(struct anon_map *amp, ulong_t an_idx,
3649 ASSERT(RW_READ_HELD(&amp->a_rwlock));
3650 an_idx = P2ALIGN(an_idx, page_get_pagecnt(amp->a_szc));
3651 hash = ANON_ARRAY_HASH(amp, an_idx);
3657 ap_slot = anon_get_slot(amp->ahp, an_idx);