View Single Post
  #167   Report Post  
Posted to uk.d-i-y
John Rumm John Rumm is offline
external usenet poster
 
Posts: 25,191
Default Samsung SSD 750 EVO v 850 EVO / Ubuntu

On 18/10/2016 15:14, The Natural Philosopher wrote:
On 18/10/16 13:24, John Rumm wrote:
On 17/10/2016 21:30, The Natural Philosopher wrote:
On 17/10/16 20:07, John Rumm wrote:
On 17/10/2016 12:34, The Natural Philosopher wrote:



There are no 'misaligned' partitions.

Just partitions.


OK, so if you look at the Intel document from 2014[1], they explain why
misaligned partitions cause performance impacts on their drives of that
time. You have claimed that that information is out of date, and its no
longer an issue. Could you point to an authoritative source that
justifies that claim?

Or are you claiming that Intel drives are just way behind the current
state of the art, and other makers drives don't suffer the problem, but
then Intel ones still do? In which case it sounds like a strong
marketing hook the other drive makers would use. Could you point to
some documentation reflecting this?


If you look at the actual strategies - and I supplied pointers to then -
google 'wear levelling' you will realise that is a massively complex
process right away, and completely destroys any relationship between
what the disk reports as a block device and where physically the data is
stored. Yea even unto splitting blocks of data up into different flash
pages or amalgamating two different 'sectors'; into one flash page.


Yup, not questioning that wear levelling is a complex subject. However
its a side issue here.

IN essence the disk is a database, with sectors located wherever they
happen to end up, and indexed by a database like structure that relates
the sector number of the logical device, to an offset in a flash page
somewhere on the disk.

And tuning the garbage correction and read and write algorithms is the
best way to increase the system life.

Logical sectors that have never been written , simply do not have any
physical area assigned to them.


Yup, I don't have any problem with that.

The asertion of the partitioneers, is that if you start a partition with
whatever information it has in it, on a less rthan e.g. 4K boundary,
that will result in more cross-page writes. Firstly I dont see that is
true even if the algorithm is always to apply aligned sectors in 4k
chunks to a 4k flash page.


I think you are mentally over complicating this.

At some point the authors of the device firmware need to make a design
decision about how they are going to store sectors. Modern 4K "advanced
format" drives have native 4K sectors (these have been the standard for
the last 5 years or so). All modern OSes will create partitions aligned
on 4K boundaries. Modern OSes also do basic disk IO transaction in 4K
lumps. So it would seem like a fairly safe bet for the designer to try
and ensure that writes of a complete 4K sector generate as few accesses
to physical storage as possible. Obviously you would choose to store an
integer number of sectors in a single page of flash. There would be
absolutely no advantage to do otherwise.

(Also keep in mind that this issue affects all 4K AF drives, not just
SSDs. Its only the SSDs that have the additional complication of life
expectancy reductions / write amplification issues as well, but even
spinning rust drives will take a performance hit)

But I see no reason why if the disk detects a sequence of data starting
at say 133rd sector....it would not start that at the beginning of the
flash page, assuming it has no prior knowledge of this sequence.


What size sector are you talking about? The difficulty comes from the
fact that the although the drive is now a native 4K sector device, most
of them still presents a legacy interface that allows 512 sectors to be
manipulated. Normally an OS will do this 8 at a time, and normally 4K
aligned, so its not a problem. However when the drive is presented with
a block of 8 (512 byte) sectors that straddle separate pages in storage
you now have extra pages to access.

After all, all that is being maintained is a database of Logical
sector-physical flash pageage offset.

There is no reason to say that because the sector number is, modulo 4,
number 3, that the page offset should also be 3.

Note that nearly all of this IIRC only applies to windows, as Linux file
systems are aligned on much larger page sizes anyway.


This is not a platform specific problem - exactly the same issues can
apply to Linux etc.

The point I wanted to make way back before all the name calling started,


I don't recall calling anyone names.

was that they way data is physically organised on a flash disk bears no
relation whatsoever to how it is presented logically. It is organised
precisely to minimise writes and erases, and to ensure that when those
take place, they are as evenly spread as possible.


Indeed - and one way to minimise erase operations is to avoid Read
Modify Write cycles...

Therefore theories that changing the nature of OS access to the
*logical* structure will impact on the physical processes are at best
optimistic simplistic and dependent on a poor implementation of wear
levelling and garbage collection algorithms. At worst they are risible
nonsense.


And yet you have seen recent documentation from Intel explaining why
this is a problem. There are also head to head performance results about
that demonstrate the performance hit from misalignment.

And there is evidence that more than one manufacturer has firmware that
exactly understands partitions of the NTFS sort and has adjusted its
algorithms accordingly. Why would they not?

https://en.wikipedia.org/wiki/Write_...age_collection


Yup, again missing the point.

A little knowledge is a dangerous thing., To someone with a little
knowledge, someone with a lot more appears ignorant and uninformed.

The 'partition your SSD correctly' appears to be an urban (windows)
myth, that has propagated widely, and yet no explanation of why it works
is consistent with my understanding of how logical to physical mapping
works in a real life SSD.


Well that could be because you are right and everyone else is misguided,
or it could be your basic understanding is flawed somewhere.

And because I have written code to analyse and understand file systems
at the sector level, I know its really not hard to understand what type
of FS and what structure is located where, on a disk.


And yet you still seem to be veering off at these tangents. This is not
a filesystem issue. Try actually thinking like a programmer, and it
should make perfect sense.

The crucial step is of course coding that can cope with arbitrary
locations of a 512 byte sector, rather than a 4k or 16k block that it
might be part of.


Of course the system can cope with individual 512 byte sectors, however
you optimise your system for the typical use case, and 90% of those will
be 4K sector reads/writes on 4K boundaries.

I can conceive that a rubbish programmer with no understanding of file
systems or flash might cobble up something that bad for a prototype
product, but in a fiercely competitive field with longevity being an
essential part of the product attributes, its unlikely that better
algorithms and more flexible mapping systems would not evolve.


Apply Occam's razor.

[1]
http://www.intel.co.uk/content/dam/w...tech-brief.pdf


Is an interesting document to be sure.



Perhaps you should offer your wisdom to the drive makers, because they
all seem to have fallen for it...

Here is the alignment tool from WD:

http://support.wdc.com/downloads.aspx?p=128&lang=en

Here is the HGST document on the use of their tool:

https://www.hgst.com/sites/default/f...User_Guide.pdf

Here is the documentation for Seagate's tool / hack:

http://www.seagate.com/docs/pdf/whit...nology_faq.pdf






--
Cheers,

John.

/================================================== ===============\
| Internode Ltd - http://www.internode.co.uk |
|-----------------------------------------------------------------|
| John Rumm - john(at)internode(dot)co(dot)uk |
\================================================= ================/