using percentage for hugepage overcommits pages
Bug #1678185 reported by
Krzysztof Klimonda
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Nova Compute Charm |
Fix Released
|
High
|
James Page |
Bug Description
Trying to define hugepage based on a percentage of total memory results in Juju assigning most of the memory for hugepages. That's due to the fact that hugepage_size is assumed to be in KB, but psutil.
Changed in charm-nova-compute: | |
importance: | Undecided → High |
status: | New → In Progress |
assignee: | nobody → James Page (james-page) |
Changed in charm-nova-compute: | |
milestone: | none → 17.05 |
Changed in charm-nova-compute: | |
milestone: | 17.05 → 17.08 |
Changed in charm-nova-compute: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
def get_hugepage_ number( ): config. endswith( '%'): virtual_ memory( )
hugepage_ config_ pct = hugepage_ config. strip(' %')
hugepage_ multiplier = float(hugepage_ config_ pct) / 100
hugepages = int((mem.total * hugepage_ multiplier) / hugepage_size)
hugepages = int(hugepage_ config)
# TODO: defaults to 2M - this should probably be configurable
# and support multiple pool sizes - e.g. 2M and 1G.
hugepage_size = 2048
hugepage_config = config('hugepages')
hugepages = None
if hugepage_config:
if hugepage_
import psutil
mem = psutil.
else:
return hugepages