]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: raise PcdShellFileOperationSize to 128KB
authorLaszlo Ersek <lersek@redhat.com>
Wed, 13 Jan 2021 08:54:45 +0000 (09:54 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 19 Jan 2021 18:23:28 +0000 (18:23 +0000)
Some UEFI shell commands read and write files in chunks. The chunk size is
given by "PcdShellFileOperationSize", whose default in
"ShellPkg/ShellPkg.dec" is 4KB (0x1000).

The virtio-fs daemon of QEMU advertizes a 128KB maximum buffer size by
default, for the FUSE_WRITE operation.

By raising PcdShellFileOperationSize 32-fold, the number of FUSE write
requests shrinks proportionately, when writing large files. And when a
Virtio Filesystem is not used, a 128KB chunk size is still not
particularly wasteful.

Some ad-hoc measurements on my laptop, using OVMF:

- The time it takes to copy a ~270MB file from a Virtio Filesystem to the
  same Virtio Filesystem improves from ~9 seconds to ~1 second.

- The time it takes to compare two identical ~270MB files on the same
  Virtio Filesystem improves from ~11 seconds to ~3 seconds.

Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3125
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Message-Id: <20210113085453.10168-3-lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
OvmfPkg/OvmfPkgIa32.dsc
OvmfPkg/OvmfPkgIa32X64.dsc
OvmfPkg/OvmfPkgX64.dsc

index 75c5f46a77860441a95d8ba39daf4ae6f20ceea9..8b6dbb83450519ef096bf99c3be151bceefce176 100644 (file)
   #\r
 !include NetworkPkg/NetworkPcds.dsc.inc\r
 \r
+  gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x20000\r
+\r
 !if $(SMM_REQUIRE) == TRUE\r
   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize|0x4000\r
 !endif\r
index 8693248b4ea0d1a2a4cc91dd0d06795c3da743f2..4d7a26636a729be0a4b812f2f6ad43066591a9a5 100644 (file)
   #\r
 !include NetworkPkg/NetworkPcds.dsc.inc\r
 \r
+  gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x20000\r
+\r
 !if $(SMM_REQUIRE) == TRUE\r
   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize|0x4000\r
 !endif\r
index 70ff2bcf2342a89dcd717a2fe8b39ee6c6e9ed4e..10f6a64d7f47d23fbda087437eeef994aedbec86 100644 (file)
   #\r
 !include NetworkPkg/NetworkPcds.dsc.inc\r
 \r
+  gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x20000\r
+\r
 !if $(SMM_REQUIRE) == TRUE\r
   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize|0x4000\r
 !endif\r