HV: modify code for intr storm detect & handling

This patch is to enhance the feature of "interrupt storm
mitigation"; when interrupt storm happens on one UOS
it should keep as smaller effect to SOS as possible.

Add variables in PTdev entry & VM, used to record one
UOS's pass-thru devices' interrupt data; add a function
to collect the data.

Also add a timer used to delay UOS pass-thru devices'
interrupt injection if an "interrupt storm" detected
by SOS.

Tracked-On: #866
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Li Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Minggui Cao
2018-09-13 16:31:17 +08:00
committed by lijinxia
parent de68ee7a09
commit 918403f925
5 changed files with 76 additions and 1 deletions

View File

@@ -173,6 +173,7 @@ struct vm {
spinlock_t softirq_dev_lock;
struct list_head softirq_dev_entry_list;
uint64_t intr_inject_delay_delta; /* delay of intr injection */
} __aligned(CPU_PAGE_SIZE);
#ifdef CONFIG_PARTITION_MODE

View File

@@ -48,6 +48,11 @@ static inline void initialize_timer(struct hv_timer *timer,
}
}
static inline bool timer_expired(const struct hv_timer *timer)
{
return ((timer->fire_tsc == 0UL) || (rdtsc() >= timer->fire_tsc));
}
/*
* Don't call add_timer/del_timer in the timer callback function.
*/