2 * Copyright (c) Red Hat Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sub license,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the
12 * next paragraph) shall be included in all copies or substantial portions
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
23 * Authors: Dave Airlie <airlied@redhat.com>
24 * Jerome Glisse <jglisse@redhat.com>
25 * Pauli Nieminen <suokkos@gmail.com>
28 * Copyright (c) 2013 The FreeBSD Foundation
29 * All rights reserved.
31 * Portions of this software were developed by Konstantin Belousov
32 * <kib@FreeBSD.org> under sponsorship from the FreeBSD Foundation.
34 * $FreeBSD: head/sys/dev/drm2/ttm/ttm_page_alloc.c 247849 2013-03-05 16:15:34Z kib $
37 /* simple list based uncached page pool
38 * - Pool collects resently freed pages for reuse
39 * - Use page->lru to keep a free list
40 * - doesn't track currently in use pages
44 #include <dev/drm2/drmP.h>
45 #include <dev/drm2/ttm/ttm_bo_driver.h>
46 #include <dev/drm2/ttm/ttm_page_alloc.h>
52 #define VM_ALLOC_DMA32 VM_ALLOC_RESERVED1
54 #define NUM_PAGES_TO_ALLOC (PAGE_SIZE/sizeof(vm_page_t))
55 #define SMALL_ALLOCATION 16
56 #define FREE_ALL_PAGES (~0U)
57 /* times are in msecs */
58 #define PAGE_FREE_INTERVAL 1000
61 * struct ttm_page_pool - Pool to reuse recently allocated uc/wc pages.
63 * @lock: Protects the shared pool from concurrnet access. Must be used with
64 * irqsave/irqrestore variants because pool allocator maybe called from
66 * @fill_lock: Prevent concurrent calls to fill.
67 * @list: Pool of free uc/wc pages for fast reuse.
68 * @gfp_flags: Flags to pass for alloc_page.
69 * @npages: Number of pages in pool.
71 struct ttm_page_pool {
76 int ttm_page_alloc_flags;
80 unsigned long nrefills;
84 * Limits for the pool. They are handled without locks because only place where
85 * they may change is in sysfs store. They won't have immediate effect anyway
86 * so forcing serialization to access them is pointless.
89 struct ttm_pool_opts {
98 * struct ttm_pool_manager - Holds memory pools for fst allocation
100 * Manager is read only object for pool code so it doesn't need locking.
102 * @free_interval: minimum number of jiffies between freeing pages from pool.
103 * @page_alloc_inited: reference counting for pool allocation.
104 * @work: Work that is used to shrink the pool. Work is only run when there is
105 * some pages to free.
106 * @small_allocation: Limit in number of pages what is small allocation.
108 * @pools: All pool objects in use.
110 struct ttm_pool_manager {
111 unsigned int kobj_ref;
112 eventhandler_tag lowmem_handler;
113 struct ttm_pool_opts options;
116 struct ttm_page_pool u_pools[NUM_POOLS];
118 struct ttm_page_pool u_wc_pool;
119 struct ttm_page_pool u_uc_pool;
120 struct ttm_page_pool u_wc_pool_dma32;
121 struct ttm_page_pool u_uc_pool_dma32;
126 #define pools _u.u_pools
127 #define wc_pool _u._ut.u_wc_pool
128 #define uc_pool _u._ut.u_uc_pool
129 #define wc_pool_dma32 _u._ut.u_wc_pool_dma32
130 #define uc_pool_dma32 _u._ut.u_uc_pool_dma32
132 MALLOC_DEFINE(M_TTM_POOLMGR, "ttm_poolmgr", "TTM Pool Manager");
135 ttm_vm_page_free(vm_page_t m)
138 KASSERT(m->object == NULL, ("ttm page %p is owned", m));
139 KASSERT(m->wire_count == 1, ("ttm lost wire %p", m));
140 KASSERT((m->flags & PG_FICTITIOUS) != 0, ("ttm lost fictitious %p", m));
141 KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("ttm got unmanaged %p", m));
142 m->flags &= ~PG_FICTITIOUS;
143 m->oflags |= VPO_UNMANAGED;
144 vm_page_unwire(m, 0);
149 ttm_caching_state_to_vm(enum ttm_caching_state cstate)
154 return (VM_MEMATTR_UNCACHEABLE);
156 return (VM_MEMATTR_WRITE_COMBINING);
158 return (VM_MEMATTR_WRITE_BACK);
160 panic("caching state %d\n", cstate);
163 static void ttm_pool_kobj_release(struct ttm_pool_manager *m)
166 free(m, M_TTM_POOLMGR);
171 static ssize_t ttm_pool_store(struct ttm_pool_manager *m,
172 struct attribute *attr, const char *buffer, size_t size)
176 chars = sscanf(buffer, "%u", &val);
180 /* Convert kb to number of pages */
181 val = val / (PAGE_SIZE >> 10);
183 if (attr == &ttm_page_pool_max)
184 m->options.max_size = val;
185 else if (attr == &ttm_page_pool_small)
186 m->options.small = val;
187 else if (attr == &ttm_page_pool_alloc_size) {
188 if (val > NUM_PAGES_TO_ALLOC*8) {
189 pr_err("Setting allocation size to %lu is not allowed. Recommended size is %lu\n",
190 NUM_PAGES_TO_ALLOC*(PAGE_SIZE >> 7),
191 NUM_PAGES_TO_ALLOC*(PAGE_SIZE >> 10));
193 } else if (val > NUM_PAGES_TO_ALLOC) {
194 pr_warn("Setting allocation size to larger than %lu is not recommended\n",
195 NUM_PAGES_TO_ALLOC*(PAGE_SIZE >> 10));
197 m->options.alloc_size = val;
203 static ssize_t ttm_pool_show(struct ttm_pool_manager *m,
204 struct attribute *attr, char *buffer)
208 if (attr == &ttm_page_pool_max)
209 val = m->options.max_size;
210 else if (attr == &ttm_page_pool_small)
211 val = m->options.small;
212 else if (attr == &ttm_page_pool_alloc_size)
213 val = m->options.alloc_size;
215 val = val * (PAGE_SIZE >> 10);
217 return snprintf(buffer, PAGE_SIZE, "%u\n", val);
221 static struct ttm_pool_manager *_manager;
223 static int set_pages_array_wb(vm_page_t *pages, int addrinarray)
228 for (i = 0; i < addrinarray; i++) {
231 unmap_page_from_agp(m);
233 pmap_page_set_memattr(m, VM_MEMATTR_WRITE_BACK);
238 static int set_pages_array_wc(vm_page_t *pages, int addrinarray)
243 for (i = 0; i < addrinarray; i++) {
246 map_page_into_agp(pages[i]);
248 pmap_page_set_memattr(m, VM_MEMATTR_WRITE_COMBINING);
253 static int set_pages_array_uc(vm_page_t *pages, int addrinarray)
258 for (i = 0; i < addrinarray; i++) {
261 map_page_into_agp(pages[i]);
263 pmap_page_set_memattr(m, VM_MEMATTR_UNCACHEABLE);
269 * Select the right pool or requested caching state and ttm flags. */
270 static struct ttm_page_pool *ttm_get_pool(int flags,
271 enum ttm_caching_state cstate)
275 if (cstate == tt_cached)
283 if (flags & TTM_PAGE_FLAG_DMA32)
286 return &_manager->pools[pool_index];
289 /* set memory back to wb and free the pages. */
290 static void ttm_pages_put(vm_page_t *pages, unsigned npages)
294 /* Our VM handles vm memattr automatically on the page free. */
295 if (set_pages_array_wb(pages, npages))
296 printf("[TTM] Failed to set %d pages to wb!\n", npages);
297 for (i = 0; i < npages; ++i)
298 ttm_vm_page_free(pages[i]);
301 static void ttm_pool_update_free_locked(struct ttm_page_pool *pool,
302 unsigned freed_pages)
304 pool->npages -= freed_pages;
305 pool->nfrees += freed_pages;
309 * Free pages from pool.
311 * To prevent hogging the ttm_swap process we only free NUM_PAGES_TO_ALLOC
312 * number of pages in one go.
314 * @pool: to free the pages from
315 * @free_all: If set to true will free all pages in pool
317 static int ttm_page_pool_free(struct ttm_page_pool *pool, unsigned nr_free)
320 vm_page_t *pages_to_free;
321 unsigned freed_pages = 0,
322 npages_to_free = nr_free;
324 if (NUM_PAGES_TO_ALLOC < nr_free)
325 npages_to_free = NUM_PAGES_TO_ALLOC;
327 pages_to_free = malloc(npages_to_free * sizeof(vm_page_t),
328 M_TEMP, M_WAITOK | M_ZERO);
331 mtx_lock(&pool->lock);
333 TAILQ_FOREACH_REVERSE_SAFE(p, &pool->list, pglist, pageq, p1) {
334 if (freed_pages >= npages_to_free)
337 pages_to_free[freed_pages++] = p;
338 /* We can only remove NUM_PAGES_TO_ALLOC at a time. */
339 if (freed_pages >= NUM_PAGES_TO_ALLOC) {
340 /* remove range of pages from the pool */
341 TAILQ_REMOVE(&pool->list, p, pageq);
343 ttm_pool_update_free_locked(pool, freed_pages);
345 * Because changing page caching is costly
346 * we unlock the pool to prevent stalling.
348 mtx_unlock(&pool->lock);
350 ttm_pages_put(pages_to_free, freed_pages);
351 if (likely(nr_free != FREE_ALL_PAGES))
352 nr_free -= freed_pages;
354 if (NUM_PAGES_TO_ALLOC >= nr_free)
355 npages_to_free = nr_free;
357 npages_to_free = NUM_PAGES_TO_ALLOC;
361 /* free all so restart the processing */
365 /* Not allowed to fall through or break because
366 * following context is inside spinlock while we are
374 /* remove range of pages from the pool */
376 TAILQ_REMOVE(&pool->list, p, pageq);
378 ttm_pool_update_free_locked(pool, freed_pages);
379 nr_free -= freed_pages;
382 mtx_unlock(&pool->lock);
385 ttm_pages_put(pages_to_free, freed_pages);
387 free(pages_to_free, M_TEMP);
391 /* Get good estimation how many pages are free in pools */
392 static int ttm_pool_get_num_unused_pages(void)
396 for (i = 0; i < NUM_POOLS; ++i)
397 total += _manager->pools[i].npages;
403 * Callback for mm to request pool to reduce number of page held.
405 static int ttm_pool_mm_shrink(void *arg)
407 static unsigned int start_pool = 0;
409 unsigned pool_offset = atomic_fetchadd_int(&start_pool, 1);
410 struct ttm_page_pool *pool;
411 int shrink_pages = 100; /* XXXKIB */
413 pool_offset = pool_offset % NUM_POOLS;
414 /* select start pool in round robin fashion */
415 for (i = 0; i < NUM_POOLS; ++i) {
416 unsigned nr_free = shrink_pages;
417 if (shrink_pages == 0)
419 pool = &_manager->pools[(i + pool_offset)%NUM_POOLS];
420 shrink_pages = ttm_page_pool_free(pool, nr_free);
422 /* return estimated number of unused pages in pool */
423 return ttm_pool_get_num_unused_pages();
426 static void ttm_pool_mm_shrink_init(struct ttm_pool_manager *manager)
429 manager->lowmem_handler = EVENTHANDLER_REGISTER(vm_lowmem,
430 ttm_pool_mm_shrink, manager, EVENTHANDLER_PRI_ANY);
433 static void ttm_pool_mm_shrink_fini(struct ttm_pool_manager *manager)
436 EVENTHANDLER_DEREGISTER(vm_lowmem, manager->lowmem_handler);
439 static int ttm_set_pages_caching(vm_page_t *pages,
440 enum ttm_caching_state cstate, unsigned cpages)
443 /* Set page caching */
446 r = set_pages_array_uc(pages, cpages);
448 printf("[TTM] Failed to set %d pages to uc!\n", cpages);
451 r = set_pages_array_wc(pages, cpages);
453 printf("[TTM] Failed to set %d pages to wc!\n", cpages);
462 * Free pages the pages that failed to change the caching state. If there is
463 * any pages that have changed their caching state already put them to the
466 static void ttm_handle_caching_state_failure(struct pglist *pages,
467 int ttm_flags, enum ttm_caching_state cstate,
468 vm_page_t *failed_pages, unsigned cpages)
471 /* Failed pages have to be freed */
472 for (i = 0; i < cpages; ++i) {
473 TAILQ_REMOVE(pages, failed_pages[i], pageq);
474 ttm_vm_page_free(failed_pages[i]);
479 * Allocate new pages with correct caching.
481 * This function is reentrant if caller updates count depending on number of
482 * pages returned in pages array.
484 static int ttm_alloc_new_pages(struct pglist *pages, int ttm_alloc_flags,
485 int ttm_flags, enum ttm_caching_state cstate, unsigned count)
487 vm_page_t *caching_array;
490 unsigned i, cpages, aflags;
491 unsigned max_cpages = min(count,
492 (unsigned)(PAGE_SIZE/sizeof(vm_page_t)));
494 aflags = VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ |
495 ((ttm_alloc_flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0 ?
498 /* allocate array for page caching change */
499 caching_array = malloc(max_cpages * sizeof(vm_page_t), M_TEMP,
502 for (i = 0, cpages = 0; i < count; ++i) {
503 p = vm_page_alloc_contig(NULL, 0, aflags, 1, 0,
504 (ttm_alloc_flags & TTM_PAGE_FLAG_DMA32) ? 0xffffffff :
505 VM_MAX_ADDRESS, PAGE_SIZE, 0,
506 ttm_caching_state_to_vm(cstate));
508 printf("[TTM] Unable to get page %u\n", i);
510 /* store already allocated pages in the pool after
511 * setting the caching state */
513 r = ttm_set_pages_caching(caching_array,
516 ttm_handle_caching_state_failure(pages,
518 caching_array, cpages);
523 p->oflags &= ~VPO_UNMANAGED;
524 p->flags |= PG_FICTITIOUS;
526 #ifdef CONFIG_HIGHMEM /* KIB: nop */
527 /* gfp flags of highmem page should never be dma32 so we
528 * we should be fine in such case
533 caching_array[cpages++] = p;
534 if (cpages == max_cpages) {
536 r = ttm_set_pages_caching(caching_array,
539 ttm_handle_caching_state_failure(pages,
541 caching_array, cpages);
548 TAILQ_INSERT_HEAD(pages, p, pageq);
552 r = ttm_set_pages_caching(caching_array, cstate, cpages);
554 ttm_handle_caching_state_failure(pages,
556 caching_array, cpages);
559 free(caching_array, M_TEMP);
565 * Fill the given pool if there aren't enough pages and the requested number of
568 static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool,
569 int ttm_flags, enum ttm_caching_state cstate, unsigned count)
575 * Only allow one pool fill operation at a time.
576 * If pool doesn't have enough pages for the allocation new pages are
577 * allocated from outside of pool.
582 pool->fill_lock = true;
584 /* If allocation request is small and there are not enough
585 * pages in a pool we fill the pool up first. */
586 if (count < _manager->options.small
587 && count > pool->npages) {
588 struct pglist new_pages;
589 unsigned alloc_size = _manager->options.alloc_size;
592 * Can't change page caching if in irqsave context. We have to
593 * drop the pool->lock.
595 mtx_unlock(&pool->lock);
597 TAILQ_INIT(&new_pages);
598 r = ttm_alloc_new_pages(&new_pages, pool->ttm_page_alloc_flags,
599 ttm_flags, cstate, alloc_size);
600 mtx_lock(&pool->lock);
603 TAILQ_CONCAT(&pool->list, &new_pages, pageq);
605 pool->npages += alloc_size;
607 printf("[TTM] Failed to fill pool (%p)\n", pool);
608 /* If we have any pages left put them to the pool. */
609 TAILQ_FOREACH(p, &pool->list, pageq) {
612 TAILQ_CONCAT(&pool->list, &new_pages, pageq);
613 pool->npages += cpages;
617 pool->fill_lock = false;
621 * Cut 'count' number of pages from the pool and put them on the return list.
623 * @return count of pages still required to fulfill the request.
625 static unsigned ttm_page_pool_get_pages(struct ttm_page_pool *pool,
626 struct pglist *pages,
628 enum ttm_caching_state cstate,
634 mtx_lock(&pool->lock);
635 ttm_page_pool_fill_locked(pool, ttm_flags, cstate, count);
637 if (count >= pool->npages) {
638 /* take all pages from the pool */
639 TAILQ_CONCAT(pages, &pool->list, pageq);
640 count -= pool->npages;
644 for (i = 0; i < count; i++) {
645 p = TAILQ_FIRST(&pool->list);
646 TAILQ_REMOVE(&pool->list, p, pageq);
647 TAILQ_INSERT_TAIL(pages, p, pageq);
649 pool->npages -= count;
652 mtx_unlock(&pool->lock);
656 /* Put all pages in pages list to correct pool to wait for reuse */
657 static void ttm_put_pages(vm_page_t *pages, unsigned npages, int flags,
658 enum ttm_caching_state cstate)
660 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
664 /* No pool for this memory type so free the pages */
665 for (i = 0; i < npages; i++) {
667 ttm_vm_page_free(pages[i]);
674 mtx_lock(&pool->lock);
675 for (i = 0; i < npages; i++) {
677 TAILQ_INSERT_TAIL(&pool->list, pages[i], pageq);
682 /* Check that we don't go over the pool limit */
684 if (pool->npages > _manager->options.max_size) {
685 npages = pool->npages - _manager->options.max_size;
686 /* free at least NUM_PAGES_TO_ALLOC number of pages
687 * to reduce calls to set_memory_wb */
688 if (npages < NUM_PAGES_TO_ALLOC)
689 npages = NUM_PAGES_TO_ALLOC;
691 mtx_unlock(&pool->lock);
693 ttm_page_pool_free(pool, npages);
697 * On success pages list will hold count number of correctly
700 static int ttm_get_pages(vm_page_t *pages, unsigned npages, int flags,
701 enum ttm_caching_state cstate)
703 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
706 int gfp_flags, aflags;
710 aflags = VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED |
711 ((flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0 ? VM_ALLOC_ZERO : 0);
713 /* No pool for cached pages */
715 for (r = 0; r < npages; ++r) {
716 p = vm_page_alloc_contig(NULL, 0, aflags, 1, 0,
717 (flags & TTM_PAGE_FLAG_DMA32) ? 0xffffffff :
718 VM_MAX_ADDRESS, PAGE_SIZE,
719 0, ttm_caching_state_to_vm(cstate));
721 printf("[TTM] Unable to allocate page\n");
724 p->oflags &= ~VPO_UNMANAGED;
725 p->flags |= PG_FICTITIOUS;
731 /* combine zero flag to pool flags */
732 gfp_flags = flags | pool->ttm_page_alloc_flags;
734 /* First we take pages from the pool */
736 npages = ttm_page_pool_get_pages(pool, &plist, flags, cstate, npages);
738 TAILQ_FOREACH(p, &plist, pageq) {
742 /* clear the pages coming from the pool if requested */
743 if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) {
744 TAILQ_FOREACH(p, &plist, pageq) {
749 /* If pool didn't have enough pages allocate new one. */
751 /* ttm_alloc_new_pages doesn't reference pool so we can run
752 * multiple requests in parallel.
755 r = ttm_alloc_new_pages(&plist, gfp_flags, flags, cstate,
757 TAILQ_FOREACH(p, &plist, pageq) {
761 /* If there is any pages in the list put them back to
763 printf("[TTM] Failed to allocate extra pages for large request\n");
764 ttm_put_pages(pages, count, flags, cstate);
772 static void ttm_page_pool_init_locked(struct ttm_page_pool *pool, int flags,
775 mtx_init(&pool->lock, "ttmpool", NULL, MTX_DEF);
776 pool->fill_lock = false;
777 TAILQ_INIT(&pool->list);
778 pool->npages = pool->nfrees = 0;
779 pool->ttm_page_alloc_flags = flags;
783 int ttm_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages)
786 if (_manager != NULL)
787 printf("[TTM] manager != NULL\n");
788 printf("[TTM] Initializing pool allocator\n");
790 _manager = malloc(sizeof(*_manager), M_TTM_POOLMGR, M_WAITOK | M_ZERO);
792 ttm_page_pool_init_locked(&_manager->wc_pool, 0, "wc");
793 ttm_page_pool_init_locked(&_manager->uc_pool, 0, "uc");
794 ttm_page_pool_init_locked(&_manager->wc_pool_dma32,
795 TTM_PAGE_FLAG_DMA32, "wc dma");
796 ttm_page_pool_init_locked(&_manager->uc_pool_dma32,
797 TTM_PAGE_FLAG_DMA32, "uc dma");
799 _manager->options.max_size = max_pages;
800 _manager->options.small = SMALL_ALLOCATION;
801 _manager->options.alloc_size = NUM_PAGES_TO_ALLOC;
803 refcount_init(&_manager->kobj_ref, 1);
804 ttm_pool_mm_shrink_init(_manager);
809 void ttm_page_alloc_fini(void)
813 printf("[TTM] Finalizing pool allocator\n");
814 ttm_pool_mm_shrink_fini(_manager);
816 for (i = 0; i < NUM_POOLS; ++i)
817 ttm_page_pool_free(&_manager->pools[i], FREE_ALL_PAGES);
819 if (refcount_release(&_manager->kobj_ref))
820 ttm_pool_kobj_release(_manager);
824 int ttm_pool_populate(struct ttm_tt *ttm)
826 struct ttm_mem_global *mem_glob = ttm->glob->mem_glob;
830 if (ttm->state != tt_unpopulated)
833 for (i = 0; i < ttm->num_pages; ++i) {
834 ret = ttm_get_pages(&ttm->pages[i], 1,
838 ttm_pool_unpopulate(ttm);
842 ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i],
844 if (unlikely(ret != 0)) {
845 ttm_pool_unpopulate(ttm);
850 if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) {
851 ret = ttm_tt_swapin(ttm);
852 if (unlikely(ret != 0)) {
853 ttm_pool_unpopulate(ttm);
858 ttm->state = tt_unbound;
862 void ttm_pool_unpopulate(struct ttm_tt *ttm)
866 for (i = 0; i < ttm->num_pages; ++i) {
868 ttm_mem_global_free_page(ttm->glob->mem_glob,
870 ttm_put_pages(&ttm->pages[i], 1,
875 ttm->state = tt_unpopulated;
880 int ttm_page_alloc_debugfs(struct seq_file *m, void *data)
882 struct ttm_page_pool *p;
884 char *h[] = {"pool", "refills", "pages freed", "size"};
886 seq_printf(m, "No pool allocator running.\n");
889 seq_printf(m, "%6s %12s %13s %8s\n",
890 h[0], h[1], h[2], h[3]);
891 for (i = 0; i < NUM_POOLS; ++i) {
892 p = &_manager->pools[i];
894 seq_printf(m, "%6s %12ld %13ld %8d\n",
895 p->name, p->nrefills,
896 p->nfrees, p->npages);