svn commit: r321805 - head/sys/kern

Mark Johnston markj at FreeBSD.org
Mon Jul 31 18:49:00 UTC 2017


Author: markj
Date: Mon Jul 31 18:48:58 2017
New Revision: 321805
URL: https://svnweb.freebsd.org/changeset/base/321805

Log:
  Batch v_wire_count decrements in vm_hold_free_pages().
  
  Atomic updates to v_wire_count are a significant source of contention, so
  combine multiple updates into one in this easy case. Also remove an old
  printf that gets executed if the page is shared-busied, which is a case
  that will lead to a panic anyway.
  
  Reviewed by:	alc, kib
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D11791

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Mon Jul 31 18:10:10 2017	(r321804)
+++ head/sys/kern/vfs_bio.c	Mon Jul 31 18:48:58 2017	(r321805)
@@ -4532,13 +4532,10 @@ vm_hold_free_pages(struct buf *bp, int newbsize)
 	for (index = newnpages; index < bp->b_npages; index++) {
 		p = bp->b_pages[index];
 		bp->b_pages[index] = NULL;
-		if (vm_page_sbusied(p))
-			printf("vm_hold_free_pages: blkno: %jd, lblkno: %jd\n",
-			    (intmax_t)bp->b_blkno, (intmax_t)bp->b_lblkno);
 		p->wire_count--;
 		vm_page_free(p);
-		atomic_subtract_int(&vm_cnt.v_wire_count, 1);
 	}
+	atomic_subtract_int(&vm_cnt.v_wire_count, bp->b_npages - newnpages);
 	bp->b_npages = newnpages;
 }
 


More information about the svn-src-head mailing list