mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 16:57:20 +00:00
hv: timer: make the timer list be ordered
make the timer list be ordered to speed up expried timer process and next timer event finding. Add timer would not schedule timer unless it's the next timer event. Signed-off-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -48,6 +48,10 @@ struct timer {
|
||||
void *priv_data; /* func private data */
|
||||
};
|
||||
|
||||
/*
|
||||
* Don't initialize a timer twice if it has been add to the timer list
|
||||
* after call add_timer. If u want, delete the timer from the list first.
|
||||
*/
|
||||
static inline void initialize_timer(struct timer *timer,
|
||||
timer_handle_t func,
|
||||
void *priv_data,
|
||||
@@ -65,6 +69,9 @@ static inline void initialize_timer(struct timer *timer,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't call add_timer/del_timer in the timer callback function.
|
||||
*/
|
||||
int add_timer(struct timer *timer);
|
||||
void del_timer(struct timer *timer);
|
||||
|
||||
|
Reference in New Issue
Block a user