Compacting free space using the disk processor can take advantage of the ``free'' bandwidth between the disk head and the platters during idle periods without consuming valuable I/O bus bandwidth, polluting host cache and memory, or interfering with host CPU operation. If we assume that we can compact free space during idle periods, then we need not worry about having to write to nearly full tracks. Instead, we can simply fill empty tracks to some threshold and rely on the compactor to generate more empty tracks. We will discuss the details of such compaction in Section 4.2; here we present the analysis of a system that makes such assumptions.
Suppose n is the total number of sectors in a track, m is the number of free sectors reserved per track before we switch tracks, s is the cost of a track switch, and r is the rotational delay incurred per sector, then the average latency incurred locating a free sector is:
where the function accounts for the non-randomness of the free space distribution. Appendix A.2 provides the derivation of the model.
Figure 2 validates the model of (5). When we switch tracks too frequently, although the free sectors in any particular track between switches are plentiful, we are penalized by the high switch cost. When we switch tracks too infrequently, locating free sectors becomes harder in a crowded track and the performance is also non-optimal. In general, the model aids the judicious selection of an optimal threshold for a particular set of disk parameters. It also reassures us that we need not suffer the performance degradation seen at high utilizations. Figure 1 and 2 also show why the demands on the compactor are less than the demands on the LFS cleaner. This is because the models indicate that compacting is only necessary for high utilizations and it can move data at small granularity.