Lec 7aOperating Systems1 Operating Systems Lecture 7a: Linux Memory Manager William M. Mongan.

Slides:



Advertisements
Similar presentations
Incomplete Structs struct B; struct A { struct B * partner; // other declarations… }; struct B { struct A * partner; // other declarations… };
Advertisements

Memory Management in Linux Anand Sivasubramaniam.
Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
Tutorial 8 March 9, 2012 TA: Europa Shang
Pointers & Dynamic Memory Allocation Mugurel Ionu Andreica Spring 2012.
The Linux Kernel: Memory Management
Memory Management in Linux (Chap. 8 in Understanding the Linux Kernel)
Kernel Memory Allocator
Allocating Memory Ted Baker  Andy Wang CIS 4930 / COP 5641.
CSC 660: Advanced Operating SystemsSlide #1 CSC 660: Advanced OS Memory Management.
Memory management.
Ashish Sangwan Dipankar Sarkar Ghanshyam Dass Naman Singhal
Case Study: Virtual Memory in UNIX Reference – Maurice J.Bach, The Design of the UNIX Operating System Terminology - Physical Memory (Main Memory) Secondary.
Union, bitfield, typedef, enum union nama_u{ }; union nama_u{ struct nama_s byte; }; enum{ }; Tipedef var BYTE.
Introduction to Memory Management 黃偉修 Linux Kernel.
Linux Memory Issues An introduction to some low-level and some high-level memory management concepts.
Linux Vs. Windows NT Memory Management Hitesh Kumar
Linux Memory Issues Introduction. Some Architecture History 8080 (late-1970s) 16-bit address (64-KB) 8086 (early-1980s) 20-bit address (1-MB) (mid-’80s)
1 Memory Management in Representative Operating Systems.
Chapter 3 Buffer Cache TOPICS UNIX system Architecture Buffer Cache
EECS 370 Discussion 1 SMBC. EECS 370 Discussion Exam 2 Solutions posted online Will be returned in next discussion (12/9) – Grades hopefully up on CTools.
Efficient Protection of Kernel Data Structures via Object Partitioning Abhinav Srivastava, Jonathon Giffin AT&T Labs-Research, HP Fortify ACSAC 2012.
Memory Management in Windows and Linux &. Windows Memory Management Virtual memory manager (VMM) –Executive component responsible for managing memory.
Chapter 12. Memory Management. Overview Memory allocation inside the kernel is not as easy as memory allocation outside the kernel  The kernel simply.
CS 6560 Operating System Design Lecture 13 Finish File Systems Block I/O Layer.
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
Simon Jackson James Sleeman Pete Hemery. Simon Jackson.
Ethernet Driver Changes for NET+OS V5.1. Design Changes Resides in bsp\devices\ethernet directory. Source code broken into more C files. Native driver.
CUDA Streams These notes will introduce the use of multiple CUDA streams to overlap memory transfers with kernel computations. Also introduced is paged-locked.
Lec 3aOperating Systems1 Operating Systems Lecture 3a: Linux Schedulers William M. Mongan Material drawn in part from
Chapter 12. Memory Management. Overview Memory allocation inside the kernel is not as easy as memory allocation outside the kernel  The kernel simply.
B LOCK L AYER S UBSYSTEM Linux Kernel Programming CIS 4930/COP 5641.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 7 – Buffer Management.
Linux Kernel Development Memory Management Pavel Sorokin Gyeongsang National University
CS 140 Lecture Notes: Virtual MemorySlide 1 Load-Time Relocation Process 1 0 ∞ Process 3 Operating System Process 6.
W4118 Operating Systems Instructor: Junfeng Yang.
Memory Virtualization In Xen
Memory Management.
Lecture 10 Memory management Nov. 17, 2015 Kyu Ho Park.
Linux 2.6 Memory Management Joseph Garvin. Why do we care? Without keeping multiple process in memory at once, we loose all the hard work we just did.
1 Carnegie Mellon A Tour of Computer Systems Instructors: Sejin Park.
Last lecture: VM Implementation
Ex-1 #include <stdio.h> struct sample { int a=0; char b='A';
CS 140 Lecture Notes: Virtual Memory
Chapter 3 Buffer Cache TOPICS UNIX system Architecture Buffer Cache
Paging Adapted from: © Ed Lazowska, Hank Levy, Andrea And Remzi Arpaci-Dussea, Michael Swift.
Linux device driver development
Memory Hierarchy Virtual Memory, Address Translation
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
CS 140 Lecture Notes: Virtual Memory
Paging Lecture November 2018.
FIGURE 12-1 Memory Hierarchy
Chapter 5 Memory CSE 820.
CSC 660: Advanced Operating Systems
CS 140 Lecture Notes: Virtual Machines
CSC 660: Advanced Operating Systems
CS 140 Lecture Notes: Virtual Memory
Too Much Milk With Locks
Too Much Milk With Locks
Instructors: Majd Sakr and Khaled Harras
Virtual Memory Overcoming main memory size limitation
Computer System Design Lecture 11
CSE 451 Autumn 2003 November 13 Section.
Kernel Memory Chris Gill, David Ferry, Brian Kocoloski
Computer Architecture
Memory Management in Linux
Dynamic Memory Allocation
CS 140 Lecture Notes: Virtual Memory
4.3 Virtual Memory.
Paging Adapted from: © Ed Lazowska, Hank Levy, Andrea And Remzi Arpaci-Dussea, Michael Swift.
Presentation transcript:

Lec 7aOperating Systems1 Operating Systems Lecture 7a: Linux Memory Manager William M. Mongan

Linux Pages Linux pages are defined as a struct_page in linux/mm.h typedef struct page { struct list_head list; struct address_space *mapping; unsigned long index; struct page *next_hash; atomic_t count; unsigned long flags; struct list_head lru; unsigned char age; unsigned char zone; struct pte_chain * pte_chain; struct page **pprev_hash; struct buffer_head * buffers; #if defined(CONFIG_HIGHMEM) || defined(CONFIG_SPARC64) void *virtual; #endif /* CONFIG_HIGMEM || CONFIG_SPARC64 */ } mem_map_t;

Linux Pages count:reference count flags: bit field including dirty bit, etc. –See linux/page-flags.h virtual: virtual address

Zones ZONE_DMA –Allows hardware performing DMA to have memory addresses mapped where they need them ZONE_NORMAL ZONE_HIGHMEM –Dynamically mapped at addresses higher than what may be virtually addressed struct zone in linux/mmzone.h

Kernel Page Allocation linux/mm.h and mm/page_alloc.c –alloc_page (return the page structure), get_free_page (return logical address) –free_page(logical_address) Or, linux/slab.h for continuous slab –kmalloc(size, flag) and kfree(ptr) Or, linux/vmalloc.h and mm/vmalloc.c for noncontinuous physical page allocation vmalloc(size)