[all-commits] [llvm/llvm-project] e202ff: [profile] Implement a non-mmap path when reading p...

Wael Yehia via All-commits all-commits at lists.llvm.org
Thu Mar 20 10:17:32 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e202ff45df206859b6e3c2142a735348a0d449bb
      https://github.com/llvm/llvm-project/commit/e202ff45df206859b6e3c2142a735348a0d449bb
  Author: Wael Yehia <wmyehia2001 at yahoo.com>
  Date:   2025-03-20 (Thu, 20 Mar 2025)

  Changed paths:
    M compiler-rt/lib/profile/InstrProfilingFile.c
    M compiler-rt/lib/profile/InstrProfilingUtil.c
    M compiler-rt/lib/profile/InstrProfilingUtil.h
    M compiler-rt/test/profile/Posix/instrprof-fork.c
    A compiler-rt/test/profile/instrprof-no-mmap-during-merging.c

  Log Message:
  -----------
  [profile] Implement a non-mmap path when reading profile files from a non-local filesystem (#131177)

On AIX, when accessing mmap'ed memory associated to a file on NFS, a
SIGBUS might be raised at random.
The problem is still in open state with the OS team.

This PR teaches the profile runtime, under certain conditions, to avoid
the mmap when reading the profile file during online merging.
This PR has no effect on any platform other than AIX because I'm not
aware of this problem on other platforms.
Other platforms can easily opt-in to this functionality in the future.

The logic in function `is_local_filesystem` was copied from
[llvm/lib/Support/Unix/Path.inc](https://github.com/llvm/llvm-project/blob/f388ca3d9d9a58e3d189458b590ba68dfd9e5a2d/llvm/lib/Support/Unix/Path.inc#L515)
(https://reviews.llvm.org/D58801), because it seems that the
compiler-rt/profile cannot reuse code from llvm except through
`InstrProfData.inc`.

Thanks to @hubert-reinterpretcast for substantial feedback downstream.

---------

Co-authored-by: Wael Yehia <wyehia at ca.ibm.com>
Co-authored-by: Hubert Tong <hubert.reinterpretcast at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list