From owner-svn-src-head@FreeBSD.ORG Fri May 29 18:35:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3387D106564A; Fri, 29 May 2009 18:35:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07C808FC27; Fri, 29 May 2009 18:35:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4TIZpZM082883; Fri, 29 May 2009 18:35:51 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4TIZpIQ082882; Fri, 29 May 2009 18:35:51 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200905291835.n4TIZpIQ082882@svn.freebsd.org> From: Alan Cox Date: Fri, 29 May 2009 18:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193044 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2009 18:35:52 -0000 Author: alc Date: Fri May 29 18:35:51 2009 New Revision: 193044 URL: http://svn.freebsd.org/changeset/base/193044 Log: Modify vm_hold_load_pages() to allocate pages using VM_ALLOC_NOOBJ rather than using the kernel object. This allows the elimination of page queues locking from vm_hold_free_pages(). Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri May 29 16:24:23 2009 (r193043) +++ head/sys/kern/vfs_bio.c Fri May 29 18:35:51 2009 (r193044) @@ -3796,30 +3796,25 @@ vm_hold_load_pages(struct buf *bp, vm_of from = round_page(from); index = (from - trunc_page((vm_offset_t)bp->b_data)) >> PAGE_SHIFT; - VM_OBJECT_LOCK(kernel_object); for (pg = from; pg < to; pg += PAGE_SIZE, index++) { tryagain: /* * note: must allocate system pages since blocking here - * could intefere with paging I/O, no matter which + * could interfere with paging I/O, no matter which * process we are. */ - p = vm_page_alloc(kernel_object, - ((pg - VM_MIN_KERNEL_ADDRESS) >> PAGE_SHIFT), - VM_ALLOC_NOBUSY | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED); + p = vm_page_alloc(NULL, pg >> PAGE_SHIFT, VM_ALLOC_NOOBJ | + VM_ALLOC_SYSTEM | VM_ALLOC_WIRED); if (!p) { atomic_add_int(&vm_pageout_deficit, (to - pg) >> PAGE_SHIFT); - VM_OBJECT_UNLOCK(kernel_object); VM_WAIT; - VM_OBJECT_LOCK(kernel_object); goto tryagain; } p->valid = VM_PAGE_BITS_ALL; pmap_qenter(pg, &p, 1); bp->b_pages[index] = p; } - VM_OBJECT_UNLOCK(kernel_object); bp->b_npages = index; } @@ -3835,7 +3830,6 @@ vm_hold_free_pages(struct buf *bp, vm_of to = round_page(to); newnpages = index = (from - trunc_page((vm_offset_t)bp->b_data)) >> PAGE_SHIFT; - VM_OBJECT_LOCK(kernel_object); for (pg = from; pg < to; pg += PAGE_SIZE, index++) { p = bp->b_pages[index]; if (p && (index < bp->b_npages)) { @@ -3847,13 +3841,11 @@ vm_hold_free_pages(struct buf *bp, vm_of } bp->b_pages[index] = NULL; pmap_qremove(pg, 1); - vm_page_lock_queues(); - vm_page_unwire(p, 0); + p->wire_count--; vm_page_free(p); - vm_page_unlock_queues(); + atomic_subtract_int(&cnt.v_wire_count, 1); } } - VM_OBJECT_UNLOCK(kernel_object); bp->b_npages = newnpages; }