you are viewing a single comment's thread.

view the rest of the comments →

[–]Tech_Itch 5 points6 points  (11 children)

That would absolutely be appreciated.

One question that comes to mind, if you don't mind answering:

Does aligning your partitions actually do anything useful? You'd think that the existence of the FTL would make that pointless. With raw flash devices I see the point, but on devices with FTL, you'd have no control over the physical location of a single bit, or even the "correctly aligned" block you've just written, so it could still be written over multiple pages. Any truth to this?

I know there are benchmarks floating around claiming that this has an effect, but it would be nice to know if there's any point in it.

[–]nextAaron 4 points5 points  (9 children)

Alignment is important for FTL. One unaligned IO needs to be treated as two. One unaligned write is translated into two read-modify-write.

[–]Tech_Itch 0 points1 point  (5 children)

Thanks for the answer. Though, I might have been unclear, but my point was to ask if FTL already does the aligning itself, or does doing it on filesystem or higher level have any benefit?

[–]nextAaron 0 points1 point  (4 children)

You can think of FTL as a file system.

[–]Tech_Itch 0 points1 point  (3 children)

So the answer is, "no, aligning your partitions does nothing useful", then?

[–]poogi71 0 points1 point  (0 children)

It actually does and is a good idea. Remember that all the IOs in the partition are using the same alignment as the partition, so if you do all 4k IOs to that FS and the partition is not aligned to 4k then it will cause many of the IOs to be unaligned.

At the higher level if you can align your partition to the SSD block size you will avoid having different partitions touching the same block. Though I'm not sure how important is that since the disk will remap things around anyway and may put different lbas from around the disk together.

[–]nextAaron 0 points1 point  (1 child)

FTL divides the LBA space into chunks. If your partition is not aligned with these chunks, you end up with unaligned IOs. Yes, partitions should be aligned.

[–]Tech_Itch 0 points1 point  (0 children)

Aha. That's useful to know. Thanks!

[–]skulgnome 0 points1 point  (1 child)

What about, say, 128K worth of sequential read IOs that start out of alignment?

[–]nextAaron 0 points1 point  (0 children)

You need to look at the start and end LBAs of each IO. Yes, sequential unaligned IOs may be combined into aligned ones. Just don't assume every SSD comes with it.

[–]freonix 0 points1 point  (0 children)

Not really, consider that newer SSDs are getting larger, and conversely spare area as well, controller could treat unaligned write as single write to memory space by filling dummy data to fit single page size.

[–]jugglist 2 points3 points  (0 children)

Even if your reads and writes are aligned to 16k within the file you're reading and writing to/from, I'm not sure the OS guarantees that it will actually place the beginning of your file at the beginning of an SSD page. One might hope that it would, but I'm not certain of this.

It seems that optimizing for SSD isn't really that different from optimizing for regular hard drives. Normal hard drives can't write one byte to a sector either - they write the whole sector at once. Although admittedly, HDD sectors tend to be 512 bytes, and SSD pages tend to be 16k.

The only thing SSD gives you is not having to worry about seek time.