Lines Matching refs:hm

151 hment_put_reserve(hment_t *hm)  in hment_put_reserve()  argument
155 hm->hm_next = hment_reserve_pool; in hment_put_reserve()
156 hment_reserve_pool = hm; in hment_put_reserve()
167 hment_t *hm = NULL; in hment_get_reserve() local
179 hm = hment_reserve_pool; in hment_get_reserve()
180 hment_reserve_pool = hm->hm_next; in hment_get_reserve()
184 return (hm); in hment_get_reserve()
194 hment_t *hm = NULL; in hment_alloc() local
205 hm = kmem_cache_alloc(hment_cache, km_flag); in hment_alloc()
206 if (hm == NULL || in hment_alloc()
210 hment_put_reserve(hm); in hment_alloc()
217 if (hm == NULL) { in hment_alloc()
219 hm = hment_get_reserve(); in hment_alloc()
225 if (hm == NULL && can_steal_post_boot) in hment_alloc()
226 hm = hment_steal(); in hment_alloc()
231 if (hm == NULL) in hment_alloc()
232 hm = hment_get_reserve(); in hment_alloc()
237 if (hm == NULL) in hment_alloc()
242 hm->hm_entry = 0; in hment_alloc()
243 hm->hm_htable = NULL; in hment_alloc()
244 hm->hm_hashlink = null_avl_link; in hment_alloc()
245 hm->hm_next = NULL; in hment_alloc()
246 hm->hm_prev = NULL; in hment_alloc()
247 hm->hm_pfn = PFN_INVALID; in hment_alloc()
248 return (hm); in hment_alloc()
258 hment_free(hment_t *hm) in hment_free() argument
264 bzero(hm, sizeof (*hm)); in hment_free()
269 hment_put_reserve(hm); in hment_free()
271 kmem_cache_free(hment_cache, hm); in hment_free()
310 hment_insert(hment_t *hm, page_t *pp) in hment_insert() argument
321 hm->hm_next = pp->p_mapping; in hment_insert()
323 ((hment_t *)pp->p_mapping)->hm_prev = hm; in hment_insert()
324 pp->p_mapping = hm; in hment_insert()
329 idx = HMENT_HASH(hm->hm_htable->ht_pfn, hm->hm_entry); in hment_insert()
332 avl_add(&hment_table[idx], hm); in hment_insert()
355 hment_t *hm = NULL; in hment_prepare() local
369 if (hm == NULL) in hment_prepare()
393 if (hm == NULL) in hment_prepare()
402 if (hm != NULL) { in hment_prepare()
403 hm->hm_htable = pp->p_mapping; in hment_prepare()
404 hm->hm_entry = pp->p_mlentry; in hment_prepare()
405 hm->hm_pfn = pp->p_pagenum; in hment_prepare()
409 hment_insert(hm, pp); in hment_prepare()
424 if (hm != NULL) in hment_prepare()
428 hm = hment_alloc(); in hment_prepare()
437 hment_free(hm); in hment_prepare()
438 hm = NULL; in hment_prepare()
442 return (hm); in hment_prepare()
451 hment_assign(htable_t *htable, uint_t entry, page_t *pp, hment_t *hm) in hment_assign() argument
461 ASSERT(hm == NULL); in hment_assign()
478 ASSERT(hm != NULL); in hment_assign()
479 hm->hm_htable = htable; in hment_assign()
480 hm->hm_entry = entry; in hment_assign()
481 hm->hm_pfn = pp->p_pagenum; in hment_assign()
482 hment_insert(hm, pp); in hment_assign()
493 hment_t *hm; in hment_walk() local
501 hm = HMENT_EMBEDDED; in hment_walk()
504 hm = NULL; in hment_walk()
509 hm = (hment_t *)pp->p_mapping; in hment_walk()
511 hm = prev->hm_next; in hment_walk()
514 if (hm != NULL) { in hment_walk()
515 *ht = hm->hm_htable; in hment_walk()
516 *entry = hm->hm_entry; in hment_walk()
519 return (hm); in hment_walk()
533 hment_t *hm; in hment_remove() local
561 hm = avl_find(&hment_table[idx], &dummy, &where); in hment_remove()
562 if (hm == NULL) in hment_remove()
566 avl_remove(&hment_table[idx], hm); in hment_remove()
572 if (hm->hm_next) in hment_remove()
573 hm->hm_next->hm_prev = hm->hm_prev; in hment_remove()
574 if (hm->hm_prev) in hment_remove()
575 hm->hm_prev->hm_next = hm->hm_next; in hment_remove()
577 pp->p_mapping = hm->hm_next; in hment_remove()
580 hm->hm_hashlink = null_avl_link; in hment_remove()
581 hm->hm_next = NULL; in hment_remove()
582 hm->hm_prev = NULL; in hment_remove()
584 return (hm); in hment_remove()
593 hment_t *hm; in hment_reserve() local
598 hm = kmem_cache_alloc(hment_cache, KM_NOSLEEP); in hment_reserve()
599 if (hm == NULL) in hment_reserve()
601 hment_put_reserve(hm); in hment_reserve()
611 hment_t *hm; in hment_adjust_reserve() local
618 hm = hment_get_reserve(); in hment_adjust_reserve()
619 if (hm == NULL) in hment_adjust_reserve()
621 kmem_cache_free(hment_cache, hm); in hment_adjust_reserve()
675 hment_t *hm; in hment_mapcnt() local
700 for (hm = larger->p_mapping; hm; in hment_mapcnt()
701 hm = hm->hm_next) { in hment_mapcnt()
702 if (hm->hm_htable->ht_level == szc) in hment_mapcnt()
725 hment_t *hm = NULL; in hment_steal() local
757 for (hm = pp->p_mapping; hm; hm = hm->hm_next) { in hment_steal()
758 ht = hm->hm_htable; in hment_steal()
775 hm2 = hati_page_unmap(pp, ht, hm->hm_entry); in hment_steal()
776 ASSERT(hm2 == hm); in hment_steal()
778 return (hm); in hment_steal()