Answer Any Five and Only Five from the Following, Not Six, Not Seven

Total Page:16

File Type:pdf, Size:1020Kb

Answer Any Five and Only Five from the Following, Not Six, Not Seven

Final Exam CS521 Operating Systems Fall 2013

Answer any five and only five from the following, not six, not seven …

Please!

Due date: Tuesday

1. Scheduling of tasks is an art tempered with a dash of science and wee bit of common sense. Unix solves this problem by adjusting process priority every 4 clock ticks using the following scheme:

processor Process priority = baseline+util + 2 * Nicefactor 4

Where processorutil refers to utilization of CPU the process is running at, and the Nicefactor is an adjustable parameter within the range -20 to 20. The utilization is incremented by 1 after every clock tick. Given this formula to evaluate priorities of processes, explore how well it handles the following:

a. It should allow jobs to get more priorities if they use the CPU extensively. b. Interactive jobs not using CPU enough would lose priority

Next suggest how this formula or a variation of it could be used to schedule processes in a multi-core environment replacing a single CPU unit.

2. Consider a system with 2 disks: Fast, and slow. The relevant statistics are:

■ Observation period: 30 mins ■ Number of users (terminals): 30 ■ Think time: 12 secs ■ Completed transactions during the observation period: 1600 ■ Fast disk visit count: 32,000, slow disk visit count: 20,000

■ Bcpu=1080, B fast = 400, B slow = 600

(a) Obtain the service demands Dcpu, D fast and D slow per transaction. (b) Obtain both the optimistic and the pessimistic bounds for throughput and response times. (c) Consider the following modifications one at a time to obtain the throughput and response time bounds, respectively

C1. Move all files to fast disk C2. Replace the slow disk by a fast disk C3. Increase CPU speed by 50% keeping the original disks C4. Increase CPU speed by 50% and balance the load between two fast disks. 3. The hi-tech ABC gourmet is a famous restaurant with two branches: One at Utica, and the other one at Rome. Since ABC offers only gourmet dishes, each of its numerous chefs work only one food item per evening with meticulous care and dedication. The servers, located at Utica and Rome, allocate the food item a specific local chef is randomly chosen to prepare, and allocation lists are available the day before.

Each server works with one application thread. However, the server is always willing to entertain requests for swapping dishes assigned to a pair of chefs via calls like

swap(chef1, chef2).

If it is possible, the assignment list would be changed accordingly, and the relevant chefs would be informed. We assume that computation of any relevant request does not take more than a few milliseconds, and transmission of the results to relevant parties does not take more than a few microseconds.

We assume the servers get their list by invoking the following for each chef:

set_and_get(chef, random(dish)); // each dish is assigned to one chef

only producing lists like

Assignment(“Julia Child”, “Poulet à l'ail dans le vin Utica”); Assignment(“Rachel Ray”, “Foie gras por receta Roma”);

(a) Obviously, neither Ms. Child nor Ms. Ray is particularly thrilled with this kind of ad- hoc lists. So they decide they each send a swap request to the server. Thus, they both issue a swap(“Julia Child”, ”Rachel Ray”) to their own server assuming they both belong to either Utica or Rome branch . What would be the final state after a minute or so?

Now it is possible that Ms. Child and Ms. Ray may belong to different branches served by different set of servers. The cross-swap function issued at a server is designed as follows:

boolean cross-swap (local_chef, remote_chef) temp1 = allocation [local_chef]; send (“set_and_get”, remote_chef, temp1, other_server); temp2=wait(response_to_”set_and_get”, other_server); assignment[local_chef]=temp2; return ok;

The other server upon receiving a send request invokes the following:

dish cross_update(chef, changed_dish) old=allocation[chef]; assignment[chef]= changed_dish; return old;

Assume the current states at Utica and Rome is as follows: At Utica: Assignment(“Rachel Ray”,” Foie gras por receta Roma”); Assignment(“Barefoot Contessa”,”Bhuna Chicken”);

At Rome: Assignment(“Julia Child:”, “Poulet à l'ail dans le vin Utica”); Assignment(“Bobby Flay”, “Hydrabadi Biriyani”);

(b) Suppose concurrently, chef Child sends a cross-swap (“Julia Child”,”Rachel Ray”) request to the Utica server, and the chef Flay sends a cross-swap(“Bobby Flay”,”Barefoot Contessa”) request to the Rome server. If we look at the states at two branches, what would we find?

4. One issue that often comes up in a multi-core processor operation is the use of its cache.

Usually, each processor within this group would have its own L1 cache. Each individual

cluster of processors would have its own community L2 cache, which could be shared by participating processors within the community, and finally, at the next level up, we could

think of a multiprocessor system bundled with an L3 cache to be shared by individual multi-core cluster in the entire system. So far so good! But then we have to figure out (a) how big or voluminous these caches ought to be, and (b) what gets placed in which

cache, and how it could be decided? Let’s suppose the volume of L2 cache in current systems is 2 MB, 5.

Recommended publications