From nobody Mon Sep 25 11:58:35 2023 X-Original-To: stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RvLxp3Ht3z4vRg8 for ; Mon, 25 Sep 2023 11:58:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RvLxp2qpvz3bW3; Mon, 25 Sep 2023 11:58:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695643134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N1ptHLnLFoT99Og4R3WiJHdQhSv/HWmThdIt5YUdwnw=; b=U0WDmumnc5gySAc8jfl+MPjXLjLN6yweHmVg5Q8PWO7VuhOp7AIxhhHcGGn5qYvXVkKsYh u4neh9AY+jmreRyQyFo5kNF2BbetjHBFWurai2l9W+liJzVz5S8i6XYRnQm2jS58uD0Nzx lvWt6Jb+R5x7/mTtPJvtOcXcvNDyUIlaGNctAPVsbawqjNMhO9pHz1xX3XlEuBz4Woft89 pPO0QR5MAsORoNrKvNR+QYQpzQe/ZB1rhJ5rkpiBwco+D+FJqiP0jIVlxQ83Eco78cuPZP NfmyUVDklnFP3LuCZTIOrI8FiiBojCKJYQwzSJmhr44G3fKD05zFSMjq6cU1FA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695643134; a=rsa-sha256; cv=none; b=SfjyqaOPwCLGl4VNrHsm2/ujhBrFqKhcgPurlLwPUQmTCtNHg5YS/X+GyB8ofxakLZDqdQ oRAx4Q5e09/u5xGxowuu21l3436iNyrD/VVbaY8JciG9nVMlJH8HYDylBCCqd5Ayohl7KK 87Ie6O39pSn4965AfgYEnWXWmEyuUQj2gHzDJog9OEXP+8+WblkpPVMR2JMwEdhBt/vUCD v2yvNnPWVIWG2wbEv2M4rcMLNSxYV34ezR/IKEBDAHzTQ5LQmJOIg3DfsAS/JdbKIsgOr8 tHAh5Ih60a1ofANg+z974UY/csur+mNkkG0QCwsk94SQy8PuvyXGM06VuZGY6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695643134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N1ptHLnLFoT99Og4R3WiJHdQhSv/HWmThdIt5YUdwnw=; b=DsWswhLwXtXXPu0q8fJvtfTUxcpcaMlF7TfYxVO0EEXOyt6Bf8BfiKGHgN93Py5QBTsuA7 ARg5035cIVe5hHgYBES1PjZiZGBuoHLJnUZw4VvSkwcdIr0ono2+g38r2i1KaVB4PWVo0M czXZwx/A2ckQzlzlQtg4KzkBAq85AsPIKrgpojRvoE+7vR/WM7yOlylgpVp5FQ1KWoDgtq RS0ZFa4Hu7pGp1BhFVqDOvCabDtUdvByMs16mhxS22/Wa1SsUqWNxa5RpwBgpVuvYhWXZM 00Cka4c4bkh9bgJj8WooQN8e9UVqjH0bkqgIL7UYekl3o2I3o1vT7+shUlV7gw== Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 4RvLxp18VGz1CZc; Mon, 25 Sep 2023 11:58:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3ED2E2A8D1; Mon, 25 Sep 2023 13:58:52 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_1FDA81CF-C4AB-484D-954B-89C1A3569B46"; protocol="application/pgp-signature"; micalg=pgp-sha1 List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: nvd->nda switch and blocksize changes for ZFS From: Dimitry Andric In-Reply-To: Date: Mon, 25 Sep 2023 13:58:35 +0200 Cc: stable@freebsd.org, Warner Losh Message-Id: References: <1b6190d1-1d42-6c99-bef6-c6b77edd386a@harz2023.behrens.de> <779546e4-1135-c808-372f-e77d347ecf65@aetern.org> To: Frank Behrens X-Mailer: Apple Mail (2.3731.700.6) --Apple-Mail=_1FDA81CF-C4AB-484D-954B-89C1A3569B46 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 25 Sep 2023, at 08:42, Frank Behrens = wrote: >=20 > Hi Dimitry, Yuri and also Mark, thanks for your fast responses! >=20 > Am 23.09.2023 um 20:58 schrieb Yuri Pankov: ... > # smartctl -a /dev/nvme0 > Namespace 1 Formatted LBA Size: 512 > ... > Supported LBA Sizes (NSID 0x1) > Id Fmt Data Metadt Rel_Perf > 0 + 512 0 0 This is the default compatibility sector size of 512 bytes, so it is not = relevant. > # nvmecontrol identify nda0 and # nvmecontrol identify nvd0 (after = hw.nvme.use_nvd=3D"1" and reboot) give the same result: > Number of LBA Formats: 1 > Current LBA Format: LBA Format #00 > LBA Format #00: Data Size: 512 Metadata Size: 0 Performance: = Best > ... > Optimal I/O Boundary: 0 blocks > NVM Capacity: 1000204886016 bytes > Preferred Write Granularity: 32 blocks > Preferred Write Alignment: 8 blocks > Preferred Deallocate Granul: 9600 blocks > Preferred Deallocate Align: 9600 blocks > Optimal Write Size: 256 blocks My guess is that the "Preferred Write Granularity" is the optimal size, = in this case 32 'blocks' of 512 bytes, so 16 kiB. This also matches the = stripe size reported by geom, as you showed. The "Preferred Write Alignment" is 8 * 512 =3D 4 kiB, so you should = align partitions etc to at least this. However, it cannot hurt to align = everything to 16 kiB either, which is an integer multiple of 4 kiB. > The recommended blocksize for ZFS is GEOM's stripesize and there I see = a difference: >=20 > # diff -w -U 10 gpart_list_nvd.txt gpart_list_nda.txt > -Geom name: nvd0 > +Geom name: nda0 > modified: false > state: OK > fwheads: 255 > fwsectors: 63 > last: 1953525127 > first: 40 > entries: 128 > scheme: GPT > Providers: > -1. Name: nvd0p1 > +1. Name: nda0p1 > Mediasize: 272629760 (260M) > Sectorsize: 512 > - Stripesize: 4096 > - Stripeoffset: 0 > + Stripesize: 16384 > + Stripeoffset: 4096 Yeah, I am suspecting that nda reports the "stripesize" from the NVMe = "Preferred Write Granularity" and "stripeoffset" from the NVMe = "Preferred Write Alignment". I think Warner's the resident expert on = NVMe drivers, so maybe he's got some clue. :) -Dimitry --Apple-Mail=_1FDA81CF-C4AB-484D-954B-89C1A3569B46 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCZRF16wAKCRCwXqMKLiCW ozj7AJ4tjqxzB3PICZQs2RfvSailtzzWGQCeNbCjAQacFh8OWjxsEhW1sHr5p6c= =L89J -----END PGP SIGNATURE----- --Apple-Mail=_1FDA81CF-C4AB-484D-954B-89C1A3569B46--