Date: Fri, 15 Dec 2006 00:50:38 -0800 From: Suleiman Souhlal <ssouhlal@FreeBSD.org> To: =?ISO-8859-1?Q?Marc_L=F6rner?= <marc.loerner@hob.de> Cc: freebsd-hackers@freebsd.org Subject: Re: Allocate aligned memory Message-ID: <458261DE.2040607@FreeBSD.org> In-Reply-To: <200612150937.37737.marc.loerner@hob.de> References: <200612150937.37737.marc.loerner@hob.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Marc Lörner wrote: > Hello all, > > I want to allocate 120KB of memory thats aligned to 32KB. > I already saw/found the function contigmalloc, now my question is, why > following functioncall never does return with an resulting address, instead > null is returned? > > unsigned long *p = (unsigned long*) > contigmalloc(120*1024, M_DEVBUF, M_WAITOK, 0, (1<<22), 32*1024, 1024*1024); Have you considered the fact that there might be no 32K-aligned 120KB chunk of memory in the range you specified? My suggestion is to make the your high limit (currently 1 << 22) MUCH higher, if possible. Also, getting rid of the 1MB boundary might help. -- Suleiman
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?458261DE.2040607>