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.
*/

View File

@@ -61,6 +61,9 @@ struct ptdev_remapping_info {
struct list_head softirq_node;
struct list_head entry_node;
struct ptdev_msi_info msi;
uint64_t intr_count;
struct hv_timer intr_delay_timer; /* used for delay intr injection */
};
extern struct list_head ptdev_list;
@@ -83,4 +86,7 @@ void ptdev_deactivate_entry(struct ptdev_remapping_info *entry);
void get_ptdev_info(char *str_arg, int str_max);
#endif /* HV_DEBUG */
uint32_t get_vm_ptdev_intr_data(const struct vm *target_vm, uint64_t *buffer,
uint32_t buffer_cnt);
#endif /* PTDEV_H */