# [preload] crash (résolu)

## Kevin57

Bonjour à tous,

J'avais installé il y a quelques temps preload pour voir si ça améliorerait les performances de mon système. Cependant, il n'a jamais marché et crash systématiquement au boot. Voici les infos que j'ai pu obtenir :

```
KevinPC ~ # preload -d

[Thu Jan 20 14:49:42 2011] loading conf from /etc/preload.conf

[Thu Jan 20 14:49:42 2011] loading conf done

[Thu Jan 20 14:49:42 2011] starting up

[Thu Jan 20 14:49:42 2011] loading state from /var/lib/preload/preload.state

[Thu Jan 20 14:49:42 2011] loading state done

[Thu Jan 20 14:49:42 2011] state scanning begin

[Thu Jan 20 14:49:42 2011] state log dump requested

persistent state stats:

preload time = 13920

num exes = 28

num bad exes = 0

num maps = 1976

runtime state stats:

num running exes = 28

[Thu Jan 20 14:49:42 2011] state log dump done

[Thu Jan 20 14:49:42 2011] state scanning end

[Thu Jan 20 14:49:42 2011] state predicting begin

**

ERROR:state.c:374:preload_markov_correlation: assertion failed: (fabs (correlation) <= 1.00001)

Abandon
```

```
KevinPC ~ # emerge --info preload

Portage 2.1.9.34 (default/linux/amd64/10.0, gcc-4.5.2, glibc-2.12.2-r0, 2.6.37-gentoo x86_64)

=================================================================

                        System Settings

=================================================================

System uname: Linux-2.6.37-gentoo-x86_64-AMD_Phenom-tm-_II_X4_965_Processor-with-gentoo-2.0.1

Timestamp of tree: Thu, 20 Jan 2011 12:15:01 +0000

ccache version 3.1.4 [enabled]

app-shells/bash:     4.1_p9

dev-java/java-config: 2.1.11-r3

dev-lang/python:     2.7.1, 3.1.3

dev-util/ccache:     3.1.4

dev-util/cmake:      2.8.3-r1

sys-apps/baselayout: 2.0.1-r1

sys-apps/openrc:     0.7.0

sys-apps/sandbox:    2.4

sys-devel/autoconf:  2.13, 2.68

sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1

sys-devel/binutils:  2.21

sys-devel/gcc:       4.5.2

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.4-r1

sys-devel/make:      3.82

virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)

ACCEPT_KEYWORDS="amd64 ~amd64"

ACCEPT_LICENSE="*"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O3 -pipe -march=amdfam10"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /var/lib/hsqldb"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-O3 -pipe -march=amdfam10"

DISTDIR="/usr/portage/distfiles"

EMERGE_DEFAULT_OPTS="--jobs=5 --load-average=5.0 --with-bdeps y"

FEATURES="assume-digests binpkg-logs ccache distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FFLAGS=""

GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ ftp://de-mirror.org/distro/gentoo/ rsync://de-mirror.org/gentoo/"

LANG="fr_FR.UTF8"

LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"

LINGUAS="fr fr_FR"

MAKEOPTS="-j5"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/var/lib/layman/desktop-effects /usr/local/portage"

SYNC="rsync://rsync3.de.gentoo.org/gentoo-portage"

USE="X a52 aac acl alsa amd64 amr bash-completion berkdb bluetooth bzip2 cdda cdr cleartype cli consolekit corefonts cracklib crypt css cups cxx dbus djvu dri dvd dvdr encode ffmpeg flac fortran ftp gdbm gif gphoto2 gpm hal handbook iconv imap ipv6 jack java jpeg lcms mad mime mmx mng modules mozilla mp3 mpeg msn mudflap multilib mysql ncurses nls nptl nptlonly nsplugin ogg opencore-amr opengl openmp pam pcre pdf perl php png pppd python rar raw readline session smp source speex spell sql sse sse2 ssl svg symlink sysfs tcpd tiff truetype type1 unicode usb v4l v4l2 vcd videos webkit wifi xcomposite xml xorg xscreensaver xvid zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr fr_FR" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" SANE_BACKENDS="pixma" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 

Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================

                        Package Settings

=================================================================

sys-apps/preload-0.6.4-r2 was built with the following:

USE="(multilib) -vanilla"
```

```
KevinPC ~ # cat /etc/preload.conf 

[model]

# cycle:

#

# This is the quantum of time for preload.  Preload performs

# data gathering and predictions every cycle.  Use an even

# number.

#

# Note: Setting this parameter too low may reduce system performance

# and stability.

#

# unit: seconds

# default: 20

#

cycle = 20

# usecorrelation:

#

# Whether correlation coefficient should be used in the prediction

# algorithm.  There are arguments both for and against using it.

# Currently it's believed that using it results in more accurate

# prediction.  The option may be removed in the future.

#

# default: true

usecorrelation = true

# minsize:

#

# Minimum sum of the length of maps of the process for

# preload to consider tracking the application.

#

# Note: Setting this parameter too high will make preload less

# effective, while setting it too low will make it eat

# quadratically more resources, as it tracks more processes.

#

# unit: bytes

# default: 2000000

#

minsize = 2000000

#

# The following control how much memory preload is allowed to use

# for preloading in each cycle.  All values are percentages and are

# clamped to -100 to 100.

#

# The total memory preload uses for prefetching is then computed using

# the following formulae:

#

#    max (0, TOTAL * memtotal + FREE * memfree) + CACHED * memcached

# where TOTAL, FREE, and CACHED are the respective values read at

# runtime from /proc/meminfo.

#

# memtotal: precentage of total memory

#

# unit: signed_integer_percent

# default: -10

#

memtotal = -10

# memfree: precentage of free memory

#

# unit: signed_integer_percent

# default: 50

#

memfree = 50

# memcached: precentage of cached memory

#

# unit: signed_integer_percent

# default: 0

#

memcached = 0

###########################################################################

[system]

# doscan:

#

# Whether preload should monitor running processes and update its

# model state.  Normally you do want that, that's all preload is

# about, but you may want to temporarily turn it off for various

# reasons like testing and only make predictions.  Note that if

# scanning is off, predictions are made based on whatever processes

# have been running when preload started and the list of running

# processes is not updated at all.

#

# default: true

doscan = true

# dopredict:

#

# Whether preload should make prediction and prefetch anything off

# the disk.  Quite like doscan, you normally want that, that's the

# other half of what preload is about, but you may want to temporarily

# turn it off, to only train the model for example.  Note that

# this allows you to turn scan/predict or or off on the fly, by

# modifying the config file and signalling the daemon.

#

# default: true

dopredict = true

# autosave:

#

# Preload will automatically save the state to disk every

# autosave period.  This is only relevant if doscan is set to true.

# Note that some janitory work on the model, like removing entries

# for files that no longer exist happen at state save time.  So,

# turning off autosave completely is not advised.

#

# unit: seconds

# default: 3600

#

autosave = 3600

# mapprefix:

#

# A list of path prefixes that controll which mapped file are to

# be considered by preload and which not.  The list items are

# separated by semicolons.  Matching will be stopped as soon as

# the first item is matched.  For each item, if item appears at

# the beginning of the path of the file, then a match occurs, and

# the file is accepted.  If on the other hand, the item has a

# exclamation mark as its first character, then the rest of the

# item is considered, and if a match happens, the file is rejected.

# For example a value of !/lib/modules;/ means that every file other

# than those in /lib/modules should be accepted.  In this case, the

# trailing item can be removed, since if no match occurs, the file is

# accepted.  It's advised to make sure /dev is rejected, since

# preload doesn't special-handle device files internally.

#

# Note that /lib matches all of /lib, /lib64, and even /libexec if

# there was one.  If one really meant /lib only, they should use

# /lib/ instead.

#

# default: (empty list, accept all)

mapprefix = /usr/;/lib;/var/cache/;/opt/;/home/;!/

# exeprefix:

#

# The syntax for this is exactly the same as for mapprefix.  The only

# difference is that this is used to accept or reject binary exectuable

# files instead of maps.

#

# default: (empty list, accept all)

exeprefix = !/usr/sbin/;!/usr/local/sbin/;/usr/;/opt/;/usr/libexec/;!/

# maxprocs

#

# Maximum number of processes to use to do parallel readahead.  If

# equal to 0, no parallel processing is done and all readahead is

# done in-process.  Parallel readahead supposedly gives a better I/O

# performance as it allows the kernel to batch several I/O requests

# of nearby blocks.

#

# default: 30

processes = 30

# sortstrategy

#

# The I/O sorting strategy.  Ideally this should be automatically

# decided, but it's not currently.  One of:

#

#   0 -- SORT_NONE:   No I/O sorting.

#         Useful on Flash memory for example.

#   1 -- SORT_PATH:   Sort based on file path only.

#         Useful for network filesystems.

#   2 -- SORT_INODE:   Sort based on inode number.

#         Does less house-keeping I/O than the next option.

#   3 -- SORT_BLOCK:   Sort I/O based on disk block.  Most sophisticated.

#         And useful for most Linux filesystems.

#

# default: 3

sortstrategy = 3
```

J'ai regardé les logs, ils donnent la même chose que preload -d. Le message d'erreur de preload ne retourne rien dans Google et je n'ai trouvé aucun rapport de bug sur le bugzilla de Gentoo, donc je ne sais pas trop quoi faire. Avez-vous des idées?

Merci beaucoup par avance.

Kevin

----------

## netfab

Salut,

Essaye de désactiver ceci :

```

# usecorrelation:

#

# Whether correlation coefficient should be used in the prediction

# algorithm.  There are arguments both for and against using it.

# Currently it's believed that using it results in more accurate

# prediction.  The option may be removed in the future.

#

# default: true

usecorrelation = true 

```

Aucune garantie, je ne connais pas preload, c'est juste qu'en lisant la source, les commentaires dans le code et ceux du fichier de conf, c'est ce que j'essairai de faire, le calcul du coefficient de correlation n'a pas l'air de fonctionner comme prévu, et le fichier de conf dit : The option may be removed in the future.

----------

## Kevin57

Merci, ça semble marcher! Si j'avais su que c'était si simple, ça fait bien 3-4 mois que je traine un preload qui marche pas!

----------

