Wednesday 30 September 2009

..but it works with Windows...

When dealing with Linux kernel bugs I frequently hear the phrase "..but it works with Windows..". This can be rather galling, why can Windows work correctly when Linux seems to fail? Well, there are several reasons.

First of all, when Windows is shipped with a PC it generally has a whole load of extra drivers bundled with it to handle weird non-standard stuff, such as hotkey handling, wireless/bluetooth kill switches and so on. Some OEMs ship new PCs with the Windows install disc and a CD/DVD with all the extra drivers. Other OEMs ship PCs with a magical restore partition that installs Windows and it's extra drivers in one go to save the hassle of messing around with all the extra drivers. Sometimes these drivers just work around non-standard PC weirdness - this can be where Windows works and Linux does not.

Secondly, Linux relies on the BIOS ACPI tables being correct. For example, yesterday I looking into a bug where a N280 Atom based machine could only run at 1.333GHz when the processor is in able to run at 1.666GHz. For some reason Windows worked correctly and Linux did not. Some digging around in the BIOS and the ACPI driver showed me that the Linux ACPI driver was correctly reading the BIOS settings and it was a buggy BIOS. This seems to indicate that somehow Windows was ignoring this incorrect data. What do you do in these cases? Apart from booting with acpi=off (which is a horrible workaround) I suppose one just needs to ask for a BIOS fix to such issues.

There are other reasons too, but the first two are generally the main causes.

Over time, the kernel just gets more and more weird workaround quirks added to fix such issues - but the crux of the matter is this - Windows has the same kind of kludges but generally they are ironed out before a PC hits the high street - and a lot of these Windows kludges don't get fed back into the mainline Windows installation because it's closed source and it's easy for PC manufacturers to just add on their own hacks to the OS.

Meanwhile, I will continue to try and sort out BIOS problems and to make sure Linux works out of the box...

Sunday 27 September 2009

Netbook computing a success!

OK, I've nearly completed 2 weeks just using a Netbook and I think it's a complete success. The experiment using a HP Mini 1000 running an Alpha version of Ubuntu Karmic proved I can get by without the need of a bulky and power hungry Laptop for all my day-to-day work.

The netbook worked out especially useful while I attended Linux Plumbers in Portland. It's light, compact and I got a reasonable amount of up-time as long as I judiciously used suspend/resume.

Will I be dumping my Lenovo 3000 N200 laptop? Possibly not, but I'm convinced netbooks are the way forward for easy portable mobile computing.

Thursday 24 September 2009

Semi-Daily Summary of Kernel Development News from LKML

Jon Masters is running which provides a semi-daily summary of the Linux Kernel Mailing List (LKML) Email traffic. The site contains podcasts and audio transcripts and is a great way of keeping up to date with kernel development without having to read 10 thousand of Emails a week. Thanks Jon - great work!

Using the noop I/O scheduler

Over the past few days I've been tweaking the configuration on my HP Mini 1000 to see how to squeeze a little more performance out of this device. Today I enabled the NOOP I/O scheduler on the SSD as this improves performance a little.

Since the SSD is just a flash memory based device, it has minimal seek time and zero rotational delay, so it's sensible to disable the more complex default cfq I/O scheduler and just use the simpler NOOP scheduler. The NOOP scheduler just puts all I/O requests into an unordered First-In First Out (FIFO) queue, and can also do request merging. The rationale behind this is that I/O performance optimisation is performed by the block device such as the logic in the SSD controller.

Traditional hard disks have the overhead of head movement seek times and also rotational delay and it makes sense for these devices to try and group I/O requests together if they are physically close on the disk. However, with SSDs this does not make sense as these delays don't apply - the NOOP I/O scheduler is a better choice as it removes the grouping of I/O requests and hopefully reduces the variability in timing of I/O request completion.

To enable the NOOP I/O scheduler on SDD device /dev/sda, I used (as root):

echo noop > /sys/block/sda/queue/scheduler

..and of course this should be placed in the appropriate boot scripts.

Tuesday 22 September 2009

Firefox Hack - Looking up Ubuntu Bugs using Bug Number

Looking up Ubuntu bugs using the bug number can be made easy in Firefox using the following bookmark hack:

In FireFox, select the Bookmarks menu (Alt-B for English users) and then right click on the menu and select "New Bookmark...". Next, fill in the New Bookmark dialogue box as follows:

Now you can just enter into the Navigation bar "bug X" where X is the number of the bug you want to lookup and FireFox will expand to the full URL and load the page.

Kudos to Leann Ogasawara for showing me this trick.

Why fixing kernel issues is not just about commit counts

Sometimes one can easily get mislead by commit counts as an "index of contribution" to fixing issues within the Linux Kernel. I deal with a lot of gnarly kernel related issues when new kit is being brought into the market and quite a lot of the fixes don't result in kernel commits. For example, identifying BIOS related issues (such as suspend/resume) and getting these fixed in the BIOS can take many hours of debugging and leads to a machine reaching the market which works for kernels all distros. Such a fix does not get measured in the kernel commit logs - and hence it seems no contribution has been made.

I've also worked on tracking down problems in closed source binary drivers where I've identified where and how the problem is occurring and suggesting a fix which ultimately ends up in improving a driver - again another fix that's not apparent in the kernel git commit log.

Don't get me wrong, I don't want to excuse myself from apparent lack of commits I make in the kernel - however I do want to let you know that bugs are being fixed silently in the background which lead to Linux running better on new hardware and it benefits all Linux distros.

Sunday 20 September 2009

Ubuntu 10.04 - Lucid Lynx

Via a Video Podcast at the Atlanta Linux Fest (ALF) Mark Shuttleworth announced that Ubuntu 10.04 will be called Lucid Lynx.

I was intending to give a talk on kernel debugging at ALF, but I'm in Portland attending a Wifi Mini-Summit, so kudos to Steve Conklin for doing the talk on my behalf! For more about what went at ALF, checkout out Pete Graner's Blog.

Friday 18 September 2009

More netbook ramblings

So, I'm now waiting in an airport lounge at London Heathrow Terminal 3 and blogging away using my HP Mini 1000 netbook. It's working out to be a good experience - it's light and portable enough to get through customs without lots of hassles.

Last night I copied about 5 Gigs of audio/video media to the netbook to keep me occupied during my flight across the pond to Portland, USA. I've dumped all the data onto a SDHC flash card as I'm running a little low of free storage space. Originally I started out with a 60GB HDD, but now I've swapped to a 16GB SSD to see if this helps extend battery life, hence I'm now using an SDHC flash card to boost my storage a little. I think this makes sense - for data that I use infrequently it's cheaper to store on a flash card rather than spending lots of money on a larger SSD.

So that's about it for now. I'd better go and catch my plane...

Wednesday 16 September 2009

Working on a Netbook

Well, day #3 with working from a netbook and so far things aren't too bad.

Getting the broadcom driver installed using Jockey was a little painful, mainly because I required network access via the Ethernet NIC but for some reason the PCI address space for this device did not get configured correctly unless one booted with acpi=none. Once I had figure a work around, installing the proprietary driver was a breeze.

I'm using the netbook on my desk with a 22" Iiyama flat screen monitor at a resolution of 1680x1050 using the HP mini video -> VGA dongle as shown below:

Not too bad, except for that fact that output has a very slight green tinge to it, which is a not brilliant.

The video dongle is tricky to get hold of, and is required because the video port is a rather slim connector. So, a saving on space on the netbook using a smaller form factor video socket means that we need a special VGA cable which adds more cabling to my desk.

When being used in "desktop" mode, I use a full sized USB keyboard and a wireless mouse, but these use up all the two available USB ports. This is a pain when I want to copy data to USB pen drives; the solution is to use a USB hub but this leaves me with a few more cables on the desk.

Speed wise, it's OK for Email, and Web browsing, I'm used to a speedier laptop so it's a little painful at times when I want a snappy response, for example, editing photos for this blog in Gimp is a bit of a memory and CPU killer.

Are You Running Ubuntu Poll Results

Before I kick off another poll, here are the results of my "Are You Running Ubuntu" poll:

Karmic Alphas
Other Ubuntu
Other Distros
What's Ubuntu?

Firstly, one cannot draw any significant conclusions from this poll, as we had only 25 votes cast. Secondly, it looks like quite a few of you are living on the bleeding-edge and running Karmic, which is impressive. Looks like Hardy users don't like casting their votes, or are just visit this blog :-) I'm really glad there are non-Ubuntu readers too, everyone is welcome!

Tuesday 15 September 2009

Monitoring HDD health using smartmontools

I found this useful blog entry describing how to check one's HDD health using S.M.A.R.T. and smartmontools. Kudos to ShadyPixel for this excellent article.

Monday 14 September 2009

Downsizing to a Netbook

Over the past 20 months or so I've been lugging my Lenovo 3000 N200 laptop with me around the world when I attend various conferences, Sprints and the Ubuntu Developer Summits. While travelling, I generally use it for Email, Web, IRC, Skype and note taking - which are netbook type activities. If I need to build and kernels I will ssh into an appropriate build server at home and grind code on a far more capable build box. With my neck playing me up, I don't really want to carry a heavy laptop if I have to.

So, it's time to move over to a netbook - the plus point is that it's much smaller and lighter (which is good since I'm not to carrying heavy objects at the moment) - however the downside is that the HDD is smaller and the screen is only 10" and the processor has easily half the compute power as my Lenovo.

My experiment is to see if I can use a netbook over the next week or two and see if it makes my Lenovo redundant.

The first step was to install the latest Ubuntu Karmic Alpha onto my HP Mini 1000 netbook. I could have opted for the Ubuntu Netbook Remix but I personally like using the normal desktop distro (call me old-fashioned!) so I installed the 32 bit Karmic Alpha 5 (since 64 bit won't work on Atom based processors). I pulled in the latest updates and I'm running the latest kernel which I know for sure gets the audio working correctly. I'm using the broadcom wl closed source wireless driver which required just a little bit of attention to install, but all in all it's fairly straight forward.

After installing my normal apps that I need for work I then transferred my home directory over from my Lenono to the netbook and that was about that. I've made some minor tweaks to alter the panel sizes and tweak the fonts just to squeeze in more text onto the screen, but that's about it.

The 1.6GHz Atom N270 processor is fast enough for Skype and also watching the BBC iplayer - although the rendering is a bit choppy when there is a lot of motion, but it's OK enough for casual usage. The integrated webcam works fine and picture quality is most reasonable.

The keyboard is 92% the size of a normal laptop keyboard, so it's quite usable. Even with my chubby fingers it's fine to use - I'm currently writing this blog entry with it without any finger pain.

Suspend/Resume works reliably and fairly fast too. When one opens the netbook lid the resume occurs so quickly that the only clue that it was suspend is seeing the wireless re-associate. So Kernel Mode Setting seems to help in the overall suspend/resume experience.

Email in Evolution is usable, but I could do with more pixels - the 1024x600 TFT display can make things a little cramped. As for battery, I'm getting over 3 hours without any powertop tweaks; I hope to get a better result with some tweaking. I could have opted for an SSD rather than using a HDD to extend battery life, but I needed the larger disk capacity for some of the work I carry around with me.

Tomorrow, I'm going to see how well an external monitor works with this netbook to see if it can be used for my normal desktop tasks. Since most of the day I'm ssh'd into my servers, I don't need a powerful desktop, so it will probably work.

I will let you know if it's thumbs up or thumbs down.

Thursday 10 September 2009

SA pigeon 'faster than broadband'

The BBC has a report on a 11 month old carrier pigeon that carried 4GB of data on a memory stick to demonstrate that it could move data quicker than the fastest available ADSL provider. While this makes a fun headline, it's really kind of bogus on many levels. How about repeating the experiment by transferring data from the UK to Australia, or sending just 1K Email message?

Any right minded computer science student will recall the Andrew Tanenbaum quote "Never underestimate the bandwidth of a station wagon full of tapes" in his definitive networking tome "Computer Networks". It's not just bandwidth we are looking at - it's connectivity, latency, reliability and distance that matters. So while it's kind of fun to make pigeon post comparisons, it is totally bogus for a like for like comparison.

Mind you this is not new, RFC1149 (Standard for transmission of IP datagrams on avia) has been around since 1990 and has a follow up RFC2549 (including fun ASCII art avian images) in 1999.

So this news story is not entirely based on an new technology :-) In fact, a ping has been successfully sent via pigeon thanks to the help of the Veste Brevdueforening carrier pigeon club, so we know it's a viable technical solution, just not the kind of one I would like to be using when using the Web or downloading my Email :-)

Wednesday 9 September 2009

Monitor network traffic using iptraf

Today I found a nifty little tool to monitor and measure IP network activity called IPTraf - an ncurses text based interactive tool written by Gerard Paul Java.

To install on a Ubuntu system, use:

sudo apt-get install iptraf

and to run, use:

sudo iptraf

It has several modes of monitoring, from IP traffic view, interface statistics, detailed interface statistics, statistical breakdowns (by packet size and by TCP/UDP port) to name but a few:

The IP traffic view displays TCP connections and a scrolling IGMP/UDP activity window; it's kind of useful but with a busy machine it can be rather too hectic with so much information being updated.

The "Detailed interface statistics" option dumps running totals on IP, TCP, UDP, ICMP, other IP and non-IP traffic, giving total rates and input/output rates on a selected network interface:

The "Statistical breakdowns..." option allows one to look at interface activity in terms of break down by packet size or by TCP/UDP port. Below is the TCP/UDP port breakdown:

There are a bunch of other options to set up filtering an a large set of tweakable configuration options one can play with. It's one of those tools that's handy to quickly see what's going on one's network interfaces and I recommend installing it and playing around with it to see it's full potential.

3Com Firmware Hassles

A few weeks ago I reflashed my Access Point to see if it resolved an Wireless associating problem with my Brother laser printer. Since the upgrade my IRC connections keep on dropping and I've hit weird issues when downloading large ISO images, so it's time to revert this upgrade. It appears that the upgrade caused more issues than it fixed. So much for progress!

Downgrading firmware is a bit of a risk, but I had more problems actually getting the firmware. 3Com's website allowed me to find the firmware with no problem, however, it was compressed inside a Windows executable, which meant firing up Windows (which I don't have) and extracting it that way. This is a real pain - especially for us non-Microsoft users - "Hello 3Com, ever heard of Apple Macs and Linux?". The irony was that the compressed image was only a few percent smaller than the uncompressed firmware, so why bother?

The firmware downgrade was less of a problem although my major complaint is that my previous settings were saved in non-volatile memory in a format that was incompatible with the re-flashed firmware and so I had to reset all my settings and re-configure the device from fresh. This must be down to poor design - surely the format/location of non-volatile settings should not change between upgrades.

So, next time, I won't be buying any 3Com kit if all their products are so painful to reflash. Thanks, but no thanks 3Com.

Sunday 6 September 2009

Family Holiday in North Devon - Sand, Sea and Rain!

Well I'm back now from a family holiday down in the North of Devon visiting fishing villages, beaches and tea rooms!

We chose late August/early September as the rates are half that of peak Summer season and there are less tourists which means less hassle on the roads and it gives us a fair chance of getting into a tea room without queuing.

We rented a "Country Cottage" at Torrington; in fact the cottage was part of a converted water mill and we also had the benefit of a small swimming pool which the kids enjoyed. However, the rooms were cold and damp and the central heating was not switched on - fortunately the living room had a wood fuelled fire which we stoked up and kept alive most evenings.

On Sunday we visited Bideford and tried to catch some crabs. Monday we visited the Quince Honey Farm and saw umpteen bee hives that could be mechanically opened at a press of a button to reveal tens of thousands of industrious bees making honey - quite impressive, but overall the exhibition and buildings looked a little run down. Tuesday we took the kids to the Big Sheep which was a sheep farming themed fun park - there were some neat shows, such as using a sheep dog to herd ducks. On site was a barn full of baby farm animals where a free range goat had a go at eating my jeans and also "EWEtopia" - a barn full of slides and climbing frames which were useful for wearing the kids out.

Wednesday we walked into Torrington town centre and saw a demonstration 1643 civil war gun being loaded and shot, much to the dislike of my 6 year old son David - far too noisy!

One of the holiday highlights was Thursdays visit to Lynton and Lynmouth and riding on the water powered Victorian cliff railway - using the help of gravity and 600 gallons of water we zipped up and down the cliff in a few minutes saving us a long walk!

We rounded the week off with a visit on Friday to the Clovelly which a small and beautiful fishing village which has banned cars from it's cobbled streets. It's got lots of character and has not changed much in a hundred years.

Being in Devon, we made best use of tea rooms and I managed to consume 3 cream teas during the week - which is probably my quota for 2009. The weather was not brilliant, but it is England and one expects rain.

All it in, not a bad break, and I managed to get through a whole week without any internet connectivity without suffering too much!