Skip to contentSkip to conversation

Differences between VM structs

DISCUSSION Kirk True 4 participants 5 messages Sep 8, 2003 Memory management

lore
Share & tools
lore

Kirk True

author
#0 lore raw

Hi all,

I apologize to ask these questions here, but I got no response from the newbies list...

1. Regarding non-contiguous memory allocation, what is the need to

have *virtually* contiguous but not *physically* contiguous pages?
2. UtLVMM says that vmalloc is only used in the kernel for storing swap information - yet it's used by a bunch of drivers which are considered part of the kernel; is it just semantics?
3. Is vmalloc called from user-mode ever?
4. Can you state a succint/brief comparison of the difference between kmalloc, malloc, and vmalloc with usage examples of each?
5. Anonymous memory is memory that is *not* backed by a file, such as the stack or heap space, right? And mmap is called when mapping files into memory, right? The why does mmap deal with anonymous memory (sorry, I'm totally confused here)?

TIA!
Kirk

--
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-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 3 lines · Kirk True

1. Regarding non-contiguous memory allocation, what is the need to have *virtually* contiguous but not *physically* contiguous pages?

Fragmentation happens.

Quoted 3 lines · Kirk True

2. UtLVMM says that vmalloc is only used in the kernel for storing swap information - yet it's used by a bunch of drivers which are considered part of the kernel; is it just semantics?

No, its usage has probably expanded. Drivers are generally not supposed to try to use it directly. It's used for things like vmap() too nowadays.

Quoted 1 line · Kirk True

3. Is vmalloc called from user-mode ever?

No function in the kernel can be called directly from usermode.

Quoted 2 lines · Kirk True

4. Can you state a succint/brief comparison of the difference between kmalloc, malloc, and vmalloc with usage examples of each?

No.

Quoted 4 lines · Kirk True

5. Anonymous memory is memory that is *not* backed by a file, such as the stack or heap space, right? And mmap is called when mapping files into memory, right? The why does mmap deal with anonymous memory (sorry, I'm totally confused here)?

mmap() needed very few extensions to handle the anonymous case.

-- wli
--
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-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 5 lines · William Lee Irwin III
Quoted 2 lines · Kirk True

4. Can you state a succint/brief comparison of the difference between kmalloc, malloc, and vmalloc with usage examples of each?

No.

Maybe this can be helpful:
http://www.xml.com/ldd/chapter/book/ch07.html

Also, check out this link for a description of mmap:
http://www.xml.com/ldd/chapter/book/ch13.html

HTH,
Marco

--
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-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#3 lore raw
In reply to William Lee Irwin III
Quoted 7 lines · Kirk True
Quoted 4 lines

5. Anonymous memory is memory that is *not* backed by a file, such as the stack or heap space, right? And mmap is called when mapping files into memory, right? The why does mmap deal with anonymous memory (sorry, I'm totally confused here)?

mmap() needed very few extensions to handle the anonymous case.

What are these extensions in mmap() that need to handle anonymous pages?? Thanks a lot,
Raghu
--
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-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#4 lore raw
Quoted 1 line · At some point in the past, I wrote:
Quoted 1 line

mmap() needed very few extensions to handle the anonymous case.

Quoted 3 lines · Raghu R. Arur

What are these extensions in mmap() that need to handle anonymous pages?? Thanks a lot,
Raghu

MAP_ANONYMOUS.

-- wli
--
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-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>