From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A0DD715ACFB for ; Tue, 18 Apr 2023 08:04:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AFF99E0880; Tue, 18 Apr 2023 08:04:04 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E7950E0844 for ; Tue, 18 Apr 2023 08:04:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1681805037; i=warp_7@gmx.de; bh=MZbIfoTxKEjgo/NPvtBMpp0KFmq56VmoUnfLmxx//iQ=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=RWBV5FjxotEvIjQCt67pTj5pdAqt7nw+ytY61y3V0Ktb9iqjpJzmRgRQtzezvPzhl R9kgVW2KX3lqphTjAraohqCt8lkpCvr0LdUs+WZhy8fOqORcPoiOwESIR8GxKkD4Fl Z/tfcylcH4l9ezE9dgLKnWpZmqxtWKX2HoJ5TXhbk/uij9PP78a1lYyx46lxNTEFuE a92fxm0QrnnRdNAddR8Z0CFmRQBLP5wwlS0BvQo+RTRG7qXYRGTM3w4d0Yb9MELnET dBKCewM7hPU9JsG9A3JeJdegUbCkpEa7jK6QbOgn7wcCWySNIIpgpKVy0vax6xkKjj ud+x2YcLzmgXw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from moby ([92.117.38.115]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1McpNy-1qNSpz1ara-00ZtK8 for ; Tue, 18 Apr 2023 10:03:57 +0200 Date: Tue, 18 Apr 2023 10:03:53 +0200 From: Frank Steinmetzger To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Finally got a SSD drive to put my OS on Message-ID: Mail-Followup-To: gentoo-user@lists.gentoo.org References: <8662fe97-64dc-cbf4-ce49-737ea9b14d06@gmail.com> <28eb1e13-0278-8656-67b7-9d995520f9ce@gmail.com> <83843fb3-8768-4674-7a75-0bf8377c7664@youngman.org.uk> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iLPf7N/34ZFZUqbc" Content-Disposition: inline In-Reply-To: User-Agent: Mutt 2.2.10; VIM - Vi IMproved 9.0 X-Provags-ID: V03:K1:eH/uLmJWn7BnrZbky3zKMA+lbPULIOMjjOcNg7EK6Xa7KmPlCp3 Hw1Ii3ofmEZEM9r6l8l+swQEgFh5i2PPxE2OrCP88xjKXUMSC6jl0K0lgNQCH9K+gOdMiOh 4JnaoUd/hnovbNBGFdgW7d0sTVBT1E6/c4kst+idN1cpFTU7NS1FCjxuaOwckt33yOouyIG ETCTZa7jJuG8opv/I2tww== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:hSWl3Yh6mkw=;HNW6tWRXhMdq/xW5dDjE8SNhifh PLXCu0z8uxpS+ykuoeUXkZtboP5XBVNASR3NNunsYPzFOTHcDj2xeLMi+AlZm+wb11T4u9Brk /8VMTTKmEnS6SEl/hgHJsnCCK9ZEiS3d5OLRkXHRtp+r82PKi7gA7E9uurOA16poaDRr7rvQU PgFU4xqMfluMQwnkaOEFI8Wj4YjS9n3+PDLmNbLUfU5Koe4Cj0kSOylKAwUiWEvMmBH24XZkd lKxFivVmt+CBxrSD1G/5WZurwal4FuJYZkWHHsXfv61QOw2c6EKudKLnpz7S8Lxj+dSxsfyr4 dLQ/tXY0QURIR+5m/wrLDtWh+Ay72EcntsHtoJ63FlqqQnU2Y2JGFCaG98+Ftclq4ExRlNstV EymFjGkb12WzBXmpfHrbyu4Fo6/HkGmzxQaV/rdJ3lPcm+nQQzQTggIEKWXj1ZGzXKioseU4C CSSrxaxGA/h2//jC5jEHUqoKx/WgBUsdO+3uOY7QE/xZbOtF24vH6kMZNHMmP81amwd6TMrfx g4ywUhrt1oYnK3DsrXIwXkXVftpxu6qNm4/dxzRSnSJo5rSnTkezk94tNeVP25EXtBIbFYVBh YjcIsUPyWtHsO3D9dwevFdVs2AQAJmyVc2kl1jk1tk47CAd9fkhoahy5f4y1MQr875ciLZG+j sdqdsll1CmdobsN3cYRnWXkj2TaxrNiXPjIYuC2d4tWx9Jd2z5WlGx32uGaWzWfdPGd1wuikj xDDEveM1PYpSi11XDwyYVUo7aQDrkMqdtWozdRlqu0rGYtUXHLnj0TLyA4Hdjh0qWazSrJSSi q0c2kQshvFLl2TWdlqb0B5jq4iqZWC5pl+ifmu2xqJcQ+JQO3zd15J18pKEG6pWXHidv1HqYw db2KUYnmdl9loEOp6rx7Sw/UlfC7caDGmNPEzC1oh78612MSb5BQtsnZCD6VspOQ1oBuAW9Pj w6/F6g== X-Archives-Salt: 3e500623-3da3-4ff9-b382-ef0b966a3c75 X-Archives-Hash: aa942c475fdd09d7a27493b97013e0ca --iLPf7N/34ZFZUqbc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am Mon, Apr 17, 2023 at 10:45:46AM -0700 schrieb Mark Knecht: > And I don't know that formatting ext4 or some other FS to 16K > really helps the write amplification issue but it makes sense to > me to match the file system blocks to the underlying flash > block size. The problem is finding out the write block size. This 7-year-old post says= =20 it=E2=80=99s reached 16 K: https://superuser.com/questions/976257/page-size= s-ssd So I would say don=E2=80=99t bother. If everything is trimmed, there is no= =20 amplification. And if the disk becomes full and you get WA when writing=20 itsy-bitsy 4 K files, you probably still won=E2=80=99t notice much differen= ce, as=20 random 4 K writes are slow anyways and how often do you write thousands of 4 K files outside of portage? Erase block sizes probably go into the megabytes these days: https://news.ycombinator.com/item?id=3D29165202 Some more detailed explanation: https://spdk.io/doc/ssd_internals.html =E2=80=9CFor each erase block, each bit may be written to (i.e. have its = bit=20 flipped from 0 to 1) with bit-granularity once. In order to write to the= =20 erase block a second time, the entire block must be erased (i.e. all bits= =20 in the block are flipped back to 0).=E2=80=9D This sounds like my initial statement was partially wrong =E2=80=93 trimmin= g does=20 cause writing zeroes, because that=E2=80=99s what an erase does. But it sti= ll=20 prevents write amplification (and one extra erase cycle) because=20 neighbouring blocks don=E2=80=99t need to be read and written back. > Real speed testing would be required to ensure reading > 16K blocks doesn't slow him down though. Here are some numbers and a conclusion gathered from a read test: https://superuser.com/questions/728858/how-to-determine-ssds-nand-erase-blo= ck-size Unless I positively need the speed for high-performance computing, I=E2=80= =99d=20 rather keep the smaller granularity for more capacity at low file sizes. A problem is what some call =E2=80=9Cparts lottery=E2=80=9D these days: man= ufacturers=20 promise some performance on the data sheet (=E2=80=9Cup to xxx=E2=80=9D), b= ut not with which=20 parts they want to achieve this (types of flash chips, TLC/QLC, controller,= =20 DRAM and so on). Meaning during the lifetime of a product, its internals ma= y=20 change and as a consequence those specs are not in the data sheet: https://unix.stackexchange.com/questions/334804/is-there-a-way-to-find-out-= ssd-page-size-on-linux-unix-what-is-physical-block =E2=80=9CThere is no standard way for a SSD to report its page size or er= ase block=20 size. Few if any manufacturers report them in the datasheets. (Because=20 they may change during the lifetime of a SKU, for example because of=20 changing suppliers.) For practical use just align all your data structures (partitions, payloa= d=20 of LUKS containers, LVM logical volumes) to 1 or 2 MiB boundaries. It's a= n=20 SSD after all--it is designed to cope with usual filesystems, such as NTF= S=20 (which uses 4 KiB allocation units).=E2=80=9D --=20 Gr=C3=BC=C3=9Fe | Greetings | Qapla=E2=80=99 Please do not share anything from, with or about me on any social network. The worst disease is indifference. So what? --iLPf7N/34ZFZUqbc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEVbE9o2D2lE5fhoVsizG+tUDUMMoFAmQ+TucACgkQizG+tUDU MMrrzQ/+K1DqgK7vv814CAOrPTEPzzBbs5ioySdpWinvIA+Je8YR7Iq1GSZjQcNJ Nho+V6ZWSDzfmDES4ZYwMWiMXECmiTnzd7xD1NY1c5KOXgtR+1sJUXK0WAjUoEDi SONH4pqyarwscLy/w6xSoOfHJuTqw27VOrL5kIg27nKUBrhzWqc+D61/rG+6F9aZ MbrRk+T9ppBeCNdSydlD3v6n99OwWCbqfK4FlbnevPGASfALxJn13RhKNzjSoiBH MdAGta4yjRcA6woPaGWpdejw9XJeY22wB9c8uK6nDeFPTMeejIRDOmavVxl+vStM bZ3CFjEANU5Pp2N7IiS9wESKM9QIZLn/+1UsxD8+2w+Ypc22wYzyHmXAb2+55Nfn MMaEBlLA9Yz3+KepQ/XVgOonIsNqVFUTnYGOve+L19eWA9OKTWGnzWJ2hjEtYAyM TEA95rlpbiy6hPHDT+kyJ88w8zv53sMbeWvC3HdeNpFgZ7+W++a2WIWSIQFyUFxI 4vnsey4CsnR/uoZgNaCKqPyjHKNAbUCDTnV5w+XWEk7bxHbEetp3O87iDSWJBfH8 lFAztutAj62QdEwZP7W6zD8iLa/OPulGjND3PqahtEUvB7cXWNbxqQszriJ+hCPf KYDZc8jthUloEn2m3WP/Csg2+CalJr235W0tSc/M21T2gcHIc3w= =jnx6 -----END PGP SIGNATURE----- --iLPf7N/34ZFZUqbc--