Construct the precedence graph

Assignment Help Operating System
Reference no: EM131218983

1. Consider a system of 9 processes, P = {p1, ..., p10} Associated with the system are 6 memory cells, M = {M1, .., M6}. The domain and range for each process is given in the following table:

Process pi

Domain D(pi)

Range R(pi)

p1

M1, M2

M3

p2

M1

M5

p3

M3, M4

M1

p4

M3, M4

M5

p5

M3

M4

p6

M4

M2

p7

M5

M5

p8

M3, M4

M2

p9

M5, M6

M6

P10

M4, M5

M6

In addition, you are given the following precedence relation:

→ = {(1,2),(1,6),(2,3),(2,4),(2,5),(3,6),(4,6),(4,7),(5,7),(5,8),(6,8),(6,9),(7,9),(8,9), (9,10)}

a. Construct the Precedence Graph (not containing any redundant edges)

b. Determine if the system above is determinate. If it is not, add to → necessary elements to make it determinate

c. Find the Maximally Parallel System

2. Linux Task Scheduling

The Linux scheduler repeatedly switches between all the running tasks on the system, attempting to give a fair amount of CPU time to each task. Fair-share scheduling is a strategy that shares the CPU among sets of processes according to the groups that own those processes. For example, suppose that Mary, Jane, and Sam belong to different groups and are logged in to a machine that uses fair-share scheduling. Suppose Mary has one runnable process, Jane has three, and Sam has six. Fair-share scheduling views the ten runnable processes in three groups, and each group receives one-third of the CPU

cycles allocated to the processes that it owns. Mary's single process would therefore get about 33% of the available CPU cycles, each of Jane's three processes would get roughly 11% of the available CPU cycles, and each of Sam's six processes would get about 5.5% of the CPU cycles. Suppose Jim belongs to Jane's group and he logs in to the machine and creates two more processes. Then Mary's single process would still get its 33% of the CPU and each of Sam's six processes would still get about 5.5% of the CPU. Jim and Jane together would have five processes that in total receive one-third of the CPU, so that each process would get about 6.7% of the CPU.

You are required to develop a new scheduling policy to support fair-share scheduling. It is called GRR, for group weighted round-robin scheduling. GRR should use fair-share scheduling based on each process's Linux group identification. At each invocation of the scheduler, we will use a hierarchical scheme to choose which task to run: first, a group is chosen, then, a task within that group's set is chosen. If we allow each group's chosen task the same amount of time on the CPU, each group should be represented equally.

Since we have to make two choices in each scheduling decision, we need two algorithms: one to choose the group and one to choose one of that group's tasks. Let's start by assuming we will use a Round-Robin scheme to decide which group to choose. We keep a queue of groups, and whichever group was chosen last time we scheduled, we choose the next group in the queue for this schedule. We then choose a task within this group's set of tasks (more on this later), and let it run for a fixed amount of time. Now every group gets an equal amount of CPU time at a relatively fine grain.

Now let's say that some groups are more equal than others. Imagine that we associate an integer, which we'll call a weight, with each group. We then modify the round-robin algorithm above so that we pick the same group for W time quanta (instead of a single time quantum), where W is the group's weight, before moving on to the next group in the queue. In this way, we can specify that some groups get more CPU time than others, and also how much more. A group with a weight of 3 will get 50% more CPU time than a group with weight 2. This is called proportional sharing. More specifically, this implementation of proportional sharing is called Weighted Round-Robin.

We still haven't specified how a task is to be chosen once we choose a group. For simplicity, use a simple round-robin (RR) scheduling algorithm to do that. The intragroup RR scheduler should use the same default timeslice as the Linux scheduler uses for a task with the default nice value. Otherwise, the RR scheduler should work the same as GRR except that it schedules tasks, not groups, and there are no different task weights.

In this homework, you are asked to implement a new task scheduler GRR as described above:

- Most of the code of interest for this assignment is in kernel/sched.c and include/linux/sched.h, and the main scheduler entry point is/are schedule() and pick_next_task(). These are probably not the only files you will need to look at, but they're a good start.

While there is a fair amount of code in these files, a key goal of this assignment is for you to understand how to abstract the scheduler code so that you learn in detail the parts of the scheduler that are crucial for this assignment and ignore the parts that are not.

- Implement group weights. Add two system calls, getgroupweight() and setgroupweight(), with the following prototypes:

int getgroupweight(int gid);

int setgroupweight(int gid, int weight);

getgroupweight() should return the weight of the specified group, or -1 on error. The default group weight should be 10.setgroupweight() should give the specified group the specified weight, and return 0, or -1 on error.

- Your scheduler should operate alongside the existing Linux scheduler. Therefore, you should add a new scheduling policy, SCHED_GRR. Only tasks whose policy is set to SCHED_GRR (normally done via the system callsched_setscheduler()) should be considered for selection by your new scheduler. Your scheduler and the existing scheduler should interoperate as follows:

o If there are any running tasks whose policy is SCHED_RR or SCHED_FIFO (these are real-time tasks), one of them should be chosen before any other, according to the existing Linux scheduler rules.

o If there are any running tasks whose policy is SCHED_NORMAL (the default scheduler), one of them should be chosen before any SCHED_GRR (your scheduler) tasks, according to the default scheduler's rules.

o If all running tasks have a policy of SCHED_GRR, your scheduler should be used to choose a task, according to the rules outlined.

In other words, there should be a strict priority relationship where SCHED_RR and SCHED_FIFO are first, SCHED_NORMAL andSCHED_BATCH are second, and SCHED_GRR is last.

- The user_struct structure in include/linux/sched.h is used for tracking users. This structure may be helpful in creating a useful way to keep track of user groups.

Create five users: Mary, Jane, Sam, Jim, and Pat. Assign Mary and Jane to the same group, Sam and Jim to the same group, and Pat to a separate group. Assign weights of 30, 10, and 10 to the respective groups. Create a simple test program that measures its own CPU usage as it runs and use it to show that your GRR scheduler behaves properly.

Prepare the tests before the demo and document your results in a writeup taken to the demo.

Reference no: EM131218983

Questions Cloud

Variety of locks available : Within a database their are a variety of locks available, many developers do not use locks explicitly. They use stored procedures which lock the data that they need. Stored procedures also promote code reuse in multiple applications. How far ca..
What is an intrarelation constraint : Describe how to represent a 1:N strong entity relationship. Give an example other than one in this chapter.
Resources to try at our institute jubail technical institute : Please let us access free resources to try at our institute Jubail Technical Institute (www.jti.edu.sa). If it is approved by higher managment later, we can have deal or an agreement with you for further course of action.
Is there a significant interaction effect : She divides volunteer students into 3 categories: first-generation immigrants, second-generation immigrants, and non-immigrants. She then administers an instrument assessing feelings of alienation, where higher scores indicate stronger feelings of..
Construct the precedence graph : CSCE 5640 Operating Systems Design Construct the Precedence Graph (not containing any redundant edges) and Determine if the system above is determinate. If it is not, add to → necessary elements to make it determinate
Find the psd of the filtered signal plus noise : Find the PSD of the filtered signal plus noise. - Find the input SNR and an estimate of the output SNR. Discuss whether or not the Wiener filter improves the SNR.
List four uses for id-dependent entities : Describe how to represent an association entity relationship. Give an example other than one in this chapter.
Find the psd of the filtered signal plus noise : Determine the Wiener smoothing filter.- ind the impulse response of the filter that produces an output that is an MMSE estimate ofS(t) .
What percent of teenage boys : (1) What percent of teenage boys have high cholesterol levels (2) We select a sample of n = 50 teenage boys. What is the probability that the sample mean will be less than or equal to 180 mg/dL?

Reviews

Write a Review

Operating System Questions & Answers

  Give an illustration where strict 2 phase locking is

question 1 give an example where strict 2 phase locking is followed but the resulting schedule leads to deadlock.

  Find all the dns servers for microsoft.com

I desperately need assistance on the questions below which some of them requires using the the command prompt. I would like to have the answer with the detail step by step commands

  Discuss the primary advantages of gui over a textual

Discuss the primary advantages of GUI over a textual (command-line) interface in Linux system administration. Describe two (2) linux desktop environments and explain how they generally function

  Benefits of leasing vs purchasing hardware and software

Your responses to the questions and statements must be supported with 2-3 academic sources in addition to the textbook, such as case studies and empirical studies.

  Identify an operating system and application combination

Identify an operating system and application combination, and discuss at least 2 cluster implementation models supported. Identify and discuss the advantages and disadvantages of the implementation of the models you suggested

  What is probability that pre-fetching is on right track

Suppose that a computer pre-fetches 20 instructions in advance. However, on the average, four of these are conditional branches, each with a probability of 90% of being predicted correctly.

  Web security threats

Think about the given threats to Web security and explain how each is countered by a particular feature of SSL.

  Uses this divide-and-average algorithm

Write a program that reads values for x, a, and the small error allowance and then uses this divide-and-average algorithm to find the approximate square root of x

  Explain "information architectures" concept in detail

At the least, you need to iterate the questions a couple of times for yourself. Write down your answers, then set them aside for a couple of days and come back to them. If you can do this a couple of times, you'll find that your formulation will b..

  How fork and vfork unix system calls work

Explain the difference between how fork() and vfork() UNIX system calls work, from Virtual memory managementprospective.

  Develop an operating system for a new hand-held device

In a detailed paper, describe what your OS will do, how you will design it and what features will be present. Do not generalize, make this a very specific with diagrams and other supporting materials. There is no programming required.

  Set of three uml class relationship diagrams

Prepare a set of three UML class relationship diagrams highlighting important relations among the discovered classes. Each diagram should give a coherent picture of relations among 3-5 classes.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd