cvs commit: src/sys/vm vm_page.c

Alan Cox alc at cs.rice.edu
Thu Mar 5 10:28:13 PST 2009


Pawel Jakub Dawidek wrote:
> On Wed, Dec 19, 2007 at 05:47:51AM +0000, Alan Cox wrote:
>   
>> alc         2007-12-19 05:47:51 UTC
>>
>>   FreeBSD src repository
>>
>>   Modified files:
>>     sys/vm               vm_page.c 
>>   Log:
>>   Eliminate redundant code from vm_page_startup().
>>   
>>   Revision  Changes    Path
>>   1.363     +0 -17     src/sys/vm/vm_page.c
>>
>> http://cvsweb.FreeBSD.org/src/sys/vm/vm_page.c.diff?r1=1.362&r2=1.363&f=h
>> --- src/sys/vm/vm_page.c	2007/12/11 21:20:34	1.362
>> +++ src/sys/vm/vm_page.c	2007/12/19 05:47:50	1.363
>> @@ -97,7 +97,7 @@
>>   */
>>  
>>  #include <sys/cdefs.h>
>> -__FBSDID("$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/vm/vm_page.c,v 1.362 2007/12/11 21:20:34 alc Exp $");
>> +__FBSDID("$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/vm/vm_page.c,v 1.363 2007/12/19 05:47:50 alc Exp $");
>>  
>>  #include <sys/param.h>
>>  #include <sys/systm.h>
>> @@ -201,7 +201,6 @@ vm_offset_t
>>  vm_page_startup(vm_offset_t vaddr)
>>  {
>>  	vm_offset_t mapped;
>> -	vm_size_t npages;
>>  	vm_paddr_t page_range;
>>  	vm_paddr_t new_end;
>>  	int i;
>> @@ -216,9 +215,6 @@ vm_page_startup(vm_offset_t vaddr)
>>  	vm_paddr_t low_water, high_water;
>>  	int biggestone;
>>  
>> -	vm_paddr_t total;
>> -
>> -	total = 0;
>>  	biggestsize = 0;
>>  	biggestone = 0;
>>  	nblocks = 0;
>> @@ -244,7 +240,6 @@ vm_page_startup(vm_offset_t vaddr)
>>  		if (phys_avail[i + 1] > high_water)
>>  			high_water = phys_avail[i + 1];
>>  		++nblocks;
>> -		total += size;
>>  	}
>>  
>>  	end = phys_avail[biggestone+1];
>> @@ -308,8 +303,6 @@ vm_page_startup(vm_offset_t vaddr)
>>  #else
>>  #error "Either VM_PHYSSEG_DENSE or VM_PHYSSEG_SPARSE must be defined."
>>  #endif
>> -	npages = (total - (page_range * sizeof(struct vm_page)) -
>> -	    (end - new_end)) / PAGE_SIZE;
>>  	end = new_end;
>>  
>>  	/*
>> @@ -345,16 +338,6 @@ vm_page_startup(vm_offset_t vaddr)
>>  	vm_page_array_size = page_range;
>>  
>>  	/*
>> -	 * This assertion tests the hypothesis that npages and total are
>> -	 * redundant.  XXX
>> -	 */
>> -	page_range = 0;
>> -	for (i = 0; phys_avail[i + 1] != 0; i += 2)
>> -		page_range += atop(phys_avail[i + 1] - phys_avail[i]);
>> -	KASSERT(page_range == npages,
>> -	    ("vm_page_startup: inconsistent page counts"));
>> -
>> -	/*
>>  	 * Initialize the physical memory allocator.
>>  	 */
>>  	vm_phys_init();
>>     
>
> This assertion is triggered on my 7-STABLE machine. It was fine when it
> was running 6.1, but now after upgrade it panics. If this assert is
> bogus could you MFC it to 7-STABLE as well?
>
>   

Hmm.  The assertion is not bogus.  It is a legitimate initialization 
time consistency check.  I removed it from HEAD because no one reported 
it failing over a period of two years, so I thought it could be removed 
and the code simplified.

Are you using a kernel from before or after the superpages MFC?

Alan




More information about the cvs-src mailing list