The timer_bh( ) function associated with the TIMER_BH bottom half invokes the update_times( ), run_old_timers( ), and run_timer_list( ) auxiliary functions, which are described next.
The xtime variable of type struct timeval is where user programs get the current time and date. The kernel also occasionally refers to it, for instance, when updating inode timestamps (see Section 1.5.4 in Chapter 1). In particular, xtime.tv_sec stores the number of seconds that have elapsed since midnight of January 1, 1970, while xtime.tv_usec stores the number of microseconds that have elapsed within the last second (its value thus ranges between and 999999).
 This date is traditionally used by all Unix systems as the earliest moment in counting time.
During system initialization, the time_init( ) function is invoked to set up the time and date: it reads them from the Real Time Clock by invoking the get_cmos_time( ) function, then it initializes xtime. Once this has been done, the kernel does not need the RTC anymore: it relies instead on the TIMER_BH bottom half, which is activated once every tick.
The update_times( ) function invoked by the TIMER_BH bottom half updates xtime by disabling interrupts and executing the following statement:
if (lost_ticks) update_wall_time(lost_ticks);
The update_wall_time( ) function invokes the update_wall_time_one_tick( ) function lost_ticks consecutive times; each invocation adds ...