Tasklet doubt!
Hello,
How much of memory can be allocated from a tasklet ? [ kmalloc (GFP_ATOMIC) ].
I was able to allocate upto 2.5 MB. But I would like to allocate upto 8MB. Is this possible?
The physical RAM limit is 64 MB. I am running 2.4.7-10 RH 7.2 on i386.
Any suggestions or pointers could be very helpful.
Thank you.
Regards,
Sriram
Quoted 2 lines · Sriram Narasimhan
How much of memory can be allocated from a tasklet ? [ kmalloc (
GFP_ATOMIC) ].
It depends. Asking for 2.5MB of GFP_ATOMIC is a lot.
Perhaps you should use the keventd task queue, which runs in process context and thus sleeps. You can allocate using kmalloc(GFP_KERNEL) or even vmalloc().
Robert Love
Quoted 8 lines · Sriram Narasimhan
Hello,
How much of memory can be allocated from a tasklet ? [ kmalloc (
GFP_ATOMIC) ].I was able to allocate upto 2.5 MB. But I would like to allocate upto 8MB. Is this possible?
Quoted 7 lines
The physical RAM limit is 64 MB. I am running 2.4.7-10 RH 7.2 on i386.
Any suggestions or pointers could be very helpful.
Thank you.
Regards,
Sriram
Maybe you do not have to dynamically allocate memory? You can allocate kmalloc(GFP_KERNEL) during initialization and only free it when you remove a module. That way, it's always there. Such RAM is still okay for interrupts because kernel RAM is never swapped out. You only need GFP_ATOMIC for stuff allocated and freed when the interrupts are off like in ISRs.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips). Why is the government concerned about the lunatic fringe? Think about it.
Quoted 2 lines · Richard B. Johnson
You only need
GFP_ATOMICfor stuff allocated and freed when the interrupts are off like in ISRs.
Not just when the interrupts are off but whenever you cannot sleep.
In most interrupt handlers, interrupts are enabled anyhow (except the current line which is masked out -- but the interrupt system itself is on i.e. sti is set). But they cannot sleep.
Robert Love
Quoted 7 lines · Sriram Narasimhan
Hello,
How much of memory can be allocated from a tasklet ? [ kmalloc (
GFP_ATOMIC) ].I was able to allocate upto 2.5 MB. But I would like to allocate upto 8MB. Is this possible?
You don't want to do that :) You're starving other GFP_ATOMIC processes, and will increase system failures due to lack of memory... even though there may be plenty outside the emergency pools.
One option is to create a background kernel thread (via schedule_task or schedule_work, depending on your kernel version) that allocates memory which your tasklet then takes.
Jeff