lkml.org 
[lkml]   [2000]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kmalloc questions


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/

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.027 / U:7.476 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site