> > Worse, the guest might decide to swap out a page that's already > > swapped in by the host, forcing it to be read in again only to be > > immediately written out to disk by the guest :-( > > ...unless the guest's disk I/O is with simulated DMA or recognisable > block-copy instruction sequences, and doesn't look at the data. In > that case the emulator can, in principle, keep track of where pages > are copied around without being examined, and avoid actually swapping > them in. > > Probably not worth the complexity.
Another solution, taken by the Disco VMM was to provide a special virtual disk device for the swap device which fakes out swapping behaviour - accesses to that device are always going to be swaps, so you can guarantee to do the right thing without having to trace and interpret behaviour. That said, I like your idea of not committing IOs for DMA-ed pages than have not been inspected, but one would have to be careful to make sure that true page-size DMA writes of data do still hit the disk in a timely fashion. Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel