SlideShare a Scribd company logo
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Allocating Kernel Memory
10.2 Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Allocating Kernel Memory
 Treated differently from user memory
 Often allocated from a free-memory pool
 Kernel requests memory for structures of varying sizes
 Some kernel memory needs to be contiguous
 I.e. for device I/O
10.3 Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Buddy System
 Allocates memory from fixed-size segment consisting of physically-contiguous
pages
 Memory allocated using power-of-2 allocator
 Satisfies requests in units sized as power of 2
 Request rounded up to next highest power of 2
 When smaller allocation needed than is available, current chunk split into
two buddies of next-lower power of 2
 Continue until appropriate sized chunk available
 For example, assume 256KB chunk available, kernel requests 21KB
 Split into AL and AR of 128KB each
 One further divided into BL and BR of 64KB
– One further into CL and CR of 32KB each – one used to satisfy
request
 Advantage – quickly coalesce unused chunks into larger chunk
 Disadvantage - fragmentation
10.4 Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Buddy System Allocator
10.5 Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Slab Allocator
 Alternate strategy
 Slab is one or more physically contiguous pages
 Cache consists of one or more slabs
 Single cache for each unique kernel data structure
 Each cache filled with objects – instantiations of the data structure
 When cache created, filled with objects marked as free
 When structures stored, objects marked as used
 If slab is full of used objects, next object allocated from empty slab
 If no empty slabs, new slab allocated
 Benefits include no fragmentation, fast memory request satisfaction
10.6 Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Slab Allocation
10.7 Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Slab Allocator in Linux
 For example process descriptor is of type struct task_struct
 Approx 1.7KB of memory
 New task -> allocate new struct from cache
 Will use existing free struct task_struct
 Slab can be in three possible states
1. Full – all used
2. Empty – all free
3. Partial – mix of free and used
 Upon request, slab allocator
1. Uses free struct in partial slab
2. If none, takes one from empty slab
3. If no empty slab, create new empty
10.8 Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Slab Allocator in Linux (Cont.)
 Slab started in Solaris, now wide-spread for both kernel mode and user
memory in various OSes
 Linux 2.2 had SLAB, now has both SLOB and SLUB allocators
 SLOB for systems with limited memory
 Simple List of Blocks – maintains 3 list objects for small, medium, large
objects
 SLUB is performance-optimized SLAB removes per-CPU queues,
metadata stored in page structure

More Related Content

What's hot

Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - Kafka
Mayank Bansal
 
The Google File System (GFS)
The Google File System (GFS)The Google File System (GFS)
The Google File System (GFS)
Romain Jacotin
 
Object Storage Overview
Object Storage OverviewObject Storage Overview
Object Storage Overview
Cloudian
 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance
SHIKHA GAUTAM
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
Clement Demonchy
 
Google file system GFS
Google file system GFSGoogle file system GFS
Google file system GFS
zihad164
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
Srikrishna k
 
Memory Management
Memory ManagementMemory Management
Memory Management
jayalakshmi268
 
google file system
google file systemgoogle file system
google file system
diptipan
 
Object storage
Object storageObject storage
Object storage
akash tambakad
 
Main Memory
Main MemoryMain Memory
Main Memory
Jenny Galino
 
Linux and windows file system
Linux and windows  file systemLinux and windows  file system
Linux and windows file system
lin yucheng
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Etsuji Nakai
 
Monitoring kubernetes with prometheus
Monitoring kubernetes with prometheusMonitoring kubernetes with prometheus
Monitoring kubernetes with prometheus
Brice Fernandes
 
Allocating of Frames.pptx
Allocating of Frames.pptxAllocating of Frames.pptx
Allocating of Frames.pptx
infomerlin
 
Distributed data processing
Distributed data processingDistributed data processing
Distributed data processing
Ayisha Kowsar
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
Krishna-Kumar
 
Everything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in KubernetesEverything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 
Chapter 3: Processes
Chapter 3: ProcessesChapter 3: Processes
Chapter 3: Processes
Shafaan Khaliq Bhatti
 
Introduction to HPC
Introduction to HPCIntroduction to HPC
Introduction to HPC
Chris Dwan
 

What's hot (20)

Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - Kafka
 
The Google File System (GFS)
The Google File System (GFS)The Google File System (GFS)
The Google File System (GFS)
 
Object Storage Overview
Object Storage OverviewObject Storage Overview
Object Storage Overview
 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Google file system GFS
Google file system GFSGoogle file system GFS
Google file system GFS
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
google file system
google file systemgoogle file system
google file system
 
Object storage
Object storageObject storage
Object storage
 
Main Memory
Main MemoryMain Memory
Main Memory
 
Linux and windows file system
Linux and windows  file systemLinux and windows  file system
Linux and windows file system
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
 
Monitoring kubernetes with prometheus
Monitoring kubernetes with prometheusMonitoring kubernetes with prometheus
Monitoring kubernetes with prometheus
 
Allocating of Frames.pptx
Allocating of Frames.pptxAllocating of Frames.pptx
Allocating of Frames.pptx
 
Distributed data processing
Distributed data processingDistributed data processing
Distributed data processing
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
 
Everything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in KubernetesEverything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in Kubernetes
 
Chapter 3: Processes
Chapter 3: ProcessesChapter 3: Processes
Chapter 3: Processes
 
Introduction to HPC
Introduction to HPCIntroduction to HPC
Introduction to HPC
 

Similar to Allocating Kernel Memory.pptx

Google File System
Google File SystemGoogle File System
Google File System
DreamJobs1
 
A presentaion on Panasas HPC NAS
A presentaion on Panasas HPC NASA presentaion on Panasas HPC NAS
A presentaion on Panasas HPC NAS
Rahul Janghel
 
342557457-Tcs-d-DBA-Rac.ppt
342557457-Tcs-d-DBA-Rac.ppt342557457-Tcs-d-DBA-Rac.ppt
342557457-Tcs-d-DBA-Rac.ppt
NithinRoy12
 
Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)
Prashanth Kumar
 
Linux memory consumption
Linux memory consumptionLinux memory consumption
Linux memory consumption
haish
 
A guide of PostgreSQL on Kubernetes
A guide of PostgreSQL on KubernetesA guide of PostgreSQL on Kubernetes
A guide of PostgreSQL on Kubernetes
t8kobayashi
 
Mastering OpenStack - Episode 07 - Compute Nodes
Mastering OpenStack - Episode 07 - Compute NodesMastering OpenStack - Episode 07 - Compute Nodes
Mastering OpenStack - Episode 07 - Compute Nodes
Roozbeh Shafiee
 
Advance google file system
Advance google file systemAdvance google file system
Advance google file system
Lalit Rastogi
 
Avi Apelbaum - RAC
Avi Apelbaum - RAC Avi Apelbaum - RAC
Avi Apelbaum - RAC
gridcontrol
 
Jaspreet webinar-cns
Jaspreet webinar-cnsJaspreet webinar-cns
Jaspreet webinar-cns
Jaspreet Kaur
 
ch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxch8-1 (final Memory).pptx
ch8-1 (final Memory).pptx
AnamRiaz31
 
ch9.pptx
ch9.pptxch9.pptx
ch9.pptx
farzeenabaid01
 
ch9.pptx
ch9.pptxch9.pptx
2800-lecture8-memeory-management in operating system.pdf
2800-lecture8-memeory-management in operating system.pdf2800-lecture8-memeory-management in operating system.pdf
2800-lecture8-memeory-management in operating system.pdf
YawkalAddis
 
[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions
ITviec
 
Chapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatzChapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatz
GiulianoRanauro
 
Updates
UpdatesUpdates
Updates
UpdatesUpdates
Configuring Aerospike - Part 2
Configuring Aerospike - Part 2 Configuring Aerospike - Part 2
Configuring Aerospike - Part 2
Aerospike, Inc.
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.ppt
infomerlin
 

Similar to Allocating Kernel Memory.pptx (20)

Google File System
Google File SystemGoogle File System
Google File System
 
A presentaion on Panasas HPC NAS
A presentaion on Panasas HPC NASA presentaion on Panasas HPC NAS
A presentaion on Panasas HPC NAS
 
342557457-Tcs-d-DBA-Rac.ppt
342557457-Tcs-d-DBA-Rac.ppt342557457-Tcs-d-DBA-Rac.ppt
342557457-Tcs-d-DBA-Rac.ppt
 
Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)
 
Linux memory consumption
Linux memory consumptionLinux memory consumption
Linux memory consumption
 
A guide of PostgreSQL on Kubernetes
A guide of PostgreSQL on KubernetesA guide of PostgreSQL on Kubernetes
A guide of PostgreSQL on Kubernetes
 
Mastering OpenStack - Episode 07 - Compute Nodes
Mastering OpenStack - Episode 07 - Compute NodesMastering OpenStack - Episode 07 - Compute Nodes
Mastering OpenStack - Episode 07 - Compute Nodes
 
Advance google file system
Advance google file systemAdvance google file system
Advance google file system
 
Avi Apelbaum - RAC
Avi Apelbaum - RAC Avi Apelbaum - RAC
Avi Apelbaum - RAC
 
Jaspreet webinar-cns
Jaspreet webinar-cnsJaspreet webinar-cns
Jaspreet webinar-cns
 
ch8-1 (final Memory).pptx
ch8-1 (final Memory).pptxch8-1 (final Memory).pptx
ch8-1 (final Memory).pptx
 
ch9.pptx
ch9.pptxch9.pptx
ch9.pptx
 
ch9.pptx
ch9.pptxch9.pptx
ch9.pptx
 
2800-lecture8-memeory-management in operating system.pdf
2800-lecture8-memeory-management in operating system.pdf2800-lecture8-memeory-management in operating system.pdf
2800-lecture8-memeory-management in operating system.pdf
 
[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions
 
Chapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatzChapter 9 Operating Systems silberschatz
Chapter 9 Operating Systems silberschatz
 
Updates
UpdatesUpdates
Updates
 
Updates
UpdatesUpdates
Updates
 
Configuring Aerospike - Part 2
Configuring Aerospike - Part 2 Configuring Aerospike - Part 2
Configuring Aerospike - Part 2
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.ppt
 

More from infomerlin

GSC-21_029_4_09_TSDSI-R1-1.pptx
GSC-21_029_4_09_TSDSI-R1-1.pptxGSC-21_029_4_09_TSDSI-R1-1.pptx
GSC-21_029_4_09_TSDSI-R1-1.pptx
infomerlin
 
sat-ppt.pptx
sat-ppt.pptxsat-ppt.pptx
sat-ppt.pptx
infomerlin
 
Paging.ppt
Paging.pptPaging.ppt
Paging.ppt
infomerlin
 
Page Replacement Algorithms.pptx
Page Replacement Algorithms.pptxPage Replacement Algorithms.pptx
Page Replacement Algorithms.pptx
infomerlin
 
Segmentation.ppt
Segmentation.pptSegmentation.ppt
Segmentation.ppt
infomerlin
 
Deadlock Detection.pptx
Deadlock Detection.pptxDeadlock Detection.pptx
Deadlock Detection.pptx
infomerlin
 
Deadlock Prevention.pptx
Deadlock Prevention.pptxDeadlock Prevention.pptx
Deadlock Prevention.pptx
infomerlin
 
Frame detection.pdf
Frame detection.pdfFrame detection.pdf
Frame detection.pdf
infomerlin
 
Deadlock Backgroud.pptx
Deadlock Backgroud.pptxDeadlock Backgroud.pptx
Deadlock Backgroud.pptx
infomerlin
 
5G Hackathon - Brainstorming Session.pptx
5G Hackathon - Brainstorming Session.pptx5G Hackathon - Brainstorming Session.pptx
5G Hackathon - Brainstorming Session.pptx
infomerlin
 
LNA.ppt
LNA.pptLNA.ppt
LNA.ppt
infomerlin
 
Lecture 4.pptx
Lecture 4.pptxLecture 4.pptx
Lecture 4.pptx
infomerlin
 
System Calls.ppt
System Calls.pptSystem Calls.ppt
System Calls.ppt
infomerlin
 
Lec 6 OS structure and Operations.ppt
Lec 6 OS structure and Operations.pptLec 6 OS structure and Operations.ppt
Lec 6 OS structure and Operations.ppt
infomerlin
 
cs-intro-os.ppt
cs-intro-os.pptcs-intro-os.ppt
cs-intro-os.ppt
infomerlin
 
Lecture-2 Signal-Spectra-Modulation.pptx
Lecture-2 Signal-Spectra-Modulation.pptxLecture-2 Signal-Spectra-Modulation.pptx
Lecture-2 Signal-Spectra-Modulation.pptx
infomerlin
 
Noise in AM systems.ppt
Noise in AM systems.pptNoise in AM systems.ppt
Noise in AM systems.ppt
infomerlin
 
Lecture 22 Threshold effects in FM.pptx
Lecture 22 Threshold effects in FM.pptxLecture 22 Threshold effects in FM.pptx
Lecture 22 Threshold effects in FM.pptx
infomerlin
 
Lecture-5 AM Signal Generation – Type 1.pptx
Lecture-5 AM Signal Generation – Type 1.pptxLecture-5 AM Signal Generation – Type 1.pptx
Lecture-5 AM Signal Generation – Type 1.pptx
infomerlin
 
Lecture-3 Need for Modulation.pptx
Lecture-3 Need for Modulation.pptxLecture-3 Need for Modulation.pptx
Lecture-3 Need for Modulation.pptx
infomerlin
 

More from infomerlin (20)

GSC-21_029_4_09_TSDSI-R1-1.pptx
GSC-21_029_4_09_TSDSI-R1-1.pptxGSC-21_029_4_09_TSDSI-R1-1.pptx
GSC-21_029_4_09_TSDSI-R1-1.pptx
 
sat-ppt.pptx
sat-ppt.pptxsat-ppt.pptx
sat-ppt.pptx
 
Paging.ppt
Paging.pptPaging.ppt
Paging.ppt
 
Page Replacement Algorithms.pptx
Page Replacement Algorithms.pptxPage Replacement Algorithms.pptx
Page Replacement Algorithms.pptx
 
Segmentation.ppt
Segmentation.pptSegmentation.ppt
Segmentation.ppt
 
Deadlock Detection.pptx
Deadlock Detection.pptxDeadlock Detection.pptx
Deadlock Detection.pptx
 
Deadlock Prevention.pptx
Deadlock Prevention.pptxDeadlock Prevention.pptx
Deadlock Prevention.pptx
 
Frame detection.pdf
Frame detection.pdfFrame detection.pdf
Frame detection.pdf
 
Deadlock Backgroud.pptx
Deadlock Backgroud.pptxDeadlock Backgroud.pptx
Deadlock Backgroud.pptx
 
5G Hackathon - Brainstorming Session.pptx
5G Hackathon - Brainstorming Session.pptx5G Hackathon - Brainstorming Session.pptx
5G Hackathon - Brainstorming Session.pptx
 
LNA.ppt
LNA.pptLNA.ppt
LNA.ppt
 
Lecture 4.pptx
Lecture 4.pptxLecture 4.pptx
Lecture 4.pptx
 
System Calls.ppt
System Calls.pptSystem Calls.ppt
System Calls.ppt
 
Lec 6 OS structure and Operations.ppt
Lec 6 OS structure and Operations.pptLec 6 OS structure and Operations.ppt
Lec 6 OS structure and Operations.ppt
 
cs-intro-os.ppt
cs-intro-os.pptcs-intro-os.ppt
cs-intro-os.ppt
 
Lecture-2 Signal-Spectra-Modulation.pptx
Lecture-2 Signal-Spectra-Modulation.pptxLecture-2 Signal-Spectra-Modulation.pptx
Lecture-2 Signal-Spectra-Modulation.pptx
 
Noise in AM systems.ppt
Noise in AM systems.pptNoise in AM systems.ppt
Noise in AM systems.ppt
 
Lecture 22 Threshold effects in FM.pptx
Lecture 22 Threshold effects in FM.pptxLecture 22 Threshold effects in FM.pptx
Lecture 22 Threshold effects in FM.pptx
 
Lecture-5 AM Signal Generation – Type 1.pptx
Lecture-5 AM Signal Generation – Type 1.pptxLecture-5 AM Signal Generation – Type 1.pptx
Lecture-5 AM Signal Generation – Type 1.pptx
 
Lecture-3 Need for Modulation.pptx
Lecture-3 Need for Modulation.pptxLecture-3 Need for Modulation.pptx
Lecture-3 Need for Modulation.pptx
 

Recently uploaded

学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
TaghreedAltamimi
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
bijceesjournal
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
riddhimaagrawal986
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
IJECEIAES
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
Madan Karki
 
Data Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptxData Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptx
ramrag33
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
GauravCar
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
LAXMAREDDY22
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
integral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdfintegral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdf
gaafergoudaay7aga
 

Recently uploaded (20)

学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
 
Data Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptxData Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptx
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
integral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdfintegral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdf
 

Allocating Kernel Memory.pptx

  • 1. Silberschatz, Galvin and Gagne ©2018 Operating System Concepts – 10th Edition Allocating Kernel Memory
  • 2. 10.2 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts – 10th Edition Allocating Kernel Memory  Treated differently from user memory  Often allocated from a free-memory pool  Kernel requests memory for structures of varying sizes  Some kernel memory needs to be contiguous  I.e. for device I/O
  • 3. 10.3 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts – 10th Edition Buddy System  Allocates memory from fixed-size segment consisting of physically-contiguous pages  Memory allocated using power-of-2 allocator  Satisfies requests in units sized as power of 2  Request rounded up to next highest power of 2  When smaller allocation needed than is available, current chunk split into two buddies of next-lower power of 2  Continue until appropriate sized chunk available  For example, assume 256KB chunk available, kernel requests 21KB  Split into AL and AR of 128KB each  One further divided into BL and BR of 64KB – One further into CL and CR of 32KB each – one used to satisfy request  Advantage – quickly coalesce unused chunks into larger chunk  Disadvantage - fragmentation
  • 4. 10.4 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts – 10th Edition Buddy System Allocator
  • 5. 10.5 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts – 10th Edition Slab Allocator  Alternate strategy  Slab is one or more physically contiguous pages  Cache consists of one or more slabs  Single cache for each unique kernel data structure  Each cache filled with objects – instantiations of the data structure  When cache created, filled with objects marked as free  When structures stored, objects marked as used  If slab is full of used objects, next object allocated from empty slab  If no empty slabs, new slab allocated  Benefits include no fragmentation, fast memory request satisfaction
  • 6. 10.6 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts – 10th Edition Slab Allocation
  • 7. 10.7 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts – 10th Edition Slab Allocator in Linux  For example process descriptor is of type struct task_struct  Approx 1.7KB of memory  New task -> allocate new struct from cache  Will use existing free struct task_struct  Slab can be in three possible states 1. Full – all used 2. Empty – all free 3. Partial – mix of free and used  Upon request, slab allocator 1. Uses free struct in partial slab 2. If none, takes one from empty slab 3. If no empty slab, create new empty
  • 8. 10.8 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts – 10th Edition Slab Allocator in Linux (Cont.)  Slab started in Solaris, now wide-spread for both kernel mode and user memory in various OSes  Linux 2.2 had SLAB, now has both SLOB and SLUB allocators  SLOB for systems with limited memory  Simple List of Blocks – maintains 3 list objects for small, medium, large objects  SLUB is performance-optimized SLAB removes per-CPU queues, metadata stored in page structure