Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 May 2013 12:16:50 -0500
From:      Alan Cox <alc@rice.edu>
To:        David Xu <davidxu@freebsd.org>
Cc:        Alan Cox <alc@FreeBSD.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r249605 - head/sys/vm
Message-ID:  <51829F82.6050402@rice.edu>
In-Reply-To: <5181E1E7.3090708@freebsd.org>
References:  <201304180534.r3I5YXK4015577@svn.freebsd.org> <5181E1E7.3090708@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 05/01/2013 22:47, David Xu wrote:
> On 2013/04/18 13:34, Alan Cox wrote:
>> Author: alc
>> Date: Thu Apr 18 05:34:33 2013
>> New Revision: 249605
>> URL: http://svnweb.freebsd.org/changeset/base/249605
>>
>> Log:
>>    When calculating the number of reserved nodes, discount the pages
>> that will
>>    be used to store the nodes.
>>
>>    Sponsored by:    EMC / Isilon Storage Division
>>
>> Modified:
>>    head/sys/vm/vm_radix.c
>>
>> Modified: head/sys/vm/vm_radix.c
>> ==============================================================================
>>
>> --- head/sys/vm/vm_radix.c    Thu Apr 18 05:12:11 2013    (r249604)
>> +++ head/sys/vm/vm_radix.c    Thu Apr 18 05:34:33 2013    (r249605)
>> @@ -360,10 +360,17 @@ vm_radix_node_zone_init(void *mem, int s
>>   static void
>>   vm_radix_prealloc(void *arg __unused)
>>   {
>> +    int nodes;
>>
>> -    if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count))
>> +    /*
>> +     * Calculate the number of reserved nodes, discounting the pages
>> that
>> +     * are needed to store them.
>> +     */
>> +    nodes = ((vm_paddr_t)cnt.v_page_count * PAGE_SIZE) / (PAGE_SIZE +
>> +        sizeof(struct vm_radix_node));
>> +    if (!uma_zone_reserve_kva(vm_radix_node_zone, nodes))
>>           panic("%s: unable to create new zone", __func__);
>> -    uma_prealloc(vm_radix_node_zone, cnt.v_page_count);
>> +    uma_prealloc(vm_radix_node_zone, nodes);
>>   }
>>   SYSINIT(vm_radix_prealloc, SI_SUB_KMEM, SI_ORDER_SECOND,
>> vm_radix_prealloc,
>>       NULL);
>>
>
> FYI, after this change, my network card no longer works, the
> driver /sys/dev/if_msk.c reports watchdog timeout, backing out
> this change works again for me.


The only effect of this change should be to reduce the amount of kernel
virtual and physical memory preallocated for radix tree nodes by a few
percent.  I really can't imagine how that impacts the operation of the
if_msk.c driver.  Can you send me additional info on the affected
machine off list?  Also, if possible, I'd like to know the values of
"nodes" and "cnt.v_page_count".

Alan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51829F82.6050402>