Addition of multi-priority queues, RQ0, RQ1, and RQ2, for each consumer or CPU thread• Differentiating three different types of processes: SCHED_FIFO, SCHED_RR, and SCHED_NORMAL• Addition of lock/unlock for consumer/CPU queues.• Selection of the next process to “run”.A. General Description of Simplified Linux Scheduling:Different priority levels are used for scheduling decision making. In modern Linux, the priority range is [0, 140)or 0 –139, inclusive. The following is a short description of some features used for Linux Completely FairScheduler (CFS).
- Multilevel queues: Linux CFS used a multilevel queue scheduler, and each queue is associated with apriority value. There are 140 priorities in total, which means that there are 140 queues. Linux makes use ofefficient bitmap hardware instruction to check all 140 queues when a CPU is to select thext process to run.It is highly efficient with the hardware support.For this lab and assignment, we simplify this layer to only three ready queues, i.e., RQ0, RQ1, and RQ2representing decreasing order of priority, i.e., priority of RQ0 > RQ1 > RQ2. Typically, processes in eachqueue will be organized using a linked list. But it is not required for the lab or assignment.RQ0 is for real-time applications (SCHED_FIFO and SCHED_RR) with the priority range [0,100), i.e., 0 to 99,inclusive. The priority of real-time processes (SCHED_FIFO and SCHED_RR) is static, i.e., it is not changedonce it is generated by the producer.SCHED_FIFO is non-preemptive, i.e., it runs to completion or when the running process is blocked. For thelab, we assume that SCHED_FIFO processes will not be blocked before it is completed. In other words, thoseprocesses will run to completion once it is selected.But SCHED_RR processes are preemptive. For the lab, assume that running processes are blocked only ontimer interrupt in each iteration, i.e., they use up the entire calculated time slice or quantum size, not due toany other event. But the expected service time (generated by the producer) is several times larger than thequantum size. See the formula for calculating quantum sizes.3The priorities for SCHED_NORMAL processes are in the range of [100, 140). Typically, SCHED_NORMALprocesses with default static priority (SP) value 120 will initially be put into RQ1 and when the dynamicpriority is >= 130, the processes will be moved into RQ2.The initial processes, priority values, and expected execution time can be read in from a pre-configuredinput file by the main thread. See the end of the description for reference. If the main thread reads processinformation from an input file, the producer thread can be eliminated. Assume that the processes are evenlydistributed initially in four queues, i.e., all consumer / CPU threads have the same number of SCHED_FIFO,SCHED_RR, and SCHED_NORMAL processes in the queues
I do not know where to begin. I am thinking of make a function to add elements to a queue however am unsure how to go about this