Re: kmalloc questions

From: Jeff Garzik (jgarzik@mandrakesoft.mandrakesoft.com)
Date: Tue Oct 03 2000 - 03:49:56 EST


On Tue, 3 Oct 2000, Justin Schoeman wrote:

> Hi everybody,
>
> A bit of a newbie question. A while ago I was looking through the
> available web resources for information on the various malloc()'s for
> drivers.
>
> The one I did find (I just can't remember what it was called) stated
> that for kmalloc(), the size must be (PAGE_SIZE-x)*2^i, where x is an
> overhead required for each page (I think this was 16 bytes, but I can't
> remember). Browsing through the 2.2.16 kernel, it seems that the
> required overhead is now 0. Is this correct? If I kmalloc(PAGE_SIZE),
> will it only use one page of physical memory? Is this memory fixed at
> the same physical address, or could it be moved if requests for large
> contiguous memory areas come in?

cat /proc/slabinfo to see the sizes of the slab caches from which
kmalloc'd memory is obtained.

> As a side note, what would be the correct way to get the page number of
> a kmalloc()ed page?

address % PAGE_SIZE ?

        Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Oct 07 2000 - 21:00:11 EST