cvs commit: src/sys/vm vm_contig.c

Scott Long scottl at samsco.org
Sun Jan 29 00:35:41 PST 2006


Nate Lawson wrote:
> Scott Long wrote:
> 
>> scottl      2006-01-29 08:24:54 UTC
>>
>>   FreeBSD src repository
>>
>>   Modified files:
>>     sys/vm               vm_contig.c   Log:
>>   The change a few years ago of having contigmalloc start its scan at 
>> the top
>>   of physical RAM instead of the bottom was a sound idea, but the 
>> implementation
>>   left a lot to be desired.  Scans would spend considerable time 
>> looking at
>>   pages that are above of the address range given by the caller, and 
>> multiple
>>   calls (like what happens in busdma) would spend more time on top of 
>> that
>>   rescanning the same pages over and over.
> 
> 
> Interesting.
> 
>> Index: src/sys/vm/vm_contig.c
>> diff -u src/sys/vm/vm_contig.c:1.47 src/sys/vm/vm_contig.c:1.48
>> --- src/sys/vm/vm_contig.c:1.47    Thu Jan 26 05:51:26 2006
>> +++ src/sys/vm/vm_contig.c    Sun Jan 29 08:24:54 2006
>> @@ -387,7 +387,9 @@
>>      vm_offset_t size;
>>      vm_paddr_t phys;
>>      vm_page_t pga = vm_page_array;
>> -    int i, pass, pqtype, start;
>> +    static vm_pindex_t np = 0;
>> +    static vm_pindex_t start = 0;
>> +    int i, pass, pqtype;
> 
> 
> What lock protects access to these static variables?
> 

The whole function is serialized by Giant.

Scott


More information about the cvs-all mailing list