Linux kernen. Version 2.4.20, 2.5.59. 11 arch. DIKU Intel, SMP. . NEL, Kernel, 2003.2.5-1 -



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

Linux Kernel Architecture

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

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

How To Write To A Linux Memory Map On A Microsoft Zseries (Amd64) On A Linux (Amd32) (

The Linux Virtual Filesystem

Virtual Memory Behavior in Red Hat Linux Advanced Server 2.1

Memory Management under Linux: Issues in Linux VM development

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

Carnegie Mellon Virtual Memory of a Linux Process Process-specific data structs (ptables, Different for

Configuring CoreNet Platform Cache (CPC) as SRAM For Use by Linux Applications

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Page replacement in Linux 2.4 memory management

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

W4118 Operating Systems. Instructor: Junfeng Yang

Understanding Virtual Memory In Red Hat Enterprise Linux 3

Chapter 10 Case Study 1: LINUX

Computer Engineering and Systems Group Electrical and Computer Engineering SCMFS: A File System for Storage Class Memory

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Determining the Correct Usage of Swap in Linux * 2.6 Kernels

Chapter 5 Cloud Resource Virtualization

How To Write A Windows Operating System (Windows) (For Linux) (Windows 2) (Programming) (Operating System) (Permanent) (Powerbook) (Unix) (Amd64) (Win2) (X

General Purpose Operating System Support for Multiple Page Sizes

Intel s Virtualization Extensions (VT-x) So you want to build a hypervisor?

Full and Para Virtualization

Operating Systems. Design and Implementation. Andrew S. Tanenbaum Melanie Rieback Arno Bakker. Vrije Universiteit Amsterdam

Outline. Operating Systems Design and Implementation. Chap 1 - Overview. What is an OS? 28/10/2014. Introduction

Database Virtualization

An Implementation Of Multiprocessor Linux

Local and Remote Memory: Memory in a Linux/NUMA System

Linux Memory Analysis Workshop Session 1 Andrew Case

Using Linux as Hypervisor with KVM

ELEC 377. Operating Systems. Week 1 Class 3

COS 318: Operating Systems. Virtual Machine Monitors

Chapter 14 Virtual Machines

Xen and XenServer Storage Performance

Multi-core Programming System Overview

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

Virtual Machines. COMP 3361: Operating Systems I Winter

Virtual Memory. Chapter 4

Tyche: An efficient Ethernet-based protocol for converged networked storage

Operating Systems. 05. Threads. Paul Krzyzanowski. Rutgers University. Spring 2015

Virtual vs Physical Addresses

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

KVM & Memory Management Updates

Virtualization in Linux

High-Density Network Flow Monitoring

Module 20: The Linux System

Lecture 5. User-Mode Linux. Jeff Dike. November 7, Operating Systems Practical. OSP Lecture 5, UML 1/33

Chapter 6, The Operating System Machine Level

The Microsoft Windows Hypervisor High Level Architecture

Technical Paper. Moving SAS Applications from a Physical to a Virtual VMware Environment

LSN 10 Linux Overview

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Cloud^H^H^H^H^H Virtualization Technology. Andrew Jones May 2011

FAME Operating Systems

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Operating Systems, 6 th ed. Test Bank Chapter 7

Safety measures in Linux

MODULE 3 VIRTUALIZED DATA CENTER COMPUTE

IOMMU: A Detailed view

Effective Handling of Low Memory Scenarios in Android

Going Linux on Massive Multicore

OSes. Arvind Seshadri Mark Luk Ning Qu Adrian Perrig SOSP2007. CyLab of CMU. SecVisor: A Tiny Hypervisor to Provide

ARM Caches: Giving you enough rope... to shoot yourself in the foot. Marc Zyngier KVM Forum 15

Chapter 3 Operating-System Structures

The Linux Kernel: Process Management. CS591 (Spring 2001)

File System & Device Drive. Overview of Mass Storage Structure. Moving head Disk Mechanism. HDD Pictures 11/13/2014. CS341: Operating System

COS 318: Operating Systems

Operating Systems 4 th Class

These sub-systems are all highly dependent on each other. Any one of them with high utilization can easily cause problems in the other.

Virtualization in Linux KVM + QEMU

Virtualization Technology. Zhiming Shen

Hardware Based Virtualization Technologies. Elsie Wahlig Platform Software Architect

SSI-OSCAR Single System Image - Open Source Cluster Application Resources

VHDL programmering H2

Survey of Filesystems for Embedded Linux. Presented by Gene Sally CELF

Linux/UNIX System Programming. POSIX Shared Memory. Michael Kerrisk, man7.org c February 2015

Architecture of the Kernel-based Virtual Machine (KVM)

OpenSPARC T1 Processor

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

Real-time KVM from the ground up

Operating Systems: Basic Concepts and History

Computer Science 4302 Operating Systems. Student Learning Outcomes

Far-western University Central Office, Mahendranagar Operating System

Migration of Process Credentials

OPERATING SYSTEMS STRUCTURES

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

Transcription:

Linux kernen Version 2.4.20, 2.5.59 11 arch. DIKU Intel, SMP.. NEL, Kernel, 2003.2.5-1 -

Linux processer Processer User mode/kernel mode. Kernel threads Processer/tråde. fork(), clone(), shmem etc. Parent child. NEL, Kernel, 2003.2.5-2 -

Synkronisering Reentrant kerne Reentrante funktioner. Låse Afbrydelser (også i kerne mode) Preemptable kerne. Lukke for afbrydelser. Semaforer Spin locks Deadlocks SMP Hyperthreading, NUMA Zones. NEL, Kernel, 2003.2.5-3 -

Hardware. NEL, Kernel, 2003.2.5-4 -

Oversigt over kernen. NEL, Kernel, 2003.2.5-5 -

Hvorfor virtuelt lager Flere samtidige processer Kan køre programmer kun delvist i RAM. Processer deler fysisk lager Processer kan dele lagerbillede (pgm, lib mm.) Programmer er relokerbare (i fysisk lager) Programmører kan skrive maskinuafhængig kode). NEL, Kernel, 2003.2.5-6 -

Memory Management Demand Paging Swapping Physical and Virtual Addressing Modes Kmalloc On alpha: different areas.. NEL, Kernel, 2003.2.5-7 -

Memory Management 2. NEL, Kernel, 2003.2.5-8 -

Memory Management 3 Large Address Spaces The operating system makes the system appear as if it has a larger amount of memory than it actually has. Protection Each process in the system has its own virtual address space. Areas of memory protected against writing. Memory Mapping In memory mapping, the contents of a file are linked directly into the virtual address space of a process. Fair Physical Memory Allocation The memory management subsystem allows each running process in the system a fair share of the physical memory of the system, Shared Virtual Memory For e.g. text segments, dynamic libraries, IPC.. NEL, Kernel, 2003.2.5-9 -

Data strukturer Task List Scheduleren vedligeholder en blok data for hver aktive process. Disse blokke gemmes i lænket liste. current er den kørende process Memory Map Memory manageren gemmer et map fra virtuelle til fysiske adresser I-nodes Det virtulelle filsystem bruger indexnoder (i-noder) til at repræsentere filer i et logisk filsystem (dentry). Kan deles mellem processer. Hvordan datastrukturerne hænger sammen Alle datastrukturer kan nås fra process schedulerens task list.. NEL, Kernel, 2003.2.5-10 -

Caches Buffer Cache The buffer cache contains data buffers that are used by the block device drivers. Page Cache Used to cache the logical contents of a file a page at a time. Swap Cache Only modified (or dirty ) pages are saved in the swap file. Hardware Caches TLB: Translation Look-aside Buffers.. NEL, Kernel, 2003.2.5-11 -

Linux Page Tables VIRTUAL ADDRESS Level 1 Level 2 Level 3 Byte within page Level 1 Level 2 Level 3 Page Table Page Table Page Table Physical Page PFN PFN PFN PGD. NEL, Kernel, 2003.2.5-12 -

Page Allocation Buddy free_area PHYSICAL MEMORY 5 56 mem_map_t mem_map_t 4 mem_map_t 0 4 3 2 1 0 map map map map 8 7 6 5 4 3 2 1 Free PFN 0 PFN. NEL, Kernel, 2003.2.5-13 -

Buddy system simple, efficient /* * Buddy system. Hairy. You really aren t * expected to understand this * * Hint: -mask = 1+~mask */ Ingo, nov 2001: in the past couple of years the buddy allocator has started to show limitations that are hurting performance and flexibility.. NEL, Kernel, 2003.2.5-14 -

Slab allocating slab.c: The memory is organized in caches, one cache for each object type. (e.g. inode cache, dentry cache, buffer head, vm area struct) Each cache consists out of many slabs (they are small (usually one page long) and always contiguous), and each slab contains multiple initialized objects.. NEL, Kernel, 2003.2.5-15 -

Zoned Buddy allocator ZONE DMA < 16 MB ISA DMA capable memory ZONE NORMAL 16-896 MB direct mapped by the kernel ZONE HIGHMEM > 896 MB only page cache and user processes. NEL, Kernel, 2003.2.5-16 -

Areas of VM Processes Virtual Memory Virtual Area vm_area_struct vm_end vm_start vm_flags vm_inode vm_ops vm_next Virtual Memory Operations open() close() unmap() protect() sync() advise() nopage() wppage() swapout() swapin(). NEL, Kernel, 2003.2.5-17 -

Processes and Files task_struct fs_struct count umask *root 0x022 inode fs *pwd files inode files_struct count close_on_exec open_fs fd[0] fd[1] fd[255] file f_mode f_pos f_flags f_count f_owner f_inode f_op f_version inode file operation routines. NEL, Kernel, 2003.2.5-18 -

Processes and Files Processes Virtual Memory task_struct mm_struct vm_area_struct mm count pgd vm_end vm_start vm_flags Data vm_inode vm_ops 0x8059BB8 mmap mmap_avl vm_next mmap_sem vm_area_struct Code vm_end vm_start vm_flags 0x8048000 vm_inode vm_ops vm_next 0x0000000 What happens when a process allocates memory? What happens when a process access memory?. NEL, Kernel, 2003.2.5-19 -

ELF ELF Executable Image e_ident e_entry e_phoff e_phentsize e_phnum E L F 0x8048090 52 32 2 Physical Header Physical Header p_type p_offset p_vaddr p_filesz p_memsz p_flags p_type p_offset p_vaddr p_filesz p_memsz p_flags PT_LOAD 0 0x8048000 68532 68532 PF_R, PF_X PT_LOAD 68536 0x8059BB8 2200 4248 PF_R, PF_W Code Data. NEL, Kernel, 2003.2.5-20 -

Booting POST LILO (fx) Kerne init Sys V init.. NEL, Kernel, 2003.2.5-21 -

Obligatoriske opgaver Exercise 1 /proc filsystem. NEL, Kernel, 2003.2.5-22 -

Projects 1. linuxbios 2. kernel memory allocation 3. I/O scheduler, non elevator 4. Block Layer redesign 5. User level filesystems.. NEL, Kernel, 2003.2.5-23 -