SlideShare a Scribd company logo
1 of 32
Download to read offline
Suvendu Kumar Dash
Suvendu.15292@gmail.com
M.Tech ECE
VtP1492

 Memory Structure of Linux OS.
 How Program is loaded into the memory.
 Address Translation.
 Feature for Multithreading and Multiprocessing.
Overview
10/10/2014 suvendu.15292@gmail.com 2

 Linux is one of popular version of UNIX operating
System.
 It is open source as its source code is freely available.
 It is free to use. Linux was designed considering
UNIX compatibility.
 It's functionality list is quite similar to that of UNIX.
Linux OS
10/10/2014 suvendu.15292@gmail.com 3

Linux Operating System has primarily three components
 Kernel - Kernel is the core part of Linux. It is responsible for all
major activities of this operating system. It is consists of various
modules and it interacts directly with the underlying hardware.
Kernel provides the required abstraction to hide low level
hardware details to system or application programs.
 System Library - System libraries are special functions or
programs using which application programs or system utilities
accesses Kernel's features. These libraries implements most of
the functionalities of the operating system and do not requires
kernel module's code access rights.
 System Utility - System Utility programs are responsible to do
specialized, individual level tasks.
Components of Linux System
10/10/2014 suvendu.15292@gmail.com 4

Components of Linux System
10/10/2014 suvendu.15292@gmail.com 5

 User Space
 Kernel Space
 Data Flow Between User Space and Kernel Space
 Architecture
Kernel Architecture Overview
10/10/2014 suvendu.15292@gmail.com 6

 The User Space is the space in memory, where user
processes run.
 This memory is above the Kernel.
 It includes the rest of available memory.
 This Space is protected.
 The system prevents one process from interfering with
another process.
 Only Kernel processes can access a user process
Kernel Architecture Overview..
User Space
10/10/2014 suvendu.15292@gmail.com 7

 The Kernel Space is the space in memory where all
kernel services are provided via kernel processes.
 The user has access to it only through the system
call.
 A user process becomes a kernel process when it
executes a system call.
Kernel Architecture Overview..
Kernel Space
10/10/2014 suvendu.15292@gmail.com 8

 User Space and Kernel Space are in different spaces.
 When a System Call is executed, the arguments to
the call are passed from User Space to Kernel Space.
Kernel Architecture Overview..
System Call
10/10/2014 suvendu.15292@gmail.com 9

Kernel Architecture Overview..
User Space and Kernel Space
Relationship
10/10/2014 suvendu.15292@gmail.com 10

Kernel Architecture Overview..
Architecture
10/10/2014 suvendu.15292@gmail.com 11
10/10/2014 suvendu.15292@gmail.com 12
Address Translation

 Address translations are kept in a special cache
called Translation Look-Aside Buffer or TLB
 TLB must be on chip; its access time is comparable to
cache.
10/10/2014 suvendu.15292@gmail.com 13
Address Translation

10/10/2014 suvendu.15292@gmail.com 14
Address Translation
Typical TLB Format
 Tag: Portion of virtual address
 Data: Physical Page number
 Dirty: since use write back, need to know whether or
not to write page to disk when replaced
 Ref: Used to help calculate LRU on replacement
 Valid: Entry is valid
 Access rights: R (read permission), W (write perm.)

 TLBs usually small, typically 128-256 entries.
 Like any other cache, the TLB can be fully
associative, set associative, or direct mapped.
10/10/2014 suvendu.15292@gmail.com 15
Address Translation
Translation Look_Aside
Buffers

 Assume 32 entries, fully associative TLB
(Alpha AXP 21064)
1: Processor sends the virtual address to all tags
2: If there is a hit (there is an entry in TLB with that
Virtual Page number and valid bit is 1) and there is no
access violation, then
3: Matching tag sends the corresponding Physical Page
number
4: Combine Physical Page number and Page Offset to
get full physical address
10/10/2014 suvendu.15292@gmail.com 16
Address Translation
Translation Look_Aside
Buffers
10/10/2014 suvendu.15292@gmail.com 17
Feature for Multithreading and
Multiprocessing
What is Thread?
 A thread is a flow of execution through the process code, with its
own program counter, system registers and stack.
 A thread is also called a light weight process.
 Threads provide a way to improve application performance
through parallelism. Threads represent a software approach to
improving performance of operating system by reducing the
overhead thread is equivalent to a classical process.
 Each thread belongs to exactly one process and no thread can exist
outside a process.
 Each thread represents a separate flow of control.
 Threads have been successfully used in implementing network
servers and web server.
 They also provide a suitable foundation for parallel execution of
applications on shared memory multiprocessors.
10/10/2014 suvendu.15292@gmail.com 18
Multithreading

10/10/2014 suvendu.15292@gmail.com 19
Multithreading..

10/10/2014 suvendu.15292@gmail.com 20
Multithreading..
Advantages of Thread
 Thread minimize context switching time.
 Use of threads provides concurrency within a
process.
 Efficient communication.
 Economy- It is more economical to create and
context switch threads.
 Utilization of multiprocessor architectures to a
greater scale and efficiency.

10/10/2014 suvendu.15292@gmail.com 21
Multithreading..
Types of Thread
Threads are implemented in following two ways
 User Level Threads -- User managed threads
 Kernel Level Threads -- Operating System managed
threads acting on kernel, an operating system core.

10/10/2014 suvendu.15292@gmail.com 22
Multithreading..
User Level Threads
 In this case, application
manages thread
management kernel is not
aware of the existence of
threads.
 The thread library contains
code for creating and
destroying threads, for
passing message and data
between threads, for
scheduling thread execution
and for saving and restoring
thread contexts.
 The application begins with
a single thread and begins
running in that thread.

10/10/2014 suvendu.15292@gmail.com 23
Multithreading..
ADVANTAGES OF USER LEVEL THREADS:
 Thread switching does not require Kernel mode
privileges.
 User level thread can run on any operating system.
 Scheduling can be application specific in the user level
thread.
 User level threads are fast to create and manage.
DISADVANTAGES OF USER LEVEL THREADS:
 In a typical operating system, most system calls are
blocking.
 Multithreaded application cannot take advantage of
multiprocessing.

10/10/2014 suvendu.15292@gmail.com 24
Multithreading..
Kernel Level Threads
 In this case, thread management done by the Kernel.
 There is no thread management code in the application area.
Kernel threads are supported directly by the operating system.
 Any application can be programmed to be multithreaded. All of
the threads within an application are supported within a single
process.
 The Kernel maintains context information for the process as a
whole and for individuals threads within the process. Scheduling
by the Kernel is done on a thread basis.
 The Kernel performs thread creation, scheduling and
management in Kernel space.
 Kernel threads are generally slower to create and manage than
the user threads.

10/10/2014 suvendu.15292@gmail.com 25
Multithreading..
ADVANTAGES OF KERNEL LEVEL THREADS:
 Kernel can simultaneously schedule multiple threads
from the same process on multiple processes.
 If one thread in a process is blocked, the Kernel can
schedule another thread of the same process.
 Kernel routines themselves can multithreaded.
DISADVANTAGES OF KERNEL LEVEL THREADS:
 Kernel threads are generally slower to create and
manage than the user threads.
 Transfer of control from one thread to another within
same process requires a mode switch to the Kernel.

10/10/2014 suvendu.15292@gmail.com 26
Multithreading..
Multithreading Models:
Multithreading models are three types
 Many to many relationship.
 Many to one relationship.
 One to one relationship.

10/10/2014 suvendu.15292@gmail.com 27
Multithreading..
Many to Many Model
 In this model, many user
level threads multiplexes to
the Kernel thread of smaller
or equal numbers. The
number of Kernel threads
may be specific to either a
particular application or a
particular machine.
 Following diagram shows the
many to many model. In this
model, developers can create
as many user threads as
necessary and the
corresponding Kernel threads
can run in parallels on a
multiprocessor.

10/10/2014 suvendu.15292@gmail.com 28
Multithreading..
Many to One Model
 Many to one model maps many
user level threads to one Kernel
level thread. Thread management
is done in user space. When
thread makes a blocking system
call, the entire process will be
blocks. Only one thread can
access the Kernel at a time , so
multiple threads are unable to
run in parallel on
multiprocessors.
 If the user level thread libraries
are implemented in the operating
system in such a way that system
does not support them then
Kernel threads use the many to
one relationship modes.

10/10/2014 suvendu.15292@gmail.com 29
Multithreading..
One to One Model
 There is one to one relationship of
user level thread to the kernel
level thread. This model provides
more concurrency than the many
to one model. It also another
thread to run when a thread
makes a blocking system call. It
support multiple thread to
execute in parallel on
microprocessors.
 Disadvantage of this model is
that creating user thread requires
the corresponding Kernel thread.
OS/2, windows NT and
windows 2000 use one to one
relationship model.

10/10/2014 suvendu.15292@gmail.com 30
Multiprocessing
 Multiprocessing is the use of two or more central
processing units (CPUs) within a single computer
system. The term also refers to the ability of a
system to support more than one processor
and/or the ability to allocate tasks between them.
 According to some on-line dictionaries,
a multiprocessor is a computer system having
two or more processing units (multiple
processors) each sharing main memory and
peripherals, in order to simultaneously process
programs

 http://www.tutorialspoint.com/operating_system/
os_linux.htm
 http://www.makelinux.net/ldd3/chp-8-sect-2
 http://www.linux-
tutorial.info/modules.php?name=MContent&pageid
=327
Reference
10/10/2014 suvendu.15292@gmail.com 31
10/10/2014 suvendu.15292@gmail.com 32

More Related Content

What's hot

Arm DynamIQ: Intelligent Solutions Using Cluster Based Multiprocessing
Arm DynamIQ: Intelligent Solutions Using Cluster Based MultiprocessingArm DynamIQ: Intelligent Solutions Using Cluster Based Multiprocessing
Arm DynamIQ: Intelligent Solutions Using Cluster Based MultiprocessingArm
 
Structure of operating system
Structure of operating systemStructure of operating system
Structure of operating systemRafi Dar
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageKernel TLV
 
Browsing Linux Kernel Source
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel SourceMotaz Saad
 
Operating System-Ch8 memory management
Operating System-Ch8 memory managementOperating System-Ch8 memory management
Operating System-Ch8 memory managementSyaiful Ahdan
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File SystemAdrian Huang
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPTQUONTRASOLUTIONS
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsDrishti Bhalla
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernelguest547d74
 
File System Hierarchy
File System HierarchyFile System Hierarchy
File System Hierarchysritolia
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Pankaj Suryawanshi
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory StructureKevin OBrien
 
Windows memory management
Windows memory managementWindows memory management
Windows memory managementTech_MX
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamalKamal Maiti
 
Linux scheduling and input and output
Linux scheduling and input and outputLinux scheduling and input and output
Linux scheduling and input and outputSanidhya Chugh
 
Transparent Hugepages in RHEL 6
Transparent Hugepages in RHEL 6 Transparent Hugepages in RHEL 6
Transparent Hugepages in RHEL 6 Raghu Udiyar
 

What's hot (20)

CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2
 
Arm DynamIQ: Intelligent Solutions Using Cluster Based Multiprocessing
Arm DynamIQ: Intelligent Solutions Using Cluster Based MultiprocessingArm DynamIQ: Intelligent Solutions Using Cluster Based Multiprocessing
Arm DynamIQ: Intelligent Solutions Using Cluster Based Multiprocessing
 
Structure of operating system
Structure of operating systemStructure of operating system
Structure of operating system
 
Unix - An Introduction
Unix - An IntroductionUnix - An Introduction
Unix - An Introduction
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Browsing Linux Kernel Source
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel Source
 
Operating System-Ch8 memory management
Operating System-Ch8 memory managementOperating System-Ch8 memory management
Operating System-Ch8 memory management
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File System
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPT
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating Systems
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
File System Hierarchy
File System HierarchyFile System Hierarchy
File System Hierarchy
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Linux Memory
Linux MemoryLinux Memory
Linux Memory
 
Windows memory management
Windows memory managementWindows memory management
Windows memory management
 
Xen Hypervisor
Xen HypervisorXen Hypervisor
Xen Hypervisor
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamal
 
Linux scheduling and input and output
Linux scheduling and input and outputLinux scheduling and input and output
Linux scheduling and input and output
 
Transparent Hugepages in RHEL 6
Transparent Hugepages in RHEL 6 Transparent Hugepages in RHEL 6
Transparent Hugepages in RHEL 6
 

Viewers also liked

Linux memorymanagement
Linux memorymanagementLinux memorymanagement
Linux memorymanagementpradeepelinux
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensicsINSIGHT FORENSIC
 
Understanding of linux kernel memory model
Understanding of linux kernel memory modelUnderstanding of linux kernel memory model
Understanding of linux kernel memory modelSeongJae Park
 
Linux Memory Basics for SysAdmins - ChinaNetCloud Training
Linux Memory Basics for SysAdmins - ChinaNetCloud TrainingLinux Memory Basics for SysAdmins - ChinaNetCloud Training
Linux Memory Basics for SysAdmins - ChinaNetCloud TrainingChinaNetCloud
 
Linux memory consumption
Linux memory consumptionLinux memory consumption
Linux memory consumptionhaish
 
Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linuxKyle Hailey
 
Process' Virtual Address Space in GNU/Linux
Process' Virtual Address Space in GNU/LinuxProcess' Virtual Address Space in GNU/Linux
Process' Virtual Address Space in GNU/LinuxVarun Mahajan
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory ManagementAkmal Cikmat
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Managementguest1415ae65
 
Operating Systems: Memory Management
Operating Systems: Memory ManagementOperating Systems: Memory Management
Operating Systems: Memory ManagementDamian T. Gordon
 

Viewers also liked (15)

Processes
ProcessesProcesses
Processes
 
Os Linux
Os LinuxOs Linux
Os Linux
 
Linux memorymanagement
Linux memorymanagementLinux memorymanagement
Linux memorymanagement
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensics
 
Understanding of linux kernel memory model
Understanding of linux kernel memory modelUnderstanding of linux kernel memory model
Understanding of linux kernel memory model
 
Linux Memory Basics for SysAdmins - ChinaNetCloud Training
Linux Memory Basics for SysAdmins - ChinaNetCloud TrainingLinux Memory Basics for SysAdmins - ChinaNetCloud Training
Linux Memory Basics for SysAdmins - ChinaNetCloud Training
 
Linux memory consumption
Linux memory consumptionLinux memory consumption
Linux memory consumption
 
Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linux
 
Process' Virtual Address Space in GNU/Linux
Process' Virtual Address Space in GNU/LinuxProcess' Virtual Address Space in GNU/Linux
Process' Virtual Address Space in GNU/Linux
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
Memory management
Memory managementMemory management
Memory management
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Management
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
Memory management
Memory managementMemory management
Memory management
 
Operating Systems: Memory Management
Operating Systems: Memory ManagementOperating Systems: Memory Management
Operating Systems: Memory Management
 

Similar to Linux Memory Management

Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programmingAnyapuPranav
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"Ra'Fat Al-Msie'deen
 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)kiran Patel
 
Symmetric multiprocessing and Microkernel
Symmetric multiprocessing and MicrokernelSymmetric multiprocessing and Microkernel
Symmetric multiprocessing and MicrokernelManoraj Pannerselum
 
Kernel Computing
Kernel ComputingKernel Computing
Kernel ComputingSabiha M
 
Parallel Processing (Part 2)
Parallel Processing (Part 2)Parallel Processing (Part 2)
Parallel Processing (Part 2)Ajeng Savitri
 
dos slide share.pptx
dos slide share.pptxdos slide share.pptx
dos slide share.pptxNagaVarthini
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptxbleh23
 
Threading Programming Guide
Threading Programming GuideThreading Programming Guide
Threading Programming GuideDEVTYPE
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcbKanza batool
 

Similar to Linux Memory Management (20)

Thread
ThreadThread
Thread
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
 
Threads
ThreadsThreads
Threads
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)
 
Sucet os module_2_notes
Sucet os module_2_notesSucet os module_2_notes
Sucet os module_2_notes
 
Symmetric multiprocessing and Microkernel
Symmetric multiprocessing and MicrokernelSymmetric multiprocessing and Microkernel
Symmetric multiprocessing and Microkernel
 
Thread
ThreadThread
Thread
 
Ipc ppt
Ipc pptIpc ppt
Ipc ppt
 
Kernel Computing
Kernel ComputingKernel Computing
Kernel Computing
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
 
Thread
ThreadThread
Thread
 
Chapter04 new
Chapter04 newChapter04 new
Chapter04 new
 
Parallel Processing (Part 2)
Parallel Processing (Part 2)Parallel Processing (Part 2)
Parallel Processing (Part 2)
 
dos slide share.pptx
dos slide share.pptxdos slide share.pptx
dos slide share.pptx
 
Threads ppt
Threads pptThreads ppt
Threads ppt
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
 
Threading Programming Guide
Threading Programming GuideThreading Programming Guide
Threading Programming Guide
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcb
 

Recently uploaded

Ece technical seminar topic for under graduate.pptx
Ece technical seminar topic for under graduate.pptxEce technical seminar topic for under graduate.pptx
Ece technical seminar topic for under graduate.pptxArjunPLinekaje
 
Mohanakumar K R Davangere_3[1] 4d1 me.pptx
Mohanakumar K R Davangere_3[1] 4d1 me.pptxMohanakumar K R Davangere_3[1] 4d1 me.pptx
Mohanakumar K R Davangere_3[1] 4d1 me.pptxMohan377827
 
Javier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptxJavier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptxJavier Fernández Muñoz
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...KrishnaveniKrishnara1
 
Structural Integrity Assessment Standards in Nigeria by Engr Nimot Muili
Structural Integrity Assessment Standards in Nigeria by Engr Nimot MuiliStructural Integrity Assessment Standards in Nigeria by Engr Nimot Muili
Structural Integrity Assessment Standards in Nigeria by Engr Nimot MuiliNimot Muili
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionSneha Padhiar
 
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...shreenathji26
 
Overview of IS 16700:2023 (by priyansh verma)
Overview of IS 16700:2023 (by priyansh verma)Overview of IS 16700:2023 (by priyansh verma)
Overview of IS 16700:2023 (by priyansh verma)Priyansh
 
Madani.store - Planning - Interview Questions
Madani.store - Planning - Interview QuestionsMadani.store - Planning - Interview Questions
Madani.store - Planning - Interview QuestionsKarim Gaber
 
Chapter 9 Mechanical Injection Systems.pdf
Chapter 9 Mechanical Injection Systems.pdfChapter 9 Mechanical Injection Systems.pdf
Chapter 9 Mechanical Injection Systems.pdfFaizanAhmed396943
 
Livre Implementing_Six_Sigma_and_Lean_A_prac([Ron_Basu]_).pdf
Livre Implementing_Six_Sigma_and_Lean_A_prac([Ron_Basu]_).pdfLivre Implementing_Six_Sigma_and_Lean_A_prac([Ron_Basu]_).pdf
Livre Implementing_Six_Sigma_and_Lean_A_prac([Ron_Basu]_).pdfsaad175691
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
Road Development plans of India-Transportation Engineering
Road Development plans of India-Transportation EngineeringRoad Development plans of India-Transportation Engineering
Road Development plans of India-Transportation EngineeringSayli Madhale
 
AI Powered Ecover creator that creates everything that you want
AI Powered Ecover creator that creates everything that you wantAI Powered Ecover creator that creates everything that you want
AI Powered Ecover creator that creates everything that you wantsuja868966
 
How to Implement Effective Stormwater Management in DC
How to Implement Effective Stormwater Management in DCHow to Implement Effective Stormwater Management in DC
How to Implement Effective Stormwater Management in DCSera Engineered, LLC
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.elesangwon
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organizationchnrketan
 
sedimentation for the material for system.
sedimentation for the material for system.sedimentation for the material for system.
sedimentation for the material for system.Shyam97291
 
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...IJAEMSJORNAL
 
Indian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfIndian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfalokitpathak01
 

Recently uploaded (20)

Ece technical seminar topic for under graduate.pptx
Ece technical seminar topic for under graduate.pptxEce technical seminar topic for under graduate.pptx
Ece technical seminar topic for under graduate.pptx
 
Mohanakumar K R Davangere_3[1] 4d1 me.pptx
Mohanakumar K R Davangere_3[1] 4d1 me.pptxMohanakumar K R Davangere_3[1] 4d1 me.pptx
Mohanakumar K R Davangere_3[1] 4d1 me.pptx
 
Javier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptxJavier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptx
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
 
Structural Integrity Assessment Standards in Nigeria by Engr Nimot Muili
Structural Integrity Assessment Standards in Nigeria by Engr Nimot MuiliStructural Integrity Assessment Standards in Nigeria by Engr Nimot Muili
Structural Integrity Assessment Standards in Nigeria by Engr Nimot Muili
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based question
 
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...
 
Overview of IS 16700:2023 (by priyansh verma)
Overview of IS 16700:2023 (by priyansh verma)Overview of IS 16700:2023 (by priyansh verma)
Overview of IS 16700:2023 (by priyansh verma)
 
Madani.store - Planning - Interview Questions
Madani.store - Planning - Interview QuestionsMadani.store - Planning - Interview Questions
Madani.store - Planning - Interview Questions
 
Chapter 9 Mechanical Injection Systems.pdf
Chapter 9 Mechanical Injection Systems.pdfChapter 9 Mechanical Injection Systems.pdf
Chapter 9 Mechanical Injection Systems.pdf
 
Livre Implementing_Six_Sigma_and_Lean_A_prac([Ron_Basu]_).pdf
Livre Implementing_Six_Sigma_and_Lean_A_prac([Ron_Basu]_).pdfLivre Implementing_Six_Sigma_and_Lean_A_prac([Ron_Basu]_).pdf
Livre Implementing_Six_Sigma_and_Lean_A_prac([Ron_Basu]_).pdf
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
 
Road Development plans of India-Transportation Engineering
Road Development plans of India-Transportation EngineeringRoad Development plans of India-Transportation Engineering
Road Development plans of India-Transportation Engineering
 
AI Powered Ecover creator that creates everything that you want
AI Powered Ecover creator that creates everything that you wantAI Powered Ecover creator that creates everything that you want
AI Powered Ecover creator that creates everything that you want
 
How to Implement Effective Stormwater Management in DC
How to Implement Effective Stormwater Management in DCHow to Implement Effective Stormwater Management in DC
How to Implement Effective Stormwater Management in DC
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organization
 
sedimentation for the material for system.
sedimentation for the material for system.sedimentation for the material for system.
sedimentation for the material for system.
 
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
 
Indian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfIndian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdf
 

Linux Memory Management

  • 2.   Memory Structure of Linux OS.  How Program is loaded into the memory.  Address Translation.  Feature for Multithreading and Multiprocessing. Overview 10/10/2014 suvendu.15292@gmail.com 2
  • 3.   Linux is one of popular version of UNIX operating System.  It is open source as its source code is freely available.  It is free to use. Linux was designed considering UNIX compatibility.  It's functionality list is quite similar to that of UNIX. Linux OS 10/10/2014 suvendu.15292@gmail.com 3
  • 4.  Linux Operating System has primarily three components  Kernel - Kernel is the core part of Linux. It is responsible for all major activities of this operating system. It is consists of various modules and it interacts directly with the underlying hardware. Kernel provides the required abstraction to hide low level hardware details to system or application programs.  System Library - System libraries are special functions or programs using which application programs or system utilities accesses Kernel's features. These libraries implements most of the functionalities of the operating system and do not requires kernel module's code access rights.  System Utility - System Utility programs are responsible to do specialized, individual level tasks. Components of Linux System 10/10/2014 suvendu.15292@gmail.com 4
  • 5.  Components of Linux System 10/10/2014 suvendu.15292@gmail.com 5
  • 6.   User Space  Kernel Space  Data Flow Between User Space and Kernel Space  Architecture Kernel Architecture Overview 10/10/2014 suvendu.15292@gmail.com 6
  • 7.   The User Space is the space in memory, where user processes run.  This memory is above the Kernel.  It includes the rest of available memory.  This Space is protected.  The system prevents one process from interfering with another process.  Only Kernel processes can access a user process Kernel Architecture Overview.. User Space 10/10/2014 suvendu.15292@gmail.com 7
  • 8.   The Kernel Space is the space in memory where all kernel services are provided via kernel processes.  The user has access to it only through the system call.  A user process becomes a kernel process when it executes a system call. Kernel Architecture Overview.. Kernel Space 10/10/2014 suvendu.15292@gmail.com 8
  • 9.   User Space and Kernel Space are in different spaces.  When a System Call is executed, the arguments to the call are passed from User Space to Kernel Space. Kernel Architecture Overview.. System Call 10/10/2014 suvendu.15292@gmail.com 9
  • 10.  Kernel Architecture Overview.. User Space and Kernel Space Relationship 10/10/2014 suvendu.15292@gmail.com 10
  • 13.   Address translations are kept in a special cache called Translation Look-Aside Buffer or TLB  TLB must be on chip; its access time is comparable to cache. 10/10/2014 suvendu.15292@gmail.com 13 Address Translation
  • 14.  10/10/2014 suvendu.15292@gmail.com 14 Address Translation Typical TLB Format  Tag: Portion of virtual address  Data: Physical Page number  Dirty: since use write back, need to know whether or not to write page to disk when replaced  Ref: Used to help calculate LRU on replacement  Valid: Entry is valid  Access rights: R (read permission), W (write perm.)
  • 15.   TLBs usually small, typically 128-256 entries.  Like any other cache, the TLB can be fully associative, set associative, or direct mapped. 10/10/2014 suvendu.15292@gmail.com 15 Address Translation Translation Look_Aside Buffers
  • 16.   Assume 32 entries, fully associative TLB (Alpha AXP 21064) 1: Processor sends the virtual address to all tags 2: If there is a hit (there is an entry in TLB with that Virtual Page number and valid bit is 1) and there is no access violation, then 3: Matching tag sends the corresponding Physical Page number 4: Combine Physical Page number and Page Offset to get full physical address 10/10/2014 suvendu.15292@gmail.com 16 Address Translation Translation Look_Aside Buffers
  • 17. 10/10/2014 suvendu.15292@gmail.com 17 Feature for Multithreading and Multiprocessing
  • 18. What is Thread?  A thread is a flow of execution through the process code, with its own program counter, system registers and stack.  A thread is also called a light weight process.  Threads provide a way to improve application performance through parallelism. Threads represent a software approach to improving performance of operating system by reducing the overhead thread is equivalent to a classical process.  Each thread belongs to exactly one process and no thread can exist outside a process.  Each thread represents a separate flow of control.  Threads have been successfully used in implementing network servers and web server.  They also provide a suitable foundation for parallel execution of applications on shared memory multiprocessors. 10/10/2014 suvendu.15292@gmail.com 18 Multithreading
  • 20.  10/10/2014 suvendu.15292@gmail.com 20 Multithreading.. Advantages of Thread  Thread minimize context switching time.  Use of threads provides concurrency within a process.  Efficient communication.  Economy- It is more economical to create and context switch threads.  Utilization of multiprocessor architectures to a greater scale and efficiency.
  • 21.  10/10/2014 suvendu.15292@gmail.com 21 Multithreading.. Types of Thread Threads are implemented in following two ways  User Level Threads -- User managed threads  Kernel Level Threads -- Operating System managed threads acting on kernel, an operating system core.
  • 22.  10/10/2014 suvendu.15292@gmail.com 22 Multithreading.. User Level Threads  In this case, application manages thread management kernel is not aware of the existence of threads.  The thread library contains code for creating and destroying threads, for passing message and data between threads, for scheduling thread execution and for saving and restoring thread contexts.  The application begins with a single thread and begins running in that thread.
  • 23.  10/10/2014 suvendu.15292@gmail.com 23 Multithreading.. ADVANTAGES OF USER LEVEL THREADS:  Thread switching does not require Kernel mode privileges.  User level thread can run on any operating system.  Scheduling can be application specific in the user level thread.  User level threads are fast to create and manage. DISADVANTAGES OF USER LEVEL THREADS:  In a typical operating system, most system calls are blocking.  Multithreaded application cannot take advantage of multiprocessing.
  • 24.  10/10/2014 suvendu.15292@gmail.com 24 Multithreading.. Kernel Level Threads  In this case, thread management done by the Kernel.  There is no thread management code in the application area. Kernel threads are supported directly by the operating system.  Any application can be programmed to be multithreaded. All of the threads within an application are supported within a single process.  The Kernel maintains context information for the process as a whole and for individuals threads within the process. Scheduling by the Kernel is done on a thread basis.  The Kernel performs thread creation, scheduling and management in Kernel space.  Kernel threads are generally slower to create and manage than the user threads.
  • 25.  10/10/2014 suvendu.15292@gmail.com 25 Multithreading.. ADVANTAGES OF KERNEL LEVEL THREADS:  Kernel can simultaneously schedule multiple threads from the same process on multiple processes.  If one thread in a process is blocked, the Kernel can schedule another thread of the same process.  Kernel routines themselves can multithreaded. DISADVANTAGES OF KERNEL LEVEL THREADS:  Kernel threads are generally slower to create and manage than the user threads.  Transfer of control from one thread to another within same process requires a mode switch to the Kernel.
  • 26.  10/10/2014 suvendu.15292@gmail.com 26 Multithreading.. Multithreading Models: Multithreading models are three types  Many to many relationship.  Many to one relationship.  One to one relationship.
  • 27.  10/10/2014 suvendu.15292@gmail.com 27 Multithreading.. Many to Many Model  In this model, many user level threads multiplexes to the Kernel thread of smaller or equal numbers. The number of Kernel threads may be specific to either a particular application or a particular machine.  Following diagram shows the many to many model. In this model, developers can create as many user threads as necessary and the corresponding Kernel threads can run in parallels on a multiprocessor.
  • 28.  10/10/2014 suvendu.15292@gmail.com 28 Multithreading.. Many to One Model  Many to one model maps many user level threads to one Kernel level thread. Thread management is done in user space. When thread makes a blocking system call, the entire process will be blocks. Only one thread can access the Kernel at a time , so multiple threads are unable to run in parallel on multiprocessors.  If the user level thread libraries are implemented in the operating system in such a way that system does not support them then Kernel threads use the many to one relationship modes.
  • 29.  10/10/2014 suvendu.15292@gmail.com 29 Multithreading.. One to One Model  There is one to one relationship of user level thread to the kernel level thread. This model provides more concurrency than the many to one model. It also another thread to run when a thread makes a blocking system call. It support multiple thread to execute in parallel on microprocessors.  Disadvantage of this model is that creating user thread requires the corresponding Kernel thread. OS/2, windows NT and windows 2000 use one to one relationship model.
  • 30.  10/10/2014 suvendu.15292@gmail.com 30 Multiprocessing  Multiprocessing is the use of two or more central processing units (CPUs) within a single computer system. The term also refers to the ability of a system to support more than one processor and/or the ability to allocate tasks between them.  According to some on-line dictionaries, a multiprocessor is a computer system having two or more processing units (multiple processors) each sharing main memory and peripherals, in order to simultaneously process programs
  • 31.   http://www.tutorialspoint.com/operating_system/ os_linux.htm  http://www.makelinux.net/ldd3/chp-8-sect-2  http://www.linux- tutorial.info/modules.php?name=MContent&pageid =327 Reference 10/10/2014 suvendu.15292@gmail.com 31