From owner-freebsd-hackers Fri Jul 20 7: 0: 8 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from technokratis.com (modemcable052.174-202-24.mtl.mc.videotron.ca [24.202.174.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D7B437B401 for ; Fri, 20 Jul 2001 07:00:01 -0700 (PDT) (envelope-from bmilekic@technokratis.com) Received: (from bmilekic@localhost) by technokratis.com (8.11.3/8.11.3) id f6KECdM12940; Fri, 20 Jul 2001 10:12:39 -0400 (EDT) (envelope-from bmilekic) Date: Fri, 20 Jul 2001 10:12:39 -0400 From: Bosko Milekic To: vishwanath pargaonkar Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: kernel malloc Message-ID: <20010720101239.A12857@technokratis.com> References: <20010720091720.28756.qmail@web5301.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010720091720.28756.qmail@web5301.mail.yahoo.com>; from vishubp@yahoo.com on Fri, Jul 20, 2001 at 10:17:20AM +0100 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 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