[all-commits] [llvm/llvm-project] 0cc19b: Reland "[BOLT][Instrumentation] Put Allocator itsl...

treapster via All-commits all-commits at lists.llvm.org
Fri Jul 7 06:39:31 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0cc19b564dd3a2b7ce51840d6ad80bd862cca15f
      https://github.com/llvm/llvm-project/commit/0cc19b564dd3a2b7ce51840d6ad80bd862cca15f
  Author: Denis Revunov <revunov.denis at huawei-partners.com>
  Date:   2023-07-07 (Fri, 07 Jul 2023)

  Changed paths:
    M bolt/runtime/instr.cpp

  Log Message:
  -----------
  Reland "[BOLT][Instrumentation] Put Allocator itslef in shared memory by default"

The issue was caused by the absence of placement new definition. It
worked for clang and thus passed Phabricator checks, but broke when
compiled with GCC on buildbot.
Full problem description: https://reviews.llvm.org/D153771#4468239

Original patch description:
In absence of instrumentation-file-append-pid option,
global allocator uses shared pages for allocation. However, since it is a
global variable, it gets COW'd after fork if instrumentation-sleep-time
is used, or if a process forks by itself. This means it handles the same
pages to every process which causes hash table corruption. Thus, if we
want shared pages, we need to put the allocator itself in a shared page,
which we do in this commit in __bolt_instr_setup.
I also added a couple of assertions to sanity-check the hash table.

Reviewed By: rafauler, Amir
Differential Revision: https://reviews.llvm.org/D153771




More information about the All-commits mailing list