Do not use vm_pager_init() to initialize vnode_pbuf_freecnt variable.

vm_pager_init() is run before required nswbuf variable has been set
to correct value. This caused system to run with single pbuf available
for vnode_pager. Handle both cluster_pbuf_freecnt and vnode_pbuf_freecnt
variable in the same way.

Reported by:	ade
Obtained from:	alc
MFC after:	2 days
This commit is contained in:
Alexander Kabaev 2005-08-13 20:21:33 +00:00
parent fd65baf8e2
commit 857b66d505
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149035
4 changed files with 3 additions and 15 deletions

View File

@ -78,12 +78,6 @@ SYSCTL_INT(_vfs, OID_AUTO, read_max, CTLFLAG_RW, &read_max, 0,
/* Page expended to mark partially backed buffers */
extern vm_page_t bogus_page;
/*
* Number of physical bufs (pbufs) this subsystem is allowed.
* Manipulated by vm_pager.c
*/
extern int cluster_pbuf_freecnt;
/*
* Read data to a buf, including read-ahead if we find this to be beneficial.
* cluster_read replaces bread.

View File

@ -474,6 +474,8 @@ extern char *buffers; /* The buffer contents. */
extern int bufpages; /* Number of memory pages in the buffer pool. */
extern struct buf *swbuf; /* Swap I/O buffer headers. */
extern int nswbuf; /* Number of swap I/O buffer headers. */
extern int cluster_pbuf_freecnt; /* Number of pbufs for clusters */
extern int vnode_pbuf_freecnt; /* Number of pbufs for vnode pager */
caddr_t kern_vfs_bio_buffer_alloc(caddr_t v, long physmem_est);
void bufinit(void);

View File

@ -216,6 +216,7 @@ vm_pager_bufferinit()
}
cluster_pbuf_freecnt = nswbuf / 2;
vnode_pbuf_freecnt = nswbuf / 2 + 1;
swapbkva = kmem_alloc_nofault(pager_map, nswbuf * MAXPHYS);
if (!swapbkva)

View File

@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$");
#include <vm/vnode_pager.h>
#include <vm/vm_extern.h>
static void vnode_pager_init(void);
static daddr_t vnode_pager_addr(struct vnode *vp, vm_ooffset_t address,
int *run);
static int vnode_pager_input_smlfs(vm_object_t object, vm_page_t m);
@ -87,7 +86,6 @@ static boolean_t vnode_pager_haspage(vm_object_t, vm_pindex_t, int *, int *);
static vm_object_t vnode_pager_alloc(void *, vm_ooffset_t, vm_prot_t, vm_ooffset_t);
struct pagerops vnodepagerops = {
.pgo_init = vnode_pager_init,
.pgo_alloc = vnode_pager_alloc,
.pgo_dealloc = vnode_pager_dealloc,
.pgo_getpages = vnode_pager_getpages,
@ -97,13 +95,6 @@ struct pagerops vnodepagerops = {
int vnode_pbuf_freecnt;
static void
vnode_pager_init(void)
{
vnode_pbuf_freecnt = nswbuf / 2 + 1;
}
/* Create the VM system backing object for this vnode */
int
vnode_create_vobject(struct vnode *vp, size_t isize, struct thread *td)