The Physical I/O Facility is a software toolkit that, when coupled with application I/O instrumentation, helps reveal the correlation between application I/O requests and physical I/O operations. This is significant because physical I/O patterns are strongly affected by data striping mechanisms, file system policies, and disk hardware attributes. Understanding how the operating system translates application I/O requests into physical disk operations can aid in optimizing file policies and data distributions for higher performance.
The Physical I/O Facility captures I/O data quantifying the performance of SCSI disk drives supporting applications run on a Linux system. Unlike other Pablo I/O characterization tools, it is not a user-level library that can be substituted for standard language or operating system I/O calls. Rather, it consists of a patch to the Linux kernel and a set of user-level tools. The Linux kernel patch performs exactly the same function as its standard Linux kernel counterpart, but it has been augmented by instrumentation software, attached before and after reads and writes, to capture internal data. Programmers run their applications in a Linux environment that has been modified with the Physical I/O Facility's Linux kernel patch. During program execution, performance data, captured by the instrumentation, is recorded in a set of histograms. Analysts study these histograms to understand how the Linux device drivers translate application I/O requests into physical disk operations. This tutorial includes: instructions for patching the Linux kernel and instructions for compiling and using the user-level tools, as well as access to an end-to-end example of performance analysis.
All physical input/output requests pass through an operating system's device drivers. These drivers define the interface between file system services and I/O devices, isolating the idiosyncrasies of specific peripherals behind standard interfaces. By instrumenting device drivers, analysts can reveal the activity patterns of all I/O requests generated by a file system.
Quantifying the behavior observable at the SCSI device drivers, the Physical I/O Facility tracks the execution of reads and writes, capturing the quantity, size, and duration of these operations and the length of time spent waiting, in the device driver queue, to access the disk.
Data captured on Read operations
Data captured on Write operations
Quantity (# bytes) Quantity (# bytes) Duration in Device Queue Duration in Device Queue Duration of Entire Read Operation Duration of Entire Write Operation Pablo Physical I/O Facility users apply a kernel patch to supplement the standard Linux kernel with the instrumentation required to generate physical I/O performance metrics. The various patches included in the Pablo Physical I/O Facility are based on official versions of the Linux kernel source and patch releases. The Linux kernel distributions can be downloaded from http://www.linux.org
To apply the kernel patch, users first choose the patch file appropriate for the kernel version being used. At the top directory of the Linux kernel source tree, execute the following command:
Command % patch -l -p0 <patch filename with the full path> Example % patch -l -p0 </tmp/phIO-patch-2.2.16 After this, compile and install the kernel. Finally, reboot the machine with the new kernel. For instructions of how to build the Linux kernel, refer to Linux documentation at http://www.linuxdoc.org/HOWTO/Kernel-HOWTO.html
The Physical I/O Facility GUI Toolkit can be used to initialize or reset the physical I/O data structures in the kernel, and to retrieve physical I/O data from the kernel in a one-time fashion or periodically. It can also plot physical I/O data statically, from the data file, and dynamically, as it retrieves the data in real time. The user-level GUI is programmed in Java and it can be run on any systems that support the Java Virtual Machine. The GUI was developed using Sun JDK version 1.3. However, our tests indicate that it runs smoothly in Sun JDK version 1.2.2 environment as well.

The top menu bar has three buttons:
File button for opening existing physical I/O data file, saving physical I/O data to a file, saving histograms to JPEG files, and exiting GUI.
Tools button for launching physical I/O user-level tools.
Help button for help on using the GUI.
File menu has 7 submenus, including:
Open: Opens the specified physical I/O data file.
Save Data: Saves the retrieved physical I/O data (either once or periodically) to a file with the previously specified name.
Save Data As: Similar to "Save Data" button, but requires that the user designate the file name.
Export JPEG: Saves the currently plotted figure to a jpeg file with the previously specified name.
Export JPEG As: Similar to the "Export JPEG" button, but requires that the user designate the file name.
Print Image: Print the current figure to a printer specified by user.
Exit: Exit the GUI.
Tools menu has the following 3 submenus:
Initial Data: Initializes and resets all Physical I/O data structures in the kernel. This function requires the user to input the SCSI driver name, the bin sizes for the read request size (in bytes), the read driver queue time (in microseconds), the read request duration (in micro-seconds), the write request size (in bytes), the write driver queue time (in micro-seconds), and the write request duration (in micro-seconds).
Get Data: Gets the current Physical I/O trace data for the SCSI driver specified by the user. When the command is launched, the data retrieved will be automatically plotted in the plotting area.
Get Data by Interval time: Gets sequential Physical I/O trace data from the SCSI driver specified by the user. The user must also designate the interval time and the number of iterations to capture. When the command is launched, the data retrieved in each time interval will automatically be plotted sequentially in the plotting area.
Help menu has the following 2 submenus:
About: Shows the version and overview description of PIOF.
Help Topics: Provides an index of topic covered in the PIOF user help library.
The Plotting Area has three parts.
On the top, there are 6 buttons denoting 6 metrics:
(r) request: for Read request size
(r) queue: for Read request driver queue time
(r) duration: for Read request duration
(w) request: for Write request size
(w) queue: for Write request driver queue time
(w) duration: for Write request duration
Clicking one of these buttons will plot the distribution of trace data characterizing that parameter in the drawing area.
In the middle of the Plotting Area, physical I/O data will be drawn for the specific metric chosen by the user. The X-axis represents the metrics, for example Read request size. The Y-axis represents the number of occurrences in each histogram bin of the specified metric.
At the bottom, there are two buttons: Histogram and Line. Users can choose the drawing format by clicking on either of these buttons. The Histogram button is for representing the data in traditional histogram fashion using bars. The Line button draws the data in a curve.
When an disk operation occurs, the Physical I/O Facility generates an entry in a histogram, a table.
Before running the GUI, set the environment variable “CLASSPATH” to the path housing the class files of executable Java files. For example.
% setenv CLASSPATH /usr/local/java/classes
To run the GUI, type “phyio” at the command line in the directory in which the tool is installed.
% phyio