1 / 27

The Structuring of Systems Using Upcalls

The Structuring of Systems Using Upcalls. David D. Clark. Overview. A method for implementing layers with synchronous procedure calls between layers Upcalls – flow of control by a lower layer calling an upper layer via procedure call

Download Presentation

The Structuring of Systems Using Upcalls

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Structuring of SystemsUsing Upcalls David D. Clark Frank Sliz, CS533, Upcalls

  2. Overview • A method for implementing layers with synchronous procedure calls between layers • Upcalls – flow of control by a lower layer calling an upper layer via procedure call • Multi-task module – subroutines in different tasks that make up the layer Frank Sliz, CS533, Upcalls

  3. Outline • Background • Upcalls and Multi-task Modules • Example • Advantages • Swift Operating System • Problems • Conclusions Frank Sliz, CS533, Upcalls

  4. Background • 1968 – THE operating system • Great interest in using layers to structure OS • 1982 – ISO model for network communication • 1985 – Swift operating system Frank Sliz, CS533, Upcalls

  5. Monolithic Operating System Frank Sliz, CS533, Upcalls

  6. Layered Operating System Frank Sliz, CS533, Upcalls

  7. Advantages of Layered OS • Modularity • Easier to test and debug • Easier to modify • Acyclic dependency • Verification • Trustworthiness Frank Sliz, CS533, Upcalls

  8. 7-Layer OSI Model 7 application 6 presentation 5 session 61 4 transport 3 network 2 data link 1 physical Frank Sliz, CS533, Upcalls

  9. Disadvantages of Layered OS • Performance • Asynchronous communication between layers • Buffering of data between layers • Copying of data for crossing protection boundary • Programming complexity • Inefficient support for upward flow of control Frank Sliz, CS533, Upcalls

  10. Upcalls and Multi-Task Modules • Upcalls • Flow of control by a lower layer calling an upper layer via procedure call • Multi-Task Modules • Subroutines in different tasks that make up the layer • Subroutines are callable from above or below via procedure calls • State variables in shared memory Frank Sliz, CS533, Upcalls

  11. System Organization Frank Sliz, CS533, Upcalls

  12. Example - Network Protocol3 Layers and 3 Tasks Display Transport Network Create Receive Send Frank Sliz, CS533, Upcalls

  13. Control Flow in Network Protocol Display Layer Transport Layer Network Layer Frank Sliz, CS533, Upcalls

  14. Example - Display LayerNetwork Protocol Frank Sliz, CS533, Upcalls

  15. Example - Transport LayerNetwork Protocol Frank Sliz, CS533, Upcalls

  16. Example Network LayerNetwork Protocol Frank Sliz, CS533, Upcalls

  17. Example – Create Task Frank Sliz, CS533, Upcalls

  18. Example – Receive Task Frank Sliz, CS533, Upcalls

  19. Example – Send Task Frank Sliz, CS533, Upcalls

  20. Advantages of Upcalls • Upward, synchronous flow via procedure call is more efficient than IPC • No need for data buffering between layers • Simplicity of implementation • Lower layer can ask advice from upper layer resulting in simplification of algorithm Frank Sliz, CS533, Upcalls

  21. Advantages of Multi-Task Modules • Subroutine interfaces are easier to deal with than IPC interfaces • No system wide IPC message format needed • Decisions about task usage can be made later, the tasks are not hard coded into the layers • Acknowledgements can be sent with new data packet - Piggybacking Frank Sliz, CS533, Upcalls

  22. Swift Operating System • Explore upcall and multi-module usage • Single address space with a typesafe language • Monitor locks for access to shared state • Initially used for network protocols • Test to determine if useful in other contexts • Develop solutions for upcall problems Frank Sliz, CS533, Upcalls

  23. Problems with Upcall • Violates basic principle of layering • upcall failure could leave lower layer left in unstable condition • Recovery of resources when an upcall fails • Upcall gets into an infinite loop Frank Sliz, CS533, Upcalls

  24. Mitigating Upcall Failures • 2 classes of data • Client or private data which is expendable • Data shared between tasks must be unlocked and consistent before upcall • Expendable tasks • Layer-specific cleanup via system procedures • Timer or User to detect infinite loop Frank Sliz, CS533, Upcalls

  25. Solutions to Indirect Recursive Call • Put state variables in consistent state before upcall and then reevaluate them upon return • Prohibit recursive downcall – variables can be left locked and inconsistent when upcalling • Downcall queues the work for later execution • Downcall is restricted in its actions • Downcall is replaced by extra arguments or it is replaced by a second upcall to query Frank Sliz, CS533, Upcalls

  26. Problems with Multi-Task Modules • Failure to use monitor locks properly which can cause incorrect results • With single shared memory address space program bugs can corrupt memory • Need queues for suspended tasks waiting to obtain monitor locks Frank Sliz, CS533, Upcalls

  27. Conclusions • Methodology is useful for operating systems • upcalls and multi-task modules are efficient • Strongly checked typesafe language should be used in a single shared address space • useful for network protocols, text editors, and I/O • Bad idea to implement a layer as a process • Parallel systems need shared memory for efficient communication between processes Frank Sliz, CS533, Upcalls

More Related