Add to Google Reader or Homepage |
~ pjvenda / blog
$home . blog . photography

16 October 2007

My new laptop: Apple MacBook Pro

Yes, I have (finally) surrendered to the mighty Apple. They have assimilated me.

For that latest 4 months or so I have been stuck with my older Acer Travelmate 4001Wlmi of September 2004. It is still a decent laptop, but the absence of a working USB controller, the tired screen (low and non-uniform brightness - "stained") and the inability to run Flight Simulator 2004 decently with some addons made me rush the decision to buy a new laptop.

So I did, and in style. I bought a shiny new 15" MacBook Pro [@Apple website / @wikipedia:Macbook_pro]. I really dig Apple hardware's look and feel, their approach to styling, the kind of materials they employ, even the packaging is a small work of art.

I chose to buy a MacBook Pro (even though I still think they are a slightly over priced for their specs) due to the following reasons (in no particular order):

  • It's a light weight and well built 15" wide-screen laptop;
  • The Intel Core 2 Duo [@wikipedia:Intel_Core_2] with 2GB of RAM looked really appealing as a Gentoo Linux desktop platform;
  • nVidia GeForce 8600M GT [@wikipedia:Geforce_8] with 256MB of VRAM. Important for Half Life 2 and Flight Simulator X (with addons);
  • Mac OS X [Tiger@Apple website / @wikipedia:Mac_os_x];
  • High resolution, LED backlit screen;
  • Apple store offers great deals for students.
I ordered it from Apple Store UK along with an iPod classic for my wife and it took 17 calendar days to arrive. I must admit that the wait was a little hard to accept, but all is well now.

First impressions were great. Intelligent and stylish packaging (as is common with all Apple products), battery charged at about 75% and Mac OS X 10.4 Tiger pre-installed. Apart from laptop and charger there was a Quick Start guide, a DVI-VGA cable adapter, infrared remote control and CD/DVD pack with operating system and software extras.

I first saw Mac OS X when I worked at RNL [@my website] where some of my fellow sysadmins owned iBook laptops with OS X. We also had to handle a couple of older iMacs running Mac OS 9, which gave me an idea of how much better OS X was when compared to OS 9. My wife also has a macbook for some months now, so OS X is not new to me, although I never used it on an daily basis.
Being a UNIX-head geek, I tend to see Mac OS X as if it is on top of a pedestal. It is by far the best achieved OS ever made and it runs on top of UNIX. Does it even get any better? Yes, with every release! Now that finally I have a system where I can legally run Mac OS X, all I can do is agree on myself. Now I think that I took too long to make this switch. Man... is it worth it!!

While I believe that Mac OS X is brilliant, it does not mean that I like to use all the applications Mr Steve Jobs would like me to use. My every day system is still Linux and I still play my heavy graphics games... sooo... I had to infect my MacBook Pro with a (legal) copy of MS Windows XP (exclusively for games) and I also had to install a Gentoo Linux distribution (mainly because of amarok, digikam and because my work flow for producing panoramas involves a set of [free] programs that I still don't know if I can use on OS X).

I will have some detailed notes on installing the two extra operating systems on my website on a stand alone article - "Yet another guide for setting up Triple Booting on a MacBook Pro".
Just some notes:
  • rEFIt is incredible. It's trivial to install and use (no configuration); It's clever (finds out about bootable partitions and CDs by itself); It's pretty (see screenshot below);
  • The Windows XP installer is an incredibly limited, unbelievably useless piece of software. It's utter crap. Right after I got the installer to do its job (install windows) I rebooted a Linux Live CD and used ntfsclone to save the freshly installed windows partition (filesystem). When I need to reinstall the system, I'll just rewrite my windows partition with that file system;
  • After the pain of installation and after installing the corresponding hardware drivers, windows XP runs very well. Can't wait to test HL2 Ep1 on it;
  • Gentoo Live CD 2007.0 does not have a driver for the ethernet network card or the wireless card, so before compiling a recent kernel (>=2.6.21) I had to do stuff without internet connection;
  • Linux on this laptop is frighteningly fast! Probably because I am used to run Gentoo on my previous laptop laptop or on VMWare hosts... Now that I think of it, my Acer Travelmate 4001WLMi has a 1.5GHz Intel Pentium-M (banias) processor with an FSB of 400MHz, while this MacBook Pro has 2x 2.4GHz Intel Core 2 processors with an FSB of 800MHz. That alone is a big performance boost.

My website contains a page with Linux compatibility notes and tips about every one of my laptops (Linux on Laptops). The MacBook Pro will not be an exception. However, the page isn't up yet. This section will be part of a huge update long long overdue. When? Don't know yet... Soon?

Cheers, PJ.

08 October 2007

Priority to Windows Media Player in Vista, over Network and I/O operations

Hardly recent news, but this one of those issues where marketing decisions seem to win over good architecture design. Trouble often awaits at the end of a shortcut...

People found out first through occasional events and then through more focused and scientific experiments that the Windows Vista scheduler deliberately (and grossly) gives CPU priority to its Media Player, against all other processes - even network and I/O operations!

But let's go for a little walk around the scheduler architecture theory park before going back to windows vista...
All of today's operating systems are multi tasking, simulating an ideal environment where each process has its own CPU. Inside every operating system's kernel there is a scheduler which job is to allocate bits of CPU time to all processes. Schedulers employ very complex algorithms to distribute an average CPU time as evenly and/or fairly as possible while keeping maximum response times for sake of interactivity and avoiding resource starvation issues (where a small group of processes keeps an unfair amount of CPU and I/O resources for themselves, leaving other processes waiting forever or, in OS jargon "starving".

I am not a scheduler guru, but I know enough to understand that they are damn hard to get right. Tuning a scheduler is an exhausting iterative task that requires great technical knowledge and creativity to come up with clever optimisations. The unsolved problem with schedulers is that nobody ever found a perfect algorithm for all kinds of usage scenarios and load patterns. Probably because such scheduler does not exist!
Playing games, browsing the web, editing audio and/or video and accessing compressed media (generic media players) are perfect examples of very different usage scenarios that happen often on the same hosts. Each has a unique set of requirements and needs a different amount of system resources to itself.
Multiple mechanisms and techniques were invented to handle this broad range of patterns as fairly as possible. In some cases schedulers categorise and tune their settings individually to each process by learning its patterns and inferring its specific category. Some other cases though are affected by users where given processes are explicitly marked as having higher priority or otherwise. With these techniques, the scheduler tries to tune itself globally to the actual usage scenario that it needs to handle. Computer scientists are working on it and slowly coming closer to the goal of the perfect scheduler that handles well every usage scenario thrown at it.

This, in general and qualitative terms, is what is involved with every scheduler in every multi tasking operating system. The source code for some schedulers is open and can be accessed, changed, tuned, made better and contributed back to the project. It is not an easy task though! As I mentioned before, schedulers are made of several elaborated algorithms that take time to locate, contain, read, understand and finally understand (this is not a typo).

Other operating system vendors, however, CHEAT!
Microsoft decided to give a higher priority specifically to its media player software, to improve interactivity and responsiveness, hopefully regardless system load. This is obviously the wrong kind of scheduler tuning probably derived from marketing and "strategy" personnel, who clearly don't know much about schedulers.
How is this wrong? Recalling that the scheduler tries to make a single CPU host behave like it runs multiple processes at the same time, increasing priority on one process is only made at the cost of performance on all other processes. This is wrong because Microsoft is giving an unfair advantage to their media player software, perpetuating their locking techniques.

The technique seems simple to me: hard code priority boosts to their own software to make all others run worse. People obviously prefer those that run well and will eventually stick with Microsoft technology. Today it's their media player... What about tomorrow? Internet Explorer?? Imagine Firefox taking 2 minutes to start or 30 seconds to load a flash based page? I would surely not use it in such conditions.

This case is serious because one of the processes that suffers a priority decrease and a notable performance decrease is related to the system's network I/O handlers. Network traffic is seriously slowed when using Microsoft media player on Windows Vista.
... but believe me, music and videos play ultra-smoothly!


Now let me explain that I am yet to install windows Vista on any of my hosts due to several different reasons:
  1. As happens with anyone else, my time is limited. I use it to research my own fields of interest and to enjoy my life as much as I can. The vast majority of Microsoft's products do not fit into any of the mentioned categories (a notable exception is Flight Simulator);
  2. My every day operating system is Linux, so testing windows Vista would be for experimental purposes only. However, there are other operating systems in queue for me to experiment with before Vista;
  3. I refuse to pay directly for a copy of windows Vista, therefore, unless there is some other legal way for me to get a licensed copy I am keeping XP. Maybe when I buy a laptop or a workstation that is only sold with a Vista pre-installation... maybe I'll give it a good long-run test;
  4. Flight Simulator X seems to run decently on XP;
  5. Oh, haven't you noticed? Vista's scheduler is broken.
Cheers, PJ.