[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] libpager: Do not flush in-core pages on offer
From: |
Sergey Bugaev |
Subject: |
[PATCH 2/6] libpager: Do not flush in-core pages on offer |
Date: |
Thu, 6 May 2021 15:56:27 +0300 |
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.
---
libpager/offer-page.c | 7 -------
1 file changed, 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,
--
2.31.1
- [PATCH 0/6] Various libpager fixes, Sergey Bugaev, 2021/05/06
- [PATCH 1/6] libpager: Fix mixing up success and error, Sergey Bugaev, 2021/05/06
- [PATCH 2/6] libpager: Do not flush in-core pages on offer,
Sergey Bugaev <=
- [PATCH 4/6] libpager: Store pagemapsize as vm_size_t, Sergey Bugaev, 2021/05/06
- [PATCH 6/6] libpager: Use libc heap for pagemap, Sergey Bugaev, 2021/05/06
- [PATCH 3/6] libpager: Add error handling to various functions, Sergey Bugaev, 2021/05/06
- [PATCH 5/6] libpager: Fix overallocating pagemap, Sergey Bugaev, 2021/05/06