Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pldm-create-phyp-nvram*: Use
truncate(1)
instead of dd(1)
(#424)
Use of `dd(1)` to create large "empty" files can cause significant performance issues. Poor application of the `bs=` parameter can cause a huge amount of syscall overhead with many back-to-back `read(2)`, `write(2)` syscalls issued. Using `truncate(1)` is much more effective as it can be used to expand the size of a file without invoking `write(2)`. By example, switching `pldm-create-phyp-nvram.service` from `dd(1)` to `truncate(1)` reduces the CPU time consumed from 15.898s to 0.032s under QEMU, yielding a 496x increase in performance. Change-Id: Iad8e51725a056fc80d6f3179c15996ad44700aac Signed-off-by: Andrew Jeffery <[email protected]>
- Loading branch information