LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
Physical memory request to Linux Kernel


Hello,

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)

Thanks,
Tanmay
 
Old 02-06-2008, 08:11 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
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
tanmay.anjaria
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?
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:53 PM.

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