which one do u think is the best OS now!

Wednesday, June 8, 2011

ReadyBoost on Linux


In my previous post on readyboost I tried to explain out the basic ideology of the technique called readyboost and also some performance statistics to support the theory. Well that was for Microsoft operating systems [dedicatedly available in Vista or newer and have to be manually configured in older OSs].

 The idea of readyboost is simple. For machines with low RAM, whenever the data access requirements over-flood the RAM, the OS starts to pass the least probably-important data to the page files on the hard disk and loads currently required/most important/high priority data on to the RAM from the hard disk/page files. This is where the machine slows down. Activating the readyboost adds another layer in between the page files and the RAM in the data access hierarchy. Thus whenever the ram over-floods, the new data is loaded from the flash drive and the old data is passed to the flash drive. In the flash drive also data is collected and maintained in the same manner as the RAM.

Now, Linux also uses something similar to the paging file systems called the swap partition. Swap partitions do the almost the same job that is done by the page files in the windows environment. So it is possible to create swap partition on a flash drive. As because flash drives give a higher access speed, the swap partition will be faster on the flash drive. And if we assign priority to the flash drive swap compared to the dedicated hard disk swap, the flash drive enters in to the hierarchy scheme and performs almost the same way as the readyboost concept.

Now the most important thing….. HOW TO DO IT…. [the code is for ubuntu]
Open the terminal.
i>                   Plug-in the flash drive.
ii>                 Linux shall automount the drive. Then you have to unmounts it 
Sudo  unmounts /media/”usbdisk”
iii>                Now find the usb device in the terminal using the command
Sudo df –h    [it will be something like /ev/sda1 or /dev/sdb2 etc. I am considering /dev/sda1 here]
iv>               Sudo mkswap /dev/sda1 [creating the swap at the /dev/sda1 flash drive]
v>                 Sudo swapon –p 32767 /dev/sda1 [-p is to activate a partition and not a file. Anf the number 32767 is the priority number. Linux processes support a priority range of 0-32767. 0 being the min priority and 32767 being the highest]
Ok. The flash drive is now working as a swap partition. It’s better to format the flash drive in exfat file system [specially ext4]  as the swap partition works best on that file system.
To verify the swap partition being operational type the following code on terminal
                Cat /proc/swaps
If the swap partition is active, then it will be shown on the output list along with the dedicated hard drive swap partition(s).
To turn the “ReadyBoost” off on the linux [Ubuntu] type this code on terminal
                Sudo swapoff /dev/sda1 [/dev/sda1 here is the flashdrive as detected in step 3]

Now I did mention that the swap technique will work almost the same way as readyboost. Well, Almost. In windows we were creating a page file which is comparable to a swap file, not a swap partition. Swap files are very flexible but vulnerable. If deleted accidentally, data could be lost or even the OS can get corrupted. Swap partitions can’t be modulated while being used. Thus the data cannot be affected. And in some cases the access speed in swap files is better than swap partitions. In linux, we are creating a swap partition on the flash drive. We shouldn’t create a swap file as because linux will not prevent us from deleting the file due to its high flexibility. So the speed advancement in linux may not be as promising as in windows. But, yeah it still works..

Sunday, April 3, 2011

Multi core architecture Simplified


I have come across many people who just can’t figure out exactly how is the multicore architecture better than the single core. A more important question among them is, how is a single core 2.55GHz single core [e.g. pentium 4] processor is not better than a 1.6GHz Dual-core, Core2Duo etc. processors.

Well it’s certainly a very strong point that, the clock frequency ultimately decides the processor speed. Higher the clock frequency, better the processor performance. But still we moved to the multicore architecture even if the clock frequency is not necessarily greater.  WHY?

The reason is simple.

The higher the frequency, the faster the processor.

The faster the processor, greater the data speed.

The greater the data speed, more the heat generated.

As the generation of fabrication technology advances, the transistors become smaller the current processors are built over 32nm (µ=32nm >Sandy bridge &  λ=32nm > in R&D) fabrication technology. The smaller the transistor get, the less power is required and the less heat they can sustain.

So, we can’t just keep increasing the clock frequency. As the generation of fabrication advances, the transistor density increases in the processor. The processors become smarter and more capable. But the supported clock frequency may not increase relatively.

So far, it is clear that processor clock frequency can’t just be increased to achieve higher efficiency. Now, comes the multicore architecture. The most common idea about multicore processors is that, they consist of multiple processors cores in the same board, thus gives twice the performance than single core. Well it’s not entirely wrong.  Lets take a Dual Core processor for understanding. In a Dual Core processor, there are 2 cores embedded on the single core environment. The cores share the same BUS system. Thus if one core performs at its 100% the other can at max achieve 80% of its processing capability (as per the processor architecture).


This is an example shown here.  In the environment, there are 2 cores each of 3.6GHz core speed, sharing  the same bus system.  The BUS structure is optimized to a level to achieve 80% of max performance while the other core delivers 100%.

If we increase the number of cores, the effective performance  will be relatively lesser than an architecture with lesser number of cores, though the overall performance increases.


 Another example?? 


 Consider a system with 4 cores. A Core 2 Duo processor. In this type of architecture 2 dual core processors are scaled together to give a 4 core based processor system. The dual cores a are designed in the fashion described earlier. Here dual core fabrication is just a part of the process. The dual cores achieved 80% SOSS, resulting in an 180% processing power compared to a single core. The 2 cores are embedded together in a single processor  architecture. Here the SOSS remains 80%  but the COCS is 70% for both the dual cores.  If the number of cores are increased under the same architecture, with each layer of scalability the efficiency will get relatively reduced. Standard Core2 Quad systems were built in an architecture similar to Core 2 Duo, but the Xeon Quad cores are designed in a more efficient way.

So this was the general architecture of multicore environment processors. Though one must be aware that, multi core is not all that makes the new generation processors so much efficient.

I will post, in the upcoming weeks, about the latest Core i series processors, 2nd generation intel processors and various technologies that help increase performance dramatically, e.g.  HTT, AVE, DFT, ITB etc.
Thank you for reading.