Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-06-2008, 12:30 AM   #1
LQ Newbie
Registered: Jan 2008
Posts: 8

Rep: Reputation: 0
Physical memory request to Linux Kernel


I am running a multithreaded program for which I'm in need of acquiring some physical memory from linux kernel.

malloc() gives virtually memory mapped memory and then MMU translates that into physical memory...

Can someone show me the way to allocate Physical memory directly on linux? (without routing through virtual)

Old 02-06-2008, 08:11 AM   #2
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,894

Rep: Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358
You can't do that.

All of the memory seen by any user process is virtual memory. And this is actually what you want.

The illusion that is presented to your program is that memory is big and that memory is "all yours." Behind the scenes, the kernel makes sure that this illusion is maintained, separately, for each and every user-program. It uses physical memory and disk-space to achieve that, and you can be assured that it will do that in the most-optimal manner possible under prevailing conditions.
Old 02-06-2008, 11:31 PM   #3
LQ Newbie
Registered: Jan 2008
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for the reply...

I had the doubt that it may not be possible... but now the question is how do I make sure that my application 'thinks' that it has got its own memory area...

will "mmap" or "mlock" help me in this?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Examples about Logical,Linear and Physical address in Linux Memory Addressing muralis Linux - Kernel 5 08-04-2007 08:18 PM
how can i run 3 linux virtual machines without going out of physical memory asterik123 General 7 04-14-2007 05:51 PM
Total system physical memory information in linux bhavishya_goel Linux - Kernel 2 08-15-2006 01:22 PM
feature request: high memory kernel (up to 4GB) as default patfins Slackware 30 04-30-2006 09:09 PM

All times are GMT -5. The time now is 01:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration