Sunday, April 07, 2013

Upgrading Linux Kernel 3.8.6 (Stable) release in Ubuntu 12.10


Linux kernel 3.8.6 has recently released on April 05, 2013 with lots of bugfixes and improvements.

The changelog contains all the improvements and bugfixes made in the kernel.

Below mentioned are some important fixes and improvements.

    * ipv6: fix bad free of addrconf_init_net
    * net: ethernet: cpsw: fix erroneous condition in error check
    * net: fq_codel: Fix off-by-one error
    * Btrfs: fix space leak when we fail to reserve metadata space
    * Fix bug for DM9000 revision B which contain a DSP PHY
    * drm/i915: Use the fixed pixel clock for eDP in intel_dp_set_m_n()
    * ARM: kirkwood: Fix chip-delay for GoFlex Net
    * NFSv4.1: Fix a race in pNFS layoutcommit
    * iwlwifi: fix length check in multi-TB HCMD
    * Bluetooth: Fix not closing SCO sockets in the BT_CONNECT2 state
    * smsc75xx: fix jumbo frame support



We shall upgrade the default kernel version 3.5.0-17.28 shipped with Ubuntu 12.10 to 3.8.6-030806.

Download the script to perform an automated kernel upgrade process.

Now open the terminal and run the below command from the folder where script is downloaded to make it executable.
$ sudo chmod +x ker-upg-3.8.6.sh

$ sudo sh ker-upg-3.8.6.sh

After the completion, reboot the system for the changes to take effect and after reboot run the below command to confirm the version.

$ uname -r

In case if the kernel 3.8.6 is not compatible with your system hardware, then run the below command to remove the kernel 3.8.6 and switch back to previous kernel.

$ sudo apt-get purge linux-image-3.8.5-030805

Monday, April 01, 2013

Upgrading Linux Kernel 3.8.5 (Stable) release in Ubuntu 12.10


Linux kernel 3.8.5 has recently released on March 28, 2013 with lots of bugfixes and improvements.

The changelog contains all the improvements and bugfixes made in the kernel.

Below mentioned are some important fixes and improvements.

* drm/radeon: fix backend map setup on 1 RB trinity boards
    * drm/radeon: fix S/R on VM systems (cayman/TN/SI)
    * ARM: tegra: fix register address of slink controller
    * target/iscsi: Fix mutual CHAP auth on big-endian arches
    * rtlwifi: rtl8192cu: Fix problem that prevents reassociation
    * rtlwifi: rtl8192cu: Fix schedule while atomic bug splat
    * ALSA: hda - Fix typo in checking IEC958 emphasis bit
    * ALSA: hda/cirrus - Fix the digital beep registration
    * vhost/net: fix heads usage of ubuf_info
    * tcp: fix skb_availroom()
    * ipv4: fix definition of FIB_TABLE_HASHSZ
    * USB: EHCI: fix regression in QH unlinking
    * udf: Fix bitmap overflow on large filesystems with small block size
    * x86-64: Fix the failure case in copy_user_handle_tail()
    * nfsd: fix bad offset use
    * MD RAID5: Fix kernel oops when RAID4/5/6 is used via device-mapper
    * IPoIB: Fix send lockup due to missed TX completion
    * ext4: fix data=journal fast mount/umount hang


We shall upgrade the default kernel version 3.5.0-17.28 shipped with Ubuntu 12.10 to 3.8.5-030805.

Download the script to perform an automated kernel upgrade process.

Now open the terminal and run the below command from the folder where script is downloaded to make it executable.
$ sudo chmod +x ker-upg-3.8.5.sh

$ sudo sh ker-upg-3.8.5.sh

After the completion, reboot the system for the changes to take effect and after reboot run the below command to confirm the version.

$ uname -r

In case if the kernel 3.8.5 is not compatible with your system hardware, then run the below command to remove the kernel 3.8.5 and switch back to previous kernel.

$ sudo apt-get purge linux-image-3.8.5-030805

Upgrading Linux Kernel 3.8.4 (Stable) release in Ubuntu 12.10


Linux kernel 3.8.4 has recently released on March 20, 2013 with lots of bugfixes and improvements.

The changelog contains all the improvements and bugfixes made in the kernel.

Below mentioned are some important fixes and improvements.

* ALSA: seq: Fix missing error handling in snd_seq_timer_open()
* tty: serial: fix typo "SERIAL_S3C2412"
* ext3: Fix format string issues
* USB: storage: fix Huawei mode switching regression
* USB: cdc-wdm: fix buffer overflow
* dcbnl: fix various netlink info leaks
* rtnl: fix info leak on RTM_GETLINK request for VF devices
* vxlan: fix oops when delete netns containing vxlan
* tcp: fix double-counted receiver RTT when leaving receiver fast path
* ARM: davinci: edma: fix dmaengine induced null pointer dereference on da830
* ARM: w1-gpio: fix erroneous gpio requests
* powerpc: Fix cputable entry for 970MP rev 1.0

We shall upgrade the default kernel version 3.5.0-17.28 shipped with Ubuntu 12.10 to 3.8.4-030804.

Download the script to perform an automated kernel upgrade process.

Now open the terminal and run the below command from the folder where script is downloaded to make it executable.
$ sudo chmod +x ker-upg-3.8.4.sh

$ sudo sh ker-upg-3.8.4.sh

After the completion, reboot the system for the changes to take effect and after reboot run the below command to confirm the version.

$ uname -r

In case if the kernel 3.8.4 is not compatible with your system hardware, then run the below command to remove the kernel 3.8.4 and switch back to previous kernel.

$ sudo apt-get purge linux-image-3.8.4-030804

Installing BFQ I/O Scheduler using Liquorix Kernel


The operating system is said to be stable when both the software and hardware of a machine or a system go parallel hand in hand. Your favorite operating system or the best hardware that you opt for alone cannot outperform to provide the best performance. Hence, if we choose for the best hardware we have to tune the operating system that we install to run efficiently on that hardware.

Optimizing an operating system requires tuning of various parameters. These parameters are a part of various software that an operating system is built of. Hence tuning of all the parameters to their appropriate values as required by the user to get the best performance gives the best overall performance of the system.

One of the most important factors to regulate the system's overall performance is “Disk I/O Scheduler”. People normally wonder that their system under performs even though they have latest processor, a fast spinning hard disk and huge RAM, this is where the I/O schedulers play their role particularly under heavy work loads. By “heavy work loads” I mean to say that I can be running 3 virtual machines, copying a Ubuntu iso file from host to guest, reading a document, there's also an audio playing in the background, and web browser in which I might be sending some mails. This might be too much to handle for the operating system, I might face slow response from the web browser or I might also get some trouble hearing the song. This is where you will find the disk I/O scheduler being a little laggy.

Disk I/O is mainly categorized into sequential I/O and random I/O. Sequential involves operating on one block immediately after it's neighbor  In this type of I/O there is very little effect on the response time as the disk drive head has to do the least work in moving from one location to another. Whereas the random I/O, on the other hand, involves large numbers of seeks and rotations, which is usually much slower. We can know if our disk I/O scheduler is sequential or random by determining the “average request size” of each I/O operation. The “avgrq-sz” column from iostat output shows the average request size per I/O operation. If the average size per I/O operation is 16KB or less then it is random disk I/O and if it is greater than 128KB then it is sequential disk I/O. The below command shows average request size.

Every operating system has a special software to communicate directly with the computer's hardware called “kernel” and I/O scheduler is the part of the kernel that handles read / write access to block storage devices. It may be a a USB stick, local hard disk, or network file system or any other storage environment that holds data in blocks. In short I/O scheduler is the guy who decides how the bandwidth of the disk has to be distributed to all of the applications simultaneously or parallely that is ultimately based on the priority of the process. A scheduler, queues and sequences the execution of read-write requests, to manage mechanical latency and optimization of data delivery performance. Latency is the seek time related to head travel around the disk. Without an I/O scheduler, Linux kernel follows FIFO (First In, First Out) algorithm which can result in hard disk crashing. For example if one process is reading from one part of disk and writing to another part of the disk that will make the head move back and forth for every operation performed. A disk I/O scheduler's main goal to optimize the disk access time.

There are four main I/O schedulers that we can find in Ubuntu namely noop, cfq, deadline and anticipatory. Since anticipatory has become obsolete, you wont find it in Ubuntu 12.04. Ubuntu 12.04 has got “CFQ” as the default I/O scheduler whereas “deadline” is default in Ubuntu 12.10.

Another such I/O scheduler is BFQ (Budget Fair Queueing) which is based on CFQ (Completely Fair Queueing). Queueing doesnt actually mean that the requests will be arranged in FIFO (First-In-First-Out) order, here queue means a container that contains or holds all the requests that need to be manipulated further. BFQ was developed by Paolo Valente, who is Assistant Professor of Computer Science at the Department of Computer Science of University of Modena.

There's more material and benchmarking tests of bfq represented graphically on HecticGeek's Website. The results are interesting enough to make anyone install it in his/her machine. You can also have a look at the video on cfq and bfq comparison posted by Paolo on Youtube.

Installation
Using Liquorix Kernel - Why drive when you can FLY?
The three most important things for a good pc is cost, security and performance. As we all know ubuntu linux is free and equally very secure. What remains is performance. For performance there are many guides available on internet. One particular way that I am always interested in is to build a custom kernel. There are also performance-focused kernels available. The Liquorix kernel and Zen kernel available at Damentz websites are built for performance enhancement. Liquorix kernel is based on zen kernel. Another major benefit of using this kernel is that it has integrated BFS (Brain Fuck Scheduler, and yes that is what it is called) which is the next best thing that money cant buy. BFS is a process scheduler developed by Con Kolivas. We will discuss BFS in detail later.

Installing Liquorix kernel is very simple. To install Liquorix kernel in Ubuntu 12.04 / 12.10 one needs to install the latest gcc using "http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main" ppa. Below shown is the screenshot to add gcc repo in Update Manager.

$ sudo apt-get update

Now install the latest gcc version. I found the latest gcc version to be 4.7 at the time of composing this post.
$ sudo apt-get install gcc-4.7 g++-4.7

$ sudo apt-get update

Install the Liquorix keyring.
$ sudo apt-get install '^liquorix-([^-]+-)?keyring.?'

$ sudo apt-get update

Search for the latest liquorix kernel available using the below command.
$ sudo apt-cache search liquorix

Now install Liquorix kernel.
$ sudo apt-get install liquorix*

After installing, set the “GRUB_TIMEOUT” parameter value to “-1” in /etc/default/grub file. After this you can see the list of kernels after rebooting the machine, where you can select the liquorix kernel to boot.

To list all the kernels installed in your system use the below mention command.
$ sudo dpkg --list | grep linux-image


There various benchmarking tools available for free like hdparm, iozone, bonnie++, phoronix test suite, stress, etc to test the performance of your system. Lastly I would say everyone must once try “BFQ” and feel the difference, though it is not yet seen in Ubuntu 12.10.