CELF-ce Linux Forum submits a "preset lpj" patch in the kernel. This patch can be used to reduce the time required to replace loops_per_jiffy during Linux kernel startup.
What is loops_per_jiffy?
The literal meaning is the number of cycles per jiffy, Jiffy is the cycle time of the kernel (HZ = 100, it indicates 10 ms), and the number of cycles indicates the number of cycles of the CPU. Loops_per_jiffy is used for the system to implement the tiny time delay function. If we know loops_per_jiffy, we can calculate the approximate number of loops required for 10 us.
Cpu_loops = 10us * loops_per_jiffy * Hz/1000000
As long as the CPU cycle cpu_loops specifies the cycle, the latency of 10 US can be achieved.
The system implements udelay and mdelay by idling the CPU to a certain cycle. Because there is a certain error in estimating the CPU loops with loops_per_jiffy, udelay (500) the delay time may be slightly different from that of 500us.
What this patch do?
The CELF patch actually adds a Kernel Parameter so that you can preset lpj when the kernel is started without complicated computing.