& Data Processing 2. Exercise 3: Memory Management. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen

Size: px
Start display at page:

Download "& Data Processing 2. Exercise 3: Memory Management. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen"

Transcription

1 Folie a: Name & Data Processing 2 3: Memory Management Dipl.-Ing. Bogdan Marin Fakultät für Ingenieurwissenschaften Abteilung Elektro-und Informationstechnik -Technische Informatik-

2 Objectives Memory Management Virtual Memory Concepts Paging and Segmentation

3 Memory Management Data Structures How does OS keep track of unused and used blocks? Bit Maps Memory divided into small allocation units (say 4 bytes) Special bit map, one bit assigned for each unit bit per 4 bytes (32 bits) bit map occupies (wastes?) /33 of total memory Each bit provides the status of the corresponding memory unit if unit is free ; if unit is used Simple data structure to maintain but expensive to use for memory allocation E.g. 4 free bytes are needed search for a run of consecutive s in map! Linked Lists Dynamic data structure with an entry for each memory block P for used partition, H for unused block Start address of partition, Length of partition Pointer to next entry Need to detect and merge adjacent H entries into a single H entry expensive Best-fit placement requires examining the complete list whereas first-fit only requires finding the first H entry which is big enough first-fit much quicker Alternative is to keep list sorted in increasing/decreasing partition length expensive

4 Memory Management Data Structures Fig. Memory Structure a. Memory structure b. Bit map c. Linked list Fig. Linked list combinations mergingfor (a) requires changing entry 2 from P to H (b) requires merging entries 2 and 3 into a single H ( list is one entry shorter) (c) requires merging entries and 2 into a single H (list is one entry shorter) (d) requires merging entries,2 and 3 into a single H (list is two entries shorter)

5 Memory Allocation The following methods applies for variable partitioning of memory space. Best fit : allocate smallest hole that fit Worst fit : allocate the largest hole First fit : allocate the first hole that fit from the beginning Next fit : allocate the first hole that fit since last operation

6 Memory Allocation:. Consider a swaping system in which memory consists of the following hole sizes in memory order: H H H2 H3 H4 H5 H6 H7 K 4KB 2KB 8KB 7KB 9KB 2KB 5KB Which hole is taken for a succesive segment request of a) 2 KB b) KB c) 9KB for first fit? Repeat the questions for best fit, worst fit and next fit. First Fit (first hole that fit) a) H2 b) H c) H3 Best Fit (smalest hole that fit) a) H6 b) H c) H5 Worst Fit (largest hole) a) H2 b) H3 c) H7 Next Fit (first hole that fit since last op) a) H2 b) H3 c) H5

7 Memory Allocation: 2. Explain how the following algorithms work in allocating memory:. First fit. 2. Best fit. 3. Worst fit. Given free memory blocks of K, 5K, 2K, 3K and 6K (in this order on a linked list), how would each of the above algorithms place requests for 22K, 47K, 2K and 426K (requested in that order)? Which algorithm makes best use of memory? Initially: Memory Allocation: Conclusion: Best Fit uses memory best

8 Buddy System () Memory blocks are available in size of 2 k where S <= k <= L, and 2 S : Smallest size of block that can be allocated 2 L : Largest size of block that can be allocated : Given a memory consisting of a single continous piece of 64 pages, allocate space for a 8-page request. Allocate another 8 page request. Allocate 4 page request. Release the allocated space for the second 8- page request. Release the allocated space for the first 8-page request. 64

9 Buddy System (2) 64 Too big, divide the 64-page chunk into half Too big, divide a 32-page chunk into half Too big, divide a 6-page chunk into half Just right! 8-page chunk fits in

10 Buddy System (3) Request for another 8-page chunk Just right! Second 8-page chunk fits in Qn : Allocate space for a 4-page request 6-page chunk is too big, half it page buddy is still too big each, half it again Just right! 4-page request fits in

11 Buddy System (4) Release space for the second 8-page request page chunk released Qn : Release space for the first 8-page request After the second 8-page chunk released Two 8-page chunk buddy merge to get 6-page chunk back Only buddies can merge!

12 Virtual Memory (VM) concepts: Paging Physical Address (PA) the address seen by the physical memory address range limited by the amount of physical memory that is available 4MB RAM 22-bit physical address address range divided into small uniform chunks called page frames typically 4K to 32K Virtual Address (VA) the address used by the process address range limited by the CPU address range 32-bit CPU 32-bit virtual address 4 GB of virtual memory address range divided into small uniform chunks called pages page size must be the same as the page frame size VA to PA mapping Process memory consists of a collection of contiguous pages which map to possibly non-contiguous page frames Process making a VA reference must be mapped to a PA reference Paging not swapping Instead of swapping whole process to disk, process pages are paged to disk

13 VA to MA mapping: Page Tables VA = [ p d ] and PA = [ f d ] PA = f-bit frame number + d-bit offset 2 f+d bit PA VA = p-bit page table index + d-bit page offset 2 p+d bit VA Usually p >> f since VA range >> PA range p-bits used to retrieve corresponding f-bit frame from per process page table One page table per process Address of page table entry = Page Table Ptr. + p 2 p entries in page table Typical page table entry: [P M R rwx access f-bit frame number] P = -bit Present bit ( if page in memory, if page not in memory) M = -bit Modified bit ( if page has been modified ( dirty ), if not) R = -bit Referenced bit ( if page has been referenced recently, if not) If P = page not in memory (on swap disk) page fault OS enters page fault handling routine is there a free page? If not page out a page according to page replacement strategy (R and M bits used to determine best page to evict R= and M= is a good candidate) read in required page from swap disk (page in) and modify page table accordingly restart instruction

14 VA to PA address translation system Address translation in a paging system

15 VA to PA example VA = [page address offset ] VA = [p d] = [8 2] 2 8 = 256 virtual pages P (present bit) M (modification bit) VA No. of virtual page 2 P M... If P= : Hit = Read If P=: take available page with M= and overwrite with reloaded page If A= and all available pages show M= ) Take content of a page in main memory and restore secondary page 2) Reload page from second memory into free page No. of physical page PA...

16 VA to PA (/2) A computer with a 6 bit address, a 4KB page size, has 64K of VA and 32K of PA. The page table for this computer is given in the following figure. Assuming that at a given time the running process issues the following instruction: MOV REG, 896 Which will be the outcome of the Memory Management Unit mapping? Page table Present bit

17 VA to PA (2/2) VA =[ p d ] and PA =[f d ] 4K pages d=2 (since 2 2 =496) 64K of VA p+d=6 (since 2 6 =65536) p=4 32K of PA f+d=5 (since 2 5 =32768) f=3 since 2 p =2 4 =6 6 entry page table is needed, where each entry = [3 bit frame address P ] Process issues instruction MOV REG, 896 VA= 896 VA= [p= d= ] p=2 entry 2 from page table is refered Entry 2 has P= and f= PA = [f= d= ] = 2458 MMU mapping produces: MOV REG, 2458

18 Multi-level Page Tables Situation: Process is assumed to have access to complete VA range Page table is too big! e.g. 32-bit CPU and 4K pages p = = million entry page table entries at least byte MB per page table per process! Multi-level Page Tables 2-level page tables VA = [ p q d ] and PA = [ f d ] p-bits to index top-level page table returns pointer to 2 nd -level page table q-bits to index 2 nd -level page table returns f-bit page frame 2 p entries in top-level page table each entry spans 2 q+d of VA memory top-level page table entry: [ Pointer to 2 nd -level page table ] 2 q entries in 2 nd -level page table each entry spans 2 d of VA memory ( page) 2 nd -level page table entry: [P M R f-bit frame number] there are 2 p x (2 nd -level page tables)! BUT not all of these are needed Adv.: Only keep those lower-level page tables that are needed Disadv.: n-level page tables require n memory references to perform translation!

19 Multi-level Page Tables 2 Level Page Table p=, q=, d=2 (VA=[ p q d ])

20 Multi-level Page Tables A computer with 32 bit address uses a 2 level page table. Virtual addresses are split into 9-bit top level page table field and -bit second level page field, and an offset. How large are the pages and how many are there in the address space? VA = [ p q d ] and PA = [ f d ] 9-bit top level page table field p=9 -bit second level page field q= 32 bit address p+q+d=32 d= 32 p q = 32 9 =2 Page is 2 d = 2 2 = 4K page Number of bits for the virtual page is: p + q = 2 Number of virtual pages is 2 2

21 Pure Segmentation SA = [ s d ] and PA = [ Base + d ] s-bit used to reference entry in segment table 2s entries in segment table; Segment table entry = [ length base ] Length (limit): specifies the maximum size of the segment Base: start address of segment in main memory If (d > length) then segmentation fault else PA = (Base + d) Address translation in a segmentation system

22 Segmentation with Paging Segmentation with Paging the best of both worlds Segment table contains pointer to page table for data within segment Length of segment must be in integer number of pages No need for length specification use page fault mechanism

23 Fragmentation Analysis (holes are represented by empty boxes) Definitions: m = bytes of the total memory s= average size of segments ks (k>=) average size of holes f= % of total of memory unused = (ammount of memory used by unused segments)/(total memory) 5% Rule (Knuth) n= numebr of segments h= number of holes h=n/2 (on average if there are n segments we expect (n/2) holes) Analysis of the free space: Conclusions: If the holes are half size of segments (k=.5) f = 2% If holes are quarter size (k=.25) f=% Smaller hole sizes more efficient memory utilisation

24 Page Replacement Policy

25 Page Replacement Policy: LRU

26 Page Replacement Structures

27 Second-Chance FIFO Policy

28 Clock Policy

29 NRU and NFU Policy

30 Page Replacement Policy: A computer has four page frames. The time of loading, time of last access and the R and M bits for each page are as shown bellow (the times are in clock ticks): Page Loaded Last Ref. R M a) Which page will NRU replace? b) Which page will FIFO replace? c) Which page will LRU replace? d) Which page will Second Chance replace? a) R=, M= (class = best page to be replaced by NRU) in above table page 2 will be replaced by NRU b) FIFO (First In First Out) in above table page 3 will be replaced by FIFO c) LRU replaces the page with the oldest last access record in above table page will be replaced by LRU d) Second Chance: check the tail of the queue (oldest page) if R= then reset R and move page to head of queue otherwise remove page page 3 has R=, algorithm resets the R bit and moves page 3 at the head of the list and search again the new tail of the list. Page 2 is the new tail of the list, R= therefore page 2 will be replaced by Second Chance

31 Next Week: Cache.. Check the webpage for exercises! EXAM: Tu. 25/7/26 LD Sporthalle 3.3

Virtual Memory Paging

Virtual Memory Paging COS 318: Operating Systems Virtual Memory Paging Kai Li Computer Science Department Princeton University (http://www.cs.princeton.edu/courses/cos318/) Today s Topics Paging mechanism Page replacement algorithms

More information

Chapter 7 Memory Management

Chapter 7 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 7 Memory Management Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall Memory Management Subdividing

More information

Operating Systems, 6 th ed. Test Bank Chapter 7

Operating Systems, 6 th ed. Test Bank Chapter 7 True / False Questions: Chapter 7 Memory Management 1. T / F In a multiprogramming system, main memory is divided into multiple sections: one for the operating system (resident monitor, kernel) and one

More information

Computer Architecture

Computer Architecture Computer Architecture Slide Sets WS 2013/2014 Prof. Dr. Uwe Brinkschulte M.Sc. Benjamin Betting Part 11 Memory Management Computer Architecture Part 11 page 1 of 44 Prof. Dr. Uwe Brinkschulte, M.Sc. Benjamin

More information

Memory Management Outline. Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging

Memory Management Outline. Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging Memory Management Outline Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging 1 Background Memory is a large array of bytes memory and registers are only storage CPU can

More information

Lecture 17: Virtual Memory II. Goals of virtual memory

Lecture 17: Virtual Memory II. Goals of virtual memory Lecture 17: Virtual Memory II Last Lecture: Introduction to virtual memory Today Review and continue virtual memory discussion Lecture 17 1 Goals of virtual memory Make it appear as if each process has:

More information

OPERATING SYSTEM - MEMORY MANAGEMENT

OPERATING SYSTEM - MEMORY MANAGEMENT OPERATING SYSTEM - MEMORY MANAGEMENT http://www.tutorialspoint.com/operating_system/os_memory_management.htm Copyright tutorialspoint.com Memory management is the functionality of an operating system which

More information

Virtual vs Physical Addresses

Virtual vs Physical Addresses Virtual vs Physical Addresses Physical addresses refer to hardware addresses of physical memory. Virtual addresses refer to the virtual store viewed by the process. virtual addresses might be the same

More information

& Data Processing 2. Exercise 2: File Systems. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen

& Data Processing 2. Exercise 2: File Systems. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen Folie a: Name & Data Processing 2 2: File Systems Dipl.-Ing. Bogdan Marin Fakultät für Ingenieurwissenschaften Abteilung Elektro-und Informationstechnik -Technische Informatik- Objectives File System Concept

More information

OPERATING SYSTEM - VIRTUAL MEMORY

OPERATING SYSTEM - VIRTUAL MEMORY OPERATING SYSTEM - VIRTUAL MEMORY http://www.tutorialspoint.com/operating_system/os_virtual_memory.htm Copyright tutorialspoint.com A computer can address more memory than the amount physically installed

More information

Chapter 7 Memory Management

Chapter 7 Memory Management Operating Systems: Internals and Design Principles Chapter 7 Memory Management Eighth Edition William Stallings Frame Page Segment A fixed-length block of main memory. A fixed-length block of data that

More information

Chapter 12. Paging an Virtual Memory Systems

Chapter 12. Paging an Virtual Memory Systems Chapter 12 Paging an Virtual Memory Systems Paging & Virtual Memory Virtual Memory - giving the illusion of more physical memory than there really is (via demand paging) Pure Paging - The total program

More information

Operating Systems. Virtual Memory

Operating Systems. Virtual Memory Operating Systems Virtual Memory Virtual Memory Topics. Memory Hierarchy. Why Virtual Memory. Virtual Memory Issues. Virtual Memory Solutions. Locality of Reference. Virtual Memory with Segmentation. Page

More information

Memory unit sees only the addresses, and not how they are generated (instruction counter, indexing, direct)

Memory unit sees only the addresses, and not how they are generated (instruction counter, indexing, direct) Memory Management 55 Memory Management Multitasking without memory management is like having a party in a closet. Charles Petzold. Programming Windows 3.1 Programs expand to fill the memory that holds

More information

CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont.

CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont. CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont. Instructors: Vladimir Stojanovic & Nicholas Weaver http://inst.eecs.berkeley.edu/~cs61c/ 1 Bare 5-Stage Pipeline Physical Address PC Inst.

More information

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems 1 Any modern computer system will incorporate (at least) two levels of storage: primary storage: typical capacity cost per MB $3. typical access time burst transfer rate?? secondary storage: typical capacity

More information

Memory management basics (1) Requirements (1) Objectives. Operating Systems Part of E1.9 - Principles of Computers and Software Engineering

Memory management basics (1) Requirements (1) Objectives. Operating Systems Part of E1.9 - Principles of Computers and Software Engineering Memory management basics (1) Requirements (1) Operating Systems Part of E1.9 - Principles of Computers and Software Engineering Lecture 7: Memory Management I Memory management intends to satisfy the following

More information

The Deadlock Problem. Deadlocks. Deadlocks. Bridge Crossing Example

The Deadlock Problem. Deadlocks. Deadlocks. Bridge Crossing Example The Deadlock Problem Deadlocks A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. Example System has 2 tape drives. P 1 and P 2 each

More information

OPERATING SYSTEMS MEMORY MANAGEMENT

OPERATING SYSTEMS MEMORY MANAGEMENT OPERATING SYSTEMS MEMORY MANAGEMENT Jerry Breecher 8: Memory Management 1 OPERATING SYSTEM Memory Management What Is In This Chapter? Just as processes share the CPU, they also share physical memory. This

More information

Memory Management 1. Memory Management. Multitasking without memory management is like having a party in a closet.

Memory Management 1. Memory Management. Multitasking without memory management is like having a party in a closet. Memory Management 1 Memory Management Multitasking without memory management is like having a party in a closet. Charles Petzold. Programming Windows 3.1 Programs expand to fill the memory that holds them.

More information

System Software Prof. Dr. H. Mössenböck

System Software Prof. Dr. H. Mössenböck System Software Prof. Dr. H. Mössenböck 1. Memory Management 2. Garbage Collection 3. Linkers and Loaders 4. Debuggers 5. Text Editors Marks obtained by end-term exam http://ssw.jku.at/misc/ssw/ 1. Memory

More information

Virtual Memory. Virtual Memory. Paging. CSE 380 Computer Operating Systems. Paging (1)

Virtual Memory. Virtual Memory. Paging. CSE 380 Computer Operating Systems. Paging (1) Virtual Memory CSE 380 Computer Operating Systems Instructor: Insup Lee University of Pennsylvania Fall 2003 Lecture Note: Virtual Memory (revised version) 1 Recall: memory allocation with variable partitions

More information

Board Notes on Virtual Memory

Board Notes on Virtual Memory Board Notes on Virtual Memory Part A: Why Virtual Memory? - Letʼs user program size exceed the size of the physical address space - Supports protection o Donʼt know which program might share memory at

More information

COS 318: Operating Systems. Virtual Memory and Address Translation

COS 318: Operating Systems. Virtual Memory and Address Translation COS 318: Operating Systems Virtual Memory and Address Translation Today s Topics Midterm Results Virtual Memory Virtualization Protection Address Translation Base and bound Segmentation Paging Translation

More information

Memory management. Chapter 4: Memory Management. Memory hierarchy. In an ideal world. Basic memory management. Fixed partitions: multiple programs

Memory management. Chapter 4: Memory Management. Memory hierarchy. In an ideal world. Basic memory management. Fixed partitions: multiple programs Memory management Chater : Memory Management Part : Mechanisms for Managing Memory asic management Swaing Virtual Page relacement algorithms Modeling age relacement algorithms Design issues for aging systems

More information

Segmentation and Fragmentation

Segmentation and Fragmentation Segmentation and Fragmentation Operating System Design MOSIG 1 Instructor: Arnaud Legrand Class Assistants: Benjamin Negrevergne, Sascha Hunold September 16, 2010 A. Legrand Segmentation and Fragmentation

More information

The Classical Architecture. Storage 1 / 36

The Classical Architecture. Storage 1 / 36 1 / 36 The Problem Application Data? Filesystem Logical Drive Physical Drive 2 / 36 Requirements There are different classes of requirements: Data Independence application is shielded from physical storage

More information

Storage in Database Systems. CMPSCI 445 Fall 2010

Storage in Database Systems. CMPSCI 445 Fall 2010 Storage in Database Systems CMPSCI 445 Fall 2010 1 Storage Topics Architecture and Overview Disks Buffer management Files of records 2 DBMS Architecture Query Parser Query Rewriter Query Optimizer Query

More information

Buffer Management 5. Buffer Management

Buffer Management 5. Buffer Management 5 Buffer Management Copyright 2004, Binnur Kurt A journey of a byte Buffer Management Content 156 A journey of a byte Suppose in our program we wrote: outfile

More information

Virtual Memory Behavior in Red Hat Linux Advanced Server 2.1

Virtual Memory Behavior in Red Hat Linux Advanced Server 2.1 Virtual Memory Behavior in Red Hat Linux Advanced Server 2.1 Bob Matthews Red Hat, Inc. Kernel Development Team Norm Murray Red Hat, Inc. Client Engineering Team This is an explanation of the virtual memory

More information

Disk Space Management Methods

Disk Space Management Methods Volume 1, Issue 1, June 2013 International Journal of Advance Research in Computer Science and Management Studies Research Paper Available online at: www.ijarcsms.com Disk Space Management Methods Ramakrishna

More information

W4118 Operating Systems. Instructor: Junfeng Yang

W4118 Operating Systems. Instructor: Junfeng Yang W4118 Operating Systems Instructor: Junfeng Yang Outline x86 segmentation and paging hardware Linux address space translation Copy-on-write Linux page replacement algorithm Linux dynamic memory allocation

More information

Memory Management CS 217. Two programs can t control all of memory simultaneously

Memory Management CS 217. Two programs can t control all of memory simultaneously Memory Management CS 217 Memory Management Problem 1: Two programs can t control all of memory simultaneously Problem 2: One program shouldn t be allowed to access/change the memory of another program

More information

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems Lecture Outline Operating Systems Objectives Describe the functions and layers of an operating system List the resources allocated by the operating system and describe the allocation process Explain how

More information

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing How is it possible for each process to have contiguous addresses and so many of them? Computer Systems Organization (Spring ) CSCI-UA, Section Instructor: Joanna Klukowska Teaching Assistants: Paige Connelly

More information

HY345 Operating Systems

HY345 Operating Systems HY345 Operating Systems Recitation 2 - Memory Management Solutions Panagiotis Papadopoulos panpap@csd.uoc.gr Problem 7 Consider the following C program: int X[N]; int step = M; //M is some predefined constant

More information

Operating Systems CSE 410, Spring 2004. File Management. Stephen Wagner Michigan State University

Operating Systems CSE 410, Spring 2004. File Management. Stephen Wagner Michigan State University Operating Systems CSE 410, Spring 2004 File Management Stephen Wagner Michigan State University File Management File management system has traditionally been considered part of the operating system. Applications

More information

File Management. Chapter 12

File Management. Chapter 12 Chapter 12 File Management File is the basic element of most of the applications, since the input to an application, as well as its output, is usually a file. They also typically outlive the execution

More information

KVM & Memory Management Updates

KVM & Memory Management Updates KVM & Memory Management Updates KVM Forum 2012 Rik van Riel Red Hat, Inc. KVM & Memory Management Updates EPT Accessed & Dirty Bits 1GB hugepages Balloon vs. Transparent Huge Pages Automatic NUMA Placement

More information

Intel P6 Systemprogrammering 2007 Föreläsning 5 P6/Linux Memory System

Intel P6 Systemprogrammering 2007 Föreläsning 5 P6/Linux Memory System Intel P6 Systemprogrammering 07 Föreläsning 5 P6/Linux ory System Topics P6 address translation Linux memory management Linux page fault handling memory mapping Internal Designation for Successor to Pentium

More information

COS 318: Operating Systems

COS 318: Operating Systems COS 318: Operating Systems File Performance and Reliability Andy Bavier Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall10/cos318/ Topics File buffer cache

More information

Chapter 10: Virtual Memory. Lesson 03: Page tables and address translation process using page tables

Chapter 10: Virtual Memory. Lesson 03: Page tables and address translation process using page tables Chapter 10: Virtual Memory Lesson 03: Page tables and address translation process using page tables Objective Understand page tables Learn the offset fields in the virtual and physical addresses Understand

More information

File System Management

File System Management Lecture 7: Storage Management File System Management Contents Non volatile memory Tape, HDD, SSD Files & File System Interface Directories & their Organization File System Implementation Disk Space Allocation

More information

Chapter 11 I/O Management and Disk Scheduling

Chapter 11 I/O Management and Disk Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ 2008, Prentice Hall I/O Devices Roadmap Organization

More information

Storing Data: Disks and Files. Disks and Files. Why Not Store Everything in Main Memory? Chapter 7

Storing Data: Disks and Files. Disks and Files. Why Not Store Everything in Main Memory? Chapter 7 Storing : Disks and Files Chapter 7 Yea, from the table of my memory I ll wipe away all trivial fond records. -- Shakespeare, Hamlet base Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Disks and

More information

The Linux Virtual Filesystem

The Linux Virtual Filesystem Lecture Overview Linux filesystem Linux virtual filesystem (VFS) overview Common file model Superblock, inode, file, dentry Object-oriented Ext2 filesystem Disk data structures Superblock, block group,

More information

Data Storage - I: Memory Hierarchies & Disks

Data Storage - I: Memory Hierarchies & Disks Data Storage - I: Memory Hierarchies & Disks W7-C, Spring 2005 Updated by M. Naci Akkøk, 27.02.2004 and 23.02.2005, based upon slides by Pål Halvorsen, 11.3.2002. Contains slides from: Hector Garcia-Molina,

More information

Page Replacement for Write References in NAND Flash Based Virtual Memory Systems

Page Replacement for Write References in NAND Flash Based Virtual Memory Systems Regular Paper Journal of Computing Science and Engineering, Vol. 8, No. 3, September 2014, pp. 157-172 Page Replacement for Write References in NAND Flash Based Virtual Memory Systems Hyejeong Lee and

More information

Treating Memory Management and Filesystems as One Topic

Treating Memory Management and Filesystems as One Topic Department Informatik Technical Reports / ISSN 2191-5008 Hans-Georg Eßer Treating Memory Management and Filesystems as One Topic Technical Report CS-2011-04 April 2011 Please cite as: Hans-Georg Eßer,

More information

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2) RTOSes Part I Christopher Kenna September 24, 2010 POSIX Portable Operating System for UnIX Application portability at source-code level POSIX Family formally known as IEEE 1003 Originally 17 separate

More information

CS162 Operating Systems and Systems Programming Lecture 15. Page Allocation and Replacement

CS162 Operating Systems and Systems Programming Lecture 15. Page Allocation and Replacement S6 Operating Systems and Systems Programming Lecture 5 Page llocation and Replacement October 5, 00 Prof. John Kubiatowicz http://inst.eecs.berkeley.edu/~cs6 Review: emand Paging Mechanisms PT helps us

More information

W4118: segmentation and paging. Instructor: Junfeng Yang

W4118: segmentation and paging. Instructor: Junfeng Yang W4118: segmentation and paging Instructor: Junfeng Yang Outline Memory management goals Segmentation Paging TLB 1 Uni- v.s. multi-programming Simple uniprogramming with a single segment per process Uniprogramming

More information

How To Write A Page Table

How To Write A Page Table 12 Paging: Introduction Remember our goal: to virtualize memory. Segmentation (a generalization of dynamic relocation) helped us do this, but has some problems; in particular, managing free space becomes

More information

4.2: Multimedia File Systems Traditional File Systems. Multimedia File Systems. Multimedia File Systems. Disk Scheduling

4.2: Multimedia File Systems Traditional File Systems. Multimedia File Systems. Multimedia File Systems. Disk Scheduling Chapter 2: Representation of Multimedia Data Chapter 3: Multimedia Systems Communication Aspects and Services Chapter 4: Multimedia Systems Storage Aspects Optical Storage Media Multimedia File Systems

More information

Two Parts. Filesystem Interface. Filesystem design. Interface the user sees. Implementing the interface

Two Parts. Filesystem Interface. Filesystem design. Interface the user sees. Implementing the interface File Management Two Parts Filesystem Interface Interface the user sees Organization of the files as seen by the user Operations defined on files Properties that can be read/modified Filesystem design Implementing

More information

Chapter 6: Physical Database Design and Performance. Database Development Process. Physical Design Process. Physical Database Design

Chapter 6: Physical Database Design and Performance. Database Development Process. Physical Design Process. Physical Database Design Chapter 6: Physical Database Design and Performance Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden Robert C. Nickerson ISYS 464 Spring 2003 Topic 23 Database

More information

Optimal Stack Slot Assignment in GCC

Optimal Stack Slot Assignment in GCC Optimal Stack Slot Assignment in GCC Naveen Sharma Sanjiv Kumar Gupta System Software Group HCL Technologies Ltd Noida, India 201301 {naveens, sanjivg}@noida.hcltech.com Abstract Several microprocessors,

More information

Lecture 16: Storage Devices

Lecture 16: Storage Devices CS 422/522 Design & Implementation of Operating Systems Lecture 16: Storage Devices Zhong Shao Dept. of Computer Science Yale University Acknowledgement: some slides are taken from previous versions of

More information

A3 Computer Architecture

A3 Computer Architecture A3 Computer Architecture Engineering Science 3rd year A3 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/3co Michaelmas 2000 1 / 1 6. Stacks, Subroutines, and Memory

More information

Computer Organization and Architecture. Characteristics of Memory Systems. Chapter 4 Cache Memory. Location CPU Registers and control unit memory

Computer Organization and Architecture. Characteristics of Memory Systems. Chapter 4 Cache Memory. Location CPU Registers and control unit memory Computer Organization and Architecture Chapter 4 Cache Memory Characteristics of Memory Systems Note: Appendix 4A will not be covered in class, but the material is interesting reading and may be used in

More information

Candidates should be able to: (i) describe the purpose of RAM in a computer system

Candidates should be able to: (i) describe the purpose of RAM in a computer system The need for RAM Teacher s Notes Lesson Plan Length 60 mins Specifi cation Link 212/i Learning objective Candidates should be able to: (i) describe the purpose of RAM in a computer system Time (min) Activity

More information

361 Computer Architecture Lecture 14: Cache Memory

361 Computer Architecture Lecture 14: Cache Memory 1 361 Computer Architecture Lecture 14 Memory cache.1 The Motivation for s Memory System Processor DRAM Motivation Large memories (DRAM) are slow Small memories (SRAM) are fast Make the average access

More information

How To Write To A Linux Memory Map On A Microsoft Zseries 2.2.2 (Amd64) On A Linux 2.3.2 2.4.2 3.5.2 4.5 (Amd32) (

How To Write To A Linux Memory Map On A Microsoft Zseries 2.2.2 (Amd64) On A Linux 2.3.2 2.4.2 3.5.2 4.5 (Amd32) ( Understanding Linux Memory Management SHARE 102 Session 9241 Dr. Ulrich Weigand Linux on zseries Development, IBM Lab Böblingen Ulrich.Weigand@de.ibm.com Linux Memory Management - A Mystery? What does

More information

Unit 4.3 - Storage Structures 1. Storage Structures. Unit 4.3

Unit 4.3 - Storage Structures 1. Storage Structures. Unit 4.3 Storage Structures Unit 4.3 Unit 4.3 - Storage Structures 1 The Physical Store Storage Capacity Medium Transfer Rate Seek Time Main Memory 800 MB/s 500 MB Instant Hard Drive 10 MB/s 120 GB 10 ms CD-ROM

More information

Chapter 12 File Management

Chapter 12 File Management Operating Systems: Internals and Design Principles Chapter 12 File Management Eighth Edition By William Stallings Files Data collections created by users The File System is one of the most important parts

More information

WHITE PAPER Optimizing Virtual Platform Disk Performance

WHITE PAPER Optimizing Virtual Platform Disk Performance WHITE PAPER Optimizing Virtual Platform Disk Performance Think Faster. Visit us at Condusiv.com Optimizing Virtual Platform Disk Performance 1 The intensified demand for IT network efficiency and lower

More information

Lecture 1: Data Storage & Index

Lecture 1: Data Storage & Index Lecture 1: Data Storage & Index R&G Chapter 8-11 Concurrency control Query Execution and Optimization Relational Operators File & Access Methods Buffer Management Disk Space Management Recovery Manager

More information

Segmentation. 16.1 Segmentation: Generalized Base/Bounds

Segmentation. 16.1 Segmentation: Generalized Base/Bounds 16 Segmentation So far we have been putting the entire address space of each process in memory. With the base and bounds registers, the OS can easily relocate processes to different parts of physical memory.

More information

Paging: Introduction. 18.1 A Simple Example And Overview

Paging: Introduction. 18.1 A Simple Example And Overview 18 Paging: Introduction It is sometimes said that the operating system takes one of two approaches when solving most any space-management problem. The first approach is to chop things up into variable-sized

More information

Using Synology SSD Technology to Enhance System Performance Synology Inc.

Using Synology SSD Technology to Enhance System Performance Synology Inc. Using Synology SSD Technology to Enhance System Performance Synology Inc. Synology_SSD_Cache_WP_ 20140512 Table of Contents Chapter 1: Enterprise Challenges and SSD Cache as Solution Enterprise Challenges...

More information

COMPUTER ORGANIZATION ARCHITECTURES FOR EMBEDDED COMPUTING

COMPUTER ORGANIZATION ARCHITECTURES FOR EMBEDDED COMPUTING COMPUTER ORGANIZATION ARCHITECTURES FOR EMBEDDED COMPUTING 2013/2014 1 st Semester Sample Exam January 2014 Duration: 2h00 - No extra material allowed. This includes notes, scratch paper, calculator, etc.

More information

This Unit: Virtual Memory. CIS 501 Computer Architecture. Readings. A Computer System: Hardware

This Unit: Virtual Memory. CIS 501 Computer Architecture. Readings. A Computer System: Hardware This Unit: Virtual CIS 501 Computer Architecture Unit 5: Virtual App App App System software Mem CPU I/O The operating system (OS) A super-application Hardware support for an OS Virtual memory Page tables

More information

& Data Processing 2. Exercise 1: Introduction to Operating System Concepts. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen

& Data Processing 2. Exercise 1: Introduction to Operating System Concepts. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen Folie a: Name & Data Processing 2 1: Introduction to Operating System Concepts Dipl.-Ing. Bogdan Marin Fakultät für Ingenieurwissenschaften Abteilung Elektro-und Informationstechnik -Technische Informatik-

More information

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management.

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management. Overview Concepts of Mobile Operating Systems Lecture 11 Concepts of Mobile Operating Systems Mobile Business I (WS 2007/08) Prof Dr Kai Rannenberg Chair of Mobile Business and Multilateral Security Johann

More information

Chapter 11: File System Implementation. Chapter 11: File System Implementation. Objectives. File-System Structure

Chapter 11: File System Implementation. Chapter 11: File System Implementation. Objectives. File-System Structure Chapter 11: File System Implementation Chapter 11: File System Implementation File-System Structure File-System Implementation Directory Implementation Allocation Methods Free-Space Management Efficiency

More information

Data De-duplication Methodologies: Comparing ExaGrid s Byte-level Data De-duplication To Block Level Data De-duplication

Data De-duplication Methodologies: Comparing ExaGrid s Byte-level Data De-duplication To Block Level Data De-duplication Data De-duplication Methodologies: Comparing ExaGrid s Byte-level Data De-duplication To Block Level Data De-duplication Table of Contents Introduction... 3 Shortest Possible Backup Window... 3 Instant

More information

File-System Implementation

File-System Implementation File-System Implementation 11 CHAPTER In this chapter we discuss various methods for storing information on secondary storage. The basic issues are device directory, free space management, and space allocation

More information

Chapter 13: Query Processing. Basic Steps in Query Processing

Chapter 13: Query Processing. Basic Steps in Query Processing Chapter 13: Query Processing! Overview! Measures of Query Cost! Selection Operation! Sorting! Join Operation! Other Operations! Evaluation of Expressions 13.1 Basic Steps in Query Processing 1. Parsing

More information

CHAPTER 17: File Management

CHAPTER 17: File Management CHAPTER 17: File Management The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides

More information

EFFICIENT EXTERNAL SORTING ON FLASH MEMORY EMBEDDED DEVICES

EFFICIENT EXTERNAL SORTING ON FLASH MEMORY EMBEDDED DEVICES ABSTRACT EFFICIENT EXTERNAL SORTING ON FLASH MEMORY EMBEDDED DEVICES Tyler Cossentine and Ramon Lawrence Department of Computer Science, University of British Columbia Okanagan Kelowna, BC, Canada tcossentine@gmail.com

More information

Storage Management for Files of Dynamic Records

Storage Management for Files of Dynamic Records Storage Management for Files of Dynamic Records Justin Zobel Department of Computer Science, RMIT, GPO Box 2476V, Melbourne 3001, Australia. jz@cs.rmit.edu.au Alistair Moffat Department of Computer Science

More information

OS OBJECTIVE QUESTIONS

OS OBJECTIVE QUESTIONS OS OBJECTIVE QUESTIONS Which one of the following is Little s formula Where n is the average queue length, W is the time that a process waits 1)n=Lambda*W 2)n=Lambda/W 3)n=Lambda^W 4)n=Lambda*(W-n) Answer:1

More information

Virtual Memory. Chapter 4

Virtual Memory. Chapter 4 Chapter 4 Virtual Memory Linux processes execute in a virtual environment that makes it appear as if each process had the entire address space of the CPU available to itself. This virtual address space

More information

Memory ICS 233. Computer Architecture and Assembly Language Prof. Muhamed Mudawar

Memory ICS 233. Computer Architecture and Assembly Language Prof. Muhamed Mudawar Memory ICS 233 Computer Architecture and Assembly Language Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals Presentation Outline Random

More information

Chapter 11 I/O Management and Disk Scheduling

Chapter 11 I/O Management and Disk Scheduling Operatin g Systems: Internals and Design Principle s Chapter 11 I/O Management and Disk Scheduling Seventh Edition By William Stallings Operating Systems: Internals and Design Principles An artifact can

More information

Administração e Optimização de BDs

Administração e Optimização de BDs Departamento de Engenharia Informática 2010/2011 Administração e Optimização de BDs Aula de Laboratório 1 2º semestre In this lab class we will address the following topics: 1. General Workplan for the

More information

Chapter 12 File Management

Chapter 12 File Management Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 12 File Management Dave Bremer Otago Polytechnic, N.Z. 2008, Prentice Hall Roadmap Overview File organisation and Access

More information

Chapter 12 File Management. Roadmap

Chapter 12 File Management. Roadmap Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 12 File Management Dave Bremer Otago Polytechnic, N.Z. 2008, Prentice Hall Overview Roadmap File organisation and Access

More information

File Systems Management and Examples

File Systems Management and Examples File Systems Management and Examples Today! Efficiency, performance, recovery! Examples Next! Distributed systems Disk space management! Once decided to store a file as sequence of blocks What s the size

More information

6. Storage and File Structures

6. Storage and File Structures ECS-165A WQ 11 110 6. Storage and File Structures Goals Understand the basic concepts underlying different storage media, buffer management, files structures, and organization of records in files. Contents

More information

Where is the memory going? Memory usage in the 2.6 kernel

Where is the memory going? Memory usage in the 2.6 kernel Where is the memory going? Memory usage in the 2.6 kernel Sep 2006 Andi Kleen, SUSE Labs ak@suse.de Why save memory Weaker reasons "I ve got 1GB of memory. Why should I care about memory?" Old machines

More information

The Quest for Speed - Memory. Cache Memory. A Solution: Memory Hierarchy. Memory Hierarchy

The Quest for Speed - Memory. Cache Memory. A Solution: Memory Hierarchy. Memory Hierarchy The Quest for Speed - Memory Cache Memory CSE 4, Spring 25 Computer Systems http://www.cs.washington.edu/4 If all memory accesses (IF/lw/sw) accessed main memory, programs would run 20 times slower And

More information

Hardware Configuration Guide

Hardware Configuration Guide Hardware Configuration Guide Contents Contents... 1 Annotation... 1 Factors to consider... 2 Machine Count... 2 Data Size... 2 Data Size Total... 2 Daily Backup Data Size... 2 Unique Data Percentage...

More information

Optimizing Sort in Hadoop using Replacement Selection

Optimizing Sort in Hadoop using Replacement Selection Optimizing Sort in Hadoop using Replacement Selection Pedro Martins Dusso 1,2, Caetano Sauer 1, and Theo Härder 1 1 Technische Universität Kaiserslautern, Kaiserlautern, Germany 2 Universidade Federal

More information

Free-Space Management

Free-Space Management 17 Free-Space Management In this chapter, we take a small detour from our discussion of virtualizing memory to discuss a fundamental aspect of any memory management system, whether it be a malloc library

More information

Using Synology SSD Technology to Enhance System Performance Synology Inc.

Using Synology SSD Technology to Enhance System Performance Synology Inc. Using Synology SSD Technology to Enhance System Performance Synology Inc. Synology_WP_ 20121112 Table of Contents Chapter 1: Enterprise Challenges and SSD Cache as Solution Enterprise Challenges... 3 SSD

More information

Record Storage and Primary File Organization

Record Storage and Primary File Organization Record Storage and Primary File Organization 1 C H A P T E R 4 Contents Introduction Secondary Storage Devices Buffering of Blocks Placing File Records on Disk Operations on Files Files of Unordered Records

More information

VM Architecture. Jun-Chiao Wang, 15 Apr. 2002 NCTU CIS Operating System lab. 2002 Linux kernel trace seminar

VM Architecture. Jun-Chiao Wang, 15 Apr. 2002 NCTU CIS Operating System lab. 2002 Linux kernel trace seminar VM Architecture Jun-Chiao Wang, 15 Apr. 2002 NCTU CIS Operating System lab. 2002 Linux kernel trace seminar Outline Introduction What is VM? Segmentation & Paging in Linux Memory Management Page Frame

More information

The Google File System

The Google File System The Google File System By Sanjay Ghemawat, Howard Gobioff, and Shun-Tak Leung (Presented at SOSP 2003) Introduction Google search engine. Applications process lots of data. Need good file system. Solution:

More information