<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8993337247705827112</id><updated>2012-02-16T00:47:23.647-08:00</updated><title type='text'>Go Tux, Go!</title><subtitle type='html'>Chad's quest to make Linux (and it's apps) go faster.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gotuxgo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://gotuxgo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>happycube</name><uri>http://www.blogger.com/profile/08122880431073403405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8993337247705827112.post-7516161154472493531</id><published>2009-11-11T22:50:00.000-08:00</published><updated>2009-11-11T22:59:02.428-08:00</updated><title type='text'>I haven't forgotten this...</title><content type='html'>... it's just that qemu is really tightly coded, even though the code it makes is a bit less than optimal ;)&lt;br /&gt;&lt;br /&gt;See, in non-kqemu/kvm mode the TCG generator is _-&gt;TCG-&gt;_, with several choices of _ on each side - qemu's regular mode can't take x86-on-x86 shortcuts.&lt;br /&gt;&lt;br /&gt;So, time to stop distracting myself with fixing qemu's output and look @ what I wanted to do from the start... setting it up to use it for precise kernel/code profiling. ;)&lt;br /&gt;&lt;br /&gt;(valgrind can actually do that, but only for user mode linux, and i dunno if it needs patches)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8993337247705827112-7516161154472493531?l=gotuxgo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gotuxgo.blogspot.com/feeds/7516161154472493531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/i-havent-forgotten-this.html#comment-form' title='36 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/7516161154472493531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/7516161154472493531'/><link rel='alternate' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/i-havent-forgotten-this.html' title='I haven&apos;t forgotten this...'/><author><name>happycube</name><uri>http://www.blogger.com/profile/08122880431073403405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>36</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8993337247705827112.post-2553110943474988854</id><published>2009-11-08T15:22:00.000-08:00</published><updated>2009-11-09T00:53:29.797-08:00</updated><title type='text'>Optimizing QEMU a lil'...</title><content type='html'>Looking at the assembly output, there're a lot of redudant load/stores.  How do you fix this in the code generator &lt;span style="font-style:italic;"&gt;without&lt;/span&gt; breaking things left and right?  Make a non-mandatory cache and have non-cache-aware instructions write the cache out.&lt;br /&gt;&lt;br /&gt;Stay tuned for a patch that'll have the core caching code... and a couple of cached instructions.&lt;br /&gt;&lt;br /&gt;edit:  dang this is complex. ;)  I think having a two stage emit phase might help... then you could do things like:&lt;br /&gt;&lt;br /&gt;0x00f65b54:  xor    %ebx,%ebx&lt;br /&gt;0x00f65b56:  add    %ecx,%ebx&lt;br /&gt;to: mov %ecx, %ebx&lt;br /&gt;&lt;br /&gt;0x00f65c98:  mov    %eax,%edx&lt;br /&gt;0x00f65c9a:  mov    %edx,%ecx&lt;br /&gt;0x00f65c9c:  mov    $0x44,%ebx&lt;br /&gt;0x00f65ca1:  mov    %eax,0x2c(%ebp)&lt;br /&gt;0x00f65ca4:  mov    %edx,0x0(%ebp)&lt;br /&gt;to:&lt;br /&gt;mov %eax, %ecx&lt;br /&gt;mov $0x44, %ebx&lt;br /&gt;mov %eax, 0x2c(%ebp)&lt;br /&gt;mov %eax, 0x0(%ebp)&lt;br /&gt;&lt;br /&gt;and finally:&lt;br /&gt;0x00f66372:  mov    0x0(%ebp),%eax&lt;br /&gt;0x00f66375:  mov    0x0(%ebp),%edx&lt;br /&gt;0x00f66378:  and    %edx,%eax&lt;br /&gt;to&lt;br /&gt;0x00f66372:  mov    0x0(%ebp),%eax&lt;br /&gt;&lt;br /&gt;;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8993337247705827112-2553110943474988854?l=gotuxgo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gotuxgo.blogspot.com/feeds/2553110943474988854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/optimizing-qemu-lil.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/2553110943474988854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/2553110943474988854'/><link rel='alternate' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/optimizing-qemu-lil.html' title='Optimizing QEMU a lil&apos;...'/><author><name>happycube</name><uri>http://www.blogger.com/profile/08122880431073403405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8993337247705827112.post-5987852240736179532</id><published>2009-11-08T01:17:00.000-08:00</published><updated>2009-11-08T01:20:15.102-08:00</updated><title type='text'>More stuff to look at...</title><content type='html'>(largely a note to self)&lt;br /&gt;&lt;br /&gt;https://wiki.ubuntu.com/KernelTeam/Specs/BootPerformance#Kernel%20Config%20Changes - points out that depmod+modprobe does a lot more than it needs to.  It shouldn't be too hard to make a binary map to easily jump from a PCI ID to a module.&lt;br /&gt;&lt;br /&gt;I need to look at oprofile and other kernel profiling stuff.&lt;br /&gt;&lt;br /&gt;Also, research using qemu(+kvm) - at the very least it's a nice sandbox.  In addition you can do a lot of traces pretty easily in an emulator...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8993337247705827112-5987852240736179532?l=gotuxgo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gotuxgo.blogspot.com/feeds/5987852240736179532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/more-stuff-to-look-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/5987852240736179532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/5987852240736179532'/><link rel='alternate' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/more-stuff-to-look-at.html' title='More stuff to look at...'/><author><name>happycube</name><uri>http://www.blogger.com/profile/08122880431073403405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8993337247705827112.post-2054798466468715373</id><published>2009-11-07T12:12:00.000-08:00</published><updated>2009-11-07T12:22:30.383-08:00</updated><title type='text'>General tips pt. 1 (of many?)</title><content type='html'>- Use 64-bit distributions whenever you can.  They're tuned to produce code for modern CPU's (all floating point goes through SSE2 for instance) and there are various 64-bit only assembly optimizations.  With the new glibc release, Core i* users will gain SSE4.2-accelerated strcpy/strcmp/etc routines that can be up to 10-12x faster, according to H.J. Lu... but only on x86-64.&lt;br /&gt;&lt;br /&gt;- If you have a recent Radeon card and don't need 3D (yet), look at using the free radeon(hd) drivers which have faster 2D and tear-free video playback.&lt;br /&gt;&lt;br /&gt;- Don't run more than your RAM can handle.  If you have &lt;=512MB of RAM, running OpenOffice and firefox together is generally a bad idea.&lt;br /&gt;&lt;br /&gt;- Keep an eye on firefox when running Flash - many flash pages run in the background and suck up all your CPU.  In general, firefox tabs can also nom memory.  It's probably best to restart firefox occasionally, especially if you have &lt;=1GB of RAM.&lt;br /&gt;&lt;br /&gt;- Consider using suspend (or maybe hibernate) when you're done working instead of shutting down.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8993337247705827112-2054798466468715373?l=gotuxgo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gotuxgo.blogspot.com/feeds/2054798466468715373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/general-tips-pt-1-of-many.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/2054798466468715373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/2054798466468715373'/><link rel='alternate' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/general-tips-pt-1-of-many.html' title='General tips pt. 1 (of many?)'/><author><name>happycube</name><uri>http://www.blogger.com/profile/08122880431073403405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8993337247705827112.post-623015737896346861</id><published>2009-11-06T23:15:00.000-08:00</published><updated>2009-11-07T17:04:27.295-08:00</updated><title type='text'>The first almost trivially tiny lil' thing...</title><content type='html'>(or: Chad spends way too much time researching trivial stuff.)&lt;br /&gt;&lt;br /&gt;The locales code in [e]glibc isn't caching directory names correctly, so you have something like this:&lt;br /&gt;&lt;br /&gt;open("/usr/lib/locale/en_US.UTF-8/LC_TELEPHONE", O_RDONLY) = -1 ENOENT (No such file or directory)&lt;br /&gt;open("/usr/lib/locale/en_US.utf8/LC_TELEPHONE", O_RDONLY) = 3&lt;br /&gt;&lt;br /&gt;about 12 times for each setlocales() call - which happens to be done by most/all processes.&lt;br /&gt;&lt;br /&gt;I wrote this mini-program to see how many microseconds a bad open() takes:&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;#include &lt;fcntl.h&gt;&lt;br /&gt;#include &lt;unistd.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;        int i;&lt;br /&gt;&lt;br /&gt;        for (i = 0; i &lt; 1000000; i++) close(open("/usr/lib/locale/en_US.UTF-8/LC_IDENTIFICATION", O_RDONLY));&lt;br /&gt;        return 0;&lt;br /&gt;}&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;On a Core Duo locked to 1.0ghz, it takes about 3.75usec per call.  This is miniscule, but multiply it by 12, and then the # of times setlocale() is called, and eventually you get to about a second.&lt;br /&gt;&lt;br /&gt;So, instead of actually fixing the locale code (and dealing with getting it upstream), a very simple fix for ubuntu 9.10 et al is:&lt;br /&gt;&lt;br /&gt;sudo ln -sf /usr/lib/locale/en_US.utf8 /usr/lib/locale/en_US.UTF-8&lt;br /&gt;^ your actual locale goes here.&lt;br /&gt;&lt;br /&gt;This should cache nicely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8993337247705827112-623015737896346861?l=gotuxgo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gotuxgo.blogspot.com/feeds/623015737896346861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/first-almost-trivially-tiny-lil-thing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/623015737896346861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/623015737896346861'/><link rel='alternate' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/first-almost-trivially-tiny-lil-thing.html' title='The first almost trivially tiny lil&apos; thing...'/><author><name>happycube</name><uri>http://www.blogger.com/profile/08122880431073403405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8993337247705827112.post-2286404485153237124</id><published>2009-11-06T21:42:00.000-08:00</published><updated>2009-11-06T21:50:35.093-08:00</updated><title type='text'>Hello world!</title><content type='html'>The goal of this blog and my "November Project" (instead of, say, a nano) is to find ways to streamline Linux and write about them here.&lt;br /&gt;&lt;br /&gt;Some things I'm planning to do this month:&lt;br /&gt;&lt;br /&gt;- Development of an OpenWRT image for fully isolated benchmarking.&lt;br /&gt;&lt;br /&gt;- Documenting use of oprofile, ltrace, strace, and CPU performance counters to find areas of improvement.&lt;br /&gt;&lt;br /&gt;- System call usage optimization (repeated attempts to open() files in non-existent directories, etc)&lt;br /&gt;&lt;br /&gt;- Memory allocation optimizations (reduce #'s of mallocs and frees needed)&lt;br /&gt;&lt;br /&gt;- Generally finding new bottlenecks and removing them.&lt;br /&gt;&lt;br /&gt;Hopefully this'll be good for everybody. :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8993337247705827112-2286404485153237124?l=gotuxgo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gotuxgo.blogspot.com/feeds/2286404485153237124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/hello-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/2286404485153237124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8993337247705827112/posts/default/2286404485153237124'/><link rel='alternate' type='text/html' href='http://gotuxgo.blogspot.com/2009/11/hello-world.html' title='Hello world!'/><author><name>happycube</name><uri>http://www.blogger.com/profile/08122880431073403405</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
