Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hurray! It lives!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Sun Jun 06, 2010 1:17 am    Post subject: Hurray! It lives! Reply with quote

About a month or two ago, I did some experimenting on my desktop's Gentoo Linux ~amd64 virtual machine and thought I killed it. I had done the following to it:

  • Changed LDFLAGS="-W1,-O1 -Wl,--as-needed"
  • Cleared out some old kernels because portage needed space to recompile the entire system.
  • Ran emerge --jobs -keep-going -ave world
I then rebooted to have lilo print several hundred character 'g's to the console. I tried chrooting into the system to fix it with system rescue cd 1.5.1 at the time (which was an old version) and my chroot attempts failed as if the binaries were incompatible with the processor for some reason. I was downloading system rescue cd 1.5.3 in the background at the time, but decided I probably would not be able to do anything, so I then put it down until today when I figured it could not hurt to try again. I booted it with system rescue cd 1.5.3 and selected the 64-bit kernel option (last time I selected 32-bit without realizing what I was doing) and was able to chroot into the system. The only thing that had to be done was the modification of /etc/lilo.conf and /sbin/lilo. I then left the chroot, rebooted and watched my Gentoo Linux ~amd64 boot for the first time in 1 to 2 months.

I had assumed that the new LDFLAGS had killed it, but it turned out that assumption had been wrong. When I log into KDE, my virtual machine now feels like it is running natively. I am now installing updates. I am so happy that I thought I would share. :)

Edit: In hindsight, saying that it had native performance was a mistake, because apparently, when I am compiling 11 packages in parallel, the mouse will flicker. :/
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13034
Location: Ste-Foy,Canada

PostPosted: Sun Jun 06, 2010 3:35 am    Post subject: Reply with quote

About your change, that's not new to me :
Code:

Portage 2.2_rc67 (default/linux/amd64/10.0/desktop, gcc-4.4.3, glibc-2.10.1-r1, 2.6.34-gentoo x86_64)
=================================================================
System uname: Linux-2.6.34-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9550_@_2.83GHz-with-gentoo-2.1.6
Timestamp of tree: Fri, 04 Jun 2010 12:00:02 +0000
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r2
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.1.6
sys-apps/openrc:     0.6.0
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1
sys-devel/gcc:       4.4.3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.7b
virtual/os-headers:  2.6.32
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://distfiles.gentoo.org"
LANG="fr_CA.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j5 -l5"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alac alsa amd64 berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr dvdread eds emboss encode evo exif fam firefox flac fortran gdbm gif gnutls gpm gstreamer gtk hal iconv ipv6 jpeg kde lame lcms ldap libnotify mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf perl png ppds pppd python qt3support qt4 quicktime readline reflection sdl session spell spl sse sse2 ssl startup-notification svg sysfs tcpd thunar tiff truetype unicode usb userlocales vorbis wavpack x264 xcb xcomposite xml xorg xscreensaver xulrunner xv xvid 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 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" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa nvidia" 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, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY       

Code:

CFLAGS="-O2 -march=native -pipe"                                                                                                                                                                                                             
CHOST="x86_64-pc-linux-gnu"                                                                                                                                                                                                                 
CXXFLAGS="${CFLAGS}"                                                                                                                                                                                                                         
MAKEOPTS="-j5 -l5"                                                                                                                                                                                                                           
GENTOO_MIRRORS="ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://distfiles.gentoo.org"                                                                                                                                             
#GENTOO_MIRRORS="http://distfiles.gentoo.org"                                                                                                                                                                                               
USE="kde -gnome -xfce qt4 qt3support xcomposite nls truetype userlocales unicode gnutls"                                                                                                                                                     
LINGUAS="fr"                                                                                                                                                                                                                                 
INPUT_DEVICES="evdev"                                                                                                                                                                                                                       
VIDEO_CARDS="vesa nvidia"                                                                                                                                                                                                                   
ACCEPT_KEYWORDS="~amd64"                                                                                                                                                                                                                     
                                                                                                                                                                                                                                             
PORTAGE_ELOG_CLASSES="log warn error info"                                                                                                                                                                                                   
PORTAGE_ELOG_SYSTEM="echo:log,error,warn,info  save:log,error,warn,info syslog:log,error,warn,info"                                                                                                                                         
EMERGE_DEFAULT_OPTS="--jobs=5 --load-average=5.0 --with-bdeps y"



As you can see, my Funtoo box already use without any glitch or bug right now :P : LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Mon Jun 14, 2010 9:45 pm    Post subject: Reply with quote

I could have sworn that I replied to this. I guess I opened the reply form and never submitted it.

Anyway, I noticed that you have -Wl,--sort-common in your LDFLAGS; are there any downsides or benefits to adding it? Could enforcing an order by size undo previous optimizations where an order to maximize access frequencies at a given cache line size was enforced, or is GCC not sophisticated enough to make such considerations?
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 3673

PostPosted: Mon Jun 14, 2010 10:51 pm    Post subject: Reply with quote

just for people that might ask, why/when/how/what is as-needed
http://www.gentoo.org/proj/en/qa/asneeded.xml

edit: diego's blog, i think it start from there, and if not, well, it's just diego's blog and it's always good reading: http://blog.flameeyes.eu/tag/asneeded
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Mon Jun 14, 2010 11:26 pm    Post subject: Reply with quote

krinn wrote:
just for people that might ask, why/when/how/what is as-needed
http://www.gentoo.org/proj/en/qa/asneeded.xml

edit: diego's blog, i think it start from there, and if not, well, it's just diego's blog and it's always good reading: http://blog.flameeyes.eu/tag/asneeded


If transitive links are the problem as diego says, would it be possible to have the linker implement a dependency cache, where it would perform a transitive closure upon the dependencies before doing the --as-needed computations on them? I guess the cache directory could be passed to it by the package manager, with the location being something along the lines of /var/tmp/portage/package/atom/, so it could be created and deleted each time a package is compiled and would not cause any issues with running multiple compilations in parallel.
Back to top
View user's profile Send private message
cach0rr0
Moderator
Moderator


Joined: 13 Nov 2008
Posts: 4117
Location: Houston, Republic of Texas

PostPosted: Tue Jun 15, 2010 12:23 am    Post subject: Reply with quote

Shining Arcanine wrote:
krinn wrote:
just for people that might ask, why/when/how/what is as-needed
http://www.gentoo.org/proj/en/qa/asneeded.xml

edit: diego's blog, i think it start from there, and if not, well, it's just diego's blog and it's always good reading: http://blog.flameeyes.eu/tag/asneeded


If transitive links are the problem as diego says, would it be possible to have the linker implement a dependency cache, where it would perform a transitive closure upon the dependencies before doing the --as-needed computations on them? I guess the cache directory could be passed to it by the package manager, with the location being something along the lines of /var/tmp/portage/package/atom/, so it could be created and deleted each time a package is compiled and would not cause any issues with running multiple compilations in parallel.


not without significant changes to the fluxcapacitor
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum