关于 lpj

来源:互联网 发布:淘宝首页广告位 编辑:程序博客网 时间:2024/06/05 09:55

lpj可以通过如下两个方式设置,内核启动时的参数传进去,或是在编译内核时设置 CONFIG_PRESET_LPJ的值。

如果先设置了CONFIG_PRESET_LPJ后在内核启动时设置参数,则CONFIG_PRESET_LPJ的值会被覆盖。

来自:kernel/Documentation/kernel-parameters.txt

lpj=n [KNL]

Sets loops_per_jiffy to given constant, thus avoiding
time-consuming boot-time autodetection (up to 250 ms per
CPU)
. 0 enables autodetection (default). To determine
the correct value for your kernel, boot with normal
autodetection and see what value is printed. Note that
on SMP systems the preset will be applied to all CPUs,
which is likely to cause problems if your CPUs need
significantly divergent settings. An incorrect value
will cause delays in the kernel to be wrong, leading to
unpredictable I/O errors and other breakage. Although
unlikely, in the extreme case this might damage your

hardware.


另外参考:

config PRESET_LPJ
int "Preset loops_per_jiffy" if EMBEDDED
default 0
help
 This is the number of loops used by delay() to achieve a single
 jiffy of delay inside the kernel.  It is normally calculated at
 boot time, but that calculation can take up to 250 ms per CPU.
 Specifying a constant value here will eliminate that delay.


 A value of 0 results in the normal autodetect behavior.


 To determine the correct value for your kernel, first set this
 option to 0, compile and boot the kernel on your target hardware,
 then see what value is printed during the kernel boot.  Use that
 value here.


 The kernel command line parameter "lpj=" can be used to override
 the value configured here.


 Note that on SMP systems the preset will be applied to all CPUs
 which will cause problems if for some reason your CPUs need
 significantly divergent settings.


 If unsure, set this to 0. An incorrect value will cause delays in
 the kernel to be wrong, leading to unpredictable I/O errors and
 other breakage.  Although unlikely, in the extreme case this might
 damage your hardware.


0 0
原创粉丝点击