kernel/vm: Don't shrink commitment on precommit in VMAnonymousNoSwapCache.

Same change as was made for VMAnonymousCache.
This commit is contained in:
Augustin Cavalier
2025-11-14 19:06:11 -05:00
parent db168093dd
commit 775449bef9
@@ -101,9 +101,12 @@ VMAnonymousNoSwapCache::Commit(off_t size, int priority)
// pre-commit some pages to make a later failure less probable // pre-commit some pages to make a later failure less probable
fHasPrecommitted = true; fHasPrecommitted = true;
uint32 precommitted = fPrecommittedPages * B_PAGE_SIZE; uint32 precommitted = (fPrecommittedPages * B_PAGE_SIZE);
if (size > precommitted) if (size > precommitted)
size = precommitted; size = precommitted;
// pre-commit should not shrink existing commitment
size += committed_size;
} }
// Check to see how much we could commit - we need real memory // Check to see how much we could commit - we need real memory