vm: Put vm_page_alloc_contig debug prints under vm_contig_verbose
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 23 Aug 2012 05:49:23 +0000 (13:49 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 23 Aug 2012 05:49:23 +0000 (13:49 +0800)
Tunable vm.contig_verbose could be used to control vm_contig_verbose.
It is disabled by default.

Well, it is too verbose even for bootverbose ...

sys/vm/vm_page.c

index c47761f..e78888d 100644 (file)
@@ -124,6 +124,9 @@ SYSCTL_ULONG(_vm, OID_AUTO, dma_reserved, CTLFLAG_RD, &vm_dma_reserved, 0,
 SYSCTL_UINT(_vm, OID_AUTO, dma_free_pages, CTLFLAG_RD,
            &vm_contig_alist.bl_free, 0, "Memory reserved for DMA");
 
 SYSCTL_UINT(_vm, OID_AUTO, dma_free_pages, CTLFLAG_RD,
            &vm_contig_alist.bl_free, 0, "Memory reserved for DMA");
 
+static int vm_contig_verbose = 0;
+TUNABLE_INT("vm.contig_verbose", &vm_contig_verbose);
+
 RB_GENERATE2(vm_page_rb_tree, vm_page, rb_entry, rb_vm_page_compare,
             vm_pindex_t, pindex);
 
 RB_GENERATE2(vm_page_rb_tree, vm_page, rb_entry, rb_vm_page_compare,
             vm_pindex_t, pindex);
 
@@ -1726,7 +1729,7 @@ vm_page_alloc_contig(vm_paddr_t low, vm_paddr_t high,
                return(NULL);
        }
        spin_unlock(&vm_contig_spin);
                return(NULL);
        }
        spin_unlock(&vm_contig_spin);
-       if (bootverbose) {
+       if (vm_contig_verbose) {
                kprintf("vm_page_alloc_contig: %016jx/%ldk\n",
                        (intmax_t)(vm_paddr_t)blk << PAGE_SHIFT,
                        (size + PAGE_MASK) * (PAGE_SIZE / 1024));
                kprintf("vm_page_alloc_contig: %016jx/%ldk\n",
                        (intmax_t)(vm_paddr_t)blk << PAGE_SHIFT,
                        (size + PAGE_MASK) * (PAGE_SIZE / 1024));
@@ -1745,7 +1748,7 @@ vm_page_free_contig(vm_page_t m, unsigned long size)
        vm_pindex_t start = pa >> PAGE_SHIFT;
        vm_pindex_t pages = (size + PAGE_MASK) >> PAGE_SHIFT;
 
        vm_pindex_t start = pa >> PAGE_SHIFT;
        vm_pindex_t pages = (size + PAGE_MASK) >> PAGE_SHIFT;
 
-       if (bootverbose) {
+       if (vm_contig_verbose) {
                kprintf("vm_page_free_contig:  %016jx/%ldk\n",
                        (intmax_t)pa, size / 1024);
        }
                kprintf("vm_page_free_contig:  %016jx/%ldk\n",
                        (intmax_t)pa, size / 1024);
        }