delay calibration init/calibrate.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am not clear with delay loop.May be some of you can help here.
 http://lxr.linux.no/#linux+v2.6.33/init/calibrate.c#L54
In comments it is mentioning

So, we do
* 1. pre_start <- When we are sure that jiffy switch hasn't happened
* 2. check jiffy switch
* 3. start <- timer value before or after jiffy switch
* 4. post_start <- When we are sure that jiffy switch has happened
What is all that pre_start and why is it needed to be used over here?

Here is some thing which I am wondering not because of logic in same program



What is the CPU busy with between timer ticks I guess it is the
calculation of delay as mentioned here in this code and what exactly
is meant by timer tick?

If you can see the following comment on the above mentioned link
it says A simple loop like .........wont do
I am not clear why they mentioned a simple loop wont do ?

/*
045 * A simple loop like
046 * while ( jiffies < start_jiffies+1)
047 * start = read_current_timer();
048 * will not do. As we don't really know whether jiffy switch
049 * happened first or timer_value was read first. And some
asynchronous
050 * event can happen between these two events introducing
errors in lpj.
051 *
052 * So, we do

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux