Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagecache: fix on-demand mapping of evicted pages #2016

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/kernel/pagecache.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,13 @@ static boolean touch_or_fill_page_nodelocked(pagecache_node pn, pagecache_page p
change_page_state_locked(pc, pp, PAGECACHE_PAGESTATE_NEW);
}
pp->refcount++;
} else {
r = irange(0, 0);
}
pagecache_unlock_state(pc);

if (range_span(r)) {
if (m) {
if (range_span(r) == 0)
return true;

/* issue page reads */
pagecache_debug(" pc %p, pp %p, r %R, reading...\n", pc, pp, r);
sg_list sg = allocate_sg_list();
Expand All @@ -383,9 +384,8 @@ static boolean touch_or_fill_page_nodelocked(pagecache_node pn, pagecache_page p
assert(pagecache_add_sgb(pp, sg, read_size) != INVALID_ADDRESS);
dma_sg_read(pn->fs_read, sg, r,
closure(pc->h, pagecache_read_page_complete, pc, pp, sg));
return false;
}
return true;
return false;
case PAGECACHE_PAGESTATE_ACTIVE:
/* move to bottom of active list */
list_delete(&pp->l);
Expand Down