svn commit: r250543 - user/attilio/jeff-numa/sys/vm

John Baldwin jhb at FreeBSD.org
Mon May 13 18:45:12 UTC 2013


On 5/13/13 2:23 PM, Attilio Rao wrote:
> On Mon, May 13, 2013 at 7:51 PM, John Baldwin <jhb at freebsd.org> wrote:
>> On 5/11/13 9:53 PM, Attilio Rao wrote:
>>> Author: attilio
>>> Date: Sun May 12 01:53:03 2013
>>> New Revision: 250543
>>> URL: http://svnweb.freebsd.org/changeset/base/250543
>>>
>>> Log:
>>>   Scan all the domains when trying to allocate from freepages.
>>>   Some domains may be empty but others may still have some available pages
>>>   satisfying the allocations.
>>
>> It seems like you have nested loops here so you are doing N^2 scans
>> rather than N?
> 
> If you want to say so. In most cases N=2 and M=4. However also
> consider the less overhead caming from all the adjustement of the
> flind because of now split DOMAINS-NFREELISTS concepts.

*sigh*

No.  Read the code.  vm_phys_alloc_pages() does 'for i = 0; i <
vm_ndomains; i++' around calls to vm_phys_alloc_pages_domain() which
internally has its _own_ 'for i = 0; i < vm_ndomains; i++'.  Same with
vm_phys_alloc_freelist_pages().  You don't need it in both places.
Also, vm_phys_alloc_pages() should now be able to just call
vm_phys_alloc_freelist_pages() and just be a simple loop that only
iterates on flind as it used to do before all the NUMA changes.

-- 
John Baldwin


More information about the svn-src-user mailing list