Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
7Activity

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
Linux Memory

Linux Memory

Ratings: (0)|Views: 10,916|Likes:
Published by Nitin Gupta

More info:

Published by: Nitin Gupta on Jan 17, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

07/21/2012

pdf

text

original

 
 1
INTRODUCTION:
What is Memory Management?
The term
memory management 
refers to the mechanisms implemented by an operating system to provide memory-related services to applications. These services include
virtual memory
(use of ahard disk or other non-RAM storage media to provide additional program memory),
 protected memory
(exclusive access to a region of memory by a process), and
 shared memory
(cooperativeaccess to a region of memory by multiple processes). Linux¶s memory management services are built on a programming foundation that includes a peripheral device called a
 Memory Management Unit (MMU)
. An MMU translates physical memory addresses to
linear addresses
used by the operating system, and requests a
 page fault 
interrupt when the CPU tries to accessmemory that it is not entitled to.
Why do we need it?
"
Compensation for limited address space
"
High cost of main memory, lower cost and greater abundance of secondary storage
"
Static storage evaluation became too difficult...
What does it do?
"
Allows processes that may not be entirely in memory to execute by means of automatic storageallocation.
"
Programs logical memory is seperated from physical memory.
"
Data is swapped between main memory and secondary storage according to some replacementalgorithm (Paging and Segmentation)
 
 2
A
dvantages:± 
"
Program must only be aware of logical memory space, and the OS may maintain multiplelevels of physical memory space.
"
Programs are unable to acces the memory allocated to other processes. To be able to do so aspecial request must be made to the OS.
Disadvantages:
"
Mapper function must be very fast.
"
Extra record keeping (Page Table, Interted Page Table)
 
 3
P
age Directories and
P
age Tables:
The fundamental unit of memory under Linux is the
 page
, a nonoverlapping region of contiguous memory. All available physical memory is organized into pages near the end of thekernel¶s boot process, and pages are doled out to and revoked from processes by the kernel¶smemory management algorithms at runtime. Linux uses 4k-byte pages for most processors.Under Linux, each process has an associated
 page directory
and
 page table
, data structures thatkeeptrack of which memory pages are being used by the process, and what their virtual and physical addresses are. When a process needs more memory, an unused page is taken from aglobal list called pgdata_list, and added to the process¶s page table. When the process exits, its pages are returned to pgdata_list.
Mapping a
P
age:
When a memory page is given to a process, the page is said to have been
mapped 
to that process.To map a page to a process, the MMU¶s configuration is adjusted so that the physical address of that page (the number that actually goes out on the processor¶s address lines) is translated to the
linear 
address needed by the process. Memory pages are usually scattered around in memory; thelinear-to-physical mapping provided by the MMU makes the pages appear to have contiguousaddresses to the operating system.

Activity (7)

You've already reviewed this. Edit your review.
1 hundred reads
陳正元 liked this
陳正元 liked this
陳正元 liked this
陳正元 liked this
陳正元 liked this
Dhruv Chawda liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->