From owner-freebsd-net Thu Aug 17 18:55:42 2000 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.129.65]) by hub.freebsd.org (Postfix) with ESMTP id 2162037BEAE for ; Thu, 17 Aug 2000 18:51:34 -0700 (PDT) Received: from cordelia.lcs.mit.edu (cordelia.lcs.mit.edu [18.26.0.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 818B26E426B for ; Thu, 17 Aug 2000 18:35:11 -0700 (PDT) Received: from cordelia.lcs.mit.edu (localhost [127.0.0.1]) by cordelia.lcs.mit.edu (8.9.3/8.9.3) with ESMTP id VAA21308; Thu, 17 Aug 2000 21:34:46 -0400 (EDT) (envelope-from yxw@cordelia.lcs.mit.edu) Message-Id: <200008180134.VAA21308@cordelia.lcs.mit.edu> To: Bosko Milekic Cc: Xiaowei Yang , freebsd-net@FreeBSD.ORG Subject: Re: how to set nmbufs In-Reply-To: Message from Bosko Milekic of "Thu, 17 Aug 2000 16:39:44 EDT." Date: Thu, 17 Aug 2000 21:34:46 -0400 From: Xiaowei Yang Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, Thanks a lot for the reply. I guess I sould phrase my question like this: I am doing some network simulation which requires a lot mbufs (for packet headers) but not mclusters. I want to allocate as much memory as possible. For example, I need about 1M mbufs. I am using right way to do this? I am using FreeBSD 4.0-release. I set NMBCLUSTER to be 64000. Here is 'netstat -m' output before the page fault happened: 5948/256000/256000 mbufs in use (current/peak/max): 5942 mbufs allocated to data 6 mbufs allocated to packet headers 178/302/64000 mbuf clusters in use (current/peak/max) 32604 Kbytes allocated to network (3% in use) 102535 requests for memory denied 0 requests for memory delayed 0 calls to protocol drain routines Here is the trace: ether_output+0x30b ip_output+0x5cb ip_stripoptions+0x1e8 ip_input+0x46a ip_input+0x69f doreti_popl_fs_fault+0x95 Xintr11+0x65 I tried a larger value for NMBCLUSTER , which is 262144, but the kernel stopped booting with page fault. (I heard that the size of mbuf is 256 in 4.x. But I still see MSIZE is set to 128 in sys/i386/include/param.h, which I donot understand.) Thanks, > > Hi, > > I'm afraid you'll need to provide much more information concerning > the page fault, if you expect someone to be able to help you. > In particular, the following is the necessary minimum: > > * FreeBSD version you're doing this with. > * Is this reproducable? If so, what is the exact procedure? > * Stack trace, as well as other available debugging information > following the page fault. > > With the information you have presently provided, it may not even be > the relevant code that is causing this fault. It could just be triggering > a problem that occurs only when kmem_map is mostly occupied by the mb_map > submap, and the size of the kmem_map (or its parent, kernel_map), may > need to be increased. > > Bosko > bmilekic@dsuper.net > > On Thu, 17 Aug 2000, Xiaowei Yang wrote: > > > Greetings, everyone, > > > > I am doing some simulation that needs to allocate as many nmbufs as > > possible. I could not figure out how to set nmbufs to be the maximum > > value allowd by my physical memory. I tired to mannual set it to be a > > huge number, for example, 128MB/128B=1M (I have 196M memory) and used > > netstat -m to monitor the real allocated nmbufs. However, when it > > reached some value lower that a 1M, a kernel page fault happened. > > > > It seems to me I also need to increase the maximum kernel memory size > > seperately. Can someone tell me how to do it right? Is there a simple > > formula to estimate the number? > > > > > > Thanks, > > > > Xiaowei > > > Cheers, --Xiaowei To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message