Here's an alternate patch (compile tested only) which is slightly
simpler, slightly more flexible, and fixes a small bug in the original.
The simplification centers around removing USE_PRESET_LPJ andYeah. When I originally wrote it, I thought using the LSb was cute,
interpeting a preset value of 0 as a signal to autodetect. This eliminates ifdefs in the code and avoids giving magic significance to the loops_per_jiffy LSb.
Additionally, the user can always disableIt's hard to imagine this case, but that would merely result in
the preset by using "lpj=0" which would allow booting a kernel that
crashes due to a bogus preset. The only problem I can think of with
this approach is if there is a system out there so slow that lpj=0 is
actually a valid setting.
I hadn't considered this. (Too much "embedded" on the brain.)
The final change is to fix a small bug in the original patch:
loops_per_jiffy was no longer initialized each time calibrate_delay()
was invoked. This is potentially an issue on SMP systems since
calibrate_delay() will be invoked for each CPU. One related thing to
keep in mind is that on an SMP system, using an lpj preset will result
in the same lpj setting on each CPU. On sane systems this shouldn't be
a problem, but if there's a machine out there with unequal CPUs it will
be a problem. Perhaps this is worth mentioning in the help text as well.
While we're on the topic: Should FASTBOOT perhaps depend on EMBEDDED? I
can imagine a user with a massively MP system perhaps finding this
option useful, so maybe not.