From owner-freebsd-hackers Wed Nov 11 06:31:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA20022 for freebsd-hackers-outgoing; Wed, 11 Nov 1998 06:31:30 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from Thingol.KryptoKom.DE (Thingol.KryptoKom.DE [194.245.91.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA20014 for ; Wed, 11 Nov 1998 06:31:25 -0800 (PST) (envelope-from Reinier.Bezuidenhout@KryptoKom.DE) Received: (from mail@localhost) by Thingol.KryptoKom.DE (8.8.7/8.8.4) id PAA07393; Wed, 11 Nov 1998 15:31:02 +0100 Received: from cirdan.kryptokom.de by via smtpp (Version 1.1.1beta6) id kwa07385; Wed Nov 11 15:30:47 1998 Received: by Cirdan.KryptoKom.DE (8.8.5/8.8.5) with ESMTP id PAA26054; Wed, 11 Nov 1998 15:27:29 +0100 Received: (from bez@localhost) by borg.kryptokom.de (8.8.8/8.8.8) id PAA25157; Wed, 11 Nov 1998 15:33:42 +0100 (CET) (envelope-from bez) From: Reinier Bezuidenhout Message-Id: <199811111433.PAA25157@borg.kryptokom.de> Subject: Re: Malloc in the kernel and double panic In-Reply-To: <199811110901.BAA13927@root.com> from David Greenman at "Nov 11, 1998 1: 1:34 am" To: dg@root.com Date: Wed, 11 Nov 1998 15:33:42 +0100 (CET) Cc: tlambert@primenet.com, grog@lemis.com, Reinier.Bezuidenhout@KryptoKom.DE@Cirdan.KryptoKom.DE, freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi ... After being unable to allocate a dynamic continious chunk of memory in the kernel, I decided I would not try to do it dynamically and let it grow as I need more entries. I decided to malloc one big array whose elements are pointers to structures ... so I have the following type: T_KEY *T_P_KEY; With T_KEY the structure. T_P_KEY *large_one; large_one = (T_P_KEY *)malloc(sizeof(T_P_KEY) * 10000, M_DEVBUF, M_WAITOK); And this causes a happy double panic in the kernel.... How can I allocate a 10000 * sizeof(pointer) section of memory in the kernel ? I have tried this on different hardware platforms etc. and the same thing happens. Any ideas ??? Reinier > >> to allocate demand-zero, pageable, kernel memory. > > > >Hmmm.... > > > > > >Better fix /sys/kern/sysv_shm.c then, since that's where I cribbed the > >code from... > > sysv_shm.c is a special beast that specifically *avoids* allocating kernel > VM for the objects it manages. > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message