Patent ID: 8914458

Claim:
A method for data transfer, comprising: receiving, by a processor, in an input/output (I/O) operation a first segment of data to be written to a specified virtual address in a host memory; detecting, upon receiving the first segment of the data, that a first page that contains the specified virtual address is swapped out of the host memory on a mass-storage device; identifying, by the processor, at least one second page of the host memory to which a second segment of the data is expected in the future to be written, before the second segment is processed by the processor; responsively to detecting that the first page is swapped out and to identifying the at least one second page, swapping at least the first and second pages into the host memory together, from the mass-storage device; and after swapping at least the first and second pages into the host memory, writing the data to the first and second pages.