Skip to content

Commit

Permalink
Include guest memory(reserve 100Mi) and adjust memory pagetables over…
Browse files Browse the repository at this point in the history
…head description
  • Loading branch information
chrisho committed Mar 9, 2023
1 parent 1919604 commit a027e40
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions enhancements/20230228-resource-quota-enhancement.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@ overhead.Add(coresMemory)
// static overhead for IOThread
overhead.Add(resource.MustParse("8Mi"))
```
* Memory pagetables overhead (one bit for every 512b of RAM size), i.e. 1Gi memory requires 2Mi overhead.
* Memory pagetables overhead (one bit for every 512b of RAM size), use limit memory instead of request memory, i.e. 1Gi memory requires 2Mi overhead.
```go
pagetableMemory := resource.NewScaledQuantity(vmiMemoryReq.ScaledValue(resource.Kilo), resource.Kilo)
pagetableMemory.Set(pagetableMemory.Value() / 512)
overhead.Add(*pagetableMemory)
```
* Reserve 100MiB (104857600 Bytes) for QEMU on guest memory overhead.

The formula: `180Mi * VMs + vcpu * 8Mi + 8Mi + memory / 512 + memory`, the actual value of the final memory limit is calculated according to this formula.
The final formula: `180Mi * VMs + vcpu * 8Mi + 8Mi + memory / 512 + memory + 100Mi`, the actual value of the final memory limit is calculated according to this formula.

### User Experience In Detail

Expand Down

0 comments on commit a027e40

Please sign in to comment.