Complete the initial set of VM changes required to support full

64-bit file sizes. This step simply addresses the remaining overflows,
and does attempt to optimise performance. The details are:

 o Use a 64-bit type for the vm_object `size' and the size argument
   to vm_object_allocate().
 o Use the correct type for index variables in dev_pager_getpages(),
   vm_object_page_clean() and vm_object_page_remove().
 o Avoid an overflow in the i386 pmap_object_init_pt().
This commit is contained in:
Ian Dowse 2002-06-25 22:14:06 +00:00
parent e78f35b33f
commit 6395da5437
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98824
5 changed files with 12 additions and 20 deletions

View File

@ -2493,14 +2493,10 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr,
((objpgs > 0) && (p != NULL));
p = TAILQ_NEXT(p, listq)) {
tmpidx = p->pindex;
if (tmpidx < pindex) {
continue;
}
tmpidx -= pindex;
if (tmpidx >= psize) {
if (p->pindex < pindex || p->pindex - pindex > psize) {
continue;
}
tmpidx = p->pindex - pindex;
/*
* don't allow an madvise to blow away our really
* free pages allocating pv entries.

View File

@ -2493,14 +2493,10 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr,
((objpgs > 0) && (p != NULL));
p = TAILQ_NEXT(p, listq)) {
tmpidx = p->pindex;
if (tmpidx < pindex) {
continue;
}
tmpidx -= pindex;
if (tmpidx >= psize) {
if (p->pindex < pindex || p->pindex - pindex > psize) {
continue;
}
tmpidx = p->pindex - pindex;
/*
* don't allow an madvise to blow away our really
* free pages allocating pv entries.

View File

@ -201,7 +201,7 @@ dev_pager_getpages(object, m, count, reqpage)
int count;
int reqpage;
{
vm_offset_t offset;
vm_pindex_t offset;
vm_offset_t paddr;
vm_page_t page;
dev_t dev;

View File

@ -187,7 +187,7 @@ vm_object_zinit(void *mem, int size)
}
void
_vm_object_allocate(objtype_t type, vm_size_t size, vm_object_t object)
_vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object)
{
static int object_hash_rand;
int exp, incr;
@ -341,7 +341,7 @@ vm_object_pip_wait(vm_object_t object, char *waitid)
* Returns a new object with the given size.
*/
vm_object_t
vm_object_allocate(objtype_t type, vm_size_t size)
vm_object_allocate(objtype_t type, vm_pindex_t size)
{
vm_object_t result;
@ -626,7 +626,7 @@ void
vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int flags)
{
vm_page_t p, np;
vm_offset_t tstart, tend;
vm_pindex_t tstart, tend;
vm_pindex_t pi;
struct vnode *vp;
int clearobjflags;
@ -1697,7 +1697,7 @@ void
vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, boolean_t clean_only)
{
vm_page_t p, next;
unsigned int size;
vm_pindex_t size;
int all;
if (object == NULL)

View File

@ -93,7 +93,7 @@ struct vm_object {
TAILQ_ENTRY(vm_object) shadow_list; /* chain of shadow objects */
TAILQ_HEAD(, vm_page) memq; /* list of resident pages */
int generation; /* generation ID */
vm_size_t size; /* Object size */
vm_pindex_t size; /* Object size */
int ref_count; /* How many refs?? */
int shadow_count; /* how many objects that this is a shadow for */
int hash_rand; /* (c) hash table randomizer */
@ -182,8 +182,8 @@ void vm_object_pip_wakeupn(vm_object_t object, short i);
void vm_object_pip_sleep(vm_object_t object, char *waitid);
void vm_object_pip_wait(vm_object_t object, char *waitid);
vm_object_t vm_object_allocate (objtype_t, vm_size_t);
void _vm_object_allocate (objtype_t, vm_size_t, vm_object_t);
vm_object_t vm_object_allocate (objtype_t, vm_pindex_t);
void _vm_object_allocate (objtype_t, vm_pindex_t, vm_object_t);
boolean_t vm_object_coalesce (vm_object_t, vm_pindex_t, vm_size_t, vm_size_t);
void vm_object_collapse (vm_object_t);
void vm_object_deallocate (vm_object_t);