From owner-svn-src-head@FreeBSD.ORG Thu May 2 03:47:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9474C52; Thu, 2 May 2013 03:47:25 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id DAB08125B; Thu, 2 May 2013 03:47:25 +0000 (UTC) Received: from xyf.my.dom (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r423lN42004614; Thu, 2 May 2013 03:47:24 GMT (envelope-from davidxu@freebsd.org) Message-ID: <5181E1E7.3090708@freebsd.org> Date: Thu, 02 May 2013 11:47:51 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130416 Thunderbird/17.0.5 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r249605 - head/sys/vm References: <201304180534.r3I5YXK4015577@svn.freebsd.org> In-Reply-To: <201304180534.r3I5YXK4015577@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 03:47:26 -0000 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. Regards, David Xu