Commit 43b6fdbc authored by Kirill Smelkov's avatar Kirill Smelkov

bigfile/virtmem: Make sure pages are emitted to store in order

Currently fileh_dirty_writeout() writes page via storeblk() in order -
- those with lower ->f_pgoffset are stored first.

This happens because current fileh_dirty_writeout() iterates whole
pagemap to find dirty pages and pagemap iteration is ordered by

In upcoming patch we'll rework writeout code not to iterate through
whole pagemap, but only through dirty pages. However the property that
pages are emitted in canonical order is useful, so let's make sure via
tests this will stay preserved:

In mkdirty2() we modify pages in 2, 0 order, but the latter code checks
(via storeblk_trace()) they were actually stored in 0, 2 order.
parent e73e22ea
......@@ -654,8 +654,8 @@ void test_file_access_synthetic(void)
/* prepare state (2 dirty pages, only 1 mapped) */
void mkdirty2() {
xvma_on_pagefault(vma, vma->addr_start + 0*PS, 1); /* write page[0] */
xvma_on_pagefault(vma, vma->addr_start + 2*PS, 1); /* write page[2] */
xvma_on_pagefault(vma, vma->addr_start + 0*PS, 1); /* write page[0] */
err = fileh_mmap(vma, fh, 100, 4);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment