Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103161824
D15911.id44238.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15911.id44238.diff
View Options
Index: sys/amd64/amd64/pmap.c
===================================================================
--- sys/amd64/amd64/pmap.c
+++ sys/amd64/amd64/pmap.c
@@ -3550,8 +3550,9 @@
{
struct pch new_tail;
struct pv_chunk *pc;
- int avail, free;
vm_page_t m;
+ int avail, free;
+ bool reclaimed;
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
KASSERT(lockp != NULL, ("reserve_pv_entries: lockp is NULL"));
@@ -3582,10 +3583,13 @@
for (; avail < needed; avail += _NPCPV) {
m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ |
VM_ALLOC_WIRED);
- if (m == NULL) {
+ if (m != NULL)
+ reclaimed = false;
+ else {
m = reclaim_pv_chunk(pmap, skip_va, lockp);
if (m == NULL)
goto retry;
+ reclaimed = true;
}
PV_STAT(atomic_add_int(&pc_chunk_count, 1));
PV_STAT(atomic_add_int(&pc_chunk_allocs, 1));
@@ -3598,6 +3602,14 @@
TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list);
TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru);
PV_STAT(atomic_add_int(&pv_entry_spare, _NPCPV));
+
+ /*
+ * The reclaim might have freed a chunk from the current pmap.
+ * If that chunk contained available entries, we need to
+ * re-count the number of available entries.
+ */
+ if (reclaimed)
+ goto retry;
}
if (!TAILQ_EMPTY(&new_tail)) {
mtx_lock(&pv_chunks_mutex);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 6:26 PM (3 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14781417
Default Alt Text
D15911.id44238.diff (1 KB)
Attached To
Mode
D15911: Re-count available PV entries after allocating a new chunk.
Attached
Detach File
Event Timeline
Log In to Comment