Os Linux
Upcoming SlideShare
Loading in...5

Os Linux



OS Linux Case Study

OS Linux Case Study



Total Views
Views on SlideShare
Embed Views



3 Embeds 185

http://www.ustudy.in 169
http://ustudy.in 14
http://www.slideshare.net 2


Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Os Linux Os Linux Presentation Transcript

  • Linux Memory Management
    Case Study : Operating System
    Muhammad Ather Rasool IS/17115/Aut-07/M
    Muhammad Muzammil IS/17104/Aut-07/M
    Muhammad Zahid Majeed IS/17105/Aut-07/M
    Federal Urdu university of Arts, Science & Technology,.
  • Introduction:
    Linux is a UNIX like system that has gained popularity in recent years.
    Development begins in 1991.
    Two different GUI (GNOME & KDE) for Linux.
    In early days, Linux development revolved around central OS kernel.
    Linux kernel:
    Is an entirely original piece of SW developed from scratch by the Linux community.
  • Components of Linux Memory
    Two Components
    Physical memory:
    kernel is loaded in memory
    rest of memory is available for user pages
    Allocate and free physical memory pages
    Virtual Memory:
    Each Linux process on a 32 bit get 3 GB for virtual addressing
    Remaining 1 GB reserve for its Page Table and kernel data
    Frequently accessed pages will be on the "hot" list
    Free pages will be on the "cold" or "free" list
  • Paging
    Page Size: Intel 4 KB, Alpha 8 KB
    Linux kernel is the page allocator
    Each process has its own page table
    The entire page table may take up too much main memory
    Page tables are also stored in virtual memory
    When a process is running, part of its page table is in main memory
  • Fetch Policy
    Linux use a demand paging
    With no preparing
    And no working set concept
    There is a system call in which user can give a hint that a certain page may be needed soon
    Demand paging
  • Linux Memory Management
    Three level page table structure
    Page directory
    Page middle directory
    Page table
  • 7
    Fig 1
  • Placement Policy
    All page frames are grouped into 10 lists of blocks that contain groups of 1, 2, 4, 8, 16, 32,64, 128, 256, and 512 contiguous page frames respectively
    If a small area is needed and only a larger area is available, the larger area is split into two Halves (buddies), possibly repeatedly
    When a block is released, the kernel attempts to merge together pairs of free buddy
    Buddy Algorithm
  • Buddy Algorithm problem
    Linux manages memory using the buddy algorithm. The algorithm leads to the internal fragmentation because if we want 65 page chunks w required 128 page chunks
    For this problem to solve Linux has a second memory allocation which manages smaller units separately
  • Fig 2:Buddy Algorithm
  • Replacement Policy
    Paging system can divided into two sections
    First policy algorithm decides which pages to write out to disk, and when to write them.
    Second the paging mechanism carries out the transfer and pages data back into physical memory when they are needed again.
    Under Linux a clock is used, and every page has an age that is adjusted on each pass of the clock
    Age is measure of youthfulness of pages
  • Clock Algorithm – Another Implementation of Second Chance
    Order pages in circular list
    “Hand” of the clock points to the page to be replaced currently
    When required to evict a page
    If page pointed to has R=0, then evict it
    If R=1, then reset R and move hand forward
    Clock algorithm can be used with NRU (decision based on both R and M bits)
  • Fig 3: Clock Algorithm for replacement
  • Replacement Scope
    Local replacement policy – chooses only among the resident pages of the process that generated page fault in selecting a page to replace
    Global replacement policy – considers all unlocked pages in main memory as candidates for replacement, regardless of which process owns a particular page
    Global policies are more attractive because of the simplicity of implementation and minimal overhead
  • References
    Fig 1:operating System 4th Edition by William Stalling
    Fig 2:Modern operating Systems 2nd Edition by A Tanenbaum.
    Fig 3:operating System 4th Edition by William Stalling
    Modern operating Systems 2nd Edition by A Tanenbaum.
    operating System 4th Edition by William Stalling
  • G4 Group