CS3 Operating Systems 2013-14, Practical Exercise. PHASE 3 ------- The assessed submission for this practical comprises three installments. This is the second installment. Part 2 ------ In this part, you need to prepare three files for submission. The first is a text file containing your description and analysis of a problem; the second is a corrected version of a program; the third is dmesg output as in Part 1. The text file should be called part2-analysis; the program should be called fixedworker.c; the output should be called part2-output . Consider the worker module from Part 1. Recall that when the module is rmmod'ed, it sets a flag to ask the kernel thread to stop, and then waits to be told by the thread that it is done. On a uniprocessing, unmodified, Linux system, this technique is safe, because kernel routines cannot be pre-empted. On an SMP system, however, the kernel thread might be running at the same time as the rmmod command. In the directory /group/teaching/cs3/os/Modules there is a slightly modified worker, called stuckworker.c , which contains a delay to simulate the effect of possible multiprocessing. Copy this file (and the Makefile - or update your own Makefile appropriately). Compile and install this module, and then do exactly what you did for worker, namely, insmod, wait thirty seconds, and rmmod . In the file part2-analysis: Describe what happens. [ You should not exceed 10 lines ] Analyse the cause of the problem. [ You should not exceed 10 lines ] Propose and explain a solution for an SMP-safe version of worker . [ You should not need more than 20 lines ] Implement your solution in fixedworker.c. Run your fixedworker in the usual way, and capture the dmesg output in your part2-output file. [ Hints: there are several ways to do this. You may find the wait_event macro (in ) of interest. You are free to use Google to assist you in solving this problem, but you should not consult humans. If you use a solution based on something on the net, you should acknowledge your source. Of course, you must understand and explain your solution. ] When you have finished this part, and no later than the final practical deadline, submit your files with the command submit os 1 part2-analysis fixedworker.c part2-output DO NOT submit any other files, or use any other name for the files. Such files will not be marked. This part contributes 30% of the practical. If you have done the suggested reading and followed lectures, it should take at most a couple of hours, and possibly much less.