ReadyBoost for Linux?

Send to a friend Print

Help more people find out about this story

Del.icio.us
StumbleUpon

Ashton Mills11 July 2007, 12:27 AM

Say what you will about Microsoft but ReadyBoost is a clever use of cheap-as-chips USB memory keys. Now there's a sort-of version for Linux too.


Lifehacker has an interesting story about making your own ReadyBoost for Linux (and, aptly, calling it SwapBoost) and even if the benefit is questionable, this is still something I would actually like to see -- it's simply an innovative take on a cheap-as-chips and common-as-dirt gadget commodity.

On Vista, ReadyBoost does make a difference -- for low memory systems. In my own brief testing, ReadyBoost does nothing (as you'd expect) for a 2G and very little for a 1G system unless under heavy load, but 512M and below it has a reasonable benefit. As a result, its market is definitely the road warrior with a possibly less-memory-than-the-desktop laptop and a source of high capacity USB keys.

I still think it's cool though, and when I first installed Vista I wanted to see if I could see how it was implemented and intercept any data on it. If you remove a ReadyBoost USB key while in use and boot to Linux, you can mount it using the UDF filesystem and you'll get to see a container file which Vista uses to store the temporary data -- it's basically a loopback device. But you can't peek inside -- well, you can, but it's encrypted (as it needs to be, considering it pages from memory, and there could be sensitive data).

While the Lifehacker SwapBoost script is commendable for its goal, it's quite a different thing -- it's just creating another swap partition on the USB device and adding it to the swap pool. Which, given Linux's excellent memory management is unlikely to see use. On my 2G system, even running a plethora of beefy apps and compiling in the background in Gentoo, my swap has never been touched. When I used to have 1G, I could count on one hand the number of times I saw it grow. This is quite a bit different to Windows, where even menial tasks seem to make use of swap.

Additionally, the default I/O schedulers for the Linux kernel are Anticipatory and CFQ, which are specifically designed and optimised with hard drives in mind (Anticipatory actually tries to take into account drive heads to optimise seeking). Flash media like a USB stick doesn't suffer the problem of variable seek times across the diameter of a disk, so ideally any ReadyBoost implementation for Linux would use the NOOP scheduler, which is perfect precisely for this type of media.

Regardless of your take on Microsoft, you have to commend it for the design of ReadyBoost -- it mirrors data going to and from drives, so the key can be removed at any time with no loss (if you removed your SwapBoost with data on it, it's gone), it diverts only small writes to the ReadyBoost device -- which maximises the performance of both your storage devices (hard drives = high throughput, high latency; USB keys = low throughput, low latency) and, of course, it encrypts the data on the fly because you don't want others peeking at your information should a key in use get stolen.

So ideally a proper attempt at ReadyBoost for Linux would need to take this these features, as well maximising performance using the NOOP scheduler for it, into account. Yeah it's a niche feature, but as before I still think it's a clever use of an abundant media in our lives today, and for that its commendable.

 

USB keys: Is there anything they can't do?USB keys: Is there anything they can't do?


Post your comment



Comments

RSS feed Email alert

Brendan:

What I can't understand is this:
Isn't it believed that flash drives have limited writes of about 10000 times? On a low ram system would this USB stick be dead by the end of the quarter?

29 February 2008, 8:31 PM (1 year ago)report abuse Send to a friend reply

Dan Warne:

Nah -- that was a problem with earlier flash memory -- I think the number of rewrites is now up into the multi-millions.

29 February 2008, 8:45 PM (1 year ago)report abuse Send to a friend reply

Daryl:

Flash these days also does sequential writes which means it will write until it hits the end of the memory then go back to the start and repeat. This way, the "early" sections of memory don't get written to more than the "end" sections, thereby extending the overall life of the memory.
This is automatically controlled by the logic inside the flash device.

29 February 2008, 8:45 PM (1 year ago)report abuse Send to a friend reply

Brendan:

What about SSD drives? Do these come under the same category?

29 February 2008, 8:45 PM (1 year ago)report abuse Send to a friend reply

Thomas:

Yes but, SSD's are manufactured at a much hirer standed then USB drives, have extra space and better management. Hence the higher dollars per gig in SDD's.

29 February 2008, 8:45 PM (1 year ago)report abuse Send to a friend reply

SW1956:

A Linux ReadyBoost would be useful for XboxLinux systems since they only have 64MB of RAM

29 February 2008, 8:32 PM (1 year ago)report abuse Send to a friend reply

DJRumpy:

The amount of ram you have doesn't affect ReadyBoost one way or another. It boosts hard drive performance.

Unfortunately there is nothing comparable in Linux. Just some sad hack that puts a swap file on a thumb drive. The person did absolutely no research into what ReadyBoost is. Sadly, the people who try his hack realize that it doesn't work and then slam windows for a stupid idea when the guy who wrote the hack doesn't even understand what it does ;)

Hopefully soon, the Linux guru's will come up with something for Linux. I've seen ReadyBoost at work. It's nice.

29 February 2008, 8:48 PM (1 year ago)report abuse Send to a friend reply

anonymous user Anonymous user


Tags