7. User-level threads : Implemented through a threads library in the address space of a process, these threads are invisible to the OS. A user-level thread (ULT) is a user-created unit of execution within a process.
8. Lightweight processes : A lightweight process (LWP) can be viewed as a mapping between user level threads and kernel threads. Each LWP supports ULT and maps to one kernel thread. LWPs are scheduled by the kernel.
9. Kernel threads : These are the fundamental entities that can be scheduled and dispatched to run on one of the system processors.
10. Kernel Entry Hardware System call interface lightweight syscalls User Level Kernel Level I / O Process Management Subsystem Interpreter User program Libraries Virtual File System Filesystem File Cache LVM device drivers IPC Scheduling Hardware control Memory Management Subsystem
13. System Call Interface . .. Virtual File System Framework Kernel Services Clocks & Timers etc Hardware – SPARC / x86 / x64 Hardware Address Translation (HAT) Network ing framework& services . .. Bus & Nexus Drivers sd ssd Processes & Threads t i m e s h a r e Scheduler i n t e r a c t i v e r e a l t i m e f a i r s h a r e f i x e d p r i o r i t y ZFS NFS ProcFS SpecFS TCP/IP Resource managem ent & cont rols Memory Management Virtual Memory Kernel Memory Allocation Resource management & controls Solaris kernel
20. XNU kernel User User libraries libc BSD I/O Kit Mach Platform Expert Xnu (kernel)
21. Microkernel architecture Hardware Hardware Accounts File Systems Networking Devices Virtual Memory Process Mgmt Virtual Memory Process Mgmt IPC Kernel Microkernel User-Space Servers Applications Applications Traditional (Monolithic) Kernel Microkernel UNIX
22. VMS (virtual memory) Solaris DEC OSF/1 -> DIGITAL UNIX HP-UX Tru64 influences System III ULTRIX Mach AIX XENIX OSF/1 Tru64 UNIX SCO UNIX (System V) Tandem NonStop-UX, Integrity XC SunOS UNIX (Bell Labs) SCO XENIX System V BSD
23. Mach in Tru64 Process Mgmt Memory Mgmt UNIX Mach Process Mgmt Memory Mgmt IPC Mach System Calls by Select System Services UNIX System Calls by Applications Other Services: File Systems Buffer Caches UNIX IPC and Networking I/O Framework Security and Accounting Etc...
28. Linux kernel Process Kernel modules Audit IPC System Call interface Devices SELinux Memory File, I/O Networking
29.
30.
31. Most services are implemented in the kernel, with the exception of many networking functions. Thus Linux kernel is relatively big in size.
32. Linux provides a unique solution in that it does not recognize a distinction between threads and processes. Using a mechanism similar to lightweight processes, user-level threads are mapped into kernel-level processes. Multiple user-level threads that constitute a single user-level process are mapped into Linux kernel-level processes that share the same group ID. This enables these processes to share resources such as files and memory and to avoid the need for a context switch when the scheduler switches among processes in the same group.
33. Context of a Process Process structure Shared memory Heap space Data Text Virtual Address Space
34. Context of a task Attributes Instructions Private storage Thread structure Thread stack User structure with register context
36. Threading models Hardware Kernel Space Kernel Threads User Space kernel scheduler kernel scheduler kernel scheduler KT KT KT KT UT UT UT UT UT scheduler KT UT UT UT scheduler KT UT UT User Process and User Threads CPU CPU CPU CPU CPU KT file management subsystem I/O management subsystem Process & memory mgmt subsystems network management subsystem
39. Thread Scheduling Contention Scopes Userspace scheduler in pthread library User Space Kernel Space "unbound" with userspace scheduler. Here, we "bind" to kernel threads. Bound threads
43. Most services are implemented in the kernel, with the exception of many networking functions. Thus Linux kernel is relatively big in size.
44. Linux provides a unique solution in that it does not recognize a distinction between threads and processes. Using a mechanism similar to lightweight processes, user-level threads are mapped into kernel-level processes. Multiple user-level threads that constitute a single user-level process are mapped into Linux kernel-level processes that share the same group ID. This enables these processes to share resources such as files and memory and to avoid the need for a context switch when the scheduler switches among processes in the same group. Virtualisation
51. KVM Architecture Native Linux kernel is the VMM (kvm module loaded) Xen is different. Xen copy code from linux kernel ; became a VMM itself ; the real linux kernel is going to "sleep" and xen kernel do everything by itself (a lot of maintenance work !! When new linux kernel release, xen need port a lot code ) Guest mode ,each vm looks as a normal linux process
82. Some Common Virtual Machine Environments User Mode Linux (UML) Unhosted Hosted VMware ESX Hyper-V VMware Server/WS MS Virtual PC HP IVM, KVM Fully virtualized Xen Para-virtualized
88. Hyper-threading Hardware Layer Kernel Layer User Layer H/W Threading Off H/W Threading On LCPUs disabled H/W Threading On LCPUs enabled CPU CPU CPU CPU CPU Core Core Core HT HT HT HT LCPU LCPU LCPU LCPU
Notes de l'éditeur
There are four primary subsystems covered in this course, which are responsible for the majority of the kernel activity. Process Management The Process Management Subsystem is responsible for managing all of the running processes and threads on the system, maintaining information about process and thread resources, and scheduling threads on the CPU or CPUs. Memory Management Memory is managed by the kernel in a way that allows each process to have its own virtual address space. The Memory Management Subsystem creates an appearance that the sum of process address space is greater than the amount of physical memory in the system. This is the theory behind the virtual address space concept. File Systems The File Subsystem is responsible for managing data on various types of disks. The File Subsystem has provisions to manage different types of file system disk layouts. The ability to do this comes from a level of abstraction known as the vnode layer.
This slide shows the "Big Picture" of some of the primary kernel data structures. Previous slides have already shown how the process management and memory structures are linked together through the VAS and pregions. In this diagram, we also see how the process management structures are linked to the file system structures through the File Descriptor Table. Each entry in this table is mapped to an entry in the System File Table. We can complete the picture of the process by using the information contained in the System File Table entries. Each of these structures will be discussed in greater detail in later parts of this course.
The program code The global variables used by the program Contains process- specific information such as the process' state, its threads, signals, size, scheduling priority Address range into which the process context is logically mapped Available range of addresses stored in the virtual address space; can be dynamically allocated by process for private data storage Available range of addresses stored in the virtual address space; can be allocated by process, populated with data, then shared with other processes virtual address space heap space shared memory
The program code specifically for this thread to execute (e.g., a function) Define thread-specific characteristics Contains thread-specific information such as the scheduling priority, states, signals, and cpu usage. Contains a program counter user structure with register context private storage Area for data; comparable to process heap space, except that unlike the process heap space, thread's private storage is not shared with other process threads Stack space used by thread to call functions