kernel - Fix vmstats.v_dma_pages
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 6 Dec 2017 08:23:16 +0000 (00:23 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 6 Dec 2017 08:23:16 +0000 (00:23 -0800)
* Fix an atomic adjustment on v_dma_pages that we believe was
  messing it up, due to not sign-extended a negation of an unsigned
  field.

Reported-by: swildner
sys/vm/vm_page.c

index 455523b..dd9a9a9 100644 (file)
@@ -592,7 +592,7 @@ vm_page_startup_finish(void *dummy __unused)
                                blk, count, rblk);
                        break;
                }
-               atomic_add_long(&vmstats.v_dma_pages, -count);
+               atomic_add_long(&vmstats.v_dma_pages, -(long)count);
                spin_unlock(&vm_contig_spin);
 
                m = PHYS_TO_VM_PAGE((vm_paddr_t)blk << PAGE_SHIFT);