From owner-freebsd-hackers Mon Jul 23 4:38: 1 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from web5301.mail.yahoo.com (web5301.mail.yahoo.com [216.115.106.110]) by hub.freebsd.org (Postfix) with SMTP id 5781F37B405 for ; Mon, 23 Jul 2001 04:37:55 -0700 (PDT) (envelope-from vishubp@yahoo.com) Message-ID: <20010723113755.21267.qmail@web5301.mail.yahoo.com> Received: from [203.200.20.3] by web5301.mail.yahoo.com via HTTP; Mon, 23 Jul 2001 12:37:55 BST Date: Mon, 23 Jul 2001 12:37:55 +0100 (BST) From: =?iso-8859-1?q?vishwanath=20pargaonkar?= Subject: Re: kernel malloc To: Bosko Milekic Cc: freebsd-hackers@freebsd.org In-Reply-To: <20010720101239.A12857@technokratis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, thx for ur reply. i wanted to know in side kernel is there any limit to the malloc that a user can do.what you told in ur previous mail is that at a time user can malloc 4k.but suppose i am doing 2k memory allocations. how many such mallocs i can do? is there any configuration we can do depending on our RAM size? please reply. thx vishwanath --- Bosko Milekic wrote: > > On Fri, Jul 20, 2001 at 10:17:20AM +0100, vishwanath > pargaonkar wrote: > > Hi, > > > > can any one please help me with this. i want > allocate > > a memory in the kernel -a buffer of size 2k to 5k. > > can i do it using malloc with second parameter as > > M_TEMP and third as M_WAITOK. > > > > can anybody tell me what M_TEMP means .what is > maximum > > malloc i can do with M_TEMP? > > will the OS allow me to malloc 4k buffer in side > > kernel??shd i give M_WAITOK or M_DONTWAIT??? > > M_TEMP is merely there for statistics gathering. If > you're writing > a subsystem and plan to malloc() a lot of things for > the subsystem you may > want to create your own malloc type (see malloc(9)). > On another note, remember that if you allocate a 5k > buffer with malloc() > on x86 where the page size if 4k, that you're not > guaranteed to have a > physically contiguous backing. > > > please tell me. > > thanx in advance. > > Regards, > -- > Bosko Milekic > bmilekic@technokratis.com > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message