Linux Newbie help
 help / color / mirror / Atom feed
* INFO REQ: Clarification of Memory Management
@ 2002-12-06 20:42 Joseph D. Wagner
  2002-12-07 12:41 ` Steven Smith
  2002-12-07 12:58 ` Ken Moffat
  0 siblings, 2 replies; 3+ messages in thread
From: Joseph D. Wagner @ 2002-12-06 20:42 UTC (permalink / raw)
  To: Linux Newbie

I'm a little confused about the way the Linux kernel allocates memory, and
I'm hoping someone could clarify this for me.

Does the __get_free_pages() function eventually call the kmalloc() function?
Or does the kmalloc() function eventually call the __get_free_pages()
function?  Or are these two totally separate functions for different
purposes?

Which of these functions can be called by user process for the purpose of
allocating memory for that user process?

TIA

Joseph Wagner

Flames will be directed to /dev/null

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: INFO REQ: Clarification of Memory Management
  2002-12-06 20:42 INFO REQ: Clarification of Memory Management Joseph D. Wagner
@ 2002-12-07 12:41 ` Steven Smith
  2002-12-07 12:58 ` Ken Moffat
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Smith @ 2002-12-07 12:41 UTC (permalink / raw)
  To: Joseph D. Wagner; +Cc: Linux Newbie

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

> Does the __get_free_pages() function eventually call the kmalloc() function?
> Or does the kmalloc() function eventually call the __get_free_pages()
> function?  Or are these two totally separate functions for different
> purposes?
kmalloc() will eventually call get_free_pages(), but you really
shouldn't ever need to know that, unless you're fiddling with the
implementations of either function.

Note that, even though kmalloc() uses get_free_pages() to allocate
memory, it performs various other bookkeeping tasks, and so the two
types of memory allocations really can't be mixed.

> Which of these functions can be called by user process for the purpose of
> allocating memory for that user process?
Neither; use malloc() in userspace. (Or the new operator if you're using
C++)

Steven Smith,
sos22@cam.ac.uk.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: INFO REQ: Clarification of Memory Management
  2002-12-06 20:42 INFO REQ: Clarification of Memory Management Joseph D. Wagner
  2002-12-07 12:41 ` Steven Smith
@ 2002-12-07 12:58 ` Ken Moffat
  1 sibling, 0 replies; 3+ messages in thread
From: Ken Moffat @ 2002-12-07 12:58 UTC (permalink / raw)
  To: Joseph D. Wagner; +Cc: Linux Newbie

On Fri, 6 Dec 2002, Joseph D. Wagner wrote:

> I'm a little confused about the way the Linux kernel allocates memory, and
> I'm hoping someone could clarify this for me.
> 
> Does the __get_free_pages() function eventually call the kmalloc() function?
> Or does the kmalloc() function eventually call the __get_free_pages()
> function?  Or are these two totally separate functions for different
> purposes?
> 
> Which of these functions can be called by user process for the purpose of
> allocating memory for that user process?
>

 Unless *I'm* totally lost here (which is very possible) you are asking
about functions which are internal to the kernel and not for direct use
from userspace.

Ken
 
> TIA
> 
> Joseph Wagner
> 
> Flames will be directed to /dev/null
> 

-- 
 Out of the darkness a voice spake unto me, saying "smile, things could be
worse". So I smiled, and lo, things became worse.



-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-07 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-06 20:42 INFO REQ: Clarification of Memory Management Joseph D. Wagner
2002-12-07 12:41 ` Steven Smith
2002-12-07 12:58 ` Ken Moffat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox