The Linux Virtual Memory System

Size: px
Start display at page:

Download "The Linux Virtual Memory System"

Transcription

1 The Linux Virtual Memory System Patrick Ladd Technical Account Manager / NY Red Hat Users Group June 8, 2016 Slides are available at

2 Topics Evolution of the Linux Memory System Evolution of system memory architectures Latest innovations in Linux Memory System NUMA Hugepages 2

3 Virtual Memory

4 Virtual Memory System (simplified) Click to add subtitle Virtual pages Virtual pages Cost nothing Basically unlimited on 64 bit architecture PageTables Physical Pages RAM of system Cost money! PageTables Physical Pages Virtual Physical Mapping 4

5 PageTables Click to add subtitle pgd pud... pud Data Structure Common code and x86 formats are the same All 4K in size 2^9 (512) pointers per table pmd pmd pmd pmd pte... pte pte... pte pte... pte pte... pte grep PageTables /proc/meminfo Accessible Memory Total: (2^9)^4 ** bits TB 5

6 Virtual Memory Fabric Click to add subtitle Data structures for connecting Hardware constrained structures pagetables to Software abstractions Tasks Processes Virtual memory areas (VMAs) mmap (glibc malloc()) 6

7 Physical Page and struct page Click to add subtitle struct page 64 bytes 64 / 4096 (1.56% of RAM) PAGE_SIZE (4K) mem_map Physical RAM... 7

8 Memory Management Algorithms

9 Memory System Heuristics Algorithms doing computations on memory fabric structures Need to solve hard problems with no guaranteed perfect solution When is the right time to unmap pages? (swappiness) Which page should I page out? Some design is unchanged Measurement of how hard it is to free memory Free memory used as cache Overcommit by default 9

10 Page reclaim clock algorithm Early kernels (~2.2) Early '90s Small system RAM sizes page[0] page[0] mem_map page[n] page reclaim clock algorithm 10

11 pgtable scan clock algorithm Kernel 2.2 Mid 90's process virtual memory process virtual memory pgtables pgtables page[0] page[1] mem_map page[n] page reclaim clock algorithm pgtables pgtables process virtual memory process virtual memory 11 pgtable scan clock algorithm

12 Last Recently Used List Kernel 2.2 Late 90's process virtual memory pgtables page[0] page[1] pgtables process virtual memory process virtual memory pgtables mem_map page[n] pgtables process virtual memory page_lru 12

13 Active and Inactive List LRU Kernel The active page LRU preserves the the active memory working set Only the inactive LRU loses information as fast as useonce I/O goes Works well enough also with an arbitrary balance Active/inactive list optimum balancing algorithm was solved in Shadow radix tree nodes that detect re-faults (more patches last month) 13

14 Active & Inactive LRU Lists Kernel 2.4 Early 2000's process virtual memory pgtables page[0] page[1] pgtables process virtual memory process virtual memory pgtables mem_map page[n] pgtables process virtual memory inactive_lru Use-once pages to trash active_lru Use-many pages 14

15 $ grep -i active /proc/meminfo Active: kb Inactive: kb Active(anon): kb Inactive(anon): kb Active(file): kb Inactive(file): kb 15

16 rmap Obsoletes pgtable Scan Clock Algorithm Click to add subtitle To free a candidate page, we must first drop all references to it (mark the page table entry non-present) 16

17 MM & VMA mm_struct aka MM Memory of a process Shared by all threads vm_area_struct aka VMA Virtual memory area Created and torn down by mmap & munmap Defines the virtual address space of a MM 17

18 rmap Obsoletes pgtable Scan Clock Algorithm Click to add subtitle rmap reverse mapping Allows direct connection to pagetables from any given physical page without scanning 18

19 rmap after unmap event Click to add subtitle If the user space program access the page, it will trigger a pagein/swapin Page fault swapin Page fault swapin Free page 19

20 objrmap / anon-vma / ksm Physical Page Anonymous anon_vma vma vma Physical Page Filesystem Physical Page Anonymous Physical Page Filesystem inode (objrmap) anon_vma prio_tree anon_vma vma vma Physical Page KSM vma vma 20

21 Active & Inactive + rmap Kernel 2.6 Late 2000's process virtual memory pgtables page[0] page[1] pgtables process virtual memory process virtual memory pgtables mem_map page[n] pgtables process virtual memory inactive_lru Use-once pages to trash active_lru Use-many pages 21

22 22 /proc/meminfo MemTotal: kb MemFree: kb MemAvailable: kb Buffers: kb Cached: kb SwapCached: kb Active: kb Inactive: kb Active(anon): kb Inactive(anon): kb Active(file): kb Inactive(file): kb Unevictable: 3188 kb Mlocked: 3188 kb SwapTotal: kb SwapFree: kb Dirty: kb Writeback: 0 kb AnonPages: kb Mapped: kb Shmem: kb Slab: kb SReclaimable: kb SUnreclaim: kb KernelStack: kb PageTables: kb NFS_Unstable: 0 kb Bounce: 0 kb WritebackTmp: 0 kb CommitLimit: kb Committed_AS: kb VmallocTotal: kb VmallocUsed: kb VmallocChunk: kb HardwareCorrupted: 0 kb AnonHugePages: kb HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kb DirectMap4k: kb DirectMap2M: kb DirectMap1G: kb

23 More recent changes: Many More LRUs Separated LRU for anon and file backed mappings memcg (memory cgroups) introduced per-memcg LRUs Removal of un-freeable pages from LRUs anonymous memory with no swap mlocked memory Transparent Hugepages in the LRU increase scalability further (lru size decreased 512 times) 23

24 CPU Memory Architectures

25 Older Architectures Direct memory bus Memory CPU Main Bus I/O 25

26 Older Architectures Northbridge / Southbridge memory bus HS I/O (graphics / PCI-E) CPU FSB Northbridge Southbridge I/O Memory 26

27 NUMA Architecture Multi-core Multi-Bus Architecture Memory Memory I/O CPU CPU I/O I/O CPU CPU I/O 27 Memory Memory

28 NUMA Non-Uniform Memory Architecture Multiple Nodes in a NUMA System Each Node CPU Memory PCI/Devices All Nodes are interconnected Interconnects are slow Why NUMA? 28

29 Linux and NUMA

30 NUMA memory policies { } MPOL_DEFAULT, /* no numactl */ MPOL_PREFERRED, /* --preferred=node */ MPOL_BIND, /* default numactl / MPOL_INTERLEAVE, /* --interleave=nodes */ MPOL_LOCAL, /* --localalloc */ 30

31 Virt startup on CPU #0 MPOL_DEFAULT CPU #0 CPU #1 KVM Node #0 RAM #0 Node #1 RAM #1 31

32 Virt Mach allocates from RAM #0 MPOL_DEFAULT, no bindings CPU #0 CPU #1 KVM Node #0 RAM #0 Node #1 RAM #1 Guest RAM 32

33 Scheduler CPU migration to #1 MPOL_DEFAULT, no bindings CPU #0 gcc Node #0 RAM #0 CPU #1 gcc KVM Node #1 RAM #1 Guest RAM 33

34 Load goes away Linux scheduler is blind KVM will stay on CPU#1 with slow memory access CPU #0 CPU #1 KVM Node #0 RAM #0 Node #1 RAM #1 Guest RAM 34

35 Hard NUMA bindings man numactl man numastat Kernel API sys_mempolicy sys_mbind sys_sched_setaffinity Numad can use the kernel API to monitor memory pressure and act accordingly sys_move_pages /dev/cpuset Full topology available in /sys 35

36 No NUMA affinity # numastat -c qemu-kvm Per-node process memory usage (in Mbs) PID Node 0 Node 1 Node 2 Node 3 Node 4 Node 5 Node 6 Node 7 Total (qemu-kvm) (qemu-kvm) (qemu-kvm) (qemu-kvm) Total

37 NUMA affinity # numastat -c qemu-kvm Per-node process memory usage (in Mbs) PID Node 0 Node 1 Node 2 Node 3 Node 4 Node 5 Node 6 Node 7 Total (qemu-kvm) (qemu-kvm) (qemu-kvm) (qemu-kvm) Total

38 Automatic NUMA balancing Introduces gravity between CPU and memory CPU Memory attracts CPU AGGRESSIVELY If idle load balancing permits Memory CPU attracts memory slowly If anti-false sharing permits Memory CPU 38

39 NUMA example Startup state Thread 1 Thread 1 Thread 2 Thread 2 RAM #0 RAM #1 RAM RAM 39

40 NUMA example Converged state Thread 1 Thread 2 Thread 1 Thread 2 RAM #0 RAM #1 RAM RAM 40

41 NUMA threading example Startup state Thread 1 Thread 2 Thread 3 Thread 4 RAM #0 RAM #1 RAM 41

42 NUMA threading example Converged state Thread 1 Thread 2 Thread 3 Thread 4 RAM #0 RAM #1 RAM RAM 42

43 Automatic NUMA balancing benchmark Intel SandyBridge (Intel(R) Xeon(R) CPU E GHz) 2 Sockets 32 Cores with Hyperthreads 256G Memory Software: RHEV 3.6 Host bare metal el7 (RHEL7.2) VM guest el7 (RHEL7.2) VM 32P, 160G (Optimized for Server) Oracle 12C, 128G SGA Storage Violin G Fibre Channel Test Running Oracle OLTP workload with increasing user count and measuring Trans / min for each run as a metric for comparison 43

44 44 4VMs with different NUMA options

45 Automatic NUMA Balancing Configuration In RHEL7 Automatic NUMA balancing is enabled when: # numactl --hardware shows multiple nodes To disable automatic NUMA balancing: # echo 0 > /proc/sys/kernel/numa_balancing To enable automatic NUMA balancing: # echo 1 > /proc/sys/kernel/numa_balancing At boot: numa_balancing=enable disable 45

46 Automatic NUMA balancing benchmark Intel SandyBridge (Intel(R) Xeon(R) CPU E GHz) 2 Sockets 32 Cores with Hyperthreads 256G Memory Software: RHEV 3.6 Host bare metal el7 (RHEL7.2) VM guest el7 (RHEL7.2) VM 32P, 160G (Optimized for Server) Oracle 12C, 128G SGA Storage Violin G Fibre Channel Test Running Oracle OLTP workload with increasing user count and measuring Trans / min for each run as a metric for comparison 46

47 HugePages

48 HugePages Traditionally x86 hardware gave us 4KiB pages The more memory the bigger the overhead in managing 4KiB pages What if you had bigger pages? 512 times bigger 2MiB 48

49 Why HugePages? Improve CPU performance Enlarge TLB size Speed up TLB miss Need 3 accesses to memory instead of 4 to refill the TLB Faster to allocate memory initially (minor) Page colouring inside the hugepage (minor) Higher scalability of the page LRUs Cons clear_page/copy_page less cache friendly higher memory footprint sometime Direct compaction takes time 49

50 50 TLB Miss cost: # of memory accesses

51 Conclusion & Questions

52 Recent Trends Large Memory Usage processes HugePages (4KB 2MB) Programs or Virtual Machines duplicating Memory KSM Optimization of workloads for you, without manual tuning Automatic NUMA balancing Transparent HugePages Page pinning MMU notifier Direct Managed private device memory (i.e. GPU) UVM (unified virtual memory) 4 th Layer of pagetables pagetables in high memory region 52

53 Slides are available at THANK YOU plus.google.com/+redhat facebook.com/redhatinc linkedin.com/company/red-hat twitter.com/redhatnews youtube.com/user/redhatvideos

Tvheadend - Bug #2309 Another memory leak?

Tvheadend - Bug #2309 Another memory leak? Tvheadend - Bug #2309 Another memory leak? 2014-09-19 08:12 - Thomas Knoll Status: Fixed Start date: 2014-09-19 Priority: Normal Due date: Assignee: % Done: 0% Category: Estimated time: 0.00 hour Target

More information

PERFORMANCE IMPLICATIONS OF NUMA WHAT YOU DON T KNOW COULD HURT YOU! CLAIRE CATES SAS INSTITUTE

PERFORMANCE IMPLICATIONS OF NUMA WHAT YOU DON T KNOW COULD HURT YOU! CLAIRE CATES SAS INSTITUTE PERFORMANCE IMPLICATIONS OF NUMA WHAT YOU DON T KNOW COULD HURT YOU! CLAIRE CATES SAS INSTITUTE AGENDA Terms What Testers need to know about NUMA What Developers need to know about NUMA What SysAdmins

More information

Critical Issues. Troubleshooting Linux Performance and Crashes. Mike Latimer. Mike Hasleton. Virtualization Engineer

Critical Issues. Troubleshooting Linux Performance and Crashes. Mike Latimer. Mike Hasleton. Virtualization Engineer Critical Issues Troubleshooting Linux Performance and Crashes Mike Latimer Virtualization Engineer mlatimer@suse.com Mike Hasleton Senior Support Engineer mhasleton@suse.com Rich Brunt Senior Support Engineer

More information

Transparent Hugepage Support

Transparent Hugepage Support Transparent Hugepage Support Red Hat Inc. Andrea Arcangeli aarcange at redhat.com KVM Forum 2010 Boston Copyright 2010 Red Hat Inc. 9 Aug 2010 Benefit of hugepages Enlarge TLB size TLB is separate for

More information

rhincodon.org - index

rhincodon.org - index rhincodon.org - index web author 20160909-222837 UTC 目次 1 Server 2 1.0.1 Place........................... 2 1.0.2 CPU............................ 2 1.0.3 Memory.......................... 3 1.0.4 HDD............................

More information

Performance Analysis for Improved RAM Utilization for Android Applications

Performance Analysis for Improved RAM Utilization for Android Applications Performance Analysis for Improved RAM Utilization for Android Applications Deepali Kayande #1, Urmila Shrawankar #2 # Department of Computer Science & Engineering G. H. Raisoni College of Engineering,

More information

Transparent Hugepage

Transparent Hugepage Transparent Hugepage Red Hat Inc. Andrea Arcangeli aarcange at redhat.com 11 Nov 2009 Agenda Benefit of hugepages Hugetlbfs troubles Transparent Hugepage objectives Transparent Hugepage possible implementations

More information

AutoNUMA Red Hat, Inc.

AutoNUMA Red Hat, Inc. AutoNUMA Red Hat, Inc. Andrea Arcangeli aarcange at redhat.com 1 Apr 2012 AutoNUMA components knuma_scand If stopped, everything stops Triggers the chain reaction when started NUMA hinting page faults

More information

Automatic NUMA Balancing. Rik van Riel, Principal Software Engineer, Red Hat Vinod Chegu, Master Technologist, HP

Automatic NUMA Balancing. Rik van Riel, Principal Software Engineer, Red Hat Vinod Chegu, Master Technologist, HP Automatic NUMA Balancing Rik van Riel, Principal Software Engineer, Red Hat Vinod Chegu, Master Technologist, HP Automatic NUMA Balancing Agenda What is NUMA, anyway? Automatic NUMA balancing internals

More information

Bash. About Bash. Guidelines and Limitations. Accessing Bash

Bash. About Bash. Guidelines and Limitations. Accessing Bash About, on page 1 Guidelines and Limitations, on page 1 Accessing, on page 1 Escalate Privileges to Root, on page 2 Examples of Commands, on page 5 Managing RPMs, on page 6 Persistently Daemonizing an SDK-

More information

SAS Viya 3.4 Administration: Operations Infrastructure

SAS Viya 3.4 Administration: Operations Infrastructure SAS Viya 3.4 Administration: Operations Infrastructure Operations Infrastructure: Overview............................................................ 2 Operations Infrastructure: Collectors...........................................................

More information

Memory Externalization With userfaultfd Red Hat, Inc.

Memory Externalization With userfaultfd Red Hat, Inc. Memory Externalization With userfaultfd Red Hat, Inc. Andrea Arcangeli aarcange at redhat.com Germany, Düsseldorf 15 Oct 2014 Memory Externalization Memory externalization is about running a program with

More information

Downloaded from: justpaste.it/o09s

Downloaded from: justpaste.it/o09s Downloaded from: justpaste.it/o09s Pogoplug:~$ cat /proc/cpuinfo Processor : ARM926EJ-S rev 1 (v5l) BogoMIPS : 1192.75 Features : swp half thumb fastmult edsp CPU implementer : 0x56 CPU architecture: 5TE

More information

NUMA replicated pagecache for Linux

NUMA replicated pagecache for Linux NUMA replicated pagecache for Linux Nick Piggin SuSE Labs January 27, 2008 0-0 Talk outline I will cover the following areas: Give some NUMA background information Introduce some of Linux s NUMA optimisations

More information

KVM PERFORMANCE OPTIMIZATIONS INTERNALS. Rik van Riel Sr Software Engineer, Red Hat Inc. Thu May

KVM PERFORMANCE OPTIMIZATIONS INTERNALS. Rik van Riel Sr Software Engineer, Red Hat Inc. Thu May KVM PERFORMANCE OPTIMIZATIONS INTERNALS Rik van Riel Sr Software Engineer, Red Hat Inc. Thu May 5 2011 KVM performance optimizations What is virtualization performance? Optimizations in RHEL 6.0 Selected

More information

Non-uniform memory access (NUMA)

Non-uniform memory access (NUMA) Non-uniform memory access (NUMA) Memory access between processor core to main memory is not uniform. Memory resides in separate regions called NUMA domains. For highest performance, cores should only access

More information

Linux Memory Management

Linux Memory Management Linux Memory Management An Overview Anshuman Khandual Contents Introduction Platform Memory MMU Virtual Memory Physical Memory Analyze Memory Performance Introduction Main Memory - A non persistent storage

More information

Performance and Scalability RHEL5 --> RHEL6 D. John Shakshober (Shak) Red Hat Performance Engineering

Performance and Scalability RHEL5 --> RHEL6 D. John Shakshober (Shak) Red Hat Performance Engineering 45, Red Hat 21 RHCE Loopback Erich Morisse Senior Solutions Architect Team Lead, Verticals emorisse@redhat.com Performance and Scalability RHEL5 --> RHEL6 D. John Shakshober (Shak) Red Hat Performance

More information

何时放入常规 bin? 释放时先放到无序 bin 下次执行 malloc 时, 放入所属的常规 bin

何时放入常规 bin? 释放时先放到无序 bin 下次执行 malloc 时, 放入所属的常规 bin 何时放入常规 bin? /* Place the chunk in unsorted chunk list. Chunks are not placed into regular bins until after they have been given one chance to be used in malloc. */ 释放时先放到无序 bin 下次执行 malloc 时, 放入所属的常规 bin

More information

Memory Mapping. Sarah Diesburg COP5641

Memory Mapping. Sarah Diesburg COP5641 Memory Mapping Sarah Diesburg COP5641 Memory Mapping Translation of address issued by some device (e.g., CPU or I/O device) to address sent out on memory bus (physical address) Mapping is performed by

More information

Linux Memory Management

Linux Memory Management Linux Memory Management Virtual memory layout: a closer look Applications require memory with different properties access permissions sharing file backed vs. anonymous dynamically sized /proc/{pid}/maps

More information

HETEROGENEOUS MEMORY MANAGEMENT. Linux Plumbers Conference Jérôme Glisse

HETEROGENEOUS MEMORY MANAGEMENT. Linux Plumbers Conference Jérôme Glisse HETEROGENEOUS MEMORY MANAGEMENT Linux Plumbers Conference 2018 Jérôme Glisse EVERYTHING IS A POINTER All data structures rely on pointers, explicitly or implicitly: Explicit in languages like C, C++,...

More information

Running High Performance Computing Workloads on Red Hat Enterprise Linux

Running High Performance Computing Workloads on Red Hat Enterprise Linux Running High Performance Computing Workloads on Red Hat Enterprise Linux Imed Chihi Senior Technical Account Manager Red Hat Global Support Services 21 January 2014 Agenda 2 The case of HPC on commodity

More information

Memory Management. Fundamentally two related, but distinct, issues. Management of logical address space resource

Memory Management. Fundamentally two related, but distinct, issues. Management of logical address space resource Management Fundamentally two related, but distinct, issues Management of logical address space resource On IA-32, address space may be scarce resource for a user process (4 GB max) Management of physical

More information

Optimizing the TLB Shootdown Algorithm with Page Access Tracking

Optimizing the TLB Shootdown Algorithm with Page Access Tracking Optimizing the TLB Shootdown Algorithm with Page Access Tracking Nadav Amit VMware Research Group 2014 VMware Inc. All rights reserved. Translation Lookaside Buffer (TLB) Virtual Address PGD PUD PMD PTE

More information

Running Oracle on a 32 socket server with 24T of memory

Running Oracle on a 32 socket server with 24T of memory Running Oracle on a 32 socket server with 24T of memory Frits Hoogland 2013 Enkitec 1 `whoami` Frits Hoogland Working with Oracle products since 1996 Blog: hhp://fritshoogland.wordpress.com TwiHer: @fritshoogland

More information

If I Send a Special Message to. Richard F. Lewis IBM

If I Send a Special Message to. Richard F. Lewis IBM If I Send a Special Message to Linux Will it Answer? - 14591 Richard F. Lewis IBM rflewis@us.ibm.com Trademarks The following are trademarks of the International Business Machines Corporation in the United

More information

Looking Inside Memory

Looking Inside Memory Looking Inside Memory Tooling for tracing memory reference patterns Ankita Garg, Balbir Singh, Vaidyanathan Srinivasan IBM Linux Technology Centre, Bangalore {ankita, balbir, svaidy}@in.ibm.com Abstract

More information

CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems CSE 120 Principles of Operating Systems Spring 2018 Lecture 10: Paging Geoffrey M. Voelker Lecture Overview Today we ll cover more paging mechanisms: Optimizations Managing page tables (space) Efficient

More information

Flavors of Memory supported by Linux, their use and benefit. Christoph Lameter, Ph.D,

Flavors of Memory supported by Linux, their use and benefit. Christoph Lameter, Ph.D, Flavors of Memory supported by Linux, their use and benefit Christoph Lameter, Ph.D, Twitter: @qant Flavors Of Memory The term computer memory is a simple term but there are numerous nuances

More information

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part I: Operating system overview: Memory Management 1 Hardware background The role of primary memory Program

More information

Red Hat Enterprise Virtualization Hypervisor Roadmap. Bhavna Sarathy Senior Technology Product Manager, Red Hat

Red Hat Enterprise Virtualization Hypervisor Roadmap. Bhavna Sarathy Senior Technology Product Manager, Red Hat Red Hat Enterprise Virtualization Hypervisor Roadmap Bhavna Sarathy Senior Technology Product Manager, Red Hat RHEV Hypervisor 1 RHEV Hypervisor Themes & 2 Architecture & Use cases 3 Q&A 4 Future 5 } HYPERVISOR

More information

OPERATING SYSTEM. Chapter 9: Virtual Memory

OPERATING SYSTEM. Chapter 9: Virtual Memory OPERATING SYSTEM Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory

More information

ECE 571 Advanced Microprocessor-Based Design Lecture 12

ECE 571 Advanced Microprocessor-Based Design Lecture 12 ECE 571 Advanced Microprocessor-Based Design Lecture 12 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 1 March 2018 HW#6 will be posted Project will be coming up Announcements

More information

Live Migration: Even faster, now with a dedicated thread!

Live Migration: Even faster, now with a dedicated thread! Live Migration: Even faster, now with a dedicated thread! Juan Quintela Orit Wasserman Vinod Chegu KVM Forum 2012 Agenda Introduction Migration

More information

Who stole my CPU? Leonid Podolny Vineeth Remanan Pillai. Systems DigitalOcean

Who stole my CPU? Leonid Podolny Vineeth Remanan Pillai.  Systems DigitalOcean Who stole my CPU? Leonid Podolny Vineeth Remanan Pillai leonid@ vineeth@ Systems Engineering @ DigitalOcean 1 2 Introduction DigitalOcean Providing developers and businesses a reliable, easy-to-use cloud

More information

Lecture 12: Demand Paging

Lecture 12: Demand Paging Lecture 1: Demand Paging CSE 10: Principles of Operating Systems Alex C. Snoeren HW 3 Due 11/9 Complete Address Translation We started this topic with the high-level problem of translating virtual addresses

More information

ECE 571 Advanced Microprocessor-Based Design Lecture 13

ECE 571 Advanced Microprocessor-Based Design Lecture 13 ECE 571 Advanced Microprocessor-Based Design Lecture 13 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 21 March 2017 Announcements More on HW#6 When ask for reasons why cache

More information

CSE 120 Principles of Operating Systems Spring 2017

CSE 120 Principles of Operating Systems Spring 2017 CSE 120 Principles of Operating Systems Spring 2017 Lecture 12: Paging Lecture Overview Today we ll cover more paging mechanisms: Optimizations Managing page tables (space) Efficient translations (TLBs)

More information

HMM: GUP NO MORE! XDC Jérôme Glisse

HMM: GUP NO MORE! XDC Jérôme Glisse HMM: GUP NO MORE! XDC 2018 Jérôme Glisse HETEROGENEOUS COMPUTING CPU is dead, long live the CPU Heterogeneous computing is back, one device for each workload: GPUs for massively parallel workload Accelerators

More information

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1 Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 CPU management Roadmap Process, thread, synchronization, scheduling Memory management Virtual memory Disk

More information

Virtual Memory III. Jo, Heeseung

Virtual Memory III. Jo, Heeseung Virtual Memory III Jo, Heeseung Today's Topics What if the physical memory becomes full? Page replacement algorithms How to manage memory among competing processes? Advanced virtual memory techniques Shared

More information

Low latency & Mechanical Sympathy: Issues and solutions

Low latency & Mechanical Sympathy: Issues and solutions Low latency & Mechanical Sympathy: Issues and solutions Jean-Philippe BEMPEL Performance Architect @jpbempel http://jpbempel.blogspot.com ULLINK 2016 Low latency order router pure Java SE application FIX

More information

CS 152 Computer Architecture and Engineering

CS 152 Computer Architecture and Engineering CS 152 Computer Architecture and Engineering Lecture 12 -- Virtual Memory 2014-2-27 John Lazzaro (not a prof - John is always OK) TA: Eric Love www-inst.eecs.berkeley.edu/~cs152/ Play: CS 152 L12: Virtual

More information

CS 318 Principles of Operating Systems

CS 318 Principles of Operating Systems CS 318 Principles of Operating Systems Fall 2018 Lecture 10: Virtual Memory II Ryan Huang Slides adapted from Geoff Voelker s lectures Administrivia Next Tuesday project hacking day No class My office

More information

Maximizing Six-Core AMD Opteron Processor Performance with RHEL

Maximizing Six-Core AMD Opteron Processor Performance with RHEL Maximizing Six-Core AMD Opteron Processor Performance with RHEL Bhavna Sarathy Red Hat Technical Lead, AMD Sanjay Rao Senior Software Engineer, Red Hat Sept 4, 2009 1 Agenda Six-Core AMD Opteron processor

More information

2 nd Half. Memory management Disk management Network and Security Virtual machine

2 nd Half. Memory management Disk management Network and Security Virtual machine Final Review 1 2 nd Half Memory management Disk management Network and Security Virtual machine 2 Abstraction Virtual Memory (VM) 4GB (32bit) linear address space for each process Reality 1GB of actual

More information

Pentium/Linux Memory System March 17, 2005

Pentium/Linux Memory System March 17, 2005 15-213 The course that gives CMU its Zip! Topics Pentium/Linux Memory System March 17, 2005 P6 address translation x86-64 extensions Linux memory management Linux page fault handling Memory mapping 17-linuxmem.ppt

More information

KVM 在 OpenStack 中的应用. Dexin(Mark) Wu

KVM 在 OpenStack 中的应用. Dexin(Mark) Wu KVM 在 OpenStack 中的应用 Dexin(Mark) Wu Agenda Overview CPU Memory Storage Network Architecture Overview nova-api REST API nova-scheduler nova-conductor nova-compute DB RPC Call libvirt driver libvirt Cinder

More information

PAGE REPLACEMENT. Operating Systems 2015 Spring by Euiseong Seo

PAGE REPLACEMENT. Operating Systems 2015 Spring by Euiseong Seo PAGE REPLACEMENT Operating Systems 2015 Spring by Euiseong Seo Today s Topics What if the physical memory becomes full? Page replacement algorithms How to manage memory among competing processes? Advanced

More information

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1 Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 Recap Paged MMU: Two main Issues Translation speed can be slow TLB Table size is big Multi-level page table

More information

ECE 598 Advanced Operating Systems Lecture 14

ECE 598 Advanced Operating Systems Lecture 14 ECE 598 Advanced Operating Systems Lecture 14 Vince Weaver http://www.eece.maine.edu/~vweaver vincent.weaver@maine.edu 22 March 2016 Announcements 1 Got a Pi3 over break Pi3 Notes Very impressive performance,

More information

Troubleshooting Memory

Troubleshooting Memory This chapter contains the following sections: About, page 1 General/High Level Assessment of Platform Memory Utilization, page 2 Detailed Assessment of Platform Memory Utilization, page 2 User Processes,

More information

Letting Go. John Stultz August 30th

Letting Go. John Stultz August 30th Letting Go (A sensitive guide to dealing with application caches under the pressures of low memory) John Stultz August 30th 2012 http://www.linaro.org Overview Caching How mm/page management works Some

More information

Measuring a 25 Gb/s and 40 Gb/s data plane

Measuring a 25 Gb/s and 40 Gb/s data plane Measuring a 25 Gb/s and 40 Gb/s data plane Christo Kleu Pervaze Akhtar 1 Contents Preliminaries Equipment Traffic generators Test topologies Host and VM configuration NUMA Architecture CPU allocation BIOS

More information

COSC3330 Computer Architecture Lecture 20. Virtual Memory

COSC3330 Computer Architecture Lecture 20. Virtual Memory COSC3330 Computer Architecture Lecture 20. Virtual Memory Instructor: Weidong Shi (Larry), PhD Computer Science Department University of Houston Virtual Memory Topics Reducing Cache Miss Penalty (#2) Use

More information

Memory System Case Studies Oct. 13, 2008

Memory System Case Studies Oct. 13, 2008 Topics 15-213 Memory System Case Studies Oct. 13, 2008 P6 address translation x86-64 extensions Linux memory management Linux page fault handling Memory mapping Class15+.ppt Intel P6 (Bob Colwell s Chip,

More information

What s New in VMware vsphere 4.1 Performance. VMware vsphere 4.1

What s New in VMware vsphere 4.1 Performance. VMware vsphere 4.1 What s New in VMware vsphere 4.1 Performance VMware vsphere 4.1 T E C H N I C A L W H I T E P A P E R Table of Contents Scalability enhancements....................................................................

More information

An Evaluation of the Linux Virtual Memory Manager to Determine Suitability for Runtime Variation of Memory

An Evaluation of the Linux Virtual Memory Manager to Determine Suitability for Runtime Variation of Memory An Evaluation of the Linux Virtual Memory Manager to Determine Suitability for Runtime Variation of Memory by Vijay Kumar Muthukumaraswamy Sivakumar Thesis submitted to the faculty of the Virginia Polytechnic

More information

P6/Linux Memory System Nov 11, 2009"

P6/Linux Memory System Nov 11, 2009 P6/Linux Memory System Nov 11, 2009" REMEMBER" 2! 3! Intel P6" P6 Memory System" DRAM" external system bus (e.g. PCI)" L2" cache" cache bus! bus interface unit" inst" TLB" instruction" fetch unit" L1"

More information

Linux multi-core scalability

Linux multi-core scalability Linux multi-core scalability Oct 2009 Andi Kleen Intel Corporation andi@firstfloor.org Overview Scalability theory Linux history Some common scalability trouble-spots Application workarounds Motivation

More information

G Disco. Robert Grimm New York University

G Disco. Robert Grimm New York University G22.3250-001 Disco Robert Grimm New York University The Three Questions! What is the problem?! What is new or different?! What are the contributions and limitations? Background: ccnuma! Cache-coherent

More information

What is KVM? KVM patch. Modern hypervisors must do many things that are already done by OSs Scheduler, Memory management, I/O stacks

What is KVM? KVM patch. Modern hypervisors must do many things that are already done by OSs Scheduler, Memory management, I/O stacks LINUX-KVM The need for KVM x86 originally virtualization unfriendly No hardware provisions Instructions behave differently depending on privilege context(popf) Performance suffered on trap-and-emulate

More information

First-In-First-Out (FIFO) Algorithm

First-In-First-Out (FIFO) Algorithm First-In-First-Out (FIFO) Algorithm Reference string: 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1 3 frames (3 pages can be in memory at a time per process) 15 page faults Can vary by reference string:

More information

Linux VMM for Database Developers. Alexander Krizhanovsky Tempesta Technologies, NatSys Lab.

Linux VMM for Database Developers. Alexander Krizhanovsky Tempesta Technologies, NatSys Lab. Linux VMM for Database Developers Alexander Krizhanovsky Tempesta Technologies, NatSys Lab. ak@natsys-lab.com Who am I? CEO & CTO at NatSys Lab & Tempesta Technologies Tempesta Technologies (Seattle, WA)

More information

Virtual Memory Management

Virtual Memory Management Virtual Memory Management CS-3013 Operating Systems Hugh C. Lauer (Slides include materials from Slides include materials from Modern Operating Systems, 3 rd ed., by Andrew Tanenbaum and from Operating

More information

The Shadowy Depths of the KVM MMU. KVM Forum 2007

The Shadowy Depths of the KVM MMU. KVM Forum 2007 The Shadowy Depths of the KVM MMU KVM Forum 2007 Agenda A quick recap of x86 paging Shadow paging in general Goals for the KVM MMU The gory details Paging on x86 Function: translate virtual addresses to

More information

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1 Virtual Memory Patterson & Hennessey Chapter 5 ELEC 5200/6200 1 Virtual Memory Use main memory as a cache for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs

More information

1. Creates the illusion of an address space much larger than the physical memory

1. Creates the illusion of an address space much larger than the physical memory Virtual memory Main Memory Disk I P D L1 L2 M Goals Physical address space Virtual address space 1. Creates the illusion of an address space much larger than the physical memory 2. Make provisions for

More information

CS 153 Design of Operating Systems Winter 2016

CS 153 Design of Operating Systems Winter 2016 CS 153 Design of Operating Systems Winter 2016 Lecture 17: Paging Lecture Overview Recap: Today: Goal of virtual memory management: map 2^32 byte address space to physical memory Internal fragmentation

More information

KVM Weather Report. Red Hat Author Gleb Natapov May 29, 2013

KVM Weather Report. Red Hat Author Gleb Natapov May 29, 2013 KVM Weather Report Red Hat Author Gleb Natapov May 29, 2013 Part I What is KVM Section 1 KVM Features KVM Features 4 KVM features VT-x/AMD-V (hardware virtualization) EPT/NPT (two dimensional paging) CPU/memory

More information

Virtual Memory. Robert Grimm New York University

Virtual Memory. Robert Grimm New York University Virtual Memory Robert Grimm New York University The Three Questions What is the problem? What is new or different? What are the contributions and limitations? VAX/VMS VAX-11 Memory Hardware Each process

More information

Operating Systems Design Exam 2 Review: Spring 2011

Operating Systems Design Exam 2 Review: Spring 2011 Operating Systems Design Exam 2 Review: Spring 2011 Paul Krzyzanowski pxk@cs.rutgers.edu 1 Question 1 CPU utilization tends to be lower when: a. There are more processes in memory. b. There are fewer processes

More information

Tuning Your SUSE Linux Enterprise Virtualization Stack. Jim Fehlig Software Engineer

Tuning Your SUSE Linux Enterprise Virtualization Stack. Jim Fehlig Software Engineer Tuning Your SUSE Linux Enterprise Virtualization Stack Jim Fehlig Software Engineer jfehlig@suse.com Agenda General guidelines Network Disk CPU Memory NUMA 2 General Guidelines Minimize software installed

More information

CPS104 Computer Organization and Programming Lecture 16: Virtual Memory. Robert Wagner

CPS104 Computer Organization and Programming Lecture 16: Virtual Memory. Robert Wagner CPS104 Computer Organization and Programming Lecture 16: Virtual Memory Robert Wagner cps 104 VM.1 RW Fall 2000 Outline of Today s Lecture Virtual Memory. Paged virtual memory. Virtual to Physical translation:

More information

Paging. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Paging. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University Paging Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu SSE3044: Operating Systems, Fall 2016, Jinkyu Jeong (jinkyu@skku.edu) Paging Allows the physical

More information

virtio-mem: Paravirtualized Memory

virtio-mem: Paravirtualized Memory virtio-mem: Paravirtualized Memory, Edinburgh, Scotland David Hildenbrand Software Engineer 26. October 2018 AGENDA Memory Hot(un)plug and Ballooning * Basics Main Differences (Selected) Issues Hyper-V

More information

CS 416: Opera-ng Systems Design March 23, 2012

CS 416: Opera-ng Systems Design March 23, 2012 Question 1 Operating Systems Design Exam 2 Review: Spring 2011 Paul Krzyzanowski pxk@cs.rutgers.edu CPU utilization tends to be lower when: a. There are more processes in memory. b. There are fewer processes

More information

CS 261 Fall Mike Lam, Professor. Virtual Memory

CS 261 Fall Mike Lam, Professor. Virtual Memory CS 261 Fall 2016 Mike Lam, Professor Virtual Memory Topics Operating systems Address spaces Virtual memory Address translation Memory allocation Lingering questions What happens when you call malloc()?

More information

SRM-Buffer: An OS Buffer Management SRM-Buffer: An OS Buffer Management Technique toprevent Last Level Cache from Thrashing in Multicores

SRM-Buffer: An OS Buffer Management SRM-Buffer: An OS Buffer Management Technique toprevent Last Level Cache from Thrashing in Multicores SRM-Buffer: An OS Buffer Management SRM-Buffer: An OS Buffer Management Technique toprevent Last Level Cache from Thrashing in Multicores Xiaoning Ding The Ohio State University dingxn@cse.ohiostate.edu

More information

ECE 598 Advanced Operating Systems Lecture 14

ECE 598 Advanced Operating Systems Lecture 14 ECE 598 Advanced Operating Systems Lecture 14 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 22 March 2018 HW#6 was due. Announcements HW#7 will be posted eventually. Project

More information

Paging. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Paging. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Paging Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Paging Allows the physical address space of a process to be noncontiguous Divide virtual

More information

Nested Virtualization and Server Consolidation

Nested Virtualization and Server Consolidation Nested Virtualization and Server Consolidation Vara Varavithya Department of Electrical Engineering, KMUTNB varavithya@gmail.com 1 Outline Virtualization & Background Nested Virtualization Hybrid-Nested

More information

Low overhead virtual machines tracing in a cloud infrastructure

Low overhead virtual machines tracing in a cloud infrastructure Low overhead virtual machines tracing in a cloud infrastructure Mohamad Gebai Michel Dagenais Dec 7, 2012 École Polytechnique de Montreal Content Area of research Current tracing: LTTng vs ftrace / virtio

More information

Storage Performance Tuning for FAST! Virtual Machines

Storage Performance Tuning for FAST! Virtual Machines Storage Performance Tuning for FAST! Virtual Machines Fam Zheng Senior Software Engineer LC3-2018 Outline Virtual storage provisioning NUMA pinning VM configuration options Summary Appendix 2 Virtual storage

More information

Chapter 8: Virtual Memory. Operating System Concepts

Chapter 8: Virtual Memory. Operating System Concepts Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2009 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

Spring 2017 :: CSE 506. Introduction to. Virtual Machines. Nima Honarmand

Spring 2017 :: CSE 506. Introduction to. Virtual Machines. Nima Honarmand Introduction to Virtual Machines Nima Honarmand Virtual Machines & Hypervisors Virtual Machine: an abstraction of a complete compute environment through the combined virtualization of the processor, memory,

More information

Memory Management Strategies for Data Serving with RDMA

Memory Management Strategies for Data Serving with RDMA Memory Management Strategies for Data Serving with RDMA Dennis Dalessandro and Pete Wyckoff (presenting) Ohio Supercomputer Center {dennis,pw}@osc.edu HotI'07 23 August 2007 Motivation Increasing demands

More information

Page Frame Reclaiming

Page Frame Reclaiming Page Frame Reclaiming Don Porter Binary Formats RCU Memory Management File System Logical Diagram Memory Allocators Threads System Calls Today s Lecture Networking (kernel level Sync mem. management) Device

More information

Agilio CX 2x40GbE with OVS-TC

Agilio CX 2x40GbE with OVS-TC PERFORMANCE REPORT Agilio CX 2x4GbE with OVS-TC OVS-TC WITH AN AGILIO CX SMARTNIC CAN IMPROVE A SIMPLE L2 FORWARDING USE CASE AT LEAST 2X. WHEN SCALED TO REAL LIFE USE CASES WITH COMPLEX RULES TUNNELING

More information

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. November 15, MIT Fall 2018 L20-1

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. November 15, MIT Fall 2018 L20-1 Virtual Memory Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. L20-1 Reminder: Operating Systems Goals of OS: Protection and privacy: Processes cannot access each other s data Abstraction:

More information

Linux-tiny And Directions For Small Systems

Linux-tiny And Directions For Small Systems Linux-tiny And Directions For Small Systems Matt Mackall mpm@digeo.com July, 2004 The Problem: Kernel Bloat The Problem: Kernel Bloat 1994: 0.99 kernel 16MHz 386SX 4MB of RAM The Problem: Kernel Bloat

More information

Intel P6 (Bob Colwell s Chip, CMU Alumni) The course that gives CMU its Zip! Memory System Case Studies November 7, 2007.

Intel P6 (Bob Colwell s Chip, CMU Alumni) The course that gives CMU its Zip! Memory System Case Studies November 7, 2007. class.ppt 15-213 The course that gives CMU its Zip! ory System Case Studies November 7, 07 Topics P6 address translation x86-64 extensions Linux memory management Linux fault handling ory mapping Intel

More information

Oracle Corporation. Speaker: Dan Magenheimer. without the Commitment. Memory Overcommit. <Insert Picture Here>

Oracle Corporation. Speaker: Dan Magenheimer. without the Commitment. Memory Overcommit. <Insert Picture Here> 2008 Memory Overcommit without the Commitment Speaker: Dan Magenheimer Oracle Corporation Overview What is overcommitment? aka oversubscription or overbooking Why (and why not) overcommit

More information

Virtual to physical address translation

Virtual to physical address translation Virtual to physical address translation Virtual memory with paging Page table per process Page table entry includes present bit frame number modify bit flags for protection and sharing. Page tables can

More information

PERFORMANCE STUDY OCTOBER 2017 ORACLE MONSTER VIRTUAL MACHINE PERFORMANCE. VMware vsphere 6.5

PERFORMANCE STUDY OCTOBER 2017 ORACLE MONSTER VIRTUAL MACHINE PERFORMANCE. VMware vsphere 6.5 PERFORMANCE STUDY OCTOBER 2017 ORACLE MONSTER VIRTUAL MACHINE PERFORMANCE VMware vsphere 6.5 Table of Contents Executive Summary...3 Introduction...3 Test Environment... 4 Test Workload... 5 Virtual Machine

More information

CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems CSE 120 Principles of Operating Systems Spring 2018 Lecture 15: Multicore Geoffrey M. Voelker Multicore Operating Systems We have generally discussed operating systems concepts independent of the number

More information

Red Hat Summit 2009 Rik van Riel

Red Hat Summit 2009 Rik van Riel 1 The Turtle And The Hare A Tale of Two Kernels Rik van Riel Senior Software Engineer, Red Hat September 3, 2009 2 The Turtle And The Hare A Tale of Two Kernels Rik van Riel Senior Software Engineer, Red

More information

KVM Weather Report. Amit Shah SCALE 14x

KVM Weather Report. Amit Shah SCALE 14x KVM Weather Report amit.shah@redhat.com SCALE 14x Copyright 2016, Licensed under the Creative Commons Attribution-ShareAlike License, CC-BY-SA. Virtualization Stack Virtualization Stack 3 QEMU Creates

More information

Fast access ===> use map to find object. HW == SW ===> map is in HW or SW or combo. Extend range ===> longer, hierarchical names

Fast access ===> use map to find object. HW == SW ===> map is in HW or SW or combo. Extend range ===> longer, hierarchical names Fast access ===> use map to find object HW == SW ===> map is in HW or SW or combo Extend range ===> longer, hierarchical names How is map embodied: --- L1? --- Memory? The Environment ---- Long Latency

More information