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.
35 /* simple list based uncached page pool
36 * - Pool collects resently freed pages for reuse
37 * - Use page->lru to keep a free list
38 * - doesn't track currently in use pages
41 #include <sys/cdefs.h>
42 __FBSDID("$FreeBSD$");
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 NUM_PAGES_TO_ALLOC (PAGE_SIZE/sizeof(vm_page_t))
53 #define SMALL_ALLOCATION 16
54 #define FREE_ALL_PAGES (~0U)
55 /* times are in msecs */
56 #define PAGE_FREE_INTERVAL 1000
59 * struct ttm_page_pool - Pool to reuse recently allocated uc/wc pages.
61 * @lock: Protects the shared pool from concurrnet access. Must be used with
62 * irqsave/irqrestore variants because pool allocator maybe called from
64 * @fill_lock: Prevent concurrent calls to fill.
65 * @list: Pool of free uc/wc pages for fast reuse.
66 * @gfp_flags: Flags to pass for alloc_page.
67 * @npages: Number of pages in pool.
69 struct ttm_page_pool {
74 int ttm_page_alloc_flags;
78 unsigned long nrefills;
82 * Limits for the pool. They are handled without locks because only place where
83 * they may change is in sysfs store. They won't have immediate effect anyway
84 * so forcing serialization to access them is pointless.
87 struct ttm_pool_opts {
96 * struct ttm_pool_manager - Holds memory pools for fst allocation
98 * Manager is read only object for pool code so it doesn't need locking.
100 * @free_interval: minimum number of jiffies between freeing pages from pool.
101 * @page_alloc_inited: reference counting for pool allocation.
102 * @work: Work that is used to shrink the pool. Work is only run when there is
103 * some pages to free.
104 * @small_allocation: Limit in number of pages what is small allocation.
106 * @pools: All pool objects in use.
108 struct ttm_pool_manager {
109 unsigned int kobj_ref;
110 eventhandler_tag lowmem_handler;
111 struct ttm_pool_opts options;
114 struct ttm_page_pool u_pools[NUM_POOLS];
116 struct ttm_page_pool u_wc_pool;
117 struct ttm_page_pool u_uc_pool;
118 struct ttm_page_pool u_wc_pool_dma32;
119 struct ttm_page_pool u_uc_pool_dma32;
124 #define pools _u.u_pools
125 #define wc_pool _u._ut.u_wc_pool
126 #define uc_pool _u._ut.u_uc_pool
127 #define wc_pool_dma32 _u._ut.u_wc_pool_dma32
128 #define uc_pool_dma32 _u._ut.u_uc_pool_dma32
130 MALLOC_DEFINE(M_TTM_POOLMGR, "ttm_poolmgr", "TTM Pool Manager");
133 ttm_vm_page_free(vm_page_t m)
136 KASSERT(m->object == NULL, ("ttm page %p is owned", m));
137 KASSERT(m->wire_count == 1, ("ttm lost wire %p", m));
138 KASSERT((m->flags & PG_FICTITIOUS) != 0, ("ttm lost fictitious %p", m));
139 KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("ttm got unmanaged %p", m));
140 m->flags &= ~PG_FICTITIOUS;
141 m->oflags |= VPO_UNMANAGED;
142 vm_page_unwire(m, PQ_INACTIVE);
147 ttm_caching_state_to_vm(enum ttm_caching_state cstate)
152 return (VM_MEMATTR_UNCACHEABLE);
154 return (VM_MEMATTR_WRITE_COMBINING);
156 return (VM_MEMATTR_WRITE_BACK);
158 panic("caching state %d\n", cstate);
161 static void ttm_pool_kobj_release(struct ttm_pool_manager *m)
164 free(m, M_TTM_POOLMGR);
169 static ssize_t ttm_pool_store(struct ttm_pool_manager *m,
170 struct attribute *attr, const char *buffer, size_t size)
174 chars = sscanf(buffer, "%u", &val);
178 /* Convert kb to number of pages */
179 val = val / (PAGE_SIZE >> 10);
181 if (attr == &ttm_page_pool_max)
182 m->options.max_size = val;
183 else if (attr == &ttm_page_pool_small)
184 m->options.small = val;
185 else if (attr == &ttm_page_pool_alloc_size) {
186 if (val > NUM_PAGES_TO_ALLOC*8) {
187 pr_err("Setting allocation size to %lu is not allowed. Recommended size is %lu\n",
188 NUM_PAGES_TO_ALLOC*(PAGE_SIZE >> 7),
189 NUM_PAGES_TO_ALLOC*(PAGE_SIZE >> 10));
191 } else if (val > NUM_PAGES_TO_ALLOC) {
192 pr_warn("Setting allocation size to larger than %lu is not recommended\n",
193 NUM_PAGES_TO_ALLOC*(PAGE_SIZE >> 10));
195 m->options.alloc_size = val;
201 static ssize_t ttm_pool_show(struct ttm_pool_manager *m,
202 struct attribute *attr, char *buffer)
206 if (attr == &ttm_page_pool_max)
207 val = m->options.max_size;
208 else if (attr == &ttm_page_pool_small)
209 val = m->options.small;
210 else if (attr == &ttm_page_pool_alloc_size)
211 val = m->options.alloc_size;
213 val = val * (PAGE_SIZE >> 10);
215 return snprintf(buffer, PAGE_SIZE, "%u\n", val);
219 static struct ttm_pool_manager *_manager;
221 static int set_pages_array_wb(vm_page_t *pages, int addrinarray)
226 for (i = 0; i < addrinarray; i++) {
229 unmap_page_from_agp(m);
231 pmap_page_set_memattr(m, VM_MEMATTR_WRITE_BACK);
236 static int set_pages_array_wc(vm_page_t *pages, int addrinarray)
241 for (i = 0; i < addrinarray; i++) {
244 map_page_into_agp(pages[i]);
246 pmap_page_set_memattr(m, VM_MEMATTR_WRITE_COMBINING);
251 static int set_pages_array_uc(vm_page_t *pages, int addrinarray)
256 for (i = 0; i < addrinarray; i++) {
259 map_page_into_agp(pages[i]);
261 pmap_page_set_memattr(m, VM_MEMATTR_UNCACHEABLE);
267 * Select the right pool or requested caching state and ttm flags. */
268 static struct ttm_page_pool *ttm_get_pool(int flags,
269 enum ttm_caching_state cstate)
273 if (cstate == tt_cached)
281 if (flags & TTM_PAGE_FLAG_DMA32)
284 return &_manager->pools[pool_index];
287 /* set memory back to wb and free the pages. */
288 static void ttm_pages_put(vm_page_t *pages, unsigned npages)
292 /* Our VM handles vm memattr automatically on the page free. */
293 if (set_pages_array_wb(pages, npages))
294 printf("[TTM] Failed to set %d pages to wb!\n", npages);
295 for (i = 0; i < npages; ++i)
296 ttm_vm_page_free(pages[i]);
299 static void ttm_pool_update_free_locked(struct ttm_page_pool *pool,
300 unsigned freed_pages)
302 pool->npages -= freed_pages;
303 pool->nfrees += freed_pages;
307 * Free pages from pool.
309 * To prevent hogging the ttm_swap process we only free NUM_PAGES_TO_ALLOC
310 * number of pages in one go.
312 * @pool: to free the pages from
313 * @free_all: If set to true will free all pages in pool
315 static int ttm_page_pool_free(struct ttm_page_pool *pool, unsigned nr_free)
318 vm_page_t *pages_to_free;
319 unsigned freed_pages = 0,
320 npages_to_free = nr_free;
323 if (NUM_PAGES_TO_ALLOC < nr_free)
324 npages_to_free = NUM_PAGES_TO_ALLOC;
326 pages_to_free = malloc(npages_to_free * sizeof(vm_page_t),
327 M_TEMP, M_WAITOK | M_ZERO);
330 mtx_lock(&pool->lock);
332 TAILQ_FOREACH_REVERSE_SAFE(p, &pool->list, pglist, plinks.q, p1) {
333 if (freed_pages >= npages_to_free)
336 pages_to_free[freed_pages++] = p;
337 /* We can only remove NUM_PAGES_TO_ALLOC at a time. */
338 if (freed_pages >= NUM_PAGES_TO_ALLOC) {
339 /* remove range of pages from the pool */
340 for (i = 0; i < freed_pages; i++)
341 TAILQ_REMOVE(&pool->list, pages_to_free[i], plinks.q);
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 for (i = 0; i < freed_pages; i++)
377 TAILQ_REMOVE(&pool->list, pages_to_free[i], plinks.q);
379 ttm_pool_update_free_locked(pool, freed_pages);
380 nr_free -= freed_pages;
383 mtx_unlock(&pool->lock);
386 ttm_pages_put(pages_to_free, freed_pages);
388 free(pages_to_free, M_TEMP);
392 /* Get good estimation how many pages are free in pools */
393 static int ttm_pool_get_num_unused_pages(void)
397 for (i = 0; i < NUM_POOLS; ++i)
398 total += _manager->pools[i].npages;
404 * Callback for mm to request pool to reduce number of page held.
406 static int ttm_pool_mm_shrink(void *arg)
408 static unsigned int start_pool = 0;
410 unsigned pool_offset = atomic_fetchadd_int(&start_pool, 1);
411 struct ttm_page_pool *pool;
412 int shrink_pages = 100; /* XXXKIB */
414 pool_offset = pool_offset % NUM_POOLS;
415 /* select start pool in round robin fashion */
416 for (i = 0; i < NUM_POOLS; ++i) {
417 unsigned nr_free = shrink_pages;
418 if (shrink_pages == 0)
420 pool = &_manager->pools[(i + pool_offset)%NUM_POOLS];
421 shrink_pages = ttm_page_pool_free(pool, nr_free);
423 /* return estimated number of unused pages in pool */
424 return ttm_pool_get_num_unused_pages();
427 static void ttm_pool_mm_shrink_init(struct ttm_pool_manager *manager)
430 manager->lowmem_handler = EVENTHANDLER_REGISTER(vm_lowmem,
431 ttm_pool_mm_shrink, manager, EVENTHANDLER_PRI_ANY);
434 static void ttm_pool_mm_shrink_fini(struct ttm_pool_manager *manager)
437 EVENTHANDLER_DEREGISTER(vm_lowmem, manager->lowmem_handler);
440 static int ttm_set_pages_caching(vm_page_t *pages,
441 enum ttm_caching_state cstate, unsigned cpages)
444 /* Set page caching */
447 r = set_pages_array_uc(pages, cpages);
449 printf("[TTM] Failed to set %d pages to uc!\n", cpages);
452 r = set_pages_array_wc(pages, cpages);
454 printf("[TTM] Failed to set %d pages to wc!\n", cpages);
463 * Free pages the pages that failed to change the caching state. If there is
464 * any pages that have changed their caching state already put them to the
467 static void ttm_handle_caching_state_failure(struct pglist *pages,
468 int ttm_flags, enum ttm_caching_state cstate,
469 vm_page_t *failed_pages, unsigned cpages)
472 /* Failed pages have to be freed */
473 for (i = 0; i < cpages; ++i) {
474 TAILQ_REMOVE(pages, failed_pages[i], plinks.q);
475 ttm_vm_page_free(failed_pages[i]);
480 * Allocate new pages with correct caching.
482 * This function is reentrant if caller updates count depending on number of
483 * pages returned in pages array.
485 static int ttm_alloc_new_pages(struct pglist *pages, int ttm_alloc_flags,
486 int ttm_flags, enum ttm_caching_state cstate, unsigned count)
488 vm_page_t *caching_array;
491 unsigned i, cpages, aflags;
492 unsigned max_cpages = min(count,
493 (unsigned)(PAGE_SIZE/sizeof(vm_page_t)));
495 aflags = VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ |
496 ((ttm_alloc_flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0 ?
499 /* allocate array for page caching change */
500 caching_array = malloc(max_cpages * sizeof(vm_page_t), M_TEMP,
503 for (i = 0, cpages = 0; i < count; ++i) {
504 p = vm_page_alloc_contig(NULL, 0, aflags, 1, 0,
505 (ttm_alloc_flags & TTM_PAGE_FLAG_DMA32) ? 0xffffffff :
506 VM_MAX_ADDRESS, PAGE_SIZE, 0,
507 ttm_caching_state_to_vm(cstate));
509 printf("[TTM] Unable to get page %u\n", i);
511 /* store already allocated pages in the pool after
512 * setting the caching state */
514 r = ttm_set_pages_caching(caching_array,
517 ttm_handle_caching_state_failure(pages,
519 caching_array, cpages);
524 p->oflags &= ~VPO_UNMANAGED;
525 p->flags |= PG_FICTITIOUS;
527 #ifdef CONFIG_HIGHMEM /* KIB: nop */
528 /* gfp flags of highmem page should never be dma32 so we
529 * we should be fine in such case
534 caching_array[cpages++] = p;
535 if (cpages == max_cpages) {
537 r = ttm_set_pages_caching(caching_array,
540 ttm_handle_caching_state_failure(pages,
542 caching_array, cpages);
549 TAILQ_INSERT_HEAD(pages, p, plinks.q);
553 r = ttm_set_pages_caching(caching_array, cstate, cpages);
555 ttm_handle_caching_state_failure(pages,
557 caching_array, cpages);
560 free(caching_array, M_TEMP);
566 * Fill the given pool if there aren't enough pages and the requested number of
569 static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool,
570 int ttm_flags, enum ttm_caching_state cstate, unsigned count)
576 * Only allow one pool fill operation at a time.
577 * If pool doesn't have enough pages for the allocation new pages are
578 * allocated from outside of pool.
583 pool->fill_lock = true;
585 /* If allocation request is small and there are not enough
586 * pages in a pool we fill the pool up first. */
587 if (count < _manager->options.small
588 && count > pool->npages) {
589 struct pglist new_pages;
590 unsigned alloc_size = _manager->options.alloc_size;
593 * Can't change page caching if in irqsave context. We have to
594 * drop the pool->lock.
596 mtx_unlock(&pool->lock);
598 TAILQ_INIT(&new_pages);
599 r = ttm_alloc_new_pages(&new_pages, pool->ttm_page_alloc_flags,
600 ttm_flags, cstate, alloc_size);
601 mtx_lock(&pool->lock);
604 TAILQ_CONCAT(&pool->list, &new_pages, plinks.q);
606 pool->npages += alloc_size;
608 printf("[TTM] Failed to fill pool (%p)\n", pool);
609 /* If we have any pages left put them to the pool. */
610 TAILQ_FOREACH(p, &pool->list, plinks.q) {
613 TAILQ_CONCAT(&pool->list, &new_pages, plinks.q);
614 pool->npages += cpages;
618 pool->fill_lock = false;
622 * Cut 'count' number of pages from the pool and put them on the return list.
624 * @return count of pages still required to fulfill the request.
626 static unsigned ttm_page_pool_get_pages(struct ttm_page_pool *pool,
627 struct pglist *pages,
629 enum ttm_caching_state cstate,
635 mtx_lock(&pool->lock);
636 ttm_page_pool_fill_locked(pool, ttm_flags, cstate, count);
638 if (count >= pool->npages) {
639 /* take all pages from the pool */
640 TAILQ_CONCAT(pages, &pool->list, plinks.q);
641 count -= pool->npages;
645 for (i = 0; i < count; i++) {
646 p = TAILQ_FIRST(&pool->list);
647 TAILQ_REMOVE(&pool->list, p, plinks.q);
648 TAILQ_INSERT_TAIL(pages, p, plinks.q);
650 pool->npages -= count;
653 mtx_unlock(&pool->lock);
657 /* Put all pages in pages list to correct pool to wait for reuse */
658 static void ttm_put_pages(vm_page_t *pages, unsigned npages, int flags,
659 enum ttm_caching_state cstate)
661 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
665 /* No pool for this memory type so free the pages */
666 for (i = 0; i < npages; i++) {
668 ttm_vm_page_free(pages[i]);
675 mtx_lock(&pool->lock);
676 for (i = 0; i < npages; i++) {
678 TAILQ_INSERT_TAIL(&pool->list, pages[i], plinks.q);
683 /* Check that we don't go over the pool limit */
685 if (pool->npages > _manager->options.max_size) {
686 npages = pool->npages - _manager->options.max_size;
687 /* free at least NUM_PAGES_TO_ALLOC number of pages
688 * to reduce calls to set_memory_wb */
689 if (npages < NUM_PAGES_TO_ALLOC)
690 npages = NUM_PAGES_TO_ALLOC;
692 mtx_unlock(&pool->lock);
694 ttm_page_pool_free(pool, npages);
698 * On success pages list will hold count number of correctly
701 static int ttm_get_pages(vm_page_t *pages, unsigned npages, int flags,
702 enum ttm_caching_state cstate)
704 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
707 int gfp_flags, aflags;
711 aflags = VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED |
712 ((flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0 ? VM_ALLOC_ZERO : 0);
714 /* No pool for cached pages */
716 for (r = 0; r < npages; ++r) {
717 p = vm_page_alloc_contig(NULL, 0, aflags, 1, 0,
718 (flags & TTM_PAGE_FLAG_DMA32) ? 0xffffffff :
719 VM_MAX_ADDRESS, PAGE_SIZE,
720 0, ttm_caching_state_to_vm(cstate));
722 printf("[TTM] Unable to allocate page\n");
725 p->oflags &= ~VPO_UNMANAGED;
726 p->flags |= PG_FICTITIOUS;
732 /* combine zero flag to pool flags */
733 gfp_flags = flags | pool->ttm_page_alloc_flags;
735 /* First we take pages from the pool */
737 npages = ttm_page_pool_get_pages(pool, &plist, flags, cstate, npages);
739 TAILQ_FOREACH(p, &plist, plinks.q) {
743 /* clear the pages coming from the pool if requested */
744 if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) {
745 TAILQ_FOREACH(p, &plist, plinks.q) {
750 /* If pool didn't have enough pages allocate new one. */
752 /* ttm_alloc_new_pages doesn't reference pool so we can run
753 * multiple requests in parallel.
756 r = ttm_alloc_new_pages(&plist, gfp_flags, flags, cstate,
758 TAILQ_FOREACH(p, &plist, plinks.q) {
762 /* If there is any pages in the list put them back to
764 printf("[TTM] Failed to allocate extra pages for large request\n");
765 ttm_put_pages(pages, count, flags, cstate);
773 static void ttm_page_pool_init_locked(struct ttm_page_pool *pool, int flags,
776 mtx_init(&pool->lock, "ttmpool", NULL, MTX_DEF);
777 pool->fill_lock = false;
778 TAILQ_INIT(&pool->list);
779 pool->npages = pool->nfrees = 0;
780 pool->ttm_page_alloc_flags = flags;
784 int ttm_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages)
787 if (_manager != NULL)
788 printf("[TTM] manager != NULL\n");
789 printf("[TTM] Initializing pool allocator\n");
791 _manager = malloc(sizeof(*_manager), M_TTM_POOLMGR, M_WAITOK | M_ZERO);
793 ttm_page_pool_init_locked(&_manager->wc_pool, 0, "wc");
794 ttm_page_pool_init_locked(&_manager->uc_pool, 0, "uc");
795 ttm_page_pool_init_locked(&_manager->wc_pool_dma32,
796 TTM_PAGE_FLAG_DMA32, "wc dma");
797 ttm_page_pool_init_locked(&_manager->uc_pool_dma32,
798 TTM_PAGE_FLAG_DMA32, "uc dma");
800 _manager->options.max_size = max_pages;
801 _manager->options.small = SMALL_ALLOCATION;
802 _manager->options.alloc_size = NUM_PAGES_TO_ALLOC;
804 refcount_init(&_manager->kobj_ref, 1);
805 ttm_pool_mm_shrink_init(_manager);
810 void ttm_page_alloc_fini(void)
814 printf("[TTM] Finalizing pool allocator\n");
815 ttm_pool_mm_shrink_fini(_manager);
817 for (i = 0; i < NUM_POOLS; ++i)
818 ttm_page_pool_free(&_manager->pools[i], FREE_ALL_PAGES);
820 if (refcount_release(&_manager->kobj_ref))
821 ttm_pool_kobj_release(_manager);
825 int ttm_pool_populate(struct ttm_tt *ttm)
827 struct ttm_mem_global *mem_glob = ttm->glob->mem_glob;
831 if (ttm->state != tt_unpopulated)
834 for (i = 0; i < ttm->num_pages; ++i) {
835 ret = ttm_get_pages(&ttm->pages[i], 1,
839 ttm_pool_unpopulate(ttm);
843 ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i],
845 if (unlikely(ret != 0)) {
846 ttm_pool_unpopulate(ttm);
851 if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) {
852 ret = ttm_tt_swapin(ttm);
853 if (unlikely(ret != 0)) {
854 ttm_pool_unpopulate(ttm);
859 ttm->state = tt_unbound;
863 void ttm_pool_unpopulate(struct ttm_tt *ttm)
867 for (i = 0; i < ttm->num_pages; ++i) {
869 ttm_mem_global_free_page(ttm->glob->mem_glob,
871 ttm_put_pages(&ttm->pages[i], 1,
876 ttm->state = tt_unpopulated;
881 int ttm_page_alloc_debugfs(struct seq_file *m, void *data)
883 struct ttm_page_pool *p;
885 char *h[] = {"pool", "refills", "pages freed", "size"};
887 seq_printf(m, "No pool allocator running.\n");
890 seq_printf(m, "%6s %12s %13s %8s\n",
891 h[0], h[1], h[2], h[3]);
892 for (i = 0; i < NUM_POOLS; ++i) {
893 p = &_manager->pools[i];
895 seq_printf(m, "%6s %12ld %13ld %8d\n",
896 p->name, p->nrefills,
897 p->nfrees, p->npages);