mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Add a page_info flag to indicate whether free pages need a TLB flush
on next use. Apart from teh small performance gain of this, my primary motivation is to avoid TLB flushes very early in boot, when the system is not yet properly set up for cross-TLB shootdowns. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
1 parent
e0cf17bba6
commit
6dec681bb6
3 files changed
+18
-6
No files matched your search
+10
-6
@@ -399,10 +399,13 @@ static struct page_info *alloc_heap_pages(
|
||||
/* Reference count must continuously be zero for free pages. */
|
||||
BUG_ON(pg[i].count_info != 0);
|
||||
|
||||
/* Add in any extra CPUs that need flushing because of this page. */
|
||||
cpus_andnot(extra_cpus_mask, cpu_online_map, mask);
|
||||
tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp);
|
||||
cpus_or(mask, mask, extra_cpus_mask);
|
||||
if ( pg[i].u.free.need_tlbflush )
|
||||
{
|
||||
/* Add in extra CPUs that need flushing because of this page. */
|
||||
cpus_andnot(extra_cpus_mask, cpu_online_map, mask);
|
||||
tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp);
|
||||
cpus_or(mask, mask, extra_cpus_mask);
|
||||
}
|
||||
|
||||
/* Initialise fields which have other uses for free pages. */
|
||||
pg[i].u.inuse.type_info = 0;
|
||||
@@ -446,8 +449,9 @@ static void free_heap_pages(
|
||||
pg[i].count_info = 0;
|
||||
|
||||
/* If a page has no owner it will need no safety TLB flush. */
|
||||
pg[i].tlbflush_timestamp =
|
||||
page_get_owner(&pg[i]) ? tlbflush_current_time() : 0;
|
||||
pg[i].u.free.need_tlbflush = (page_get_owner(&pg[i]) != NULL);
|
||||
if ( pg[i].u.free.need_tlbflush )
|
||||
pg[i].tlbflush_timestamp = tlbflush_current_time();
|
||||
}
|
||||
|
||||
spin_lock(&heap_lock);
|
||||
|
||||
@@ -62,6 +62,8 @@ struct page_info
|
||||
struct {
|
||||
/* Order-size of the free chunk this page is the head of. */
|
||||
u32 order;
|
||||
/* Do TLBs need flushing for safety before next page use? */
|
||||
bool_t need_tlbflush;
|
||||
} free;
|
||||
|
||||
} u;
|
||||
|
||||
@@ -66,6 +66,12 @@ struct page_info
|
||||
unsigned long count:26; /* Reference count */
|
||||
} sh;
|
||||
|
||||
/* Page is on a free list: ((count_info & PGC_count_mask) == 0). */
|
||||
struct {
|
||||
/* Do TLBs need flushing for safety before next page use? */
|
||||
bool_t need_tlbflush;
|
||||
} free;
|
||||
|
||||
} u;
|
||||
|
||||
union {
|
||||
|
||||