Processes David Ferry, Chris Gill

Slides:



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

Processes CSCI 444/544 Operating Systems Fall 2008.
Process Management. External View of the OS Hardware fork() CreateProcess() CreateThread() close() CloseHandle() sleep() semctl() signal() SetWaitableTimer()
The kernel’s task list Introduction to process descriptors and their related data-structures for Linux kernel version
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Process in Unix, Linux and Windows CS-3013 C-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
Unix & Windows Processes 1 CS502 Spring 2006 Unix/Windows Processes.
BINA RAMAMURTHY UNIVERSITY AT BUFFALO System Structure and Process Model 5/30/2013 Amrita-UB-MSES
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Process in Unix, Linux, and Windows CS-3013 A-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
Lecture 5 Process, Thread and Task September 22, 2015 Kyu Ho Park.
Multiprogramming CSE451 Andrew Whitaker. Overview Multiprogramming: Running multiple programs “at the same time”  Requires multiplexing (sharing) the.
The Structure of Processes. What is a Process? an instance of running program Program vs process(task) Program : just a passive collection of instructions.
Operating Systems CMPSC 473 Processes (4) September Lecture 10 Instructor: Bhuvan Urgaonkar.
4P13 Week 3 Talking Points 1. Process State 2 Process Structure Catagories – Process identification: the PID and the parent PID – Signal state: signals.
Linux Processes Travis Willey Jeff Mihalik. What is a process? A process is a program in execution A process includes: –program counter –stack –data section.
1 Review of Process Mechanisms. 2 Scheduling: Policy and Mechanism Scheduling policy answers the question: Which process/thread, among all those ready.
CSC 660: Advanced Operating SystemsSlide #1 CSC 660: Advanced OS Processes.
4300 Lines Added 1800 Lines Removed 1500 Lines Modified PER DAY DURING SUSE Lab.
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
CSC 660: Advanced Operating Systems
2 Processor(s)Main MemoryDevices Process, Thread & Resource Manager Memory Manager Device Manager File Manager.
What is a Process ? A program in execution.
Kernel Structure and Infrastructure David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
S ALVATORE DI G IROLAMO (TA) Networks and Operating Systems: Exercise Session 1.
Processes David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Introduction to Kernel
Processes and threads.
Linux Details: Device Drivers
CS 6560: Operating Systems Design
How & When The Kernel Runs
Midterm Review Chris Gill CSE 422S - Operating Systems Organization
Operating Systems: A Modern Perspective, Chapter 6
Chapter 3: Processes.
Process Realization In OS
Semester Review Chris Gill CSE 422S - Operating Systems Organization
System Structure and Process Model
System Structure and Process Model
Processes in Unix, Linux, and Windows
Linux kernel: Processes, threads and scheduling
System Structure B. Ramamurthy.
CS 143A Quiz 1 Solution.
Processes in Unix, Linux, and Windows
System Structure and Process Model
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Kernel Structure and Infrastructure
Lecture Topics: 11/1 General Operating System Concepts Processes
Linux Details: Device Drivers
Midterm Review Brian Kocoloski
How & When The Kernel Runs
fork() and exec() David Ferry CSCI 3500 – Operating Systems
CSE 451: Operating Systems Winter 2003 Lecture 4 Processes
Processes in Unix, Linux, and Windows
Implementing Processes, Threads, and Resources
Kernel Tracing David Ferry, Chris Gill, Brian Kocoloski
Processes in Unix and Windows
CS703 - Advanced Operating Systems
CS510 Operating System Foundations
Process Description and Control in Unix
CSE 153 Design of Operating Systems Winter 2019
Process Description and Control in Unix
Implementing Processes, Threads, and Resources
Interrupts and Interrupt Handling
Processes David Ferry, Chris Gill, Brian Kocoloski
User-level Memory Chris Gill, David Ferry, Brian Kocoloski
Shared Memory David Ferry, Chris Gill
CS Introduction to Operating Systems
Presentation transcript:

Processes David Ferry, Chris Gill CSE 422S - Operating Systems Organization Washington University in St. Louis St. Louis, MO 63143

CSE 422S –Operating Systems Organization Processes in Linux Fundamental process abstraction: Original: Each process behaves as though it has total control over the system Modern: Threads still execute as though they monopolize the system, but the process abstraction also facilitates multi-threading, signals, and inter-process communication More features: Multi-threading Scheduling Shared memory Virtual Memory Sockets Process accounting etc. Signals Process groups Synchronization CSE 422S –Operating Systems Organization

What is a Process, Really? A process is an execution stack together with data that describes the process state. (also describes threads) Two stacks: Kernel mode User mode Data: thread_info: small, efficient task_struct: large, statically allocated by slab allocator, points to other data structs User side: Kernel side: User Stack thread_info Kernel stack task_struct .bss .data .text CSE 422S –Operating Systems Organization

Creating a New Process: fork() and clone() Duplicate existing process Initialize per-PID data PID, real_parent, statistics If new process: Copies file handles, signal handlers, process address space, etc. Resources shared via page-level lazy copy-on-write* If new thread: Shares pointers to above resources thread_info Kernel stack task_struct ptr* 0x1 ptr* 0x2 ptr* 0x3 thread_info Kernel stack task_struct ptr* 0x1 ptr* 0x2 ptr* 0x3 *E.g. Every process in the system shares the same “copy” of the C library CSE 422S –Operating Systems Organization

CSE 422S –Operating Systems Organization Process States Alive states: TASK_RUNNING: running or runnable TASK_INTERRUPTIBLE: blocked on wait queue TASK_UNINTERRUPTIBLE: short duration blocking, can’t receive signals __TASK_TRACED: being traced with syscall ptrace __TASK_STOPPED: cannot execute (SIGSTOP, debugger) Exit states: EXIT_ZOMBIE: exited but has not been waited for (kernel structures still exit) EXIT_DEAD: exited and has been waited for CSE 422S –Operating Systems Organization

Handling Processes in Linux Linux uses many containers to ensure efficient access to processes: Linked list of all processes Lists of child processes PID hash table Processor run queues Blocking I/O wait queues Helper functions: for_each_process() list_for_each(list, task->children) task_struct ptr* 0x1 ptr* 0x2 ptr* 0x3 task_struct ptr* 0x1 ptr* 0x2 ptr* 0x3 task_struct ptr* 0x1 ptr* 0x2 ptr* 0x3 task_struct ptr* 0x1 ptr* 0x2 ptr* 0x3 task_struct ptr* 0x1 ptr* 0x2 ptr* 0x3 task_struct ptr* 0x1 ptr* 0x2 ptr* 0x3 CSE 422S – Operating Systems Organization

CSE 422S – Operating Systems Organization One Size Fits All Processes, threads, and kernel threads are all implemented with the same data structures (thread_info and task_struct) and functions. C has limited classes / polymorphism Logic and code for handling all runnable objects is the same Threads are like user processes but they share their parent’s address space. Kernel threads don’t have a user-side address space (i.e. mm_struct pointer is NULL) and not all data values are used. CSE 422S – Operating Systems Organization