[Click] Memory allocation in Click elements
Eddie Kohler
kohler at cs.ucla.edu
Mon May 3 23:25:32 EDT 2004
Hi Greg,
The 'kmalloc()' call that 'operator new' corresponds to cannot handle
allocations of very large blocks of memory. You need to use 'vmalloc()'
for that; see <linux/vmalloc.h> for the vmalloc() and vfree() calls.
Eddie
Grzegorz Adamski wrote:
> Hi,
> I'm trying to allocate large amount of memory in one of my elements (30
> - 40 MBs). And while everything works fine in user mode, I can't make
> the kernel driver to work. First I tried declaring a static table, later
> I tried allocating memory for the table dynamically, but every time I
> run the router I get the following error messages from the kernel:
>
> kernel: click: starting router thread pid 3258 (d9beb940)
> kernel: Unable to handle kernel NULL pointer dereference at virtual
> address 00000000
> kernel: printing eip:
> kernel: dca45db8
> kernel: *pde = 18f31067
> kernel: *pte = 00000000
> kernel: Oops: 0002
> kernel: CPU: 0
> kernel: EIP: 0010:[<dca45db8>] Not tainted
> kernel: EFLAGS: 00013202
> kernel: eax: 00000000 ebx: 00000000 ecx: 007a1204 edx: 00000004
> kernel: esi: d51c3cc0 edi: 00000001 ebp: c8a3bf3c esp: c8a3bed4
> kernel: ds: 0018 es: 0018 ss: 0018
> kernel: Process kclick (pid: 3258, stackpage=c8a3b000)
> kernel: Stack: 00200096 c0374470 0000000e 00000004 c14de800 20000001
> c8a3bf38 0000000e
> kernel: c0108845 d8b58000 c8a3a000 da556540 c0111d2a c8a3bf3c
> d3fa2ec0 d5e46000
> kernel: 00000000 dc8e8000 00002000 d3fa2ec0 c8a3a000 00000000
> c034dd80 d51c3cc0
> kernel: Call Trace: [<c0108845>] [<c0111d2a>] [<dc9f05df>]
> [<dca3dfed>] [<dca046a0>]
> kernel: [<dca65e0e>] [<c010577e>] [<dca65d90>]
> kernel:
> kernel: Code: c7 00 40 42 0f 00 89 d3 bf 3f 42 0f 00 8d 76 00 83 ec 0c
> 53
>
> Any suggestions as to the cause of the problem? Is there any "special"
> way to allocate memory for the kernel driver module (for now I'm using
> "new").
> Thanks
> Greg Adamski
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
More information about the click
mailing list