LWN.net Logo

Why partition alignment?

Why partition alignment?

Posted Mar 11, 2010 18:39 UTC (Thu) by PO8 (guest, #41661)
In reply to: Why partition alignment? by BenHutchings
Parent article: 4K-sector drives and Linux

No, I just want the kernel to issue reads and writes aligned with the disk blocks. I don't see why anything has to move on-disk at all? Reads presumably aren't much of an issue anyhow, and writes are only going to be a problem at the beginning and end. I don't see why just doing the reads and writes properly aligned wouldn't be almost as good as shifting the data on disk?


(Log in to post comments)

Why partition alignment?

Posted Mar 11, 2010 19:33 UTC (Thu) by cmccabe (guest, #60281) [Link]

What you're talking about is actually done by a lot of SSDs that are sold today. It's called write coalescing. SSDs don't really have sectors, they have "erase blocks" which are often 16k or so in size.

So when they get a request for a 512-byte write, rather than doing the read-modify-write of a 16k block, they wait to see if the user wants to do any more I/O to that erase block.

The disadvantages of write coalescing are kind of obvious-- it's complex, requires temporary storage (for the un-coalesced 512-byte chunks). More buffering also means there's a longer window when power failures can result in data loss.

Overall, it's not something you want to do unless you absolutely have to. Performance and stability would be a lot better if the kernel knew about the real situation on the hardware.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds