diff options
author | Mark Johnston <markj@FreeBSD.org> | 2017-07-31 18:48:58 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2017-07-31 18:48:58 +0000 |
commit | 6c7ebc242bedc75bb56a11ea419cc1c316d5e5e3 (patch) | |
tree | 3566d72ba9dcd93c2d5bd95e82eb5acad41df52c | |
parent | 3a122598ce08e43a5dca6cb345c5e0890d60d9d9 (diff) | |
download | src-6c7ebc242bedc75bb56a11ea419cc1c316d5e5e3.tar.gz src-6c7ebc242bedc75bb56a11ea419cc1c316d5e5e3.zip |
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
Notes
Notes:
svn path=/head/; revision=321805
-rw-r--r-- | sys/kern/vfs_bio.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index af59c0b3b465..20069d566a25 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -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; } |