Date: Tue, 30 Aug 2022 15:41:59 +0000 From: Rick Macklem <rmacklem@uoguelph.ca> To: Mateusz Guzik <mjguzik@gmail.com>, Alexander Motin <mav@FreeBSD.org>, Alan Somers <asomers@freebsd.org> Cc: "src-committers@FreeBSD.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@FreeBSD.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@FreeBSD.org" <dev-commits-src-main@FreeBSD.org> Subject: Re: git: 35b7759c05cb - main - cp: Fix build without VM_AND_BUFFER_CACHE_SYNCHRONIZED. Message-ID: <YQXPR01MB415043ACC269C3256EAFB959DD799@YQXPR01MB4150.CANPRD01.PROD.OUTLOOK.COM> In-Reply-To: <CAGudoHEMRkBRT6ew9ROh1p-mmYCbkT%2BewuMdLTdUAiqwg=_3Og@mail.gmail.com> References: <202208301453.27UEroGr037461@gitrepo.freebsd.org> <CAGudoHEphH-4pKGf=ta4AWir2Uj9Mg_tUysU1V5ic6z_XVQG4Q@mail.gmail.com> <YQXPR01MB41500177CCDFEECFBE95861EDD799@YQXPR01MB4150.CANPRD01.PROD.OUTLOOK.COM> <837f27fc-97b0-6e71-50c0-12b8799e574d@FreeBSD.org> <CAGudoHEMRkBRT6ew9ROh1p-mmYCbkT%2BewuMdLTdUAiqwg=_3Og@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Mateusz Guzik <mjguzik@gmail.com> wrote:=0A= > On 8/30/22, Alexander Motin <mav@freebsd.org> wrote:=0A= >> On 30.08.2022 11:02, Rick Macklem wrote:=0A= >>> Mateusz Guzik <mjguzik@gmail.com> wrote:=0A= >>>> On 8/30/22, Alexander Motin <mav@freebsd.org> wrote:=0A= >>>>> The branch main has been updated by mav:=0A= >>>>>=0A= >>>>> URL:=0A= >>>>> https://cgit.FreeBSD.org/src/commit/?id=3D35b7759c05cbc65c06d87141da7= 9f0f80af0f458=0A= >>>>>=0A= >>>>> commit 35b7759c05cbc65c06d87141da79f0f80af0f458=0A= >>>>> Author: Alexander Motin <mav@FreeBSD.org>=0A= >>>>> AuthorDate: 2022-08-30 14:51:21 +0000=0A= >>>>> Commit: Alexander Motin <mav@FreeBSD.org>=0A= >>>>> CommitDate: 2022-08-30 14:51:21 +0000=0A= >>>>>=0A= >>>>> cp: Fix build without VM_AND_BUFFER_CACHE_SYNCHRONIZED.=0A= >>>>>=0A= >>>>> It allows to not use mmap() for small files, which is not helpfu= l=0A= >>>>> in case of ZFS. Should be no functional change.=0A= >>>>>=0A= >>>>=0A= >>>> This should be of no use thanks to copy_file_range=0A= >>> cp does not use copy_file_range(2) for small files, if I recall=0A= >>> correctly.=0A= >>=0A= >> Right. I tried to look for motivation, but history of this file goes=0A= >> back to 4.4 Lite. :) I wonder whether copy_file_range(2) for UFS does= =0A= >> something clever, like this mmap() to avoid additional memory copy.=0A= It does not at this time. Unless both files are on the same file system and= =0A= the file system provides a custom VOP_COPY_FILE_RANGE() { only NFS has=0A= one at this time }, it simply uses vn_rdwr() to do the file system I/O.=0A= =0A= A custom VOP_COPY_FILE_RANGE() can be implemented for file systems,=0A= if there is a better way for that file system.=0A= =0A= >> For=0A= >> ZFS though it cause big problem with buffer cache squeezing ARC to=0A= >> absolute minimum. So if there is agreement to modernize this, I'd=0A= >> completely support it.=0A= >>=0A= >> --=0A= >> Alexander Motin=0A= >>=0A= >=0A= >The way I see it userspace cannot do it any faster.=0A= >=0A= >Especially with the zfs considerations it makes sense to straight up=0A= >copy_file_range if you can and let the kernel figure out what to do in=0A= >a sensible manner. Thought I have no idea if zfs is currently handled=0A= >in such a way. Someone(tm) should look into it.=0A= I've added asomers@, since he did the commit to cp so that=0A= it used copy_file_range(2) and left it doing small files using mmap(2).=0A= =0A= rick=0A= =0A= --=0A= Mateusz Guzik <mjguzik gmail.com>=0A=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YQXPR01MB415043ACC269C3256EAFB959DD799>