Peter Marheine has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/81608?usp=email )
Change subject: reduce DELAY_MINIMUM_SLEEP_US to 100 by default ......................................................................
reduce DELAY_MINIMUM_SLEEP_US to 100 by default
This makes flashrom sleep more eagerly rather than busy-waiting, observing that most delays in flashrom are either less than 100 microseconds (barely enough time to get any work done, even on a fast machine) or much more than 1 millisecond (very wasteful to busy-loop). Since we believe most systems offer good timer resolution that should provide sleep latency on the order of 100 microseconds, this is a reasonable default.
For DOS, the default is set to 50ms because the best available timing source on DOS only ticks at about 20 Hz.
Signed-off-by: Peter Marheine pmarheine@chromium.org Change-Id: I0f431d240c670446218b14811ef62a34e4c83da2 --- M Makefile M meson_cross/i586_djgpp_dos.txt M meson_options.txt 3 files changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/08/81608/1
diff --git a/Makefile b/Makefile index 09b31b3..71a7490 100644 --- a/Makefile +++ b/Makefile @@ -542,7 +542,7 @@ # Disable wiki printing by default. It is only useful if you have wiki access. CONFIG_PRINT_WIKI ?= no
-CONFIG_DELAY_MINIMUM_SLEEP_US ?= 100000 +CONFIG_DELAY_MINIMUM_SLEEP_US ?= 100
# Disable all features if CONFIG_NOTHING=yes is given unless CONFIG_EVERYTHING was also set ifeq ($(CONFIG_NOTHING), yes) diff --git a/meson_cross/i586_djgpp_dos.txt b/meson_cross/i586_djgpp_dos.txt index 66d5ed0..4a96e2e 100644 --- a/meson_cross/i586_djgpp_dos.txt +++ b/meson_cross/i586_djgpp_dos.txt @@ -25,5 +25,7 @@ [project options] tests = 'disabled' ich_descriptors_tool = 'disabled' +# DOS time resolution is only about 50ms +delay_minimum_sleep_us = 50000
[properties] diff --git a/meson_options.txt b/meson_options.txt index 8a04114..f5e2800 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -22,6 +22,6 @@ option('documentation', type : 'feature', value : 'auto', description : 'build the html documentation') option('ni845x_search_path', type : 'string', value : 'C:\Program Files (x86)\National Instruments\Ni-845x\MS Visual C', description : 'Path to search for the proprietary ni845x library and header (32-bit Windows only)') -option('delay_minimum_sleep_us', type : 'integer', min : 0, value : 100000, +option('delay_minimum_sleep_us', type : 'integer', min : 0, value : 100, description : 'Minimum time in microseconds to suspend execution for (rather than polling) when a delay is required.' + ' Larger values may perform better on machines with low timer resolution, at the cost of increased power.')