I’m trying to understand,
__mod_timer(struct timer_list *timer, unsigned long expires,
bool pending_only, int pinned)
this’s calling lock_timer_base method. I’m not sure, what exactly its trying to do? Any idea?
It’s trying to reschedule a timer.
timerpoints to a timer object, which may be set to expire some time in the future.This function wants to change it, so it would expire at another time (
expires).The lock is needed to make sure data doesn’t get corrupt.
For example, it’s possible that the old expiration time is just now, and another CPU is handling the same timer at the same time. The lock is there to make sure things still work.