More on ASYNC_IO

From: Michael O'Reilly <michael@dont-contact.us>
Date: 25 Oct 1997 13:51:54 +0800

Lots of fun here. :)

In store.c:storeCheckSwapOut(), the order of the 2nd last and 3rd last
lines is wrong.

[ .. ]
    x = file_write(mem->swapout.fd,
        swap_buf,
        swap_buf_len,
        storeSwapOutHandle,
        e,
        put_free_8k_page)
    mem->swapout.queue_offset += swap_buf_len;
    assert(x == DISK_OK);
}

should actually be

[ .. ]
    mem->swapout.queue_offset += swap_buf_len;
    x = file_write(mem->swapout.fd,
        swap_buf,
        swap_buf_len,
        storeSwapOutHandle,
        e,
        put_free_8k_page);
    assert(x == DISK_OK);
}

Reason is that file_write() will _immediately_ do the callback,
resulting in the write being queued twice.

Not sure that do the callback before the call to file_write() returns
is actually allowed, but changing the order of the lines fixes one
problem.

Michael.
Received on Tue Jul 29 2003 - 13:15:44 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:27 MST