CS-736: Homework 2

Due Friday, October 10/01.

This homework is to be done by yourself although you may of course talk to your colleagues or the professor.

This is an assignment about measurement of computer systems. The basic idea is to familiarize yourself with a challenging and necessary component of systems research: empirical analysis. On a real system of your choice, you should determine the following via simple timing measurements:

  • the cost of a context switch
  • the number of entries in the TLB, and the cost of a TLB miss
  • detailed disk characteristics such as seek time and rotational speed (other aspects such as track-switch cost could be considered extra credit)

You are to do this simply by writing little programs that exercise the system in some way in order to bring out these characteristics, and then timing them to see how long they take. For example, to determine the number of entries in a TLB, one might access an increasing number of entries in an array, repeatedly in a loop, and time each set of accesses; when the time to do so jumps, it may indicate that one has gone from hitting in the TLB to missing.

One key aspect of doing this project is to understand what kind of timers you have at your disposal, and how precise they are. Typically, one might use gettimeofday() or access the processor cycle counter via the rdtsc instruction. Use man pages or google or both to find out more about these, and convince yourself that you are doing the measurements correctly.

What to turn in: Either on the day of the project (or before), you will sign up for a short (10 minute) slot with the professor to present your results. You should have a simple set of powerpoints (8 slides).The first slide should have your name, a picture of you, and a title of some kind. The second should have some information about your method, including what you have learned about timers and their precision. Then the final six slides should be in three pairs, one for each target measurement (context switch, TLB, disk characteristics). The first slide in each pair should show what code you ran and timed, and the second your results in the form of beautiful graphs. See Tufte for details about how to present graphical data.

Hint: The important aspect of this project is the construction of convincing experiments. Getting some numbers out of a computer is easy! Getting understandable numbers that withstand the scrutiny of others is more difficult. Your experiment must convince me (or anyone else) that you have absolutely positively measured the thing you are trying to measure! Be your own harshest critic, instead of letting the audience (that's me) find flaws in your work. Of course, you are free to come by before the final due date with your results to discuss them.

Hint: The raw device interface might be useful for measuring disk characteristics. You might need to bind a thread to a processor in order to understand context switch costs.