Live Long and Prosper: The Logical Page

Computers are all about abstraction. In the early days of computing you had to write assembly code to get your hardware to do anything. Programming languages like C and C++ created a layer of abstraction between the programmer and the hardware, simplifying the development process. The key word there is simplification. You can be more efficient writing directly for the hardware, but it’s far simpler (and much more manageable) to write high level code and let a compiler optimize it.

The same principles apply within SSDs.

The smallest writable location in NAND flash is a page; that doesn’t mean that it’s the largest size a controller can choose to write. Today I’d like to introduce the concept of a logical page, an abstraction of a physical page in NAND flash.

Confused? Let’s start with a (hopefully, I'm no artist) helpful diagram:

On one side of the fence we have how the software views storage: as a long list of logical block addresses. It’s a bit more complicated than that since a traditional hard drive is faster at certain LBAs than others but to keep things simple we’ll ignore that.

On the other side we have how NAND flash stores data, in groups of cells called pages. These days a 4KB page size is common.

In reality there’s no fence that separates the two, rather a lot of logic, several busses and eventually the SSD controller. The latter determines how the LBAs map to the NAND flash pages.

The most straightforward way for the controller to write to flash is by writing in pages. In that case the logical page size would equal the physical page size.

Unfortunately, there’s a huge downside to this approach: tracking overhead. If your logical page size is 4KB then an 80GB drive will have no less than twenty million logical pages to keep track of (20,971,520 to be exact). You need a fast controller to sort through and deal with that many pages, a lot of storage to keep tables in and larger caches/buffers.

The benefit of this approach however is very high 4KB write performance. If the majority of your writes are 4KB in size, this approach will yield the best performance.

If you don’t have the expertise, time or support structure to make a big honkin controller that can handle page level mapping, you go to a larger logical page size. One such example would involve making your logical page equal to an erase block (128 x 4KB pages). This significantly reduces the number of pages you need to track and optimize around; instead of 20.9 million entries, you now have approximately 163 thousand. All of your controller’s internal structures shrink in size and you don’t need as powerful of a microprocessor inside the controller.

The benefit of this approach is very high large file sequential write performance. If you’re streaming large chunks of data, having big logical pages will be optimal. You’ll find that most flash controllers that come from the digital camera space are optimized for this sort of access pattern where you’re writing 2MB - 12MB images all the time.

Unfortunately, the sequential write performance comes at the expense of poor small file write speed. Remember that writing to MLC NAND flash already takes 3x as long as reading, but writing small files when your controller needs large ones worsens the penalty. If you want to write an 8KB file, the controller will need to write 512KB (in this case) of data since that’s the smallest size it knows to write. Write amplification goes up considerably.

Remember the first OCZ Vertex drive based on the Indilinx Barefoot controller? Its logical page size was equal to a 512KB block. OCZ asked for a firmware that enabled page level mapping and Indilinx responded. The result was much improved 4KB write performance:

Iometer 4KB Random Writes, IOqueue=1, 8GB sector space Logical Block Size = 128 pages Logical Block Size = 1 Page
Pre-Release OCZ Vertex 0.08 MB/s 8.2 MB/s

A Quick Flash Refresher The Cleaning Lady and Write Amplification
Comments Locked

295 Comments

View All Comments

  • albor - Friday, June 18, 2010 - link

    Hi,
    try RamDisk Plus 11 from SuperSpeed.
    (http://www.superspeed.com/desktop/ramdisk.php)
    I use it on Xp pro 32 bit with 30 GB OCZ Vertex and 8 GB RAM. All above 3.2 GB is configured for swap and temp. Works perfectly and no visible SSD performance degradation after about 10 months.
    Greetings.
  • jmr3000 - Thursday, August 23, 2012 - link

    would explain to me how did you install it?

    the ssd as a second drive or did u install all the program on the ssd and use the hhd as a second?

    thanks in advance!

    jm
  • marraco - Friday, August 13, 2010 - link

    SWAP file is one of the most important speed bottleneck on windows.

    it writes frequently to disk, so consumes the read write cicles of the disk, reducing his useful life.

    But you are not buying space storage when you buy SSD. You are buying speed, so it makes nosense to buy an expensive SSD, and then remove from it all the activities that need the speed and are bottlenecks.

    you buy a SSD to do the fastest SWAP. keep it on SSD.

    Also, drive indexing permanently does a lot of reads, but it does not matter if the disk is fast. Drive indexing is like a little local google. If you disable it, and then search for all the files with a given text on it, searching the entire disk takes longer than just read an indexing.

    Those activities consume the useful life of the disk, but at the time the disk gonna need replacement, (5 years, maybe), this disk gonna need replacement anyways, and new SSD gonna be dirty cheap, so it makes no sense to disable swap, temp files, and indexing.

    On other side, prefetch, superfetch and defrag most probably are better disabled under SSD.
  • jimlocke - Wednesday, June 1, 2011 - link

    Pehu, I know this much after your posting, but I was curios what you ended up doing for swap.
    8GB of RAM almost seems like swap may not be needed, unless you have several memory-hogging apps open.
    Hope you still like your SSD. I'm looking at getting one soon, and agree this was an excellent article!
    -Jim
  • krumme - Friday, October 9, 2009 - link

    First: I submit to the importance of random 4k for ssd.
    Second: Over the years I have highly valued the articles of Anand. It is remarkable to see such detailed and enthusiastic information.

    Now I have a few questions, following the general impact of this work.
    Some observations first:
    Following an article at Toms of a ssd article the 6 of September. The author was called a “Moron”, primarily as the random 4k synthetic bm was missing. The author was giving a different opinion on the indilinx vs intel, in the desktop sector, compared to Anand, giving more weight to transfer vs iops.
    In an discussion about a Kingston V-series review, one said that he would take the indilinx ssd any day because it was “750 times faster” – an argument based on iops.
    Another remark I have read several times is: “The Intel x25-M g2 is the only drive to get”.
    Another is: “I would like to buy the Dell xx, but it has an Samsung controller so its of no use”.

    I think it is time to stop, and make sure there is reason in what is happening for normal desktop use.

    Do we have blind test where to tell the difference between the Intel, Samsung and Indilinx?
    What is the actual real world bm fx. Win7 boot times for the 3 controlers?

    There is something called good enough. When is 4k random read/write time enough, to not notice any subjective improvement afterwards in win7? Could it be fx. 10M/s?

    The ssd is the best thing happening since 3d gfx, but I think we should enjoy what is happeing right now, because this time, could be the turning point where we soon are focusing on small differences.

    Anyone knows what´s the next big thing?
  • bebby - Friday, October 30, 2009 - link

    Random 4k and its relevance for desktop use is really the main topic for me, too.
    If I assume that I only use the SSD for the OS and software and save my data on other, much less expensive HDDs, I doubt very much that this discussion is worth it. The Samsung SSD then suddenly looks not so bad at all and much cheaper...
    The next big thing for me would be an OS starting up in 5 seconds, like the OS we had in the 90s...making SSD obsolete.
  • bebby - Friday, October 30, 2009 - link

    Random 4k and its relevance for desktop use is really the main topic for me, too.
    If I assume that I only use the SSD for the OS and software and save my data on other, much less expensive HDDs, I doubt very much that this discussion is worth it. The Samsung SSD then suddenly looks not so bad at all and much cheaper...
    The next big thing for me would be an OS starting up in 5 seconds, like the OS we had in the 90s...making SSD obsolete.
  • marraco - Friday, August 13, 2010 - link

    I agree completely. I think that human beings can nottice the difference between a hard disk, and a non bad SSD, because the difference is too large, but over "good enough", it does not matter much if the SSD is 2X or 4X faster in 4Kb random R/W.

    But mine is just an opinion, and I don't have good data to test it. I would like to read an article with repeatable testing on human perception.
  • SimesP - Wednesday, September 23, 2009 - link

    I haven't read all 254 comments (yet) but I'd like to add my thanks to everyone elses for the comprehensive and illuminating article. This, along with the previous AnandTech SSD articles have increased my understanding of SSD's immensely.

    Thanks again!
  • ClemSnide - Friday, October 2, 2009 - link

    Anand,

    A couple of guys from HotHardware.com pointed me at your SSD article, and it allowed me to make an informed decision. Thanks!

    I wanted to speed up one game in particular (World of Warcraft) as well as routine OS tasks and web browsing. I think an SSD will do a bang-up job on at least the first two. The one I decided upon was the OCZ Agility 60 GB, which offers some growth room; I currently have 40 GB on my system drive. I know the Intel has better numbers, but I was able to get the OCZ for $156 after a rebate, which translates to decent performance at a price I can justify. (For the curious, it's available from TigerDirect for $184, and OCZ is giving a $30 rebate.)

    Even though my system build is still months away, this should be usable on my old clunker as well. Very nifty!

Log in

Don't have an account? Sign up now