<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><id>tag:blogger.com,1999:blog-8324236518119035279</id><updated>2013-05-23T00:35:35.128-07:00</updated><category term="linux" /><category term="nostalgia" /><category term="compression" /><category term="virtualization" /><category term="windows" /><category term="os x" /><category term="memory" /><category term="research" /><category term="git" /><category term="programming" /><title type="text">vflare</title><subtitle type="html">Every idea that strengthens you must be taken up and every thought that weakens you must be rejected.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.vflare.org/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.vflare.org/" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/vflare" /><feedburner:info uri="vflare" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-6406428554093401334</id><published>2013-04-21T00:31:00.000-07:00</published><updated>2013-04-21T00:52:26.652-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="os x" /><title type="text">(Primitive) Media Management on OS X</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I recently got a Mac Air and got frustrated with lack of usable media players. Tried Songbird, Enqueue, MplayerX, Sonora, Spotify (mainly for Local music) etc. Oh, and iTunes is just too painful. Most of these players either have bad/non-existent playlist management, can only play audio (believe it or not: Spotify even lacks ogg support) or just plain slow/buggy, or are insanely costly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyways, finally I have a setup that I find really convenient. You need:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;1. VLC&lt;/b&gt;: Good ol' VLC. The Best Audio/Video player but nearly non-existent playlist management -- this is the issue we will solve.&lt;/div&gt;&lt;div&gt;&lt;b&gt;2. Alfred&lt;/b&gt; (optional): Spotlight is also good but Alfred seems more magical! For searching files, just activate it (Alt+Space), then in the search window, press space again to search for files/folders instead of applications.&lt;/div&gt;&lt;div&gt;&lt;b&gt;3.&lt;/b&gt; ...and this &lt;b&gt;&lt;i&gt;script&lt;/i&gt;&lt;/b&gt;: It generates playlist, in m3u format, of all the Audio/Video files in the current directory.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;script class="brush: bash" type="syntaxhighlighter"&gt;&lt;![CDATA[  #!/bin/bash  ## # Creates m3u playlist of Audio/Video files in the current directory # Input: output file name (default: current_folder_name.m3u) # # Example: cd ~/Music; create_playlist.sh # # Author: Nitin Gupta &lt;ngupta AT vflare.org&gt;#  OUT="$1" [ "x${OUT}" == "x" ] &amp;&amp; OUT=`basename "$PWD"`  OUT="${OUT}.m3u" [ -e "$OUT" ] &amp;&amp; echo "Output playlist file $OUT already exists. Exiting." &amp;&amp; exit 0  # m3u header echo "#EXTM3U" &gt; "$OUT"  # list of audio/video files find . -type f | while read name; do  TYPE=`file --mime-type "$name" | cut -d':' -f2 | cut -d'/' -f1`  if [ "x${TYPE}" == "x video" -o "x$TYPE" == "x audio" ]; then   echo "$name" &gt;&gt; "$OUT"  fi done  COUNT=`cat "$OUT" | wc -l` echo "Created playlist $OUT with $COUNT files." ]]&gt;&lt;/script&gt; &lt;/div&gt;&lt;div&gt;With this simple script, I created multiple playlists spread across multiple folders within ~/Music. If you later add more files, just re-run the script to refresh the playlist to include them too. Then fire-up Alfred/Spotlight, select your playlist and VLC does the rest. Just be sure that m3u files are set to open with VLC instead of iTunes otherwise iTunes will end up copying all the files in the playlist to its internal black hole, without a prompt -- didn't I tell you iTunes is ... ?&lt;/div&gt;&lt;br /&gt;All my media, along with these playlists, live inside Dropbox, so all systems are happy and there are no opaque databases to deal with. &lt;br /&gt;&lt;br /&gt;Seems like back to stone age but for me, it's more convenient than any of the apps out there :) &lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/xT4722SbWXI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/6406428554093401334/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2013/04/primitive-media-management-on-os-x.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/6406428554093401334" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/6406428554093401334" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/xT4722SbWXI/primitive-media-management-on-os-x.html" title="(Primitive) Media Management on OS X" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.vflare.org/2013/04/primitive-media-management-on-os-x.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-4223799847145200058</id><published>2010-06-19T05:22:00.054-07:00</published><updated>2013-04-21T00:39:43.525-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="virtualization" /><title type="text">Faster compilation with distcc</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="text-align: justify;"&gt;Often, you have more than one system at your disposal but no clear way of distributing your compilation workloads over to all or some of them. They might be running different OSes which makes it look even more difficult. In my case, I have one laptop (2 cores) and a desktop (4 cores) connected with a WiFi network. The laptop runs Linux (Fedora 13 64-bit) while the desktop runs Windows 7 (64-bit). I wanted to somehow offload Linux kernel compilation over to my powerful desktop and keep my laptop cool :)&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://distcc.samba.org/"&gt;distcc&lt;/a&gt; comes to the rescue! distcc is a program that can distribute builds of C, C++ code across several machines on a network. Its a fairly well known program but slightly problematic to setup. It took me few hours to setup everything correctly but now it all works like a charm. I hope this short tutorial will help you get running in minutes :)&lt;/div&gt;&lt;div align="left"&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;So, here is what we need to do:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Install distcc on both &lt;i&gt;client&lt;/i&gt; and &lt;i&gt;server(s)&lt;/i&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Configure distcc on both sides&lt;/li&gt;&lt;li&gt;Configure Firewall on server(s) to allow incoming distcc traffic&lt;/li&gt;&lt;li&gt;Build, build, build!&lt;/li&gt;&lt;li&gt;Monitoring&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Before we can go ahead with above, we need to install Linux VMs (I used VirtualBox) on the desktop since its running Windows. I created two Linux (Fedora 13, 64-bit) VMs where Linux Kernel compilation can be offloaded. Each VM was assigned 1G of memory and 2 vCPUs each (a single 4 vCPU VM was quite unstable). In general, you need to have both client and server with the same platform (32/64-bit) and the same compiler versions otherwise you can run into weird compiler/linker errors or even worse, undetectable errors!&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;Install distcc&lt;/h2&gt;&lt;div align="justify"&gt;Firstly, you need to install distcc on both client and server -- distcc calls machine(s) where compilation actually happens as server. So in my case,&amp;nbsp; VMs on the desktop will be servers. Almost all Linux distributions provide distcc in standard repositories. On Fedora, all you need to do is:&lt;/div&gt;&lt;pre&gt;sudo yum install distcc distcc-server &lt;/pre&gt;Now create these symlinks in a separate folder (e.g. ~/distcc/):&lt;br /&gt;&lt;pre&gt;mkdir ~/distcc; cd ~/distcc&lt;br /&gt;ln -s /usr/bin/distcc gcc&lt;br /&gt;ln -s /usr/bin/distcc g++&lt;br /&gt;ln -s /usr/bin/distcc c++&lt;br /&gt;&lt;/pre&gt;&lt;div align="justify"&gt;&lt;br /&gt;NOTE: do not create these symlinks such that they take precedence over your actual compilers, otherwise it will try to offload all kinds compilation you do on the client. In general, its not useful to offload very small compilations.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;Configure distcc&lt;/h2&gt;&lt;div align="justify"&gt;Now we need to configure distcc on both client and server. On client side, we need to list servers where we want to offload compilation. On server side, we need to give “authorized” client IP address(es) and port where distcc daemon will listen for client requests.&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Client side configuration:&lt;/b&gt;&lt;br /&gt;Available servers needs to be listed in ~/.distcc/hosts file. On my laptop, it looks like this:&lt;br /&gt;&lt;pre&gt;192.168.1.10,lzo, 192.168.1.11,lzo&lt;/pre&gt;&lt;div align="justify"&gt;&lt;br /&gt;Where 192.168.1.{10,11} are IPs of Linux VMs running on my desktop. The ‘lzo’ option tells distcc to compress object files as they are transferred over the network. This slightly increases CPU usage on both client and server but is useful if you have a low bandwidth network. This configuration completely offloads compilation to server. In case you want to local machine to also participate in compilation, change above to:&lt;/div&gt;&lt;pre&gt;localhost, 192.168.1.10,lzo, 192.168.1.11,lzo&lt;/pre&gt;&lt;div align="justify"&gt;&lt;br /&gt;NOTE: do not use local IP address instead of term ‘localhost’ in this configuration file, otherwise distcc will incur network overhead even for local part of compilation. But if ’localhost’ is used, local part of compilation will have negligible overhead due to distcc.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;As another example, you may want to restrict usage of local machine, so it can remain cool and most of the work is done by other servers:&lt;/div&gt;&lt;pre&gt;localhost, 192.168.1.10,lzo, 192.168.1.11,lzo&lt;/pre&gt;&lt;div align="justify"&gt;This restricts the number of compilation threads on local machine to 1. Remaining threads (as specified from make –j parameter) go to other server(s).&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Server side configuration:&lt;/b&gt;&lt;br /&gt;&lt;div align="justify"&gt;Among other things, we need to provide list of allowed client IP addresses (by default, all IPs are blocked) and the port where distcc daemon will listen for client requests (default port: 3632). On Fedora, the configuration file is /etc/sysconfig/distccd (the exact location may be different depending on your distro). In my case, two Fedora VMs on the desktop were distcc servers, so I need to enter the following configuration on both of them (config file: /etc/sysconfig/distccd)&lt;/div&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;USER=ngupta&lt;br /&gt;OPTIONS="--jobs 4 --allow 192.168.1.0/24 --port 3632 --log-file=/tmp/distccd.log"&lt;br /&gt;&lt;/pre&gt;&lt;div align="justify"&gt;This specifies upper limit on number of parallel jobs on server, range of allowed client IPs, port to listen on and the log file (by default it spams the system log file: /var/log/messages). The USER option is useful if distccd daemon is started as root, in which case it is changed to user USER. See distccd man page for more details.&lt;/div&gt;&lt;br /&gt;Now, start the distcc server with:&lt;br /&gt;&lt;pre&gt;service distccd start&lt;/pre&gt;&lt;br /&gt;Or, manually with:&lt;br /&gt;&lt;pre&gt;distccd --daemon --user ngupta --jobs 4 --allow 192.168.1.0/24 --port 3632 --log-file=/tmp/distccd.log&lt;/pre&gt;&lt;br /&gt;Of course, you need to change the user. Now, verify that it started successfully with:&lt;br /&gt;&lt;pre&gt;ps awwx | grep distcc&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;h2&gt;Configure Firewall&lt;/h2&gt;&lt;div align="left"&gt;We need to open TCP port 3632 (or whatever port you specified in distccd configuration). For this, insert following iptables rule in /etc/sysconfig/iptables&lt;/div&gt;&lt;pre&gt;-A INPUT -m state --state NEW -m tcp -p tcp --dport 3632 -j ACCEPT&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;This must be inserted before any other REJECT rules. Alternately, you can use GUI like system-config-firewall to open TCP port 3632. In fact, this is what I used and the above configuration line is auto generated by GUI.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;Build, Build, Build!&lt;/h2&gt;All set now, its time to build! Now, for whatever compilation you want to distribute using distcc, issue build like this:&lt;br /&gt;&lt;pre&gt;PATH=$HOME/distcc:$PATH make –j8&lt;/pre&gt;&lt;div align="justify"&gt;&lt;br /&gt;This PATH prefix makes sure that those distcc symlinks get priority over the real compiler. This also gives us the control to use or avoid distcc easily – just don’t use PATH prefix as above and you will fall back to local compiler.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;The distcc man page specifies that number of threads (make –j parameter) should normally be set to twice the number of available CPUs to cover for threads blocked on network I/O.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;In my case, I have 2 VMs each with 2vCPUs, so total of 4 CPUs. Sometimes, I also add ‘localhost’ to distcc server list, so I can use 2 cores on my laptop too. With a total of 6 cores, my Linux kernel build time (with default Fedora 13 config) came down from over an hour to just 20 mins!&lt;/div&gt;&lt;div align="justify"&gt;I used Linux kernel just as an example but you can distribute build of any C/C++ code with distcc. Throw-in the power of Virtualization and you can even use a mix of Linux/Windows, 32/64-bit machines.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;Monitoring&lt;/h2&gt;&lt;div style="text-align: justify;"&gt;You can easily monitor how your build is being distributing among servers with either 'distccmon-gnome' or 'distccmon-text'.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-E0EOFJypg2E/UXOXmqrMQVI/AAAAAAAAJSo/pGEmTS69feM/s1600/distcc_screenshot.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-E0EOFJypg2E/UXOXmqrMQVI/AAAAAAAAJSo/pGEmTS69feM/s1600/distcc_screenshot.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="text-align: left;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="text-align: left;"&gt;Figure: distccmon-gnome continuously showing distcc status during Linux kernel compile.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Happy Building! :)&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/mEmzAY7rjjg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/4223799847145200058/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2010/06/faster-compilation-with-distcc.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/4223799847145200058" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/4223799847145200058" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/mEmzAY7rjjg/faster-compilation-with-distcc.html" title="Faster compilation with distcc" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-E0EOFJypg2E/UXOXmqrMQVI/AAAAAAAAJSo/pGEmTS69feM/s72-c/distcc_screenshot.jpg" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://www.vflare.org/2010/06/faster-compilation-with-distcc.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-8421297097020777858</id><published>2010-05-30T06:53:00.004-07:00</published><updated>2010-06-19T06:16:06.154-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="research" /><category scheme="http://www.blogger.com/atom/ns#" term="virtualization" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="memory" /><category scheme="http://www.blogger.com/atom/ns#" term="compression" /><title type="text">Compressed RAM disk for Windows, The Virtual Way!</title><content type="html">&lt;div style="text-align: justify;"&gt;Recently, I developed Linux kernel driver which creates generic RAM based compressed block devices (called &lt;b&gt;zram&lt;/b&gt;). Being RAM disks, they do not provide persistent storage but there are many use cases where persistence is not required: /tmp, various caches under /var, swap disks etc. These cases can benefit greatly from high speed RAM disks along with savings which compression brings!&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;However, all this seems to be completely Linux centric. But with virtualization, zram can be used for Windows too! The trick is a expose zram as a ‘raw disk’ to Windows running inside a Virtual Machine (VM). I will be using VirtualBox as example but exposing raw disks should be supported by other Virtualization solutions like VMware, KVM too.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Of course, you need to have Linux as the host and have the zram driver loaded. Here are the steps we need to do:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;Get zram sources, compile and load the driver &lt;/li&gt;&lt;li&gt;Set zram disksize &lt;/li&gt;&lt;li&gt;Create VMDK file with raw disk set as /dev/zram0 &lt;/li&gt;&lt;li&gt;Add this disk to Windows VM &lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Once this much is done, the disk will be detected in Windows as ‘VBox HardDisk’ and after disk initialization (as is needed for any new harddisk), you can format it with NTFS (or any other) filesystem.&lt;/div&gt;&lt;h2&gt;Get zram sources, compile and load the driver&lt;br /&gt;&lt;/h2&gt;&lt;div style="text-align: justify;"&gt;zram is not yet available as a downloadable tarball, so you need to checkout the source directly from repository:&lt;/div&gt;&lt;pre&gt;hg clone https://compcache.googlecode.com/hg/ compcache&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;Now, to compile it against your running kernel, just run:&lt;/div&gt;&lt;pre&gt;make&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;If you get lots of compilation errors, then you are probably missing kernel-devel and kernel-headers package. This driver has been well tested with Linux kernel 2.6.33-xx which ships with Fedora 13 (x86_64).If compilation went fine, you should now have the zram.ko driver. Load it along with its dependencies:&lt;/div&gt;&lt;pre&gt;modprobe lzo_compress&lt;br /&gt;modprobe lzo_decompress&lt;br /&gt;insmod ./zram.ko&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;Set zram disk size&lt;/h2&gt;&lt;div style="text-align: justify;"&gt;Disksize is set using &lt;i&gt;zramconfig&lt;/i&gt; userspace utility which is compiled along with the driver. You can find it in &amp;lt;sourcedir&amp;gt;/sub-projects/zramconfig/zramconfig. Following sets disksize as 2GB and initializes the disk:&lt;/div&gt;&lt;pre&gt;zramconfig /dev/zram0 –-disksize_kb=2097152 --init&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;Create VMDK file with raw disk set as /dev/zram0&lt;/h2&gt;&lt;div style="text-align: justify;"&gt;Now we will create a VMDK file which simply points to /dev/zram0 device as its data source. This VMDK will later be added to Windows VM in VirtualBox.&lt;/div&gt;&lt;pre&gt;VBoxManage internalcommands createrawvmdk -filename ~/temp/zram.vmdk -rawdisk /dev/zram0 –register&lt;/pre&gt;This command creates VMDK file in ~/temp (you can replace it with any other location) and also registers as one of the harddisks in VirtualBox.&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Normal (non-root) users cannot do direct I/O to /dev/zram devices but you certainly don’t want to run VirtualBox as root! So, as a workaround, you can ‘chown’ the device:&lt;/div&gt;&lt;pre&gt;chown username:username /dev/zram0&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;Of course, you need to run this as root. This gives you the ownership of the device, so you will not have to run VirtualBox as root.&lt;/div&gt;&lt;h2&gt;Add this disk to Windows VM&lt;/h2&gt;&lt;div style="text-align: justify;"&gt;This VMDK disk (~/temp/zram.vmdk in our example), can be added to any VM, be it Linux or Windows. But for now, we will stick with Windows. Go to VM’s storage configuration and add this disk. You will then get storage configuration like this:&lt;/div&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_zR-Lx8KguFc/TAJtxlugIEI/AAAAAAAABq4/JaTVvjKPakc/s1600-h/zram_vbox_storage_config%5B3%5D.png"&gt;&lt;img alt="zram_vbox_storage_config" border="0" height="517" src="http://lh5.ggpht.com/_zR-Lx8KguFc/TAJtzRB9ySI/AAAAAAAABq8/_pwMlhrNrZ8/zram_vbox_storage_config_thumb%5B1%5D.png?imgmax=800" style="border-width: 0px; display: inline;" title="zram_vbox_storage_config" width="728" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;div style="text-align: justify;"&gt;Now poweron the VM. Windows will detect this disk as ‘VBox HardDisk’ and you need to ‘initialize’ the disk within Windows before you can start using it (as is needed for any new harddisk). To initialize the disk, goto: Control Panel –&amp;gt; Administrative Tools –&amp;gt; Computer Management –&amp;gt; Disk Management. Here you will automatically get a wizard to help to initialize the disk and assign it a drive letter. Make sure you set &lt;b&gt;Block Size as 4096&lt;/b&gt; and keep NTFS filesystem compression disabled (default) -- otherwise, you will get suboptimal performance!&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;After the disk initialization wizard finishes, zram disk should show up in My Computer:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_zR-Lx8KguFc/TAJt1ei_dFI/AAAAAAAABrE/zgmbtzPviNg/s1600-h/zram_drive_my_comp3.png"&gt;&lt;img alt="zram_drive_my_comp" border="0" height="558" src="http://lh3.ggpht.com/_zR-Lx8KguFc/TAJt3az3YmI/AAAAAAAABrI/I8CiL3xozFw/zram_drive_my_comp_thumb1.png?imgmax=800" style="border-width: 0px; display: inline;" title="zram_drive_my_comp" width="710" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Above shows zram drive highlighted, formatted with NTFS filesystem and size of about 2GB. You can now use it as any other disk.&lt;br /&gt;&lt;br /&gt;Apart from use as a generic disk, an interesting use case it to have Windows swap file on this disk. This way, whatever is swapped from Windows goes to host (Linux) where it is compressed and stored in memory itself! In a way this is like dynamically giving more memory to a VM. Reading/Writing to this disk is way faster than rotation disks, so it should also improve your VM performance.&lt;br /&gt;&lt;br /&gt;To setup Windows to swap on zram disk, goto: Control Panel –&amp;gt; System –&amp;gt; Advanced –&amp;gt; Settings (Under Performance) –&amp;gt; Advanced –&amp;gt; Change (under Virtual Memory)&lt;br /&gt;&lt;br /&gt;Now you should get screen like this, showing target disks for swap file:&lt;/div&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_zR-Lx8KguFc/TAJt325ta-I/AAAAAAAABrM/-BWPNNF5uWM/s1600-h/zram_swap_windows3.png"&gt;&lt;img alt="zram_swap_windows" border="0" height="443" src="http://lh5.ggpht.com/_zR-Lx8KguFc/TAJt4tiYBuI/AAAAAAAABrQ/r3g1yAMm4yo/zram_swap_windows_thumb1.png?imgmax=800" style="border-width: 0px; display: inline;" title="zram_swap_windows" width="349" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Select zram as swap target, select System managed size and click Set. You can also disable swap file in C: to make sure all swapping goes to zram only.&lt;br /&gt;&lt;br /&gt;At any time, you can monitor zram I/O stats on (Linux) host using zramconfig. Following also shows sample output stats from my system:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;[ngupta@vflare ~]$ zramconfig /dev/zram0 --stats&lt;br /&gt;DiskSize:        2097152 kB&lt;br /&gt;NumReads:        4214012&lt;br /&gt;NumWrites:       3941172&lt;br /&gt;FailedReads:           0&lt;br /&gt;FailedWrites:          0&lt;br /&gt;InvalidIO:             0&lt;br /&gt;NotifyFree:            0&lt;br /&gt;ZeroPages:        393297&lt;br /&gt;GoodCompress:         98 %&lt;br /&gt;NoCompress:            1 %&lt;br /&gt;PagesStored:        3399&lt;br /&gt;PagesUsed:           105&lt;br /&gt;OrigDataSize:      13596 kB&lt;br /&gt;ComprDataSize:       393 kB&lt;br /&gt;MemUsedTotal:        420 kB&lt;/pre&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;That’s it!&lt;br /&gt;If you do try it out, do let me know! :)&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/UpvARwpaLqo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/8421297097020777858/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2010/05/compressed-ram-disk-for-windows-virtual.html#comment-form" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/8421297097020777858" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/8421297097020777858" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/UpvARwpaLqo/compressed-ram-disk-for-windows-virtual.html" title="Compressed RAM disk for Windows, The Virtual Way!" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_zR-Lx8KguFc/TAJtzRB9ySI/AAAAAAAABq8/_pwMlhrNrZ8/s72-c/zram_vbox_storage_config_thumb%5B1%5D.png?imgmax=800" height="72" width="72" /><thr:total>7</thr:total><feedburner:origLink>http://www.vflare.org/2010/05/compressed-ram-disk-for-windows-virtual.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-8658850968169686304</id><published>2010-04-10T07:33:00.005-07:00</published><updated>2010-05-26T01:10:40.628-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title type="text">Setting up KDE API Documentation</title><content type="html">&lt;p align="justify"&gt;Since last few months, I have been playing around with &lt;a href="http://www.kdevelop.org/"&gt;KDevelop&lt;/a&gt; which is a KDE based IDE for C/C++ any many other languages. Its a large C++ codebase and navigating through all the files, classes is quite difficult with usual VI + cscope combination. The most lacking part is a readily accessible KDE API documentation which is almost essential, no matter what component you are working on. There is a KDE API reference &lt;a href="http://api.kde.org/"&gt;site&lt;/a&gt; but searching there for every reference is very cumbersome.  So, I decided to setup a local API reference. Steps:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;Checkout sources&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Generate API documentation from sources&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Import documentation in Qt Assistant: It provides nice interface to navigate through all the documentation&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Get KDevelop4 working from sources (to hack KDevelop itself!) [&lt;a href="http://www.kdevelop.org/mediawiki/index.php/KDevelop_4/compiling"&gt;explained here&lt;/a&gt;]&lt;br /&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Checkout Sources&lt;/h2&gt;  &lt;p align="justify"&gt;We will checkout sources for kdelibs, kdesdk, kdevplatform and kdevelop. I just want to hack on KDevelop, so you may need checkout additional repositories depending on what you want to do. Instructions for checkout of different repositories and branches is present &lt;a href="http://techbase.kde.org/Getting_Started/Sources/Anonymous_SVN"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p align="justify"&gt;We’ll checkout everything in $HOME/repo/ (of course, you can change it to anything you want).&lt;/p&gt;  &lt;p align="justify"&gt;mkdir $HOME/repo; cd $HOME/repo&lt;/p&gt;  &lt;pre&gt;svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs&lt;br /&gt;svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdesdk&lt;br /&gt;&lt;br /&gt;git clone git://gitorious.org/kdevelop/kdevplatform.git&lt;br /&gt;git clone git://gitorious.org/kdevelop/kdevelop.git&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;Generate API Documentation&lt;/h2&gt;Now we’ll generate documentation from sources in .qch format – which is a single compressed file containing all the documentation. These qch files will be later imported in Qt Assistant.&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;First, &lt;a href="http://wiki.kxref.googlecode.com/hg/files/scripts/kde_gendoc.sh"&gt;download script&lt;/a&gt; to generate these qch files. This is a slightly modified version of the script included with kdesdk (kdesdk/scripts/kdedoxyqt.sh). This modified version works for all the source trees listed above and also generates class diagrams etc. Now, generate documentation for each source tree using this script:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;cd ~/repo&lt;br /&gt;cd kdesdk; kde_gendoc.sh; cd ..&lt;br /&gt;cd kdelibs; kde_gendoc.sh; cd ..&lt;br /&gt;cd kdevplatforms; kde_gendoc.sh; cd ..&lt;br /&gt;cd kdevelop; kde_gendoc.sh; cd ..&lt;/pre&gt;&lt;br /&gt;This will generate a .qch file in each of the trees (&amp;lt;tree&amp;gt;/apidocs/qch/&amp;lt;tree&amp;gt;.4.x.qch). For example, kdesdk/apidocs/qch/kdesdk.4.x.qch&lt;br /&gt;&lt;br /&gt;&lt;p&gt;All these qch files total around 120MB.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Import In Qt Assistant&lt;/h2&gt;&lt;br /&gt;Now import all these qch files in Qt4 Assistant. Start the program and goto: Edit –&amp;gt; Preferences –&amp;gt; Documentation tab –&amp;gt; Add… and select a qch file. Repeat this for all four .qch files and you are done.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_zR-Lx8KguFc/S8CMLDtP9BI/AAAAAAAABo8/vgIqnAenx2I/s1600-h/qt4_assistant_with_kdedoc%5B4%5D.png"&gt;&lt;img style="border: 0px none; display: inline;" title="qt4_assistant_with_kdedoc" alt="qt4_assistant_with_kdedoc" src="http://lh3.ggpht.com/_zR-Lx8KguFc/S8CMNIt6-aI/AAAAAAAABpA/s0KKVwsZUHc/qt4_assistant_with_kdedoc_thumb%5B2%5D.png?imgmax=800" border="0" height="484" width="565" /&gt;&lt;/a&gt; &lt;/p&gt;Figure 1: Qt Assistant with all the KDE API documentation.&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;You should now have all the KDE documentation listed in ‘Contents’. Now any class reference is quick and easy with lightning fast Qt Assistant’s Index.&lt;/p&gt;That’s it!&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/5DMFXbRi3cA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/8658850968169686304/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2010/04/setting-up-kde-api-documentation.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/8658850968169686304" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/8658850968169686304" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/5DMFXbRi3cA/setting-up-kde-api-documentation.html" title="Setting up KDE API Documentation" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_zR-Lx8KguFc/S8CMNIt6-aI/AAAAAAAABpA/s0KKVwsZUHc/s72-c/qt4_assistant_with_kdedoc_thumb%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://www.vflare.org/2010/04/setting-up-kde-api-documentation.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-8909174667394329627</id><published>2010-02-24T14:33:00.002-08:00</published><updated>2010-02-24T14:37:24.607-08:00</updated><title type="text">KXref: A KDE based code cross-referencing tool</title><content type="html">&lt;p align="justify"&gt;As part of my job and for hobby projects, I often have to work on large C codebases (particularly, the Linux kernel). Like a great majority of developers, I spend almost all my work time understanding these ever evolving, huge code bases.&lt;/p&gt;  &lt;p align="justify"&gt;Few years back, the only tool I found usable for this purpose was VI editor+cscope. However, this combination falls short of various features which modern IDEs provides that make life so much easier -- graphical call graph/tree, integration with SCMs (Git, Perforce etc.), integrated disassembler, access to previous queries and other conveniences typically provided by GUI environments like better use of multi-monitor, widescreen setups and so on.&lt;/p&gt;  &lt;p align="justify"&gt;Such large C based projects typically have their own build systems with compilation offloaded to separate cluster(s). Also, kernel debugging is really not something which is very feasible to do within IDEs. Thus, what is needed for such kind of work is a simple GUI application which can overcome various problems with classical VI+cscope combination, some of which I listed in the beginning. Integrated build system, debugger etc. provided by typical IDEs is simply not required.&lt;/p&gt;  &lt;p align="justify"&gt;Since last 1 or so year I (and various teammates) have been hooked to &lt;a href="http://kscope.sourceforge.net/"&gt;KScope&lt;/a&gt; which is a KDE based frontend for cscope+ctags. In particular, it can show graphical call graph/tree which is extremely useful. However, it lacks integration with any SCM (so cannot view diffs with previous revisions), no integrated disassembler and so on. Initially, I decided to work on extending this great tool but soon realized that its not feasible: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;KScope 1.6.x is based on KDE3. Porting it to KDE4 platform is far from trivial and adding to existing KDE3 based code is surely going to hurt as this outdated platform is no longer the focus of KDE developers.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;KSscope 1.9.x is highly stripped down version of 1.6.x series! It looks like a bare Qt application with “QScintilla” editor part. This departure from KDE framework makes it look ugly, with inferior font rendering (compare with Kate!) and makes it real hard to use new KDE based frameworks like “&lt;a href="http://www.kdevelop.org/"&gt;KDevPlatform&lt;/a&gt;” which makes it easier to develop IDE like applications.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;KScope is frontend for cscope+ctags. These backends that themselves ancient and almost unmaintained. They also lack incremental cross-reference database update which is essential for frequently updated projects like the Linux kernel.&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="justify"&gt;Add to all this the fact that the KScope (only) developer has now left the project and considering above all, its difficult to jump in and maintain this dying project.&lt;/p&gt;  &lt;p align="justify"&gt;So what now? The need for such a tool led me to start a new project: &lt;a href="http://code.google.com/p/kxref/"&gt;KXref&lt;/a&gt; which is going to be a KDE4 based code-reference tool. It has lots of features planned which I missed the most in KScope (details on project home).  Its backend for code cross-referencing will be &lt;a href="http://www.gnu.org/software/global/"&gt;GNU Global&lt;/a&gt; which is under active development, has good roadmap and supports incremental update even toady.&lt;/p&gt;  &lt;p align="justify"&gt;Currently, only bare bones have been developed and the progress so far has been slow partly due to the time factor and due to my fear of C++ in general. I’m also a relative newcomer to KDE programming. However, I regularly dump down any new ideas on the project page – at least this part I’m enjoying :)    If you have any time and some KDE/Qt programming experience or some ideas to share, you are surely welcome!  The project badly needs contributors :)&lt;/p&gt;  &lt;p align="justify"&gt;As I said, the project is in very initial stages and its really too early for screenshots – anyways, here is what is looks like &lt;em&gt;today!&lt;/em&gt;&lt;/p&gt;&lt;p align="justify"&gt;(click to enlarge)&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh6.ggpht.com/_zR-Lx8KguFc/S4WpPJSgwrI/AAAAAAAABoA/ibZF-VyYnDE/s1600-h/kxref_nascent%5B1%5D%5B6%5D.png"&gt;&lt;img style="border: 0px none ; display: inline;" title="kxref_nascent[1]" alt="kxref_nascent[1]" src="http://lh6.ggpht.com/_zR-Lx8KguFc/S4WpRAQMH7I/AAAAAAAABoE/3sYA2leQOAA/kxref_nascent%5B1%5D_thumb%5B4%5D.png?imgmax=800" border="0" height="465" width="644" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="justify"&gt;KXref “nascent”&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/8mPUXdgk_pw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/8909174667394329627/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2010/02/kxref-kde-based-code-cross-referencing.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/8909174667394329627" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/8909174667394329627" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/8mPUXdgk_pw/kxref-kde-based-code-cross-referencing.html" title="KXref: A KDE based code cross-referencing tool" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_zR-Lx8KguFc/S4WpRAQMH7I/AAAAAAAABoE/3sYA2leQOAA/s72-c/kxref_nascent%5B1%5D_thumb%5B4%5D.png?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://www.vflare.org/2010/02/kxref-kde-based-code-cross-referencing.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-2036703939801734009</id><published>2010-02-23T08:08:00.004-08:00</published><updated>2010-02-23T08:12:51.458-08:00</updated><title type="text">Memory Compression support for various Linux distributions</title><content type="html">&lt;p align="justify"&gt;I recently installed the latest release of Ubuntu (9.10 aka Karmic Koala) and was disappointed to find an ancient version of &lt;a href="http://code.google.com/p/compcache/"&gt;compcache/ramzswap&lt;/a&gt; installed by default. My favourite distro (Fedora) does not even ship compcache. Currently, major part of compcache/ramzswap code is included in mainline (2.6.33) however full support is expected no sooner than kernel 2.6.34. I think it will take quite a long time before 2.6.34 kernel is adopted by various distros. Also, it takes considerable amount of time before additions/fixes to compcache are synced with mainline kernel.  I think Ubuntu, Fedora and their various 'spins' can benfit from memory compression and there is no need to wait for these future kernel releases. Providing support for uptodate compcache version is also very easy and non-intrusive. Here what any distro needs to do: &lt;ul&gt;  &lt;li&gt;   Apply (small) "swap notify" patch to kernel. This patch is included in '-mm' tree since a long time and is well tested.  &lt;/li&gt;  &lt;li&gt;   Ship ramzswap kernel module and rzscontrol utility as a spearate package. This package can be updated as soon as new compcache version is available for download. This package can be provided through rpmfusion repository for Fedora and something similar for Ubuntu.  &lt;/li&gt; &lt;/ul&gt;  All of above (notify patch, ramzswap module, rzscontrol utility) are available at project's &lt;a href="http://code.google.com/p/compcache/downloads/list"&gt;download area&lt;/a&gt;. I hope it will be adopted by more distros in future giving me motivation to keep the development alive :)&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/XB6iUwM8RUg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/2036703939801734009/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2010/02/memory-compression-support-for-various.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/2036703939801734009" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/2036703939801734009" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/XB6iUwM8RUg/memory-compression-support-for-various.html" title="Memory Compression support for various Linux distributions" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.vflare.org/2010/02/memory-compression-support-for-various.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-1576793596675837656</id><published>2009-12-27T06:28:00.034-08:00</published><updated>2013-04-21T00:41:27.606-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="git" /><title type="text">Comprehensive graphical Git diff viewer</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="text-align: justify;"&gt;Since a long time, I was looking for a graphical git diff viewer which could show original and modified file side-by-side and highlight the changes. There are few solutions but none of them is sufficient:&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;A tool included with git called 'git-difftool' is partially helpful -- it can show changes graphically but diff for each file is shown one-by-one. This is very irritating. In fact, unusable even with just 10-15 files.&lt;/li&gt;&lt;li&gt;Another alternative is the &lt;a href="http://meld.sourceforge.net/"&gt;meld diff viewer&lt;/a&gt; which is "git aware". The problem here is that it can show diff for uncommitted changes only which is very limiting. What if you want to see what changes between Linux kernel, say 2.6.33-rc1 and 2.6.33-rc2? or changes between last two commits? meld cannot do it, AFAIK.&lt;/li&gt;&lt;li&gt;Finally, with &lt;a href="http://www.caffeinated.me.uk/kompare/"&gt;kompare&lt;/a&gt;, you can do something like: 'git diff  master | kompare -o -'. This method however, does not show original and new files side-by-side. It is simply prettier diff highlighting.&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;None of above methods are sufficient. So, I wrote the following script which solves our problem: show complete contents of original and new files and highlight the differences.&lt;br /&gt;&lt;br /&gt;This script reconstructs (sparse) tree containing modified files. This is very useful with large projects like the Linux kernel -- there is one Kconfig file in each directory, which is the one this change modified!&lt;br /&gt;&lt;br /&gt;To use it, just use the script instead of 'git diff' directly. Arguments to this script are the same as if you are using git-diff command. See script comments for further help.&lt;br /&gt;&lt;br /&gt;Lets see some examples:&lt;br /&gt;&lt;br /&gt;1) I have a 'qemu-kvm' git tree with some uncommitted changes. In this tree 'git diff', without any arguments, would generate the diff. So, we do the same with git-diffc.&lt;br /&gt;&lt;pre class="brush: js"&gt;git-diffc&lt;/pre&gt;&lt;br /&gt;2) I want to see difference between Linux kernel 2.6.33-rc1 and 2.6.33-rc2. This can be done with 'git diff v2.6.33-rc1 v2.6.33-rc2' which will generate unified diff between these two releases. To get graphical diff (note: we always use same args as git-diff):&lt;br /&gt;&lt;pre class="brush: js"&gt;git-diffc v2.6.33-rc1 v2.6.33-rc2&lt;/pre&gt;Here is the output with default (kdiff3) diff viewer:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-zQJ_r4k6cRQ/UXOYIYs0aaI/AAAAAAAAJSw/E5eTc9r-vLk/s1600/git-diffc_screenshot.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-zQJ_r4k6cRQ/UXOYIYs0aaI/AAAAAAAAJSw/E5eTc9r-vLk/s1600/git-diffc_screenshot.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Note that entire directory hierarchy is reconstructed which is almost essential for such large projects. A simple flat list of changed files will be almost useless. As another example if you were simply interested in checking what files are modified across these two versions, you could do:&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;DIFF_BIN=/usr/bin/tree git-diffc v2.6.33-rc1 v2.6.33-rc2&lt;/pre&gt;&lt;br /&gt;The same command as above, but overriding diff viewer (see script comments for details).&lt;br /&gt;I hope you will find this script useful. Happy Hacking and Happy New Year!&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;You can download the script from &lt;a href="http://code.google.com/p/compcache/source/browse/sub-projects/scripts/git-diffc"&gt;&lt;span style="font-weight: bold;"&gt;here&lt;/span&gt;&lt;/a&gt;.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/yRIwtX4PpsE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/1576793596675837656/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/12/comprehensive-graphical-git-diff-viewer.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/1576793596675837656" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/1576793596675837656" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/yRIwtX4PpsE/comprehensive-graphical-git-diff-viewer.html" title="Comprehensive graphical Git diff viewer" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-zQJ_r4k6cRQ/UXOYIYs0aaI/AAAAAAAAJSw/E5eTc9r-vLk/s72-c/git-diffc_screenshot.jpg" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://www.vflare.org/2009/12/comprehensive-graphical-git-diff-viewer.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-8683520472912484913</id><published>2009-09-23T10:21:00.002-07:00</published><updated>2010-07-21T02:23:53.116-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="git" /><title type="text">Linux kernel workflow with Git</title><content type="html">&lt;div align="justify"&gt;You worked on some part of Linux kernel. It works great. Now, how to generate the patch series and send it out for review? For this, I always used to generate diffs, create a set of draft mails (one for each patch) in KMail or Thunderbird, and send all these mails one-by-one. This workflow quickly became a big headache. Then I learned Git (and some related tools) to do all this from command line and wow! what a relief!   &lt;br /&gt;&lt;/div&gt;This is just a quick dump of my notes which I made while struggling to make it all work. There are probably many other (most probably, better) workflows but this is what works for me. I hope you will find it useful. Any comments/suggestions welcome!     &lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Why workflow with KMail/Thunderbird was bad?&lt;/h2&gt;&lt;div align="justify"&gt;Firstly, for any Linux kernel patch series, the convention is to create an introductory email a.k.a. PATCH [0/n] where 'n' is number of patches in series. Then, all the following patches should be sent as reply to this introductory patch (so, if someone is not interested in your patches, they can simply collapse the thread). For example:&lt;/div&gt;&lt;blockquote&gt;[PATCH 0/3] my super kernel feature   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |-&amp;gt; [PATCH 1/3] this is part1    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |-&amp;gt; [PATCH 2/3] this is part2    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |-&amp;gt; [PATCH 3/3] this is part3&lt;/blockquote&gt;&lt;div align="justify"&gt;With KMail or Thunderbird, I could not find any clean way to compose draft mails with this threaded structure. If when you compose drafts with this threading, it screws-up patch ordering while sending.   &lt;br /&gt;&lt;/div&gt;Secondly, almost all graphical email clients have the habit of tinkering with the text and corrupting the patch. BTW, this is not a problem with KMail atleast (Linux kernel includes documentation on how to avoid this problem with other email clients too, including Thunderbird).     &lt;br /&gt;&lt;br /&gt;Thirdly, whenever you have to send a patch series, you have to re-create entire To: and Cc: list. This can become quite cumbersome -- as more and more people review your code, this list can become quite long.&lt;br /&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Workflow with Git&lt;/h2&gt;&lt;h3&gt;Creating patches:&lt;/h3&gt;&lt;h4&gt;Method 1:&lt;/h4&gt;&lt;div align="justify"&gt;&lt;i&gt;&lt;/i&gt;Suppose you have Linux kernel tree with two branches: mywork and master. You make series of changes (commits) to mywork branch. If you have a clean work history -- i.e. last 'n' git commits reflect incremental development of your work then you can simply use following to create set of patches ready for submission:&lt;/div&gt;&lt;blockquote&gt;git format-patch --cover-letter -o patch_dir master     &lt;br /&gt;&lt;/blockquote&gt;Options:   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --cover-letter: also generate 'patch' that introduces your patch series.    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -o: specifies directory where to store patches created (patch_dir here).    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; master: replace this with branch to diff against    &lt;br /&gt;(as usual, see man page for all other options and details).    &lt;br /&gt;&lt;br /&gt;This creates patch files:   &lt;br /&gt;out/0000-cover-letter.patch    &lt;br /&gt;out/0001-great-new-feature-something.patch    &lt;br /&gt;out/0002-great-new-feature-something-more.patch    &lt;br /&gt;... and so on.&lt;br /&gt;&lt;h4&gt;&lt;/h4&gt;The filename is based on first line of git commit message.&lt;br /&gt;Each patch file begins with subject line:   &lt;br /&gt;[PATCH 0/n] &amp;lt;first line of git commit message&amp;gt;&amp;nbsp; &lt;br /&gt;and rest of git commit message as the body, then followed by the actual patch.    &lt;br /&gt;If you want to omit automatic appending of '[PATCH 0/n]' part to the subject, you can use '&lt;i&gt;--keep-subject&lt;/i&gt;' option for git format-patch.&lt;br /&gt;&lt;div align="justify"&gt;Now, review subject and body for each of these patches -- especially cover letter which is, of course, without proper subject or body when initially created.   &lt;br /&gt;&lt;/div&gt;&lt;h4&gt;Method 2:&lt;/h4&gt;&lt;div align="justify"&gt;Sometimes you don't have a clean working history i.e. last 'n' commits do not represent incremental development of your work. This is usually the case with me. In my case, all development happened outside mainline. To prepare patches against mainline, I commit all files in one-go and make lot of small commits later as cleanups, bug fixes are done.   &lt;br /&gt;In such case, you can create another branch which has a 'clean' history by carefully committing changes in correct order to this new branch. Then, you git format-patch (as in Method 1) to generate patch series. However, I usually do following -- no good reason to prefer this but it just better suits my laziness.    &lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Since my git commit history is full of uninteresting small commits, I create individual patches manually. For each patch, I hand-pick set of files to create patch like this: &lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;git diff --patch-with-stat master path/to/file1 path/to/file2 patch/to/file3 &amp;gt; 0001-great_new_feature_something.patch    &lt;br /&gt;git diff --patch-with-stat master path/to/file4 path/to/file5 &amp;gt; 0002-great_new_feature_something_more.patch&lt;/blockquote&gt;&lt;div align="justify"&gt;.... and so on.   &lt;br /&gt;Note that patch file names contain numbering (like '0001') so that git send-email picks patches in correct order (more on this later).    &lt;br /&gt;&lt;/div&gt;In the beginning of each of these patches, add the following lines:&lt;br /&gt;&lt;blockquote&gt;Subject: [PATCH 1/n] subject for patch1 ('n' is no. of patches)     &lt;br /&gt;&amp;lt;message body describing patch&amp;gt;      &lt;br /&gt;Signed-off-by: Your Name &lt;a href="mailto:email@domain.com"&gt;email@domain.com&lt;/a&gt;      &lt;br /&gt;--- (three dashes)      &lt;br /&gt;&amp;lt;actual patch as generated by git diff&amp;gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div align="justify"&gt;Also create 'cover letter' that introduces your patch series. Give it any filename but prefix it with '0000' (for example, 0000-cover-letter.patch), to make sure git send-email picks this patch for sending before any other patch (more on this later).&lt;/div&gt;&lt;h4&gt;Sanity check for patches:&lt;/h4&gt;&lt;div align="justify"&gt;Verify that your patches follow all Linux kernel coding style (and some other basic sanity checks) by using checkpatch.pl script included with linux kernel:&lt;/div&gt;&lt;blockquote&gt;&lt;div align="justify"&gt;linux_source/scripts/checkpatch.pl &amp;lt;patch filename&amp;gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;h4&gt;Sending patches: &lt;/h4&gt;&lt;div align="justify"&gt;Now the patches are prepared and sanity checks are done, its time to send these patches out for review. We will use git-send-email for this.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;First, prepare and address book containing entries for all the recipients. I use &lt;b&gt;abook &lt;/b&gt;which I found very easy to use. With abook create this address book and export it as 'mutt alias' file (using 'e' for export, followed by 'c' for mutt alias format). This mutt alias file will be used by git send-email.    &lt;br /&gt;&lt;/div&gt;Now add following to linux_source/.git/config:&lt;br /&gt;&lt;blockquote&gt;[user]     &lt;br /&gt;name = Your Name      &lt;br /&gt;email = &lt;a href="mailto:email@domain.com"&gt;email@domain.com&lt;/a&gt;&lt;br /&gt;[sendemail]     &lt;br /&gt;aliasesfile = /path/to/email_aliases_file      &lt;br /&gt;aliasfiletype = mutt      &lt;br /&gt;smtpserver = smtp.gmail.com      &lt;br /&gt;smtpserverport = 465      &lt;br /&gt;smtpencryption = ssl      &lt;br /&gt;smtpuser = email@domain.com      &lt;br /&gt;to = alias1      &lt;br /&gt;cc = alias2      &lt;br /&gt;cc = alias3      &lt;br /&gt;cc = alias4&lt;/blockquote&gt;(these smtp settings are for gmail accounts).   &lt;br /&gt;where, alias1 etc. is the string appearing between 'alias' and actual email address in mutt alias file created above.&lt;br /&gt;&lt;div align="justify"&gt;Now, we are ready to send it out to world. We want to send all patches as reply to the cover letter (a.k.a patch 0), as is the convention used on LKML. Send it with:&lt;/div&gt;&lt;blockquote&gt;git send-email --no-chain-reply --suppress-cc=sob --suppress-cc=self patches_dir&lt;/blockquote&gt;Options:   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --no-chain-reply: Don't send every patch as reply to previous patch. Instead, what we want is to send all patches as reply to _first_ patch (i.e. the cover letter).    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --suppress-cc=sob: Don't Cc email mentioned in 'Signed-off-by:' line in each patch.    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --suppress-cc=self: Don't send a copy of patches to you.    &lt;br /&gt;(If your requirements are different, then man git-send-email is always your friend!)    &lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;git send-email seems to pick patches in alphabetical order. So, 0000-cover-letter becomes the first patch. All other patches are sent as reply to this one. At last, before actually sending patches, add ‘&lt;i&gt;—dry-run’&lt;/i&gt; option to git send-email and make sure everything looks okay.    &lt;br /&gt;&lt;/div&gt;That’s it!&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/oCX7jYtgzbg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/8683520472912484913/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/09/linux-kernel-workflow-with-git.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/8683520472912484913" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/8683520472912484913" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/oCX7jYtgzbg/linux-kernel-workflow-with-git.html" title="Linux kernel workflow with Git" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>6</thr:total><feedburner:origLink>http://www.vflare.org/2009/09/linux-kernel-workflow-with-git.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-4796709245902361737</id><published>2009-06-23T10:28:00.002-07:00</published><updated>2009-07-25T00:33:39.538-07:00</updated><title type="text">Government plans to scrap UGC, AICTE</title><content type="html">&lt;p align="justify"&gt;&lt;a href="http://lh4.ggpht.com/_zR-Lx8KguFc/SkEQpuq8-FI/AAAAAAAABKM/uxqpw_kfNQ4/s1600-h/Yashpal%5B4%5D.jpg"&gt;&lt;img style="border: 0px none ; display: inline; margin-left: 0px; margin-right: 0px;" title="Yashpal" alt="Yashpal" src="http://lh5.ggpht.com/_zR-Lx8KguFc/SkEQuMrT4NI/AAAAAAAABKQ/zFfXVEHa4Yc/Yashpal_thumb%5B2%5D.jpg?imgmax=800" align="right" border="0" height="92" width="109" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt; In an attempt to cleanup the mess of Indian higher education, Yashpal Committee, whose report is to be given to HRD minister on Wednesday, has suggested scrapping  UGC, AICTE – to be replaced by a super regulator: a seven member &lt;em&gt;Commission for Higher Education and Research (CHER)&lt;/em&gt;. Other suggestions include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;IITs and IIMs should be encouraged to diversify and expand their scope to work as full-fledged universities.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;A national testing scheme for university admissions on the lines of GRE which would be open to all aspirants and would be held more than once a year.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Identify India's 1,500 top colleges to upgrade them as universities.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Complete ban on further grant of “deemed university” status to “education shops” .&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Teachers should have the freedom to design courses and students should be able to study &lt;span style="color:#000000;"&gt;subjects outside their courses. &lt;em&gt;Wow!&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt; &lt;span style="color:#000000;"&gt;&lt;/span&gt;  &lt;p align="justify"&gt;Of the seven members of the proposed CHER, one would be an eminent professional from the world of industry. Chairperson and members will be selected by a committee headed by the PM, Leader of Opposition and the Chief Justice of India. Commission will have five divisions dealing with future directions, accreditation management, funding and development and new institutions. An eminent individual will head each division for five years.   &lt;br /&gt;  &lt;br /&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Let’s hope that these recommendations will be accepted &lt;em&gt;and&lt;/em&gt; implemented. This will surely reduce India’s &lt;em&gt;junk-grads-per-year&lt;/em&gt; output.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/GfCvaX2dN7I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/4796709245902361737/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/06/government-plans-to-scrap-ugc-aicte.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/4796709245902361737" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/4796709245902361737" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/GfCvaX2dN7I/government-plans-to-scrap-ugc-aicte.html" title="Government plans to scrap UGC, AICTE" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_zR-Lx8KguFc/SkEQuMrT4NI/AAAAAAAABKQ/zFfXVEHa4Yc/s72-c/Yashpal_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.vflare.org/2009/06/government-plans-to-scrap-ugc-aicte.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-7720567831253610453</id><published>2009-06-19T23:25:00.002-07:00</published><updated>2010-03-24T20:54:00.315-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title type="text">Fedora 11 on ThinkPad W500</title><content type="html">&lt;p&gt;This was the release I was waiting for! The installation was a bit of a trouble but it was surely worth the effort. Its really the first Fedora release that I really liked. Its stable, has good hardware support and boots really quickly (&amp;lt;20 seconds on my system).&lt;/p&gt;  &lt;p&gt;In my case, Windows 7 RC was already installed on one partition, so Fedora 11 (x64) was installed in second partition. So, now I have dual boot configuration – the windows boot loader presents option to continue booting windows or launch GRUB from Linux partition. I didn’t want GRUB to be present in MBR as I experiment a lot with Linux system – so, its better if I have a working system even if I blow up Linux installation :)&lt;/p&gt;  &lt;p&gt;The installation was smooth except for the disk partitioning step. Anaconda kept crashing while creating partitions. After a few attempts, I finally got this partitioning scheme:&lt;/p&gt;  &lt;table border="1" cellpadding="2" cellspacing="0" width="557"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td width="247"&gt;&lt;strong&gt;Partition&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="113"&gt;&lt;strong&gt;Mount point&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="102"&gt;&lt;strong&gt;FS type&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="93"&gt;&lt;strong&gt;Size&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="247"&gt;/dev/sda5&lt;/td&gt;        &lt;td width="113"&gt;/boot&lt;/td&gt;        &lt;td width="102"&gt;ext3&lt;/td&gt;        &lt;td width="93"&gt;200M&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="247"&gt;/dev/sda6&lt;/td&gt;        &lt;td width="113"&gt;NA&lt;/td&gt;        &lt;td width="102"&gt;Linux LVM&lt;/td&gt;        &lt;td width="93"&gt;43G&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="247"&gt;&lt;span style="font-size:85%;"&gt;           &lt;p&gt;/dev/mapper/vg_vflare-lv_root&lt;/p&gt;         &lt;/span&gt;&lt;/td&gt;        &lt;td width="113"&gt;/&lt;/td&gt;        &lt;td width="102"&gt;ext4&lt;/td&gt;        &lt;td width="93"&gt;36G&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="247"&gt;&lt;span style="font-size:85%;"&gt;           &lt;p&gt;/dev/mapper/vg_vflare-lv_swap&lt;/p&gt;         &lt;/span&gt;&lt;/td&gt;        &lt;td width="113"&gt;swap&lt;/td&gt;        &lt;td width="102"&gt;swap&lt;/td&gt;        &lt;td width="93"&gt;~6G&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;strong&gt;/boot FS type has to be ext3. Its not allowed to be ext4.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Package selection step was smooth (as usual I selected KDE). Then comes boot loader options. I selected boot loader to be installed on first sector of boot partition (/dev/sda5 here), so I can later configure Windows boot loader to load Linux.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The system failed to boot after installation! &lt;/strong&gt;For some mysterious reasons Linux installation overwrote MBR even though I selected Linux boot loader to be installed on boot partition. Fortunately, the recovery was easy. I rebooted with Windows 7 DVD and it presented Repair Windows –&amp;gt; Startup Recovery option which allowed recovering the MBR. This at least allowed Windows to boot again. Phew! But now, there was not trace of Linux. We have to now setup Windows to dual boot Linux.&lt;/p&gt;  &lt;h2&gt;Setting up Win7 and Fedora dual booting&lt;/h2&gt;  &lt;p&gt;Win7 uses something called BCD (Boot Configuration Data) to manage boot loader related stuff. With Windows XP you could simply extract first 512 bytes from Linux boot partition using ‘dd’ command, save this file in ‘C:\’ and add an entry for this boot sector file in ‘C:\boot.ini’ file. However, with BCD things are bit complex – boot.ini no longer exists. After lot of googling and experimentation I could not figure out how to add entry for Linux in Win7 boot loader.&lt;/p&gt;  &lt;p&gt;Finally, I found a program called &lt;a href="http://neosmart.net/forums/showthread.php?t=642" target="_blank"&gt;EasyBCD 2.0 beta&lt;/a&gt; (‘stable’ version of EasyBCD didn’t work). This program allows adding Linux as one of entries in Windows boot loader:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_zR-Lx8KguFc/SjyA5z8mnxI/AAAAAAAABJ8/nVADXzPPzqk/s1600-h/EasyBCD%5B1%5D.png"&gt;&lt;img style="border: 0px none; display: inline;" title="EasyBCD" alt="EasyBCD" src="http://lh6.ggpht.com/_zR-Lx8KguFc/SjyA7qljFpI/AAAAAAAABKE/xQp5dc4E0kU/EasyBCD_thumb%5B1%5D.png?imgmax=800" border="0" height="484" width="573" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;While adding the entry, select Linux boot partition from ‘Devices’ list. In above case, Partition 4 is the boot partition. Remember that /boot partition is only 200MB and only ‘Partition 4’ is listed as ‘0 GB’, so we can guess that this the one we need to select. I selected the entry name as ‘NeoSmart Linux native’ but you can be smarter and call it ‘Fedora 11’ or something.&lt;/p&gt;  &lt;p&gt;Once the entry is added, you will see it listed as one of Windows boot loader boot options. Selecting it will take you to GRUB installed on the Linux boot partition. That’s it!&lt;/p&gt;  &lt;h2&gt;Into the Linux&lt;/h2&gt;  &lt;p&gt;Fedora is now up and running natively. Everything worked out of box. Wireless network detected, suspend and hibernation worked perfectly. The KDE 4.2 looks simply awesome!&lt;/p&gt;  &lt;p&gt;Only thing that’s a bit annoying is that tapping on touchpad is not detected as a click. Till now I haven’t found a solution for this. Also, this system has switchable graphics (ATI FireGL 5700 / Intel integrated crap). I have set integrated Intel graphics card as default in BIOS, so I don’t how well ATI plays with this version of Fedora.&lt;/p&gt;  &lt;h2&gt;Next Steps&lt;/h2&gt;  &lt;p&gt;As expected from a Linux box, MP3 and tons of video formats do not play by default. With Fedora 11, fortunately its now almost trivial to get these working.&lt;/p&gt;  &lt;p&gt;First you need to add rpmfusion-{free, nonfree} repositories as &lt;a href="http://rpmfusion.org/Configuration" target="_blank"&gt;shown here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;For MP3 support:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;yum install audacious* # if you use &lt;a href="http://audacious-media-player.org/" target="_blank"&gt;Audacious audio player&lt;/a&gt; (my favourite!) &lt;/li&gt;    &lt;li&gt;yum install xine* amarok* #if you use &lt;a href="http://amarok.kde.org/" target="_blank"&gt;Amarok&lt;/a&gt; (this used to be my favourite) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;For various Video formats:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;yum install smplayer* # &lt;a href="http://smplayer.sourceforge.net/" target="_blank"&gt;smplayer&lt;/a&gt; is a simple and nice video player. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This installs lots of codecs (as dependency of smplayer) to play nearly all file formats: flv, mpg, mov etc. etc.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Adobe Flash:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Since this is a 64-bit system, you need to download Flash Player 10 pre-release from here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://labs.adobe.com/downloads/flashplayer10.html"&gt;http://labs.adobe.com/downloads/flashplayer10.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;tar-unzip the file and copy the libflashplayer.so file to /usr/lib64/mozilla/plugins. Restart Firefox and test with some YouTube videos.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;DeltaRPMs:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Install &lt;a href="https://fedorahosted.org/presto/" target="_blank"&gt;yum-presto&lt;/a&gt; plugin. This causes yum to download only the ‘delta’ between two version of packages resulting in much smaller download during upgrade.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;yum install yum-presto &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;and now, upgrade all packages:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;yum upgrade –y &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Misc Notes:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;By default, KDE4 Konsole does not read ~/.bash_profile on startup. To do this, change Konsole Shell command (using ‘Settings –&amp;gt; Edit current profile’) to: &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;/usr/bin/bash --login&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;With default ‘Oxygen’ style, its difficult to distinguish active and inactive windows. So, my personal preference is to use ‘Plastique’ style which looks much better and is easier on eyes. &lt;/li&gt;    &lt;li&gt;To get that Lion (‘leonidas’) wallpaper :) &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;yum install leonidas-backgrounds*&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/fBu4p0qirWU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/7720567831253610453/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/06/fedora-11-on-thinkpad-w500.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/7720567831253610453" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/7720567831253610453" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/fBu4p0qirWU/fedora-11-on-thinkpad-w500.html" title="Fedora 11 on ThinkPad W500" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_zR-Lx8KguFc/SjyA7qljFpI/AAAAAAAABKE/xQp5dc4E0kU/s72-c/EasyBCD_thumb%5B1%5D.png?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://www.vflare.org/2009/06/fedora-11-on-thinkpad-w500.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-2973978503138413496</id><published>2009-05-10T01:39:00.002-07:00</published><updated>2009-06-19T21:11:24.256-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><title type="text">Windows 7 RC on ThinkPad W500</title><content type="html">&lt;p&gt;Today I replaced Vista (32-bit) on my Thinkpad W500* with shiny new Windows 7 RC (64-bit). Now just waiting for &lt;a href="https://fedoraproject.org/wiki/Releases/11/Schedule"&gt;Fedora 11&lt;/a&gt; to be released for dual boot with Windows – yeah, sometimes Virtual Machine is not enough!&lt;/p&gt;  &lt;p&gt;In summary, Win7 is just awesome! Installation went smooth. Post-install some problems I faced:&lt;/p&gt;  &lt;p&gt;- &lt;strong&gt;Switchable graphics didn’t work&lt;/strong&gt;. However, ATI card works normally with switchable graphics driver (for Vista64) from Lenovo site. But since switchable graphics does not work, you have to set BIOS to use Discrete Graphics as default. I’m not much into computer gaming (occasionally NFS MW, AOE), so I have just set BIOS to Integrated Graphics considering I’m going to dual-boot with Linux once Fedora 11 is released (Linux and ATI are not good buddies).&lt;/p&gt;  &lt;p&gt;- &lt;strong&gt;Fingerprint device didn’t work&lt;/strong&gt;. Tried Fingerprint driver for Vista64 from Lenovo site but installer bails out with error “Lenovo Fingerprint Software is not supported on this version of Windows”. Didn’t try any further – its not so important :)&lt;/p&gt;  &lt;p&gt;- &lt;strong&gt;Few Software incompatibility issues&lt;/strong&gt;: MagicDisk could not mount ISO (and any other disk image) files. So, currently I have no way to mount such images. Again, not a showstopper. All “essential” stuff works perfectly – Firefox 3, Thunderbird 2, VMware Workstation 6.5.2, Sun VirtualBox 2.2.2, Vim 7.2 (failed to add “Edit with Vim” context menu entry), Visual Studio 2008, Adobe Reader 9, VideoLAN 0.9.9, Office 2007.&lt;/p&gt;  &lt;p&gt;Keeping aside above problems, system seems much more responsive than (pre-installed) Vista crap – primarily I think due to full use of 4G RAM (pre-installed was Vista 32-bit. eh!). Startup is fast – Login screen appears within ~30 secs. Shutdown has “Force Shutdown” option – so if something is stuck during shutdown, you have option to kill that pig and proceed with shutdown. Neat.&lt;/p&gt;  &lt;p&gt;Overall, this RC is impressive and really, this is how Vista should have been. There is nothing even remotely radical in Win7 over Vista/XP but surely good step forward in terms of performance and stability.&lt;/p&gt;  &lt;p&gt;* Configuration: Intel Core 2 Duo (T9600, 2.8GHz), RAM: 4G, Win7 partition: 132G (~35G for Linux), Video: Switchable Graphics (Intel 45 Express + ATI FireGL V5700), Display: WUXGA (1920x1200), Wireless: Intel 5300AGN.&lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/vflare/~4/wuuAV97VnqA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/2973978503138413496/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/05/windows-7-rc-on-thinkpad-w500.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/2973978503138413496" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/2973978503138413496" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/wuuAV97VnqA/windows-7-rc-on-thinkpad-w500.html" title="Windows 7 RC on ThinkPad W500" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.vflare.org/2009/05/windows-7-rc-on-thinkpad-w500.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-677378037029965385</id><published>2009-03-19T14:40:00.006-07:00</published><updated>2010-06-06T14:38:58.976-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title type="text">ccache to speed-up Linux kernel compile</title><content type="html">In case you are unfamiliar with ccache, its a "compiler cache". Compiling is primarily CPU intensive task. So, ccache caches compiled objects - so next time we compile same code, it reuses these objects thereby &lt;span style="font-weight: bold;"&gt;significantly&lt;/span&gt; speeding-up compilation.&lt;br /&gt;&lt;br /&gt;I need to recompile Linux kernel usually several times a day, with different permutations of config settings. This almost forces a 'make clean' or 'make mrproper' which deletes all compiled objects in build tree and then we have to rebuild everything all over again. This takes enormous amount of time. ccache comes to rescue! I'm surprised why I didn't use it earlier.&lt;br /&gt;&lt;br /&gt;To use ccache to speedup Linux kernel compile, all I had to do was '&lt;span style="font-weight: bold;"&gt;yum install ccache&lt;/span&gt;' on Fedora10 system. This automatically created all needed symlinks and PATH setting. After this do make O=build bzImage; make O=build modules as usual. First time you won't notice any speed gain as ccache is simply building up its cache. Subsequently doing a rebuild 'make clean; make' will be significantly faster&lt;br /&gt;To monitor ccache stats, do:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ccache -s&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;sample output:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;cache directory                    /home/ngupta/.ccache&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;cache hit                        521&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;cache miss                       729&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;called for link                  37&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;preprocessor error               1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;not a C/C++ file                 895&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;autoconf compile/link            131&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;no input file                    766&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;files in cache                   1458&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;cache size                       92.7 Mbytes&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;max cache size                   976.6 Mbytes&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;(Ah! how to stop blogger from messing with formatting!)&lt;br /&gt;&lt;br /&gt;If you see cache hits not increasing while you are compiling (and this is not the first compile), this might mean that ccache currently contains useless compiled objects. In such cases, if cache size is already near max cache size, its better to clean-up ccache with:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ccache  -c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and reset stats with:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ccache  -z&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and lastly, you can set limit on disk size used by ccache using:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ccache  -M &lt;maxsize&gt;&lt;/maxsize&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;e.g. ccache -M 1G sets max size to 1 GB – similarly you can use K, M or G suffix to specify size.&lt;br /&gt;&lt;br /&gt;Happy compiling!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;UPDATE&lt;/span&gt;&lt;br /&gt;On Fedora-13 system, the PATH is not automatically set after 'yum install ccache'. However, symlinks from ccache to compiler names are still created. So, you just need to add /usr/lib64/ccache to your PATH manually.&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/Lx5Pqgf61vU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/677378037029965385/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/03/ccache-to-speed-up-linux-kernel-compile.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/677378037029965385" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/677378037029965385" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/Lx5Pqgf61vU/ccache-to-speed-up-linux-kernel-compile.html" title="ccache to speed-up Linux kernel compile" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.vflare.org/2009/03/ccache-to-speed-up-linux-kernel-compile.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-1673363165722946877</id><published>2009-03-18T18:08:00.002-07:00</published><updated>2009-03-18T18:29:23.488-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title type="text">SLOB memory allocator</title><content type="html">&lt;div class="moz-text-flowed" style="font-family: -moz-fixed; font-size: 16px;" lang="x-western"&gt;Linux kernel has few SLAB allocator variants included: SLAB, SLUB and SLOB. Of these, SLOB is especially meant to be used on embedded devices -- it tries to be more memory space efficient than other SLAB variants.&lt;br /&gt;&lt;br /&gt;Yesterday, I had a detailed look at SLOB allocator for possible use in &lt;a href="http://code.google.com/p/compcache/"&gt;compcache poject&lt;/a&gt; and found it unacceptable for the purpose. I did it in response to feedback on &lt;a href="http://code.google.com/p/compcache/wiki/xvMalloc"&gt;xvmalloc&lt;/a&gt; allocator -- as part of compcache patches posted of inclusion in mainline Linux kernel:&lt;br /&gt;http://lkml.org/lkml/2009/3/17/116&lt;br /&gt;&lt;br /&gt;The requirement of this project is allocation of large no. of randomly sized objects in range [32, f * PAGE_SIZE] where fraction 'f' is typically 3/4 and PAGE_SIZE 4Kb.&lt;br /&gt;&lt;br /&gt;To begin with, SLOB maintains just 3 freelists:&lt;br /&gt; - for size &lt; 256     - free_slob_small&lt;br /&gt; - [256, 1024)        - free_slob_medium&lt;br /&gt; - [1024, PAGE_SIZE)  - free_slob_large&lt;br /&gt;&lt;br /&gt;It allocates from one of these lists depending on size requested.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why SLOB is bad: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1) &lt;span style="font-weight: bold;"&gt;O(n) allocation:&lt;/span&gt;&lt;br /&gt;To find block of given size, it &lt;span class="moz-txt-underscore"&gt;&lt;span class="moz-txt-tag"&gt;_&lt;/span&gt;linearaly&lt;span class="moz-txt-tag"&gt;_&lt;/span&gt;&lt;/span&gt; scans corresponding free list to find a page with &lt;span class="moz-txt-underscore"&gt;&lt;span class="moz-txt-tag"&gt;_&lt;/span&gt;total&lt;span class="moz-txt-tag"&gt;_&lt;/span&gt;&lt;/span&gt; free space &gt;= requested size. This free space might not be contiguous. So it runs through free blocks within each such candidate page until it finally finds some page with free contiguous area &gt;= requested size.&lt;br /&gt;&lt;br /&gt;2) &lt;span style="font-weight: bold;"&gt;Fragmentation:&lt;/span&gt; When growing SLOB cache, page is added to one of 3 freelists (depending on what size we are currently allocating). After this, this page can never move to any other list - even if its free space drops down to fall in next range below or vice versa. This has two problems:&lt;br /&gt;  - Potentially large wastage due to "page internal fragmentation": e.g.: alloc(3096) is satisfied from a page in 'large free list'. Now it has 1000b free (assuming 4k page) which will now never be used.&lt;br /&gt;  - It can trigger unnecessary cache grows: e.g.: even though we have such unfilled pages in 'large' list, allocation in 'small' range can still cause cache grow if 'small free list' is empty.&lt;br /&gt;&lt;br /&gt;3) It only allocates from "low memory". This is clearly not acceptable for compcache on 32-bit systems.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/XWUCpv5pEdU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/1673363165722946877/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/03/slob-memory-allocator.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/1673363165722946877" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/1673363165722946877" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/XWUCpv5pEdU/slob-memory-allocator.html" title="SLOB memory allocator" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.vflare.org/2009/03/slob-memory-allocator.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-1941946822939991355</id><published>2009-03-18T17:56:00.003-07:00</published><updated>2009-03-18T18:05:03.884-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><title type="text">Tag files on windows</title><content type="html">All GMail addicts know power of tags! Surprisingly, today's systems have none/limited tag functionality for files. Fortunately I found this freeware for windows which lets you tag almost any filetype. Interface is really good with shell integration and search based on tags is fast too. A real life saver!&lt;br /&gt;&lt;br /&gt;You can get it from:&lt;br /&gt;http://www.tag2find.com/&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/zSOtXlUxoeI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/1941946822939991355/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/03/tag-files-on-windows.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/1941946822939991355" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/1941946822939991355" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/zSOtXlUxoeI/tag-files-on-windows.html" title="Tag files on windows" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.vflare.org/2009/03/tag-files-on-windows.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-6034007386392409904</id><published>2009-03-18T17:48:00.001-07:00</published><updated>2009-03-18T17:50:26.701-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title type="text">Anti-tip of the month</title><content type="html">Very old but still as relevant... and very interesting too! Directly go to "anti-tip" section of &lt;a href="http://www.mactech.com/articles/mactech/Vol.11/11.10/Oct95Tips/index.html"&gt;this article&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"The moral of the story is: don’t get tricky. C programmers often try to minimize the number of lines of C in their program without consideration for what the compiler will generate. When in doubt, write clear code and give the optimizer a chance to maximize performance. Look at the compiler output. Your code will be easier to debug and probably faster too."&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/5AI0yvhCfUs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/6034007386392409904/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/03/anti-tip-of-month.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/6034007386392409904" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/6034007386392409904" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/5AI0yvhCfUs/anti-tip-of-month.html" title="Anti-tip of the month" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.vflare.org/2009/03/anti-tip-of-month.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-6344322970851471791</id><published>2009-03-18T17:35:00.006-07:00</published><updated>2009-03-18T17:54:59.331-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title type="text">Fedora 10 instability issue solved!</title><content type="html">One of my Fedora 10 systems used to freeze very frequently. After lot of looking around I found its because of "KWin Composing" which gives OpenGL driven special effects for desktop. Unfortunately, Linux has always been bad at radeon drivers, so it better to disable these effects especially if you have radeon video cards.&lt;br /&gt;&lt;br /&gt;in ~/.kde/share/config/kwinrc:&lt;br /&gt;&lt;br /&gt;in [Compositing] section change&lt;br /&gt;Enabled=true to Enabled=false.&lt;br /&gt;&lt;br /&gt;Reboot after this change. Now I never get any system freeze - as is expected from solid Linux system :)&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/pOe0pE5nGp4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/6344322970851471791/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/03/fedora-10-instability-issue-solved.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/6344322970851471791" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/6344322970851471791" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/pOe0pE5nGp4/fedora-10-instability-issue-solved.html" title="Fedora 10 instability issue solved!" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.vflare.org/2009/03/fedora-10-instability-issue-solved.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-3949578784082550466</id><published>2009-03-18T17:35:00.003-07:00</published><updated>2009-03-18T17:41:28.732-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="nostalgia" /><title type="text">Remember Windows 95 CD sampler ??</title><content type="html">I still remember my first "multimedia capable" system with Windows 95! Best part was "Interactive CD Sampler" that shipped on Win95 CD. It was collection of some videos and small games. These were very special to me and got me excited about computers :)&lt;br /&gt;&lt;br /&gt;I digged nearly all of those videos on youtube and prepared this &lt;a href="http://www.youtube.com/watch?v=aCSd3qhkEoo&amp;amp;feature=PlayList&amp;amp;p=65F87919D4EA6146&amp;amp;index=0&amp;amp;playnext=1"&gt;playlist&lt;/a&gt;.&lt;br /&gt;Enjoy!&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/Yoca5kd6riE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/3949578784082550466/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/03/remember-windows-95-cd-sampler.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/3949578784082550466" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/3949578784082550466" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/Yoca5kd6riE/remember-windows-95-cd-sampler.html" title="Remember Windows 95 CD sampler ??" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.vflare.org/2009/03/remember-windows-95-cd-sampler.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-6835368961995129274</id><published>2009-03-13T05:30:00.000-07:00</published><updated>2009-03-15T07:34:44.585-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="research" /><category scheme="http://www.blogger.com/atom/ns#" term="memory" /><category scheme="http://www.blogger.com/atom/ns#" term="compression" /><title type="text">Difference Engine: Harnessing Memory Redundancy in Virtual Machines</title><content type="html">Here is link to paper (&lt;a href="http://www.usenix.org/events/osdi08/tech/full_papers/gupta/gupta.pdf"&gt;pdf&lt;/a&gt;) (&lt;a href="http://www.usenix.org/media/events/osdi08/tech/mp3s/gupta.mp3"&gt;MP3&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Recently I came across this paper published in &lt;a href="http://www.usenix.org/events/osdi08/"&gt;OSDI '08&lt;/a&gt;. Its an extension to VMware's page-sharing and shows some amazing and &lt;span style="font-weight: bold;"&gt;hard to believe&lt;/span&gt; results. VMware page-sharing mechanism scans memory for all VMs and maps pages with &lt;span style="font-weight: bold;"&gt;same&lt;/span&gt; contents to a single page. This achieves memory savings if multiple VMs are hosted running same OS. However, with technique discussed in this paper, we find pages that are &lt;span style="font-weight: bold;"&gt;nearly same&lt;/span&gt;. For such pages, they save a &lt;span style="font-style: italic;"&gt;base page&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;/span&gt;and other similar pages as &lt;span style="font-style: italic;"&gt;delta&lt;/span&gt; of original page. For pages which are not similar to any other page are simply compressed. Their benchmarks shows upto 45% more memory saving over ESX page-sharing under some (specially crafted) workload.&lt;br /&gt;&lt;br /&gt;The idea is surely very interesting but I have serious doubts if it really will be that effective for real workload. Below I give my notes on this paper and some possible extensions to this work.&lt;br /&gt;&lt;br /&gt;Following notes refer to paper extensively. So keep the paper handy while reading these (link to paper in beginning of this post).&lt;br /&gt;&lt;h2 id="Notes"&gt;Notes&lt;/h2&gt; &lt;span class="anchor" id="line-5"&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Page Sharing (for identical pages) by DE itself is much more efficient than that of ESX (with scan rate of 10,000 pages/sec). See Fig 9 and 11 in particular. After long run, ESX eventually catches up but saving is much inferior *during* benchmark. &lt;span class="anchor" id="line-6"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;For all 3 "real world" workloads (ident, MIXED-1, MIXED-2), memory saving contribution of page sharing for DE in just first few seconds is nearly 30-50%. This looks too good to be real. &lt;span class="anchor" id="line-7"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;They don't show data for any of real workloads where only *one* of mem saving mechanisms is active. We compress only the pages that are not "similar" to any other page - what are perf numbers if all pages were compressed? They only show contribution of individual methods (page sharing, delta for similar pages, compression for unique pages) but not the effect of individual methods working alone. &lt;span class="anchor" id="line-8"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;They show effect of individual methods for artificial workloads (Fig 5, 6, 7). Fig 7(b) shows big savings with patching. However this is case where pages are 95% "similar". Author has not noted in what terms they are similar. Are changes confined to end of page, beginning or at random offsets? For each of these cases patching algorithm can give significantly different patch sizes. &lt;span class="anchor" id="line-9"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-10"&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="line867"&gt; &lt;/p&gt;&lt;h2 id="Comments"&gt;Comments&lt;/h2&gt; &lt;span class="anchor" id="line-11"&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Nothing can guarantee good saving for any arbitrary workload. Authors choice of "real world" mixed workload however looks good. Proper performance evaluation with these mixed workloads should be good enough to show strength of DE however this is not done properly in this paper as noted above. &lt;/li&gt;&lt;li&gt;&lt;p class="line862"&gt;DE used &lt;a class="http" href="http://code.google.com/p/xdelta/"&gt;xdelta&lt;/a&gt; for patching. A far more superior algorithm for this is &lt;a class="http" href="http://www.daemonology.net/bsdiff/"&gt;bsdiff&lt;/a&gt; but this is has much higher mem/CPU requirements. Maybe work on more efficient variation is worth it. &lt;span class="anchor" id="line-13"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p class="line862"&gt;Lots of performance numbers comparing different patching algorithms can be found in this thesis. &lt;a class="http" href="http://www.daemonology.net/papers/thesis.pdf"&gt;(pdf)&lt;/a&gt; &lt;span class="anchor" id="line-14"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;Some data transforms are expected to significantly increase memory savings without much additional CPU overhead (see Future Work). &lt;span class="anchor" id="line-15"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-16"&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="line867"&gt; &lt;/p&gt;&lt;h2 id="Conclusion"&gt;Conclusion&lt;/h2&gt; &lt;span class="anchor" id="line-17"&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Paper does not conclusively proves that data de-duplication gives significant space savings over compression alone even for its sample "real world" apps. &lt;span class="anchor" id="line-18"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-19"&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="line867"&gt; &lt;/p&gt;&lt;h2 id="FutureWork"&gt;Future Work&lt;/h2&gt; &lt;span class="anchor" id="line-20"&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Collect suspend images of various VMs with mixed workloads (similar to this paper) and check effectiveness of these cases: &lt;span class="anchor" id="line-21"&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;share identical pages only &lt;span class="anchor" id="line-22"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;delta encode similar pages only (with sharing of ident pages) &lt;span class="anchor" id="line-23"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;compress individual pages only &lt;span class="anchor" id="line-24"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;All combined (showing individual contributions here). &lt;span class="anchor" id="line-25"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-26"&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li class="gap"&gt;Compare different patching algorithms in above cases. &lt;span class="anchor" id="line-27"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Redundancy can be artificially created: BWT# transform followed by MTF# encoding is known to generate redundancy for various kinds of data. So, I expect more effective data de-duplication with following modification to DE: &lt;span class="anchor" id="line-28"&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="line874"&gt;# BWT (Burrows-Wheeler transform)&lt;/p&gt;&lt;p class="line874"&gt;# MTF (Move-to-front) &lt;/p&gt;&lt;p class="line867"&gt;&lt;span class="anchor" id="line-32"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-33"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-34"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-35"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-36"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-37"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-38"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-39"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-40"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-41"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-42"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-43"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-44"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-45"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-46"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-47"&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre style="font-family: courier new;"&gt;// This function is called after search&lt;br /&gt;// for *identical* page fails.&lt;br /&gt;EncodePage(page)&lt;br /&gt;{&lt;br /&gt;P1 = BWT(page)&lt;br /&gt;P2 = MTF(P1)&lt;br /&gt;// Typically two keys per page&lt;br /&gt;keySet[] = Fingerprint(P2)&lt;br /&gt;Psim = (&lt;br /&gt;       Find Page with at least&lt;br /&gt;       one key matching with keySet[]&lt;br /&gt;    )&lt;br /&gt;if (Psim) {&lt;br /&gt; // bsdiff - or some variation&lt;br /&gt; // (better than xdelta used in DE)&lt;br /&gt; DeltaEncode(P2, Psim)&lt;br /&gt;} else {&lt;br /&gt; // Expected must higher compressibility&lt;br /&gt; // due to BWT+MTF already applied&lt;br /&gt; CompressPage(P2)&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DecodePage(encodedPage) - BWT is reversible!&lt;/pre&gt;&lt;span class="anchor" id="line-48"&gt;&lt;/span&gt;&lt;span class="anchor" id="line-49"&gt;&lt;/span&gt;BWT+MTF create more redundancy within each page and hence is expected to create more redundancy across pages. There is already a compression utility &lt;a class="http" href="http://rzip.samba.org/"&gt;rzip&lt;/a&gt; that exploits this. Among other things, it applies BWT+MTF and then compresses using global dictionary. Its not useful as is but the idea can surely be used.&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/weLoaOagDko" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/6835368961995129274/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/03/difference-engine-harnessing-memory.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/6835368961995129274" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/6835368961995129274" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/weLoaOagDko/difference-engine-harnessing-memory.html" title="Difference Engine: Harnessing Memory Redundancy in Virtual Machines" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.vflare.org/2009/03/difference-engine-harnessing-memory.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-8324236518119035279.post-8500966430406914656</id><published>2009-03-12T13:01:00.001-07:00</published><updated>2009-05-10T01:43:38.500-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="research" /><category scheme="http://www.blogger.com/atom/ns#" term="memory" /><category scheme="http://www.blogger.com/atom/ns#" term="compression" /><title type="text">RAM is not enough - Memory Compression!</title><content type="html">This is my first post and what else I could start with!&lt;br /&gt;&lt;br /&gt;Memory compression has been my pet project since last 2 years. It adds a compression layer to swap path -- whatever OS swaps out will be compressed and stored in memory itself. This is huge win over swapping to slow hard-disks which are typically used for swapping. Biggest challenges are what to compress? how much to compress? how to manage compressed blocks? handling incompressible data and list goes on...&lt;br /&gt;&lt;br /&gt;This is all basically shifting load over to processor to avoid slow disks. Now in multi-core era this seems to only gain in relevance -- de/compression can be almost free if we can use all those cores smartly :)&lt;br /&gt;&lt;br /&gt;Project home:&lt;br /&gt;&lt;a href="http://code.google.com/p/compcache/"&gt;http://code.google.com/p/compcache/&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/vflare/~4/FQcKnT71LlY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.vflare.org/feeds/8500966430406914656/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.vflare.org/2009/03/ram-is-not-enough-memory-compression.html#comment-form" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/8500966430406914656" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8324236518119035279/posts/default/8500966430406914656" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/vflare/~3/FQcKnT71LlY/ram-is-not-enough-memory-compression.html" title="RAM is not enough - Memory Compression!" /><author><name>Nitin Gupta</name><uri>https://plus.google.com/105127892700311175215</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-Hwdn9pIN7UI/AAAAAAAAAAI/AAAAAAAAHLU/KAIOYLdq_lA/s512-c/photo.jpg" /></author><thr:total>8</thr:total><feedburner:origLink>http://www.vflare.org/2009/03/ram-is-not-enough-memory-compression.html</feedburner:origLink></entry></feed>
