Check out the new USENIX Web site. next up previous
Next: Improved prefetching for swapping Up: In-kernel speculative execution Previous: Basic resource control

Performance of the basic design

Figure 2 shows the overall performance of the basic design. For all four explicit-I/O applications, shown in the leftmost section, our in-kernel design delivers large improvements, reducing elapsed times by 35% to 56%. These benefits are comparable to those delivered by the user-level design [3], and are achieved for the same reasons. In particular, unlike file readahead, the speculative execution approach enables prefetching across files and can leverage the decision paths encoded in applications to generate accurate prefetches for accesses that are seemingly random.

The results for swapping applications, shown in the central section, and our combination application, Sphinx, are more varied. We deliver substantial benefits for FFTPDE and MATVEC, but we degrade the performance of MGRID and Sphinx. Thus, our base design performs poorly compared with the compiler-based approach [4], which delivered a substantial performance benefit for MGRID.


Figure 2: Performance of our basic in-kernel design.
\includegraphics[width=3in]{base}


Table 2 provides more detailed information about the executions. Unsurprisingly given the overall results, for all the applications except MGRID and Sphinx, speculative execution significantly reduces both the number of I/O stalls and the I/O stall time experienced by normal execution.

Table 2: Effectiveness of prefetching by the basic design, compared with a system which performs no speculative execution. I/O stalls is the number of, and elapsed time during, I/O stalls experienced by normal execution. Speculative prefetches is the number of speculative prefetches, and the percentage of those prefetches that completed before the data was requested by normal execution. Unused speculative prefetches is the number of speculative prefetches that prefetched data that was not used before being ejected from memory. Unused readahead prefetches is the same statistic for prefetches generated by the operating system's file readahead and page clustering heuristics. Sync delay is the total time used to synchronize the speculative child process, some of which is hidden by disk access latency. CoW faults is the total number of copy-on-write faults experienced during normal execution.
Benchmark Specx I/O Stalls Spec prefetches Unused prefetches Sync CoW
enabled? Total Time Total Full Spec Readahead delay faults
Agrep No 14080 30s - - - 50 - 286
(42s) Yes 4239 17s 7350 92% 0 50 0s 326
Gnuld No 5434 26s - - - 5245 - 8
(30s) Yes 3228 15s 4684 74% 641 472 2s 8
PostgreSQL No 1056013 8471s - - - 823234 - 259
(9915s) Yes 267498 3230s 1201033 87% 25101 43011 45s 2714
XDS No 22887 159s - - - 178430 - 13
(171s) Yes 5905 63s 44512 87% 634 1632 7s 11376
FFTPDE No 439221 5345s - - - 3188757 - 8
(5537s) Yes 201384 3024s 1384548 86% 583 116134 929s 391281
MGRID No 87594 757s - - - 130413 - 8
(913s) Yes 59732 1020s 1095623 90% 14 21390 428s 179714
MATVEC No 105518 925s - - - 332361 - 7
(1006s) Yes 36114 375s 893238 80% 0 12788 75s 91
Sphinx No 6238 43s - - - 19711 - 1386
(72s) Yes 6957 58s 8417 68% 909 20831 6s 1388


One potential concern with speculative execution is that it will not generate prefetches early enough to hide a substantial amount of I/O stall time. The figures for full speculative prefetches show that the vast majority of speculative prefetches actually complete before the data is accessed during normal execution; in other words, there are very few partial stalls on in-progress prefetches. Another potential concern is that, as with any heuristic approach, speculative execution may generate prefetches for data that will not be used, wasting both memory and disk bandwidth. The figures for unused speculative prefetches show that speculative execution is perfectly accurate for Agrep and MATVEC. For the other benchmarks, speculative execution generates some needless prefetches, but is always much more accurate than the operating system's default file readahead and page cluster heuristics. Furthermore, because good speculative prefetches disable the operating system's default prefetching heuristics, we are able to avoid a large proportion of needless prefetches for all benchmarks except Sphinx. This further helps performance by reducing contention for memory and disk bandwidth.

On the other hand, comparing the figures for explicit-I/O and swapping applications reveals that synchronization is substantially more expensive for swapping applications. In particular, comparing the synchronization times to original execution times (shown in the first column) reveals that MGRID is synchronizing for almost half of its original execution time. This suggests one way in which the base design is inefficient for swapping applications, and ineffective for MGRID in particular. For many applications, we also notice a substantial increase in the number of copy-on-write faults. Finally, Sphinx demonstrates a different potential problem with speculative execution. The memory use of speculative execution can cause useful data to be prematurely ejected from memory. This is revealed by how speculative execution increases the total number of I/O stalls for Sphinx. We address these weaknesses of the basic design in the next two sections.


next up previous
Next: Improved prefetching for swapping Up: In-kernel speculative execution Previous: Basic resource control