SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Understanding the Linux 
operating system
PERFORMANCE TUNING 
Performance tuning is a challenging task that requires in-depth 
understanding of the hardware, operating system, and application.
LINUX PROCESS MANAGEMENT 
Process management is one of the most important roles of any 
operating system. 
Linux process management implementation is similar to UNIX® 
implementation. It includes process scheduling, interrupt handling, 
signaling, process prioritization, process switching, process state, 
process memory, and so on.
WHAT IS A PROCESS 
A process is an instance of execution that runs on a processor. The 
process uses any resources that the Linux kernel can handle to 
complete its task.
LIFE CYCLE OF A PROCESS 
Every process has its own life cycle such as creation, execution, 
termination, and removal. These phases will be repeated literally 
millions of times as long as the system is up and running. Therefore, 
the process life cycle is very important from the performance 
perspective.
LIFE CYCLE OF A PROCESS 
When a process creates a new process, the creating process (parent 
process) issues a fork() system call. When a fork() system call is 
issued, it gets a process descriptor for the newly created process 
(child process) and sets a new process id. It copies the values of the 
parent process’ process descriptor to the child’s. At this time the 
entire address space of the parent process is not copied; both 
processes share the same address space.
LIFE CYCLE OF A PROCESS 
The exec() system call copies the new program to the address space 
of the child process. Because both processes share the same address 
space, writing new program data causes a page fault exception. At 
this point, the kernel assigns the new physical page to the child 
process.
LIFE CYCLE OF A PROCESS 
When program execution has completed, the child process terminates 
with an exit() system call. The exit() system call releases most of the 
data structure of the process and notifies the parent process of the 
termination sending a signal
LIFE CYCLE OF A PROCESS 
The child process will not be completely removed until the parent 
process knows of the termination of its child process by the wait() 
system call. As soon as the parent process is notified of the child 
process termination, it removes all the data structure of the child 
process and release the process descriptor.
THREAD 
A thread is an execution unit generated in a single process. It runs 
parallel with other threads in the same process. They can share the 
same resources such as memory, address space, open files, and so 
on. They can access the same set of application data. A thread is also 
called Light Weight Process (LWP). Because they share resources, each 
thread should not change their shared resources at the same time. 
The implementation of mutual exclusion, locking, serialization, and so 
on, are the user application’s responsibility
PROCESS PRIORITY AND NICE 
LEVEL 
Process priority is a number that determines the order in which the 
process is handled by the CPU and is determined by dynamic priority 
and static priority. 
A process which has higher process priority has a greater chance of 
getting permission to run on a processor.
CONTEXT SWITCHING 
During process execution, information on the running process is stored in 
registers on the 
processor and its cache. The set of data that is loaded to the register for the 
executing 
process is called the context. To switch processes, the context of the 
running process is 
stored and the context of the next running process is restored to the 
register. The process 
descriptor and the area called kernel mode stack are used to store the 
context. This switching 
process is called context switching. Having too much context switching is 
undesirable 
because the processor has to flush its register and cache every time to make
INTERRUPT HANDLING 
Interrupt handling is one of the highest priority tasks. Interrupts are usually 
generated by I/O 
devices such as a network interface card, keyboard, disk controller, serial 
adapter, and so on. 
The interrupt handler notifies the Linux kernel of an event (such as keyboard 
input, ethernet 
frame arrival, and so on). It tells the kernel to interrupt process execution 
and perform 
interrupt handling as quickly as possible because some device requires quick 
responsiveness. This is critical for system stability. When an interrupt signal 
arrives to the 
kernel, the kernel must switch a current execution process to a new one to 
handle the
In Linux implementations, there are two types of interrupts. A hard 
interrupt is generated for devices which require responsiveness (disk 
I/O interrupt, network adapter interrupt, keyboard interrupt, mouse 
interrupt). 
A soft interrupt is used for tasks which processing can be deferred 
(TCP/IP operation, SCSI protocol operation, and so on). You can see 
information related to hard interrupts at /proc/interrupts.
PROCESS STATE 
Every process has its own state that shows what is currently happening in 
the process. 
Process state changes during process execution. Some of the possible states 
are as follows: 
TASK_RUNNING 
In this state, a process is running on a CPU or waiting to run in the queue 
(run queue). 
TASK_STOPPED 
A process suspended by certain signals (for example SIGINT, SIGSTOP) is in 
this state. The 
process is waiting to be resumed by a signal such as SIGCONT. 
TASK_INTERRUPTIBLE
In this state, the process is suspended and waits for a certain condition to be 
satisfied. If a process is in TASK_INTERRUPTIBLE state and it receives a signal to 
stop, the process state is changed and operation will be interrupted. A typical 
example of a 
TASK_INTERRUPTIBLE process is a process waiting for keyboard interrupt. 
TASK_UNINTERRUPTIBLE 
Similar to TASK_INTERRUPTIBLE. While a process in TASK_INTERRUPTIBLE state 
can be interrupted, sending a signal does nothing to the process in 
TASK_UNINTERRUPTIBLE state. A typical example of a TASK_UNINTERRUPTIBLE 
process is a process waiting for disk I/O operation. 
TASK_ZOMBIE 
After a process exits with exit() system call, its parent should know of the 
termination. In TASK_ZOMBIE state, a process is waiting for its parent to be 
notified to release all the data structure.
ZOMBIE PROCESSES 
When a process has already terminated, having received a signal to 
do so, it normally takes some time to finish all tasks (such as closing 
open files) before ending itself. In that normally very short time 
frame, the process is a zombie.
PROCESS MEMORY SEGMENTS 
A process uses its own memory area to perform work. The work 
varies depending on the situation and process usage. A process can 
have different workload characteristics and different data size 
requirements. The process has to handle a of variety of data sizes. To 
satisfy this requirement, the Linux kernel uses a dynamic memory 
allocation mechanism for each process.
The process memory area consist of these segments 
Text segment 
The area where executable code is stored. 
Data segment 
The data segment consists of these three areas. 
– Data: The area where initialized data such as static variables are stored. 
– BSS: The area where zero-initialized data is stored. The data is initialized to zero. 
– Heap: The area where malloc() allocates dynamic memory based on the demand. 
The heap grows towards higher addresses. 
Stack segment 
The area where local variables, function parameters, and the return address of a function 
is stored. The stack grows toward lower addresses.
LINUX CPU SCHEDULER 
The basic functionality of any computer is, quite simply, to compute. To be able to 
compute, 
there must be a means to manage the computing resources, or processors, and the 
computing tasks, also known as threads or processes. Thanks to the great work of Ingo 
Molnar, Linux features a kernel using a O(1) algorithm as opposed to the O(n) algorithm 
used 
to describe the former CPU scheduler. The term O(1) refers to a static algorithm, meaning 
that the time taken to choose a process for placing into execution is constant, regardless 
of 
the number of processes. 
The new scheduler scales very well, regardless of process count or processor count, and 
imposes a low overhead on the system. The algorithm uses two process priority arrays: 
1. active 
2. expired

Weitere ähnliche Inhalte

Was ist angesagt?

Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Operating system structures
Operating system structuresOperating system structures
Operating system structures
Mohd Arif
 

Was ist angesagt? (20)

Linux file system
Linux file systemLinux file system
Linux file system
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Shell and its types in LINUX
Shell and its types in LINUXShell and its types in LINUX
Shell and its types in LINUX
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Linux
Linux Linux
Linux
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 
Unix - An Introduction
Unix - An IntroductionUnix - An Introduction
Unix - An Introduction
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
Operating system structures
Operating system structuresOperating system structures
Operating system structures
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
 
linux file sysytem& input and output
linux file sysytem& input and outputlinux file sysytem& input and output
linux file sysytem& input and output
 
System calls
System callsSystem calls
System calls
 
User management
User managementUser management
User management
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Operating systems unix
Operating systems   unixOperating systems   unix
Operating systems unix
 

Ähnlich wie Linux process management

Linux process management
Linux process managementLinux process management
Linux process management
Raghu nath
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
tech2click
 
Week 11Linux InternalsProcesses, schedulingLecture o.docx
Week 11Linux InternalsProcesses, schedulingLecture o.docxWeek 11Linux InternalsProcesses, schedulingLecture o.docx
Week 11Linux InternalsProcesses, schedulingLecture o.docx
melbruce90096
 
Operating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - EngineeringOperating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - Engineering
Yogesh Santhan
 
23565104 process-management(2)
23565104 process-management(2)23565104 process-management(2)
23565104 process-management(2)
Anuj Malhotra
 
operating system for computer engineering ch3.ppt
operating system for computer engineering ch3.pptoperating system for computer engineering ch3.ppt
operating system for computer engineering ch3.ppt
gezaegebre1
 
15. Computer Systems Basic Software 1
15. Computer Systems   Basic Software 115. Computer Systems   Basic Software 1
15. Computer Systems Basic Software 1
New Era University
 

Ähnlich wie Linux process management (20)

Linux process management
Linux process managementLinux process management
Linux process management
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
 
Week 11Linux InternalsProcesses, schedulingLecture o.docx
Week 11Linux InternalsProcesses, schedulingLecture o.docxWeek 11Linux InternalsProcesses, schedulingLecture o.docx
Week 11Linux InternalsProcesses, schedulingLecture o.docx
 
Operating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - EngineeringOperating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - Engineering
 
Operating system
Operating systemOperating system
Operating system
 
Processing management
Processing managementProcessing management
Processing management
 
Os
OsOs
Os
 
Os
OsOs
Os
 
OS-Process.pdf
OS-Process.pdfOS-Process.pdf
OS-Process.pdf
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
 
23565104 process-management(2)
23565104 process-management(2)23565104 process-management(2)
23565104 process-management(2)
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
operating system for computer engineering ch3.ppt
operating system for computer engineering ch3.pptoperating system for computer engineering ch3.ppt
operating system for computer engineering ch3.ppt
 
Operating Systems
Operating Systems Operating Systems
Operating Systems
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
 
15. Computer Systems Basic Software 1
15. Computer Systems   Basic Software 115. Computer Systems   Basic Software 1
15. Computer Systems Basic Software 1
 
Advanced Operating Systems......Process Management
Advanced Operating Systems......Process ManagementAdvanced Operating Systems......Process Management
Advanced Operating Systems......Process Management
 
Operating System-Concepts of Process
Operating System-Concepts of ProcessOperating System-Concepts of Process
Operating System-Concepts of Process
 
Operating system ppt
Operating system pptOperating system ppt
Operating system ppt
 

Mehr von Raghu nath

Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
Raghu nath
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
Raghu nath
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raghu nath
 
Selection sort
Selection sortSelection sort
Selection sort
Raghu nath
 
Binary search
Binary search Binary search
Binary search
Raghu nath
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
Raghu nath
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
Raghu nath
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp role
Raghu nath
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
Raghu nath
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
Raghu nath
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2
Raghu nath
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1
Raghu nath
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2
Raghu nath
 
python chapter 1
python chapter 1python chapter 1
python chapter 1
Raghu nath
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
Raghu nath
 

Mehr von Raghu nath (20)

Mongo db
Mongo dbMongo db
Mongo db
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
 
MS WORD 2013
MS WORD 2013MS WORD 2013
MS WORD 2013
 
Msword
MswordMsword
Msword
 
Ms word
Ms wordMs word
Ms word
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Selection sort
Selection sortSelection sort
Selection sort
 
Binary search
Binary search Binary search
Binary search
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp role
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2
 
python chapter 1
python chapter 1python chapter 1
python chapter 1
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
 
Perl
PerlPerl
Perl
 

Kürzlich hochgeladen

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Kürzlich hochgeladen (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

Linux process management

  • 1. Understanding the Linux operating system
  • 2. PERFORMANCE TUNING Performance tuning is a challenging task that requires in-depth understanding of the hardware, operating system, and application.
  • 3. LINUX PROCESS MANAGEMENT Process management is one of the most important roles of any operating system. Linux process management implementation is similar to UNIX® implementation. It includes process scheduling, interrupt handling, signaling, process prioritization, process switching, process state, process memory, and so on.
  • 4. WHAT IS A PROCESS A process is an instance of execution that runs on a processor. The process uses any resources that the Linux kernel can handle to complete its task.
  • 5. LIFE CYCLE OF A PROCESS Every process has its own life cycle such as creation, execution, termination, and removal. These phases will be repeated literally millions of times as long as the system is up and running. Therefore, the process life cycle is very important from the performance perspective.
  • 6. LIFE CYCLE OF A PROCESS When a process creates a new process, the creating process (parent process) issues a fork() system call. When a fork() system call is issued, it gets a process descriptor for the newly created process (child process) and sets a new process id. It copies the values of the parent process’ process descriptor to the child’s. At this time the entire address space of the parent process is not copied; both processes share the same address space.
  • 7. LIFE CYCLE OF A PROCESS The exec() system call copies the new program to the address space of the child process. Because both processes share the same address space, writing new program data causes a page fault exception. At this point, the kernel assigns the new physical page to the child process.
  • 8. LIFE CYCLE OF A PROCESS When program execution has completed, the child process terminates with an exit() system call. The exit() system call releases most of the data structure of the process and notifies the parent process of the termination sending a signal
  • 9. LIFE CYCLE OF A PROCESS The child process will not be completely removed until the parent process knows of the termination of its child process by the wait() system call. As soon as the parent process is notified of the child process termination, it removes all the data structure of the child process and release the process descriptor.
  • 10. THREAD A thread is an execution unit generated in a single process. It runs parallel with other threads in the same process. They can share the same resources such as memory, address space, open files, and so on. They can access the same set of application data. A thread is also called Light Weight Process (LWP). Because they share resources, each thread should not change their shared resources at the same time. The implementation of mutual exclusion, locking, serialization, and so on, are the user application’s responsibility
  • 11. PROCESS PRIORITY AND NICE LEVEL Process priority is a number that determines the order in which the process is handled by the CPU and is determined by dynamic priority and static priority. A process which has higher process priority has a greater chance of getting permission to run on a processor.
  • 12. CONTEXT SWITCHING During process execution, information on the running process is stored in registers on the processor and its cache. The set of data that is loaded to the register for the executing process is called the context. To switch processes, the context of the running process is stored and the context of the next running process is restored to the register. The process descriptor and the area called kernel mode stack are used to store the context. This switching process is called context switching. Having too much context switching is undesirable because the processor has to flush its register and cache every time to make
  • 13. INTERRUPT HANDLING Interrupt handling is one of the highest priority tasks. Interrupts are usually generated by I/O devices such as a network interface card, keyboard, disk controller, serial adapter, and so on. The interrupt handler notifies the Linux kernel of an event (such as keyboard input, ethernet frame arrival, and so on). It tells the kernel to interrupt process execution and perform interrupt handling as quickly as possible because some device requires quick responsiveness. This is critical for system stability. When an interrupt signal arrives to the kernel, the kernel must switch a current execution process to a new one to handle the
  • 14. In Linux implementations, there are two types of interrupts. A hard interrupt is generated for devices which require responsiveness (disk I/O interrupt, network adapter interrupt, keyboard interrupt, mouse interrupt). A soft interrupt is used for tasks which processing can be deferred (TCP/IP operation, SCSI protocol operation, and so on). You can see information related to hard interrupts at /proc/interrupts.
  • 15. PROCESS STATE Every process has its own state that shows what is currently happening in the process. Process state changes during process execution. Some of the possible states are as follows: TASK_RUNNING In this state, a process is running on a CPU or waiting to run in the queue (run queue). TASK_STOPPED A process suspended by certain signals (for example SIGINT, SIGSTOP) is in this state. The process is waiting to be resumed by a signal such as SIGCONT. TASK_INTERRUPTIBLE
  • 16. In this state, the process is suspended and waits for a certain condition to be satisfied. If a process is in TASK_INTERRUPTIBLE state and it receives a signal to stop, the process state is changed and operation will be interrupted. A typical example of a TASK_INTERRUPTIBLE process is a process waiting for keyboard interrupt. TASK_UNINTERRUPTIBLE Similar to TASK_INTERRUPTIBLE. While a process in TASK_INTERRUPTIBLE state can be interrupted, sending a signal does nothing to the process in TASK_UNINTERRUPTIBLE state. A typical example of a TASK_UNINTERRUPTIBLE process is a process waiting for disk I/O operation. TASK_ZOMBIE After a process exits with exit() system call, its parent should know of the termination. In TASK_ZOMBIE state, a process is waiting for its parent to be notified to release all the data structure.
  • 17. ZOMBIE PROCESSES When a process has already terminated, having received a signal to do so, it normally takes some time to finish all tasks (such as closing open files) before ending itself. In that normally very short time frame, the process is a zombie.
  • 18. PROCESS MEMORY SEGMENTS A process uses its own memory area to perform work. The work varies depending on the situation and process usage. A process can have different workload characteristics and different data size requirements. The process has to handle a of variety of data sizes. To satisfy this requirement, the Linux kernel uses a dynamic memory allocation mechanism for each process.
  • 19. The process memory area consist of these segments Text segment The area where executable code is stored. Data segment The data segment consists of these three areas. – Data: The area where initialized data such as static variables are stored. – BSS: The area where zero-initialized data is stored. The data is initialized to zero. – Heap: The area where malloc() allocates dynamic memory based on the demand. The heap grows towards higher addresses. Stack segment The area where local variables, function parameters, and the return address of a function is stored. The stack grows toward lower addresses.
  • 20. LINUX CPU SCHEDULER The basic functionality of any computer is, quite simply, to compute. To be able to compute, there must be a means to manage the computing resources, or processors, and the computing tasks, also known as threads or processes. Thanks to the great work of Ingo Molnar, Linux features a kernel using a O(1) algorithm as opposed to the O(n) algorithm used to describe the former CPU scheduler. The term O(1) refers to a static algorithm, meaning that the time taken to choose a process for placing into execution is constant, regardless of the number of processes. The new scheduler scales very well, regardless of process count or processor count, and imposes a low overhead on the system. The algorithm uses two process priority arrays: 1. active 2. expired