From nobody Fri Jan 10 16:17:19 2025 X-Original-To: freebsd-hackers@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 4YV6Hx4xFQz5kb35 for ; Fri, 10 Jan 2025 16:17:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV6Hx0Hxkz3xQ6 for ; Fri, 10 Jan 2025 16:17:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=XxchnTlB; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::102d) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2ee50ffcf14so5152705a91.0 for ; Fri, 10 Jan 2025 08:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1736525851; x=1737130651; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PUhTF3XcyGSPrgbYkWy0AdEDTEcKZmlI+x4U7XZqm8E=; b=XxchnTlB2OILgFdY2n0sTSVjfIyB0QzdgLok91O4Gvx70u5rGbWJNUdDnCn11qsFnX ZMiOxd0a56wVtdaVNYk1GNp/JLOZr5+EiHTbtL6uvWC55Z2HuI1BeGjM0V9KTRhqYFM9 LcHJkQk8K6NUVH1Yyn6aT6RFzkTuVMvyjoKj+/3dVsNGd6iwBUUh88B6z3xxQYue6RE4 fIbX96VBNdBJFDyuj/Ogb/6Do3XlSWGulvqGzC0wJt5/miy8nwXGmo1K7VTyd9Uk7pfb SPDyPjCfwvo7v2RnK2lVxB6x603SYbEO+gXzBsg1uEsKsI3tEn85Phljhd0MFjuKB23k roNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736525851; x=1737130651; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PUhTF3XcyGSPrgbYkWy0AdEDTEcKZmlI+x4U7XZqm8E=; b=RPLro3AwFHja8dnDei8SuKAZMIZFVE2J87KqXgGH0woSUDhj2CeJEWN55b4pXrPR3y zuDEFwuqagCMz4YztZPeUcBJPEl2DBKYWLmA0f6EgJDfEsqqleSm4au3Omuo21UPcHpX 51W59dkUHGCIqVoVxdtQDYOijY//gmEJg03eILD+V2/sR+5cLp0hSTXhY4vJZPkXofMO JDZxVSicbhcnX8dJvQzOXNvCBEW95JgWcIEBGHbofkoSMDWFKOMBsPQMuYZ+S9B4SUjZ 782Mn21jmwGMFCzS0/GrP/GA6hXyDMaWpZA8ctZR1JXghvBWjzqh0HNIdn6iNhhXTGDk 8lNw== X-Forwarded-Encrypted: i=1; AJvYcCUvJoebgMgAEFKRajyPR7Gyo9oCwdFqcxfKGKoCt42DVi32MlTF/6Q9Xl5p30ePR2N/hsmLofEsM45lT09VR94=@freebsd.org X-Gm-Message-State: AOJu0Yw/B14xjUPeH6H1kEPt6lWnExgCMrHzf3G/KcIc43NFXLEFAUjf /ZtxZxqsa3oe843hsr8p/tv2VFv4IN3Huo6UKZp4vGQU+GBqwwYGVmkSpOU1E+qVdMcqaD4OemR bQhhs/Nr8e23t7E6DU9NJMPhXqvkXJa5tFGU1KVuClrdrUghaUsA= X-Gm-Gg: ASbGncuZw8bfg2jggbX+dllTJFrGBpZPdgF1V4NI8tLP7qzIZimSrHkLoKbYgQL/2bk SHBd7SH2tTMQ6azkErSAF1pSZcCfhiqXPpdqG1A== X-Google-Smtp-Source: AGHT+IHsg4c+R1xnRMcukpFOwljg2wiwJh+VU962z5bhJNtWYYGJ5ASusiqsKCgj2oOyBkwL3hUy7i0iFcpZCeGayuE= X-Received: by 2002:a17:90b:2705:b0:2ee:5c9b:35c0 with SMTP id 98e67ed59e1d1-2f55836a9c8mr9428648a91.9.1736525851129; Fri, 10 Jan 2025 08:17:31 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Fri, 10 Jan 2025 09:17:19 -0700 X-Gm-Features: AbW1kvZaiDpgGvNv6_YFZ69N3MjbpkMnvSrxX3iXF7yIcjoZWWC7lz6qoRL6fyA Message-ID: Subject: Re: WRITE_SAME support in FreeBSD nfsd NFSv4.1 mode? To: Rick Macklem Cc: Dan Shelton , freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="0000000000008017d4062b5c6e56" X-Rspamd-Queue-Id: 4YV6Hx0Hxkz3xQ6 X-Spamd-Bar: - X-Spamd-Result: default: False [-1.99 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.993]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DMARC_NA(0.00)[bsdimp.com]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_NA(0.00)[no SPF record]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TAGGED_RCPT(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::102d:from] --0000000000008017d4062b5c6e56 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 10, 2025 at 7:58=E2=80=AFAM Rick Macklem wrote: > On Thu, Jan 9, 2025 at 8:14=E2=80=AFPM Dan Shelton > wrote: > > > > On Fri, 10 Jan 2025 at 02:59, Rick Macklem > wrote: > > > > > > On Thu, Jan 9, 2025 at 4:31=E2=80=AFPM Dan Shelton > wrote: > > > > > > > > Hello! > > > > > > > > Does FreeBSD nfsd support the WRITE_SAME request in NFSv4.1 mode? > > > Not at this time, I'm afraid. > > > > > > Maybe in a future release, rick > > > > How fast could it be implemented? > For the simplest version, not too long. > The simplest version would be synchronous only and use > VOP_WRITE() calls. Doing a new VOP_xxx() call to try and optimize > it per-fs would take quite a bit longer. (I know very little about ZFS, > but just > maybe, block cloning would be useful for this?) > I had discussions years ago about adding a BIO_WRITE_SAME and whether or not it made sense. It's mildly helpful to just send one write command that writes all the LBAs using the SCSI WRITE SAME command. But it got hairy in a hurry and WRITE SAME is mostly only used to unmap / trim blocks anyway. But only SCSI drives support this, and it's been too long to recall if they all support writing multiple blocks from the same OUT BUFFER or not. NVME doesn't have a similar concept (just write zeros), so I gave up on it. I didn't have a good use case for it. Warner > Btw, it is a NFSv4.2 call, so it would only be supported for NFSv4.2 and > not > NFSv4.1. > > rick > > > > > Dan > > -- > > Dan Shelton - Cluster Specialist Win/Lin/Bsd > > > > --0000000000008017d4062b5c6e56 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Jan 10,= 2025 at 7:58=E2=80=AFAM Rick Macklem <rick.macklem@gmail.com> wrote:
On Thu, Jan 9, 2025 at 8:14=E2=80=AFPM Dan= Shelton <d= an.f.shelton@gmail.com> wrote:
>
> On Fri, 10 Jan 2025 at 02:59, Rick Macklem <rick.macklem@gmail.com> wrote:<= br> > >
> > On Thu, Jan 9, 2025 at 4:31=E2=80=AFPM Dan Shelton <dan.f.shelton@gmail.com<= /a>> wrote:
> > >
> > > Hello!
> > >
> > > Does FreeBSD nfsd support the WRITE_SAME request in NFSv4.1 = mode?
> > Not at this time, I'm afraid.
> >
> > Maybe in a future release, rick
>
> How fast could it be implemented?
For the simplest version, not too long.
The simplest version would be synchronous only and use
VOP_WRITE() calls. Doing a new VOP_xxx() call to try and optimize
it per-fs would take quite a bit longer. (I know very little about ZFS, but= just
maybe, block cloning would be useful for this?)
--0000000000008017d4062b5c6e56--