From owner-svn-src-head@freebsd.org Wed Jan 4 22:27:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F75FC9F648; Wed, 4 Jan 2017 22:27:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D464C14CD; Wed, 4 Jan 2017 22:27:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v04MRKVt027328; Wed, 4 Jan 2017 22:27:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v04MRJbh027321; Wed, 4 Jan 2017 22:27:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201701042227.v04MRJbh027321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 4 Jan 2017 22:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311336 - in head/sys: dev/agp kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 04 Jan 2017 22:27:21 -0000 Author: glebius Date: Wed Jan 4 22:27:19 2017 New Revision: 311336 URL: https://svnweb.freebsd.org/changeset/base/311336 Log: Move bogus_page declaration to vm_page.h and initialization to vm_page.c. Reviewed by: kib Modified: head/sys/dev/agp/agp_i810.c head/sys/kern/kern_sendfile.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pager.c Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Wed Jan 4 22:25:57 2017 (r311335) +++ head/sys/dev/agp/agp_i810.c Wed Jan 4 22:27:19 2017 (r311336) @@ -1932,8 +1932,6 @@ DRIVER_MODULE(agp_i810, vgapci, agp_i810 MODULE_DEPEND(agp_i810, agp, 1, 1, 1); MODULE_DEPEND(agp_i810, pci, 1, 1, 1); -extern vm_page_t bogus_page; - void agp_intel_gtt_clear_range(device_t dev, u_int first_entry, u_int num_entries) { Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Wed Jan 4 22:25:57 2017 (r311335) +++ head/sys/kern/kern_sendfile.c Wed Jan 4 22:27:19 2017 (r311336) @@ -62,8 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include -extern vm_page_t bogus_page; - /* * Structure describing a single sendfile(2) I/O, which may consist of * several underlying pager I/Os. Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Jan 4 22:25:57 2017 (r311335) +++ head/sys/kern/vfs_bio.c Wed Jan 4 22:27:19 2017 (r311336) @@ -288,15 +288,6 @@ static int bufspace_request; static int bd_speedupreq; /* - * bogus page -- for I/O to/from partially complete buffers - * this is a temporary solution to the problem, but it is not - * really that bad. it would be better to split the buffer - * for input in the case of buffers partially already in memory, - * but the code is intricate enough already. - */ -vm_page_t bogus_page; - -/* * Synchronization (sleep/wakeup) variable for active buffer space requests. * Set when wait starts, cleared prior to wakeup(). * Used in runningbufwakeup() and waitrunningbufspace(). @@ -1115,9 +1106,6 @@ bufinit(void) hifreebuffers = (3 * lofreebuffers) / 2; numfreebuffers = nbuf; - bogus_page = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ | - VM_ALLOC_NORMAL | VM_ALLOC_WIRED); - /* Setup the kva and free list allocators. */ vmem_set_reclaim(buffer_arena, bufkva_reclaim); buf_zone = uma_zcache_create("buf free cache", sizeof(struct buf), Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Wed Jan 4 22:25:57 2017 (r311335) +++ head/sys/kern/vfs_cluster.c Wed Jan 4 22:27:19 2017 (r311336) @@ -81,9 +81,6 @@ static int read_min = 1; SYSCTL_INT(_vfs, OID_AUTO, read_min, CTLFLAG_RW, &read_min, 0, "Cluster read min block count"); -/* Page expended to mark partially backed buffers */ -extern vm_page_t bogus_page; - /* * Read data to a buf, including read-ahead if we find this to be beneficial. * cluster_read replaces bread. Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Jan 4 22:25:57 2017 (r311335) +++ head/sys/vm/vm_page.c Wed Jan 4 22:27:19 2017 (r311336) @@ -131,6 +131,12 @@ struct mtx_padalign vm_page_queue_free_m struct mtx_padalign pa_lock[PA_LOCK_COUNT]; +/* + * bogus page -- for I/O to/from partially complete buffers, + * or for paging into sparsely invalid regions. + */ +vm_page_t bogus_page; + vm_page_t vm_page_array; long vm_page_array_size; long first_page; @@ -158,7 +164,7 @@ static void vm_page_alloc_check(vm_page_ static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits); static void vm_page_enqueue(uint8_t queue, vm_page_t m); static void vm_page_free_wakeup(void); -static void vm_page_init_fakepg(void *dummy); +static void vm_page_init(void *dummy); static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred); static void vm_page_insert_radixdone(vm_page_t m, vm_object_t object, @@ -166,14 +172,16 @@ static void vm_page_insert_radixdone(vm_ static int vm_page_reclaim_run(int req_class, u_long npages, vm_page_t m_run, vm_paddr_t high); -SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init_fakepg, NULL); +SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init, NULL); static void -vm_page_init_fakepg(void *dummy) +vm_page_init(void *dummy) { fakepg_zone = uma_zcreate("fakepg", sizeof(struct vm_page), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_VM); + bogus_page = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ | + VM_ALLOC_NORMAL | VM_ALLOC_WIRED); } /* Make sure that u_long is at least 64 bits when PAGE_SIZE is 32K. */ Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Jan 4 22:25:57 2017 (r311335) +++ head/sys/vm/vm_page.h Wed Jan 4 22:27:19 2017 (r311336) @@ -243,6 +243,8 @@ extern struct vm_domain vm_dom[MAXMEMDOM #define vm_pagequeue_unlock(pq) mtx_unlock(&(pq)->pq_mutex) #ifdef _KERNEL +extern vm_page_t bogus_page; + static __inline void vm_pagequeue_cnt_add(struct vm_pagequeue *pq, int addend) { Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Wed Jan 4 22:25:57 2017 (r311335) +++ head/sys/vm/vm_pager.c Wed Jan 4 22:27:19 2017 (r311336) @@ -84,8 +84,6 @@ __FBSDID("$FreeBSD$"); #include #include -extern vm_page_t bogus_page; - int cluster_pbuf_freecnt = -1; /* unlimited to begin with */ struct buf *swbuf;