diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-12-08 07:55:21 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-12-08 07:55:21 +0000 |
commit | 272c176b86a1e442f9ec0bddf44034fbe0aa26c1 (patch) | |
tree | f78ef071bf278cd240965169e8c468fca8796ac0 /xen/include/xen/mm.h | |
parent | b9c20c78789f94b3b550d0a9d694662cba5fa794 (diff) | |
download | xen-272c176b86a1e442f9ec0bddf44034fbe0aa26c1.tar.gz xen-272c176b86a1e442f9ec0bddf44034fbe0aa26c1.tar.bz2 xen-272c176b86a1e442f9ec0bddf44034fbe0aa26c1.zip |
Track free pages live rather than count pages in all nodes/zones
Trying to fix a livelock condition in tmem that occurs
only when the system is totally out of memory requires
the ability to easily determine if all zones in all
nodes are empty, and this must be checked at a fairly
high frequency. So to avoid walking all the zones in
all the nodes each time, I'd like a fast way to determine
if "free_pages" is zero. This patch tracks the sum
of the free pages in all nodes/zones. Since I think
the value is modified only when heap_lock is held,
it need not be atomic.
I don't know this for sure, but suspect this will be
useful in other future memory utilization code, e.g.
page sharing.
This has had limited testing, though I did drive free
memory down to zero and up and down a few times with
debug on and no asserts were triggered.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Diffstat (limited to 'xen/include/xen/mm.h')
-rw-r--r-- | xen/include/xen/mm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 609994ad37..468947e4f5 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -62,6 +62,7 @@ unsigned long avail_domheap_pages(void); unsigned int online_page(unsigned long mfn, uint32_t *status); int offline_page(unsigned long mfn, int broken, uint32_t *status); int query_page_offline(unsigned long mfn, uint32_t *status); +unsigned long total_free_pages(void); void scrub_heap_pages(void); |