summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2021-05-06 15:56:27 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-05-06 23:58:42 +0200
commit7b3815d91a49672864ad3cb2515eba01320d8360 (patch)
tree2a178d699f6824bf0f4b762b0423eec098dbb9d8
parenta9f1e487350cca14ac7df732ac24437822d4eac9 (diff)
libpager: Do not flush in-core pages on offer
pager_offer_page () is documented to may ignore the offered page if the kernel already has a copy in core (indeed, that's what Mach does). However the current behavior is the inverse of that: it asks the kernel to flush (i.e. drop) its in-core copy, and replace it with the offered one. Fix this by not doing that, and calling memory_object_data_supply () directly. Message-Id: <20210506125631.79117-3-bugaevc@gmail.com>
-rw-r--r--libpager/offer-page.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/libpager/offer-page.c b/libpager/offer-page.c
index ddea236a..0b0ca2eb 100644
--- a/libpager/offer-page.c
+++ b/libpager/offer-page.c
@@ -34,13 +34,6 @@ pager_offer_page (struct pager *p,
goto release_out;
short *pm_entry = &p->pagemap[offset / vm_page_size];
-
- while (*pm_entry & PM_INCORE)
- {
- pthread_mutex_unlock (&p->interlock);
- pager_flush_some (p, offset, vm_page_size, 1);
- pthread_mutex_lock (&p->interlock);
- }
*pm_entry |= PM_INCORE;
memory_object_data_supply (p->memobjcntl, offset, buf, vm_page_size, 0,