[Toybox] copy_file_range and (1<<30)

enh enh at google.com
Thu May 25 17:08:01 PDT 2023


so i finally enabled copy_file_range for the _host_ toybox because someone
pointed out that we copying 16GiB zip files around in the build, and even
though obviously we should stop doing that, 30s seemed unreasonable, and
coreutils cp "only" took 20s because of copy_file_range.

but toybox cp with copy_file_range still takes 25s. why?

      if (bytes<0 || bytes>(1<<30)) len = (1<<30);

the checkin comment being:

Update comments and add "sanity check" from kernel commit f16acc9d9b376.
(The kernel's been doing this since 2019, but older kernels may not, so...)

what the kernel _actually_ does though is clamp to MAX_RW_COUNT. which is
actually (INT_MAX & PAGE_MASK). which i'm assuming changes for a non-4KiB
page kernel?

sadly 2019 is only 4 years ago, so there's a decent chunk of the 7 year
rule left to run out...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230525/555fa154/attachment.htm>


More information about the Toybox mailing list