I need (want) to allocate block of memory for POSIX timers in about page
size chuncks. Currently I am using kmalloc() to allocate a page at a
time. I don't want to have to worry about mapping/unmapping etc. I
just what to go about using the memory. It will be used for timers so
it must not be paged.
Is kmalloc() the best interface to use or is there a better one?
--
George [email protected]
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Real time sched: http://sourceforge.net/projects/rtsched/
> size chuncks. Currently I am using kmalloc() to allocate a page at a
> time. I don't want to have to worry about mapping/unmapping etc. I
Use get_free_page() to get page sized chunks
Alan Cox wrote:
>
> > size chuncks. Currently I am using kmalloc() to allocate a page at a
> > time. I don't want to have to worry about mapping/unmapping etc. I
>
> Use get_free_page() to get page sized chunks
What about __get_free_page() ? I don't need or want the clear page
(performance issues).
And then to return the page, free_page() ?
--
George [email protected]
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Real time sched: http://sourceforge.net/projects/rtsched/
On Wed, 21 Nov 2001, george anzinger wrote:
> Alan Cox wrote:
> >
> > > size chuncks. Currently I am using kmalloc() to allocate a page at a
> > > time. I don't want to have to worry about mapping/unmapping etc. I
> >
> > Use get_free_page() to get page sized chunks
>
> What about __get_free_page() ? I don't need or want the clear page
> (performance issues).
get_free_page() doesn't clear the page afaics.
regards,
Rik
--
DMCA, SSSCA, W3C? Who cares? http://thefreeworld.net/
http://www.surriel.com/ http://distro.conectiva.com/
Rik van Riel wrote:
>
> On Wed, 21 Nov 2001, george anzinger wrote:
> > Alan Cox wrote:
> > >
> > > > size chuncks. Currently I am using kmalloc() to allocate a page at a
> > > > time. I don't want to have to worry about mapping/unmapping etc. I
> > >
> > > Use get_free_page() to get page sized chunks
> >
> > What about __get_free_page() ? I don't need or want the clear page
> > (performance issues).
>
> get_free_page() doesn't clear the page afaics.
>
In mm.h (2.4.13 kernel)....
#define __get_free_page(gfp_mask) \
__get_free_pages((gfp_mask),0)
#define __get_dma_pages(gfp_mask, order) \
__get_free_pages((gfp_mask) | GFP_DMA,(order))
/*
* The old interface name will be removed in 2.5:
*/
#define get_free_page get_zeroed_page
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Where as __get_free_page() does not zero. I know this is an old kernel,
but...
What am I missing?
--
George [email protected]
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Real time sched: http://sourceforge.net/projects/rtsched/
On Wed, 21 Nov 2001, george anzinger wrote:
> /*
> * The old interface name will be removed in 2.5:
> */
> #define get_free_page get_zeroed_page
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Where as __get_free_page() does not zero. I know this is an old
> kernel, but...
Urghhh, you're right.
Rik
--
DMCA, SSSCA, W3C? Who cares? http://thefreeworld.net/
http://www.surriel.com/ http://distro.conectiva.com/