kernel/vm: Move committed_size to the cache implementations.

This fixes a long-standing TODO, and a major inconsistency
that for different caches, "commitment" reserves from different
pools, so any two aren't necessarily convertible.

The new system introduces a virtual method "TakeCommitmentFrom",
which allows the VM's cut_area routine to behave as it did
previously.
This commit is contained in:
Augustin Cavalier
2026-03-26 17:36:27 -04:00
parent 0a5cd96093
commit 33dc47cb2c
7 changed files with 107 additions and 45 deletions
+2 -3
View File
@@ -147,9 +147,10 @@ public:
status_t SetMinimalCommitment(off_t commitment,
int priority);
off_t Commitment() const;
virtual off_t Commitment() const;
virtual bool CanOvercommit();
virtual status_t Commit(off_t size, int priority);
virtual void TakeCommitmentFrom(VMCache* from, off_t commitment);
// backing store operations
virtual bool StoreHasPage(off_t offset);
@@ -206,8 +207,6 @@ public:
VMCache* source;
off_t virtual_base;
off_t virtual_end;
off_t committed_size;
// TODO: Remove!
uint32 page_count;
uint32 temporary : 1;
uint32 type : 6;