kernel/vm: Don't shrink commitment on precommit in VMAnonymousCache.
If we were "donated" some commitment (e.g. in copy_on_write_area) then we don't want to drop it when pre-committing. Fixes some commitments being too low in forked teams.
This commit is contained in:
@@ -734,9 +734,12 @@ VMAnonymousCache::Commit(off_t size, int priority)
|
||||
|
||||
// pre-commit some pages to make a later failure less probable
|
||||
fHasPrecommitted = true;
|
||||
uint32 precommitted = fPrecommittedPages * B_PAGE_SIZE;
|
||||
uint32 precommitted = (fPrecommittedPages * B_PAGE_SIZE);
|
||||
if (size > precommitted)
|
||||
size = precommitted;
|
||||
|
||||
// pre-commit should not shrink existing commitment
|
||||
size += committed_size;
|
||||
}
|
||||
|
||||
return _Commit(size, priority);
|
||||
|
||||
Reference in New Issue
Block a user