[XEN] Make tlbflush_time a PER_CPU variable.

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2006-08-08 11:45:37 +01:00
1 parent ff3a405c4d
commit dedb00f212
7 files changed
+22 -21

No files matched your search

+1 -1
View File
@@ -55,7 +55,7 @@ int opt_earlygdb = 0;
boolean_param("earlygdb", opt_earlygdb);
u32 tlbflush_clock = 1U;
u32 tlbflush_time[NR_CPUS];
DEFINE_PER_CPU(u32, tlbflush_time);
unsigned int watchdog_on;
unsigned long wait_init_idle;
+2 -2
View File
@@ -20,7 +20,7 @@
#endif
u32 tlbflush_clock = 1U;
u32 tlbflush_time[NR_CPUS];
DEFINE_PER_CPU(u32, tlbflush_time);
void write_cr3(unsigned long cr3)
{
@@ -71,7 +71,7 @@ void write_cr3(unsigned long cr3)
* case, so really we are being ultra paranoid.
*/
tlbflush_time[smp_processor_id()] = t2;
this_cpu(tlbflush_time) = t2;
local_irq_restore(flags);
}
+1 -2
View File
@@ -73,8 +73,7 @@ void *map_domain_page(unsigned long pfn)
if ( unlikely(cache->epoch != cache->shadow_epoch[vcpu]) )
{
cache->shadow_epoch[vcpu] = cache->epoch;
if ( NEED_FLUSH(tlbflush_time[smp_processor_id()],
cache->tlbflush_timestamp) )
if ( NEED_FLUSH(this_cpu(tlbflush_time), cache->tlbflush_timestamp) )
{
perfc_incrc(domain_page_tlb_flush);
local_flush_tlb();
+8 -7
View File
@@ -22,6 +22,7 @@
#define _ASM_FLUSHTLB_H_
#include <xen/config.h>
#include <xen/percpu.h>
#include <xen/types.h>
#include <asm/misc.h>
@@ -30,7 +31,7 @@ extern u32 tlbflush_clock;
#define tlbflush_current_time() tlbflush_clock
/* Time at which each CPU's TLB was last flushed. */
extern u32 tlbflush_time[NR_CPUS];
DECLARE_PER_CPU(u32, tlbflush_time);
static inline int NEED_FLUSH(u32 cpu_stamp, u32 lastuse_stamp)
{
@@ -44,12 +45,12 @@ static inline int NEED_FLUSH(u32 cpu_stamp, u32 lastuse_stamp)
* Filter the given set of CPUs, removing those that definitely flushed their
* TLB since @page_timestamp.
*/
#define tlbflush_filter(mask, page_timestamp) \
do { \
unsigned int cpu; \
for_each_cpu_mask ( cpu, mask ) \
if ( !NEED_FLUSH(tlbflush_time[cpu], page_timestamp) ) \
cpu_clear(cpu, mask); \
#define tlbflush_filter(mask, page_timestamp) \
do { \
unsigned int cpu; \
for_each_cpu_mask ( cpu, mask ) \
if ( !NEED_FLUSH(per_cpu(tlbflush_time, cpu), page_timestamp) ) \
cpu_clear(cpu, mask); \
} while ( 0 )
+1 -1
View File
@@ -8,6 +8,7 @@
#define __X86_CURRENT_H__
#include <xen/config.h>
#include <xen/percpu.h>
#include <public/xen.h>
#include <asm/page.h>
@@ -53,7 +54,6 @@ static inline struct cpu_info *get_cpu_info(void)
#define schedule_tail(vcpu) (((vcpu)->arch.schedule_tail)(vcpu))
#include <xen/percpu.h>
/*
* Which VCPU's state is currently running on each CPU?
* This is not necesasrily the same as 'current' as a CPU may be
+9 -7
View File
@@ -11,13 +11,15 @@
#define __FLUSHTLB_H__
#include <xen/config.h>
#include <xen/percpu.h>
#include <xen/smp.h>
#include <xen/types.h>
/* The current time as shown by the virtual TLB clock. */
extern u32 tlbflush_clock;
/* Time at which each CPU's TLB was last flushed. */
extern u32 tlbflush_time[NR_CPUS];
DECLARE_PER_CPU(u32, tlbflush_time);
#define tlbflush_current_time() tlbflush_clock
@@ -47,12 +49,12 @@ static inline int NEED_FLUSH(u32 cpu_stamp, u32 lastuse_stamp)
* Filter the given set of CPUs, removing those that definitely flushed their
* TLB since @page_timestamp.
*/
#define tlbflush_filter(mask, page_timestamp) \
do { \
unsigned int cpu; \
for_each_cpu_mask ( cpu, mask ) \
if ( !NEED_FLUSH(tlbflush_time[cpu], page_timestamp) ) \
cpu_clear(cpu, mask); \
#define tlbflush_filter(mask, page_timestamp) \
do { \
unsigned int cpu; \
for_each_cpu_mask ( cpu, mask ) \
if ( !NEED_FLUSH(per_cpu(tlbflush_time, cpu), page_timestamp) ) \
cpu_clear(cpu, mask); \
} while ( 0 )
extern void new_tlbflush_clock_period(void);
-1
View File
@@ -2,7 +2,6 @@
#define __XEN_PERCPU_H__
#include <xen/config.h>
#include <xen/smp.h>
#include <asm/percpu.h>
/* Preferred on Xen. Also see arch-defined per_cpu(). */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.