Allocating large chunks of mem from net-bh
Hi.
I need to allocate (dynamically, as the need arises) large memory areas from the bottom-half context (net-bh, to be exact) in Linux 2.2.x.
kmalloc does not let me allocate as much memory as I need, and vmalloc refuses to work in bottom-half context.
I don't need anything special from the allocated memory, (like physical continuity, or DMA area). I even don't care much how long
it takes to allocate, sice it really does not happen that much often.
Is there any reasonable workaround that would let me solve this problem? Is the situation in 2.4 any better (because my code will have to move on to 2.4 eventually)
Roman
Hi,
Quoted 4 lines · Roman Mitnitski
I need to allocate (dynamically, as the need arises) large memory areas from the bottom-half context (net-bh, to be exact) in Linux 2.2.x.
Quoted 8 lines
kmalloc does not let me allocate as much memory as I need, and vmalloc refuses to work in bottom-half context.
I don't need anything special from the allocated memory, (like physical continuity, or DMA area). I even don't care much how long
it takes to allocate, sice it really does not happen that much often.Is there any reasonable workaround that would let me solve this problem?
Yep. Just call get_free_page() to allocate as many individual pages as you want. I assume that if you don't need physical contiguity, then tracking that set of pages will be fine for you.
kiobufs will provide convenient containers for such sets of pages in 2.4 if you want them, and we're adding things like support functionality for the allocation of arbitrary pages directly into kiobufs for 2.5.
Cheers,
Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/