* Tasklet doubt!
@ 2003-04-11 16:19 Sriram Narasimhan
2003-04-11 16:31 ` Robert Love
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Sriram Narasimhan @ 2003-04-11 16:19 UTC (permalink / raw)
To: linux-kernel
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Tasklet doubt!
2003-04-11 16:19 Tasklet doubt! Sriram Narasimhan
@ 2003-04-11 16:31 ` Robert Love
2003-04-11 16:45 ` Jeff Garzik
2003-04-11 16:46 ` Richard B. Johnson
2 siblings, 0 replies; 5+ messages in thread
From: Robert Love @ 2003-04-11 16:31 UTC (permalink / raw)
To: Sriram Narasimhan; +Cc: linux-kernel
On Fri, 2003-04-11 at 12:19, Sriram Narasimhan wrote:
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Tasklet doubt!
2003-04-11 16:19 Tasklet doubt! Sriram Narasimhan
2003-04-11 16:31 ` Robert Love
@ 2003-04-11 16:45 ` Jeff Garzik
2003-04-11 16:46 ` Richard B. Johnson
2 siblings, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2003-04-11 16:45 UTC (permalink / raw)
To: Sriram Narasimhan; +Cc: linux-kernel
On Fri, Apr 11, 2003 at 09:49:01PM +0530, Sriram Narasimhan wrote:
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Tasklet doubt!
2003-04-11 16:19 Tasklet doubt! Sriram Narasimhan
2003-04-11 16:31 ` Robert Love
2003-04-11 16:45 ` Jeff Garzik
@ 2003-04-11 16:46 ` Richard B. Johnson
2003-04-11 16:48 ` Robert Love
2 siblings, 1 reply; 5+ messages in thread
From: Richard B. Johnson @ 2003-04-11 16:46 UTC (permalink / raw)
To: Sriram Narasimhan; +Cc: linux-kernel
On Fri, 11 Apr 2003, Sriram Narasimhan wrote:
> 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
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Tasklet doubt!
2003-04-11 16:46 ` Richard B. Johnson
@ 2003-04-11 16:48 ` Robert Love
0 siblings, 0 replies; 5+ messages in thread
From: Robert Love @ 2003-04-11 16:48 UTC (permalink / raw)
To: root; +Cc: Sriram Narasimhan, linux-kernel
On Fri, 2003-04-11 at 12:46, Richard B. Johnson wrote:
> You only need GFP_ATOMIC for 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-04-11 16:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-11 16:19 Tasklet doubt! Sriram Narasimhan
2003-04-11 16:31 ` Robert Love
2003-04-11 16:45 ` Jeff Garzik
2003-04-11 16:46 ` Richard B. Johnson
2003-04-11 16:48 ` Robert Love
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox