Development of a Resource Locking Algorithm for a Kernel Debugging User-space API Library TJHSST Computer Systems Lab 2004-2005 Timothy Wismer.

Slides:



Advertisements
Similar presentations
Handling Deadlocks n definition, wait-for graphs n fundamental causes of deadlocks n resource allocation graphs and conditions for deadlock existence n.
Advertisements

Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
6. Deadlocks 6.1 Deadlocks with Reusable and Consumable Resources
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Deadlock Emery Berger and Mark Corner University of Massachusetts.
Lecture 11 Recoverability. 2 Serializability identifies schedules that maintain database consistency, assuming no transaction fails. Could also examine.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 6 Deadlocks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All.
Tanenbaum Ch 6 Silberschatz Ch 7
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
Quick Review of Apr 29 material
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
Transaction Management and Concurrency Control
Deadlocks. 2 System Model There are non-shared computer resources –Maybe more than one instance –Printers, Semaphores, Tape drives, CPU Processes need.
Review: Process Management Objective: –Enable fair multi-user, multiprocess computing on limited physical resources –Security and efficiency Process: running.
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
Deadlock CSCI 444/544 Operating Systems Fall 2008.
CPSC 4650 Operating Systems Chapter 6 Deadlock and Starvation
Deadlock Detection with One Resource of Each Type (1)
Chapter 18: Distributed Coordination (Chapter 18.1 – 18.5)
1 Concurrency: Deadlock and Starvation Chapter 6.
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
Distributed process management: Distributed deadlock
Deadlocks in Distributed Systems Deadlocks in distributed systems are similar to deadlocks in single processor systems, only worse. –They are harder to.
1 Advanced Computer Programming Concurrency Multithreaded Programs Copyright © Texas Education Agency, 2013.
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
Deadlock Questions answered in this lecture: What are the four necessary conditions for deadlock? How can deadlock be prevented? How can deadlock be avoided?
Games Development 2 Concurrent Programming CO3301 Week 9.
1 Announcements The fixing the bug part of Lab 4’s assignment 2 is now considered extra credit. Comments for the code should be on the parts you wrote.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Mutual Exclusion.
Operating Systems Part III: Process Management (Deadlocks)
1 MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 6 Deadlocks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.
Computer Systems Lab TJHSST Current Projects In-House, pt 5.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 6 Deadlocks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All.
Processor Architecture
This Time - Deadlock Definition Conditions for deadlocks
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
DEADLOCK DETECTION ALGORITHMS IN DISTRIBUTED SYSTEMS
CSC 322 Operating Systems Concepts Lecture - 28: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Operating Systems COMP 4850/CISG 5550 Deadlocks Dr. James Money.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
Deadlocks Copyright ©: University of Illinois CS 241 Staff1.
Tutorial 3: Homework 2 and Project 2
10-Jun-16COMP28112 Lecture 131 Distributed Transactions.
OPERATING SYSTEMS DO YOU REQUIRE AN OPERATING SYSTEM IN YOUR SYSTEM?
Linux Kernel Development Chapter 8. Kernel Synchronization Introduction Geum-Seo Koo Fri. Operating System Lab.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Kernel Synchronization David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Introduction to Operating Systems Concepts
CSE 120 Principles of Operating
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Deadlocks (part II) Deadlock avoidance – (not reasonable)
ITEC 202 Operating Systems
Operating System Structure
Challenges in Concurrent Computing
Lecture 14: Pthreads Mutex and Condition Variables
Intro. To Operating Systems
Threads Chapter 4.
Review: Readers-Writers Problem
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Multithreaded Programming
The relation between the process and
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Operating System Introduction.
Synchronization These notes introduce:
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Transactions, Properties of Transactions
Presentation transcript:

Development of a Resource Locking Algorithm for a Kernel Debugging User-space API Library TJHSST Computer Systems Lab Timothy Wismer

Introduction: Kernel-space and User-space ● The Linux Kernel provides the core functionality of a system—interaction with hardware, management of file systems, etc. ● All other programs depend on the functionality provided by the kernel, and are said to exist in user-space. ● Because of the critical position of the kernel, development and testing is very difficult. ● This project aims to simplify kernel development by moving kernel functionality to user-space.

Operating System Layers Hardware Layer (ex: Matrox Millenium II Graphics Card) Hardware Layer (ex: matroxfb_base.o driver) Abstraction Layer (ex: framebuffer) User-space (ex: OpenGL Library) Kernel-space Functionality to be ported by KDUAL

Introduction: Resource Locking ● Access to resources used by multiple processes must be atomic to avoid problems. ● Atomicity means that the entire operation succeeds or fails as a whole, and creates no intermediate state visible to other processes. ● A series of operations is made atomic by restricting those operations with a single, inherently atomic operation—the lock. ● As long as all processes use the lock to access the resource, they should not conflict.

Introduction: Deadlock ● Deadlock occurs when a process tries to obtain a resource that will not be available until the process gives up a resource that it already holds. ● Deadlock can involve any number of processors. ● Deadlock cannot resolve on its own—unless interrupted by some outside entity, it will cause the system to lock up. ● The KDUAL locking implementation will include deadlock detection.

Theory: Detection of Deadlock ● When processes are waiting on held locks, they depend on the process that holds the lock. If A depends on B and B depends on C, A also depends (indirectly) on C. ● Deadlock occurs when a process depends on itself (through any number of intermediaries). ● In a graph with nodes representing processes and edges representing dependencies, a deadlock will appear as a cycle: a complete path from a node back to itself.

A Deadlock Scenario 2 1,3 3 2 Each box represents a lock, held by the process identified in the oval. The inner box identifies processes waiting for the lock: Processes 2 and 3 each want the lock held by the other; process 1 is not part of the deadlock.

Wait-For Graph The WFG representation of the previous slide. The cycle clearly shows a deadly embrace involving processes 2 and 3:

The Deadlock Detection Algorithm ● A separate Deadlock Detection Thread (DDT) will be created when the application starts. ● The locking functions will make information about process dependencies available to the DDT. ● The DDT will periodically check the dependency information for WFG cycles to identify deadlocks. ● In the event that a deadlock is detected, one involved process will be terminated and the user will be provided with debugging information.

Future Development & Value to Others ● Completion of KDUAL – so far the locking implementation is the only component; much more would be needed to make KDUAL usable. ● A working KDUAL would simplify and speed up development of kernel code. ● Apart from KDUAL, the locking implementation can serve as a “test suite” for applications that use locking.