[prev in list] [next in list] [prev in thread] [next in thread]
List: gentoo-user
Subject: Re: [gentoo-user] Re: Finally got a SSD drive to put my OS on
From: Mark Knecht <markknecht () gmail ! com>
Date: 2023-04-19 19:59:56
Message-ID: CAK2H+eexeFK3J6CmXWZhLgwsnZxPHKNbV_aD8=0waPGHEy2d7w () mail ! gmail ! com
[Download RAW message or body]
On Wed, Apr 19, 2023 at 12:39 PM Nikos Chantziaras <realnc@gmail.com> wrote:
>
> On 19/04/2023 22:26, Dale wrote:
> > So for future reference, let it format with the default? I'm also
> > curious if when it creates the file system it will notice this and
> > adjust automatically. It might. Maybe?
>
> AFAIK, SSDs will internally convert to 4096 in their firmware even if
> they report a physical sector size of 512 through SMART. Just a
> compatibility thing. So formatting with 4096 is fine and gets rid of the
> internal conversion.
I suspect this is right, or has been mostly right in the past.
I think technically they default to the physical block size internally
and the earlier ones, attempting to be more compatible with HDDs,
had 4K blocks. Some of the newer chips now have 16K blocks but
still support 512B Logical Block Addressing.
All of these devices are essentially small computers. They have internal
controllers, DRAM caches usually in the 1-2GB sort of range but getting
larger. The bus speeds they quote is because data is moving for the most
part in and out of cache in the drive.
In Dale's case, if he has a 4K file system block size then it's going to
send
4K to the drive and the drive will write 8 512 byte writes to put it in
flash.
If I have the same 4K file system block size I send 4K to the drive but
my physical block size is 4K so it's a single write cycle to get it
into flash.
What I *think* is true is that any time your file system block size is
smaller than the physical block size on the storage element then
simplistically you have the risk of write amplification.
What I know I'm not sure about is how inodes factor into this.
For instance:
mark@science2:~$ ls -i
35790149 000_NOT_BACKED_UP
33320794 All_Files.txt
33337840 All_Sizes_2.txt
33337952 All_Sizes.txt
33329818 All_Sorted.txt
33306743 ardour_deps_install.sh
33309917 ardour_deps_remove.sh
33557560 Arena_Chess
33423859 Astro_Data
33560973 Astronomy
33423886 Astro_science
33307443 'Backup codes - Login.gov.pdf'
33329080 basic-install.sh
33558634 bin
33561132 biosim4_functions.txt
33316157 Boot_Config.txt
33560975 Builder
33338822 CFL_88_F_Bright_Syn.xsc
If the inodes are on the disk then how are they
stored? Does a single inode occupy a physical
block? A 512 byte LBA? Something else?
I have no clue.
>
> I believe Windows always uses 4096 by default and thus it's reasonable
> to assume that most SSDs are aware of that.
>
[Attachment #3 (text/html)]
<div dir="ltr"><br><br>On Wed, Apr 19, 2023 at 12:39 PM Nikos Chantziaras <<a \
href="mailto:realnc@gmail.com">realnc@gmail.com</a>> wrote:<br>><br>> On \
19/04/2023 22:26, Dale wrote:<br>> > So for future reference, let it format \
with the default? I'm also<br>> > curious if when it creates the file \
system it will notice this and<br>> > adjust automatically. It might. \
Maybe?<br>><br>> AFAIK, SSDs will internally convert to 4096 in their firmware \
even if<br>> they report a physical sector size of 512 through SMART. Just \
a<br>> compatibility thing. So formatting with 4096 is fine and gets rid of \
the<br>> internal conversion.<div><br></div><div>I suspect this is right, or has \
been mostly right in the past. </div><div><br></div><div>I think technically they \
default to the physical block size internally</div><div>and the earlier ones, \
attempting to be more compatible with HDDs,</div><div>had 4K blocks. Some of the \
newer chips now have 16K blocks but</div><div>still support 512B Logical Block \
Addressing. <br></div><div><br></div><div>All of these devices are essentially small \
computers. They have internal </div><div>controllers, DRAM caches usually in the \
1-2GB sort of range but getting</div><div>larger. The bus speeds they quote is \
because data is moving for the most</div><div>part in and out of cache in the drive. \
</div><div><br></div><div>In Dale's case, if he has a 4K file system block size \
then it's going to send </div><div>4K to the drive and the drive will write 8 \
512 byte writes to put it in flash.</div><div><br></div><div>If I have the same 4K \
file system block size I send 4K to the drive but</div><div>my physical block size is \
4K so it's a single write cycle to get it </div><div>into \
flash.</div><div><br></div><div>What I *think* is true is that any time your file \
system block size is</div><div>smaller than the physical block size on the storage \
element then</div><div>simplistically you have the risk of write amplification. \
</div><div><br></div>What I know I'm not sure about is how inodes factor into \
this. <br><br>For instance:<br><br>mark@science2:~$ ls -i<br>35790149 \
000_NOT_BACKED_UP<br>33320794 All_Files.txt<br>33337840 \
All_Sizes_2.txt<br>33337952 All_Sizes.txt<br>33329818 All_Sorted.txt<br>33306743 \
ardour_deps_install.sh<br>33309917 ardour_deps_remove.sh<br>33557560 \
Arena_Chess<br>33423859 Astro_Data<br>33560973 Astronomy<br>33423886 \
Astro_science<br>33307443 'Backup codes - Login.gov.pdf'<br>33329080 \
basic-install.sh<br>33558634 bin<br>33561132 biosim4_functions.txt<br>33316157 \
Boot_Config.txt<br>33560975 Builder<br>33338822 CFL_88_F_Bright_Syn.xsc<br><br>If \
the inodes are on the disk then how are they <br>stored? Does a single inode occupy a \
physical<br>block? A 512 byte LBA? Something else?<br><br>I have no clue.<div><span \
style="font-family:monospace"><br></span></div><div>><br></div><div>> I believe \
Windows always uses 4096 by default and thus it's reasonable<br>> to assume \
that most SSDs are aware of that.<br>><br></div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic