Linux Memory Management High-Level versus Low-Level.

Slides:



Advertisements
Similar presentations
Memory Management in Linux Anand Sivasubramaniam.
Advertisements

Kernel Memory Allocator
Using VMX within Linux We explore the feasibility of executing ROM-BIOS code within the Linux x86_64 kernel.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Assistant Professor, University of Maryland Baltimore County.
Shared memory. Process A Process B Physical Memory Virtual address space A Virtual address space B Share Instruction memory Data Instruction memory Data.
Linux ‘Demand-Paging’
Introduction to Memory Management 黃偉修 Linux Kernel.
Linux Filesystem Features Evolution of a de facto standard file system for Linux: ‘ext2’
The ‘process’ abstraction
The ‘thread’ abstraction A look at the distinction between the idea of a ‘process’ and the concept of a ‘thread’
Linux Memory Issues An introduction to some low-level and some high-level memory management concepts.
“Virtual” Memory How does the OS kernel provide “private” and “shared” memory areas to multiple concurrent processes?
The kernel’s task list Introduction to process descriptors and their related data-structures for Linux kernel version
The kernel’s task list Introduction to process descriptors and their related data-structures for Linux kernel version
Scientific Visualization Using imagery to aid humans in understanding a complicated phenomenon.
Memory management, part 3: outline
The ‘mmap()’ method Adding the ‘mmap()’ capability to our ‘vram.c’ device-driver.
CS 140 Lecture Notes: Virtual MemorySlide 1 Load-Time Relocation Process 1 0 ∞ Process 3 Operating System Process 6.
Protected Mode. Protected Mode (1 of 2) 4 GB addressable RAM –( to FFFFFFFFh) Each program assigned a memory partition which is protected from.
Linux Memory Management How does the Linux kernel keep track of the Virtual Memory Areas that each process uses?
Memory Mapping Sarah Diesburg COP5641.
CS 6560 Operating System Design Lecture 13 Finish File Systems Block I/O Layer.
Memory Addressing in Linux  Logical Address machine language instruction location  Linear address (virtual address) a single 32 but unsigned integer.
Socket Swapping for efficient distributed communication between migrating processes MS Final Defense Praveen Ramanan 12 th Dec 2002.
The Structure of Processes. What is a Process? an instance of running program Program vs process(task) Program : just a passive collection of instructions.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Assistant Professor, University of Maryland Baltimore County.
University of Amsterdam Computer Systems – virtual memory Arnoud Visser 1 Computer Systems Virtual Memory.
SigGraph: Brute Force Scanning of Kernel Data Structure Instances Using Graph-based Signatures Zhiqiang Lin 1 Junghwan Rhee 1, Xiangyu Zhang 1, Dongyan.
CSC 660: Advanced Operating Systems
What is a Process ? A program in execution.
CS 140 Lecture Notes: Virtual MemorySlide 1 Load-Time Relocation Process 1 0 ∞ Process 3 Operating System Process 6.
Why Kernel Works? kernel function gets dynamic memory in a fairly straightforward manner _get_free_pages( ) or alloc_pages( ) The simple approaches work.
Memory Management 백 일 우
Virtual Memory: Systems
Processes David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
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.
CS 140 Lecture Notes: Virtual Memory
CS 105 “Tour of the Black Holes of Computing!”
CS 105 “Tour of the Black Holes of Computing!”
Virtual Memory: Systems
Process Management.
Processes David Ferry, Chris Gill
Process Realization In OS
Threads and Locks.
Virtual Memory: Systems /18-213/14-513/15-513: Introduction to Computer Systems 18th Lecture, October 25, 2018.
CS 140 Lecture Notes: Virtual Memory
Virtual Memory: Systems
Virtual Memory: Systems
Making Virtual Memory Real: The Linux-x86-64 way
SWE3015 Operating System Project Assignment 2 박은수, 박경원, 김지원
Memory System Case Studies Oct. 13, 2008
Pentium/Linux Memory System
P6 (PentiumPro,II,III,Celeron) memory system
CSC 660: Advanced Operating Systems
CS 140 Lecture Notes: Virtual Memory
Pentium III / Linux Memory System April 4, 2000
Virtual Memory.
Instructor: Phil Gibbons
Virtual Memory: Systems CSCI 380: Operating Systems
CS 105 “Tour of the Black Holes of Computing!”
CS 105 “Tour of the Black Holes of Computing!”
Displaying Memory/Files
CS 140 Lecture Notes: Virtual Memory
Processes David Ferry, Chris Gill, Brian Kocoloski
User-level Memory Chris Gill, David Ferry, Brian Kocoloski
CS 105 “Tour of the Black Holes of Computing!”
Virtual Memory and Paging
Shared Memory David Ferry, Chris Gill
P6 (PentiumPro,II,III,Celeron) memory system
Presentation transcript:

Linux Memory Management High-Level versus Low-Level

Assigning memory to tasks Each Linux process has a ‘process descriptor’ with a pointer inside it named ‘mm’: struct task_struct { pid_tpid; char comm[16]; struct mm_struct*mm; /* plus many additional fields */ };

struct mm_struct Describes the task’s ‘memory map’ Where’s the code, the data, the stack? Where are the ‘shared libraries’? What are attributes of each memory area? How many distinct memory areas? Where is the task’s ‘page directory’?

Virtual Memory Areas Inside ‘mm_struct’ is a pointer to a list Name of this pointer is ‘mmap’ struct mm_struct { struct vm_area_struct*mmap; /* plus many other fields */};

Linked List of VMAs Each ‘vm_area_struct’ points to another struct vm_area_struct { unsigned longvm_start; unsigned longvm_end; unsigned longvm_flags; struct vm_area_struct*vm_next; /* plus some other fields */};

Structure relationships VMA mm_struct task_struct *mm *mmap Linked list of ‘vm_area_struct’ structures The ‘process descriptor’ for a task Task’s mm structure

Demo ‘vma.c’ module Creates a pseudo-file: /proc/vma Lets user see the list of VMAs for a task Also shows the ‘pgd’ field in ‘mm_struct’ EXERCISE Compare our demo to ‘/proc/self/maps’