Lines Matching refs:zd
2568 zone_depot_init(struct zone_depot *zd) in zone_depot_init() argument
2570 *zd = (struct zone_depot){ in zone_depot_init()
2571 .zd_tail = &zd->zd_head, in zone_depot_init()
2576 zone_depot_insert_head_full(struct zone_depot *zd, zone_magazine_t mag) in zone_depot_insert_head_full() argument
2578 if (zd->zd_full++ == 0) { in zone_depot_insert_head_full()
2579 zd->zd_tail = &mag->zm_next; in zone_depot_insert_head_full()
2581 mag->zm_next = zd->zd_head; in zone_depot_insert_head_full()
2582 zd->zd_head = mag; in zone_depot_insert_head_full()
2586 zone_depot_insert_tail_full(struct zone_depot *zd, zone_magazine_t mag) in zone_depot_insert_tail_full() argument
2588 zd->zd_full++; in zone_depot_insert_tail_full()
2589 mag->zm_next = *zd->zd_tail; in zone_depot_insert_tail_full()
2590 *zd->zd_tail = mag; in zone_depot_insert_tail_full()
2591 zd->zd_tail = &mag->zm_next; in zone_depot_insert_tail_full()
2595 zone_depot_insert_head_empty(struct zone_depot *zd, zone_magazine_t mag) in zone_depot_insert_head_empty() argument
2597 zd->zd_empty++; in zone_depot_insert_head_empty()
2598 mag->zm_next = *zd->zd_tail; in zone_depot_insert_head_empty()
2599 *zd->zd_tail = mag; in zone_depot_insert_head_empty()
2603 zone_depot_pop_head_full(struct zone_depot *zd, zone_t z) in zone_depot_pop_head_full() argument
2605 zone_magazine_t mag = zd->zd_head; in zone_depot_pop_head_full()
2607 assert(zd->zd_full); in zone_depot_pop_head_full()
2609 zd->zd_full--; in zone_depot_pop_head_full()
2610 if (z && z->z_recirc_full_min > zd->zd_full) { in zone_depot_pop_head_full()
2611 z->z_recirc_full_min = zd->zd_full; in zone_depot_pop_head_full()
2613 zd->zd_head = mag->zm_next; in zone_depot_pop_head_full()
2614 if (zd->zd_full == 0) { in zone_depot_pop_head_full()
2615 zd->zd_tail = &zd->zd_head; in zone_depot_pop_head_full()
2623 zone_depot_pop_head_empty(struct zone_depot *zd, zone_t z) in zone_depot_pop_head_empty() argument
2625 zone_magazine_t mag = *zd->zd_tail; in zone_depot_pop_head_empty()
2627 assert(zd->zd_empty); in zone_depot_pop_head_empty()
2629 zd->zd_empty--; in zone_depot_pop_head_empty()
2630 if (z && z->z_recirc_empty_min > zd->zd_empty) { in zone_depot_pop_head_empty()
2631 z->z_recirc_empty_min = zd->zd_empty; in zone_depot_pop_head_empty()
2633 *zd->zd_tail = mag->zm_next; in zone_depot_pop_head_empty()
2784 zone_magazine_free_list(struct zone_depot *zd) in zone_magazine_free_list() argument
2786 zone_magazine_t tmp, mag = *zd->zd_tail; in zone_magazine_free_list()
2794 *zd->zd_tail = NULL; in zone_magazine_free_list()
2795 zd->zd_empty = 0; in zone_magazine_free_list()
3795 static void zone_depot_trim(zone_t z, uint32_t target, struct zone_depot *zd);
4669 struct zone_depot zd; in zalloc_expand_drain_exhausted_caches_locked() local
4676 zone_depot_init(&zd); in zalloc_expand_drain_exhausted_caches_locked()
4677 zone_depot_trim(z, 0, &zd); in zalloc_expand_drain_exhausted_caches_locked()
4680 if (zd.zd_full) { in zalloc_expand_drain_exhausted_caches_locked()
4682 &zd, zd.zd_full, NULL); in zalloc_expand_drain_exhausted_caches_locked()
4684 if (zd.zd_empty) { in zalloc_expand_drain_exhausted_caches_locked()
4686 &zd, zd.zd_empty, NULL); in zalloc_expand_drain_exhausted_caches_locked()
7621 zone_depot_trim(zone_t z, uint32_t target, struct zone_depot *zd) in zone_depot_trim() argument
7628 zone_depot_move_full(zd, &zc->zc_depot, n, NULL); in zone_depot_trim()
7633 zone_depot_move_empty(zd, &zc->zc_depot, n, NULL); in zone_depot_trim()
7647 zone_reclaim_pcpu(zone_t z, zone_reclaim_mode_t mode, struct zone_depot *zd) in zone_reclaim_pcpu() argument
7659 zone_depot_trim(z, depot_max, zd); in zone_reclaim_pcpu()
7681 zone_reclaim_recirc_drain(zone_t z, struct zone_depot *zd) in zone_reclaim_recirc_drain() argument
7683 assert(zd->zd_empty == 0); in zone_reclaim_recirc_drain()
7684 assert(zd->zd_full == 0); in zone_reclaim_recirc_drain()
7688 *zd = z->z_recirc; in zone_reclaim_recirc_drain()
7689 if (zd->zd_full == 0) { in zone_reclaim_recirc_drain()
7690 zd->zd_tail = &zd->zd_head; in zone_reclaim_recirc_drain()
7702 zone_reclaim_recirc_trim(zone_t z, struct zone_depot *zd) in zone_reclaim_recirc_trim() argument
7720 zone_depot_move_empty(zd, &z->z_recirc, count, NULL); in zone_reclaim_recirc_trim()
7734 zone_depot_move_full(zd, &z->z_recirc, count, NULL); in zone_reclaim_recirc_trim()
7774 struct zone_depot zd; in zone_reclaim() local
7776 zone_depot_init(&zd); in zone_reclaim()
7825 zone_reclaim_recirc_trim(z, &zd); in zone_reclaim()
7827 zone_reclaim_recirc_drain(z, &zd); in zone_reclaim()
7829 zone_reclaim_pcpu(z, mode, &zd); in zone_reclaim()
7835 while (zd.zd_full) { in zone_reclaim()
7836 mag = zone_depot_pop_head_full(&zd, NULL); in zone_reclaim()
7844 zone_depot_insert_head_empty(&zd, mag); in zone_reclaim()
7849 zone_magazine_free_list(&zd); in zone_reclaim()
7862 while (zd.zd_full) { in zone_reclaim()
7863 mag = zone_depot_pop_head_full(&zd, NULL); in zone_reclaim()
7895 zone_magazine_free_list(&zd); in zone_reclaim()