profile remote TLB invalidations
This commit is contained in:
@@ -32,7 +32,8 @@ struct profile_event {
|
|||||||
* for each added profiled event.
|
* for each added profiled event.
|
||||||
*/
|
*/
|
||||||
enum profile_event_type {
|
enum profile_event_type {
|
||||||
PROFILE_page_fault = PROFILE_EVENT_MIN,
|
PROFILE_tlb_invalidate = PROFILE_EVENT_MIN,
|
||||||
|
PROFILE_page_fault,
|
||||||
PROFILE_page_fault_anon_clr,
|
PROFILE_page_fault_anon_clr,
|
||||||
PROFILE_page_fault_file,
|
PROFILE_page_fault_file,
|
||||||
PROFILE_page_fault_dev_file,
|
PROFILE_page_fault_dev_file,
|
||||||
|
|||||||
12
kernel/mem.c
12
kernel/mem.c
@@ -970,6 +970,9 @@ void remote_flush_tlb_cpumask(struct process_vm *vm,
|
|||||||
|
|
||||||
void tlb_flush_handler(int vector)
|
void tlb_flush_handler(int vector)
|
||||||
{
|
{
|
||||||
|
#ifdef PROFILE_ENABLE
|
||||||
|
unsigned long t_s = rdtsc();
|
||||||
|
#endif // PROFILE_ENABLE
|
||||||
int flags = cpu_disable_interrupt_save();
|
int flags = cpu_disable_interrupt_save();
|
||||||
|
|
||||||
struct tlb_flush_entry *flush_entry = &tlb_flush_vector[vector -
|
struct tlb_flush_entry *flush_entry = &tlb_flush_vector[vector -
|
||||||
@@ -992,6 +995,15 @@ void tlb_flush_handler(int vector)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cpu_restore_interrupt(flags);
|
cpu_restore_interrupt(flags);
|
||||||
|
#ifdef PROFILE_ENABLE
|
||||||
|
{
|
||||||
|
unsigned long t_e = rdtsc();
|
||||||
|
profile_event_add(PROFILE_tlb_invalidate, (t_e - t_s));
|
||||||
|
if (cpu_local_var(current)->profile)
|
||||||
|
cpu_local_var(current)->profile_elapsed_ts +=
|
||||||
|
(t_e - t_s);
|
||||||
|
}
|
||||||
|
#endif // PROFILE_ENABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
static void page_fault_handler(void *fault_addr, uint64_t reason, void *regs)
|
static void page_fault_handler(void *fault_addr, uint64_t reason, void *regs)
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ extern char *syscall_name[];
|
|||||||
|
|
||||||
char *profile_event_names[] =
|
char *profile_event_names[] =
|
||||||
{
|
{
|
||||||
|
"remote_tlb_invalidate",
|
||||||
"page_fault",
|
"page_fault",
|
||||||
"page_fault_anon_clr_mem",
|
"page_fault_anon_clr_mem",
|
||||||
"page_fault_file",
|
"page_fault_file",
|
||||||
|
|||||||
Reference in New Issue
Block a user