lkml.org 
[lkml]   [2004]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: 2.6.8 kmem_cache_alloc barfs
Date
Richard,

Here you go....

#define MAX_BUFFER_SIZE 0x10000


NOTE: This code barfs in kmalloc while allocating 64KB blocks. I
allocate a large number of these blocks from this routine. 2.6.4,2.6.7,
and 2.6.8 all crash in kmem_cache_alloc when kmalloc gets called and
I have exceeded the 1GB memory space in the kernel. I am using 2.4.20
kernels with the userspace/kernelspace patch that allows the
kernel page space to be increased from 1GB to 3GB to allow me
to allocate 2.5 GB of memory in the kernel. I am not using
this patch at present, but was testing 2.6.8 to see if it returned
proper failure states when large amounts of memory were allocated
and kernel memory was exhausted.

Jeff

for (i = 0; i < (32 * 2048); i++)
{
buffer = kmalloc(MAX_BUFFER_SIZE, GFP_KERNEL);
if (!buffer)
{
P_Print("could not allocate data buffer (%d bytes)\n",
MAX_BUFFER_SIZE);
break;
}
P_Set(buffer, 0, MAX_BUFFER_SIZE);
}

Pretty easy to make it fail.

Jeff




> On Thu, Aug 19, 2004 at 06:18:20PM +0000, jmerkey@comcast.net wrote:
> >
> > in 2.6.8 with all features and config options (at least those that will build)
> with 4GB memory option selected, kmem_cache_alloc crashes when called with
> requests for 64KB chunks of memory which exceed the kernel address space of 1GB
> in size rather than returning an out of memory error.
>
> testcase please.
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.039 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site