[PATCH] D115957: [Support] Revert posix_fallocate in resize_file

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 17 10:56:59 PST 2021


MaskRay created this revision.
Herald added subscribers: dexonsmith, hiraditya, krytarowski, arichardson, mgorny, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This reverts 3816c53f040cc6aa06425978dd504b0bd5b7899c and removes follow-up
fixups.

The original intention was to show error earlier (posix_fllocate time) than
later for ld.lld but it appears to cause some problems which make it not free.

- FreeBSD ZFS: EINVAL, not too bad.
- NetBSD: maybe EOPNOTSUPP
- Linux tmpfs: unless and tmpfs is set up to use huge pages (requires CONFIG_TRANSPARENT_HUGE_PAGECACHE=y), I can consistently demonstrate ~300ms delay for a 1.4GiB output.
- Linux ext4: I currently don't measure any benefit
- The current code organization of `defined(HAVE_POSIX_FALLOCATE)` costs us a macro dispatch for AIX.

I think we should just remove it. I think if it ever finds demonstrable benefit,
it is likely Linux specific and will not need HAVE_POSIX_FALLOCATE.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115957

Files:
  llvm/cmake/config-ix.cmake
  llvm/include/llvm/Config/config.h.cmake
  llvm/lib/Support/Unix/Path.inc
  llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
  utils/bazel/llvm-project-overlay/llvm/config.bzl
  utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h
  utils/bazel/llvm_configs/config.h.cmake

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115957.395173.patch
Type: text/x-patch
Size: 4381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211217/3774c617/attachment.bin>


More information about the llvm-commits mailing list