Lines Matching refs:pgt_cache
45 struct pgt_cache pgt_cache; member
90 SLIST_INSERT_HEAD(&parent->pgt_cache, pgt, link); in free_pgt()
120 SLIST_INIT(&parent->pgt_cache); in alloc_pgt_parent()
125 SLIST_INSERT_HEAD(&parent->pgt_cache, pgt + n, link); in alloc_pgt_parent()
148 pgt = SLIST_FIRST(&parent->pgt_cache); in alloc_pgt()
149 SLIST_REMOVE_HEAD(&parent->pgt_cache, link); in alloc_pgt()
173 struct pgt_cache *pgt_cache = &uctx->pgt_cache; in pgt_flush_range() local
181 p = SLIST_FIRST(pgt_cache); in pgt_flush_range()
183 SLIST_REMOVE_HEAD(pgt_cache, link); in pgt_flush_range()
185 p = SLIST_FIRST(pgt_cache); in pgt_flush_range()
215 struct pgt_cache *pgt_cache = &uctx->pgt_cache; in pgt_flush() local
219 p = SLIST_FIRST(pgt_cache); in pgt_flush()
222 SLIST_REMOVE_HEAD(pgt_cache, link); in pgt_flush()
229 struct pgt_cache *pgt_cache = &uctx->pgt_cache; in pgt_clear_range() local
239 SLIST_FOREACH(p, pgt_cache, link) { in pgt_clear_range()
253 static struct pgt *prune_before_va(struct pgt_cache *pgt_cache, struct pgt *p, in prune_before_va() argument
263 assert(p == SLIST_FIRST(pgt_cache)); in prune_before_va()
264 SLIST_REMOVE_HEAD(pgt_cache, link); in prune_before_va()
266 p = SLIST_FIRST(pgt_cache); in prune_before_va()
275 struct pgt_cache *pgt_cache = &uctx->pgt_cache; in pgt_check_avail() local
277 struct pgt *p = SLIST_FIRST(pgt_cache); in pgt_check_avail()
294 p = prune_before_va(pgt_cache, p, pp, va); in pgt_check_avail()
312 p = SLIST_FIRST(pgt_cache); in pgt_check_avail()
335 SLIST_INSERT_HEAD(pgt_cache, p, link); in pgt_check_avail()
349 static struct pgt_cache pgt_free_list = SLIST_HEAD_INITIALIZER(pgt_free_list);
358 static struct pgt_cache pgt_cache_list = SLIST_HEAD_INITIALIZER(pgt_cache_list);
397 SLIST_INIT(&pgt_parents[n].pgt_cache); in pgt_init()
404 SLIST_INSERT_HEAD(&pgt_parents[n].pgt_cache, p, link); in pgt_init()
461 struct pgt *p = SLIST_FIRST(&pgt_parents[n].pgt_cache); in pop_from_free_list()
464 SLIST_REMOVE_HEAD(&pgt_parents[n].pgt_cache, link); in pop_from_free_list()
476 SLIST_INSERT_HEAD(&p->parent->pgt_cache, p, link); in push_to_free_list()
565 static void pgt_free_unlocked(struct pgt_cache *pgt_cache) in pgt_free_unlocked() argument
567 while (!SLIST_EMPTY(pgt_cache)) { in pgt_free_unlocked()
568 struct pgt *p = SLIST_FIRST(pgt_cache); in pgt_free_unlocked()
570 SLIST_REMOVE_HEAD(pgt_cache, link); in pgt_free_unlocked()
674 static void flush_ctx_range_from_list(struct pgt_cache *pgt_cache, void *ctx, in flush_ctx_range_from_list() argument
684 p = SLIST_FIRST(pgt_cache); in flush_ctx_range_from_list()
687 SLIST_REMOVE_HEAD(pgt_cache, link); in flush_ctx_range_from_list()
689 p = SLIST_FIRST(pgt_cache); in flush_ctx_range_from_list()
720 struct pgt_cache *pgt_cache = &uctx->pgt_cache; in pgt_flush_range() local
725 flush_ctx_range_from_list(pgt_cache, ctx, begin, last); in pgt_flush_range()
732 static void clear_ctx_range_from_list(struct pgt_cache *pgt_cache, in clear_ctx_range_from_list() argument
744 SLIST_FOREACH(p, pgt_cache, link) { in clear_ctx_range_from_list()
762 struct pgt_cache *pgt_cache = &uctx->pgt_cache; in pgt_clear_range() local
767 clear_ctx_range_from_list(pgt_cache, ctx, begin, end); in pgt_clear_range()
773 static bool pgt_alloc_unlocked(struct pgt_cache *pgt_cache, struct ts_ctx *ctx, in pgt_alloc_unlocked() argument
788 pgt_free_unlocked(pgt_cache); in pgt_alloc_unlocked()
794 SLIST_INSERT_HEAD(pgt_cache, p, link); in pgt_alloc_unlocked()
825 struct pgt_cache *pgt_cache = &uctx->pgt_cache; in pgt_get_all() local
833 pgt_free_unlocked(pgt_cache); in pgt_get_all()
834 while (!pgt_alloc_unlocked(pgt_cache, uctx->ts_ctx, vm_info)) { in pgt_get_all()
846 struct pgt_cache *pgt_cache = &uctx->pgt_cache; in pgt_put_all() local
848 if (SLIST_EMPTY(pgt_cache)) in pgt_put_all()
853 pgt_free_unlocked(pgt_cache); in pgt_put_all()