From: Ingo Molnar Date: Thu, 12 Mar 2009 14:15:31 +0000 (+0100) Subject: kconfig: improve seed in randconfig X-Git-Tag: v2.6.29~7^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0fe551000179c868d46266278a890eab878baca;p=pandora-kernel.git kconfig: improve seed in randconfig 'make randconfig' uses glibc's rand function, and the seed of that PRNG is set via: srand(time(NULL)); But 'time()' only increases once every second - freezing the randconfig result within a single second. My Nehalem testbox does randconfig much faster than 1 second and i have a few scripts that do 'randconfig until condition X' loops. Those scripts currently waste a lot of CPU time due to randconfig changing its seed only once per second currently. Change the seed to be micrseconds based. (I checked the statistical spread of the seed - the now.tv_sec*now.tv_usec multiplication there further improves it.) Signed-off-by: Ingo Molnar Cc: Roman Zippel [sam: fix for systems where usec is zero - noticed by Geert Uytterhoeven] Signed-off-by: Sam Ravnborg --- Reading git-diff-tree failed