<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/ExecutionEngine/Orc/MapperJITLinkMemoryManager.cpp, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[ORC] MapperJITLinkMemoryManager should deinitialize on abandon, not deallocate.</title>
<updated>2025-03-31T03:08:42+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@apple.com</email>
</author>
<published>2025-03-31T02:08:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dad86f5931453ff3d14ba5adb93855ee780298b2'/>
<id>dad86f5931453ff3d14ba5adb93855ee780298b2</id>
<content type='text'>
The JITLinkMemoryManager::InFlightAlloc::abandon method should only abandon
memory for the current allocation, not any other allocations. In
MapperJITLinkMemoryManager this corresponds to the deinitialize operation, not
the deallocate operation (which releases whole slabs of memory that may be
shared by many allocations).

No testcase: This was spotted by inspection. The failing program was linking
concurrently when one linker instance raised an error. Through the call to
abandon an entire underlying slab was deallocated, resulting in segfaults in
other concurrent links that were sharing that slab.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The JITLinkMemoryManager::InFlightAlloc::abandon method should only abandon
memory for the current allocation, not any other allocations. In
MapperJITLinkMemoryManager this corresponds to the deinitialize operation, not
the deallocate operation (which releases whole slabs of memory that may be
shared by many allocations).

No testcase: This was spotted by inspection. The failing program was linking
concurrently when one linker instance raised an error. Through the call to
abandon an entire underlying slab was deallocated, resulting in segfaults in
other concurrent links that were sharing that slab.
</pre>
</div>
</content>
</entry>
<entry>
<title>[ExecutionEngine] Remove unused includes (NFC) (#116749)</title>
<updated>2024-11-20T03:41:59+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-11-20T03:41:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1f4d91ecb8529678a3d3919d7523743bd21942ca'/>
<id>1f4d91ecb8529678a3d3919d7523743bd21942ca</id>
<content type='text'>
Identified with misc-include-cleaner.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identified with misc-include-cleaner.</pre>
</div>
</content>
</entry>
<entry>
<title>[ORC][JITLink] Move MemoryFlags.h (MemProt, AllocGroup,...) from JITLink to ORC.</title>
<updated>2022-10-04T02:35:34+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2022-10-02T18:19:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d3d9f7caf96680dad4ef0fd108e64ca044a0a113'/>
<id>d3d9f7caf96680dad4ef0fd108e64ca044a0a113</id>
<content type='text'>
Moving these types to OrcShared eliminates the need for the separate
WireProtectionFlags type.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Moving these types to OrcShared eliminates the need for the separate
WireProtectionFlags type.
</pre>
</div>
</content>
</entry>
<entry>
<title>[ORC][ORC-RT][MachO] Reset __data and __common sections on library close.</title>
<updated>2022-09-16T20:40:19+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2022-09-16T18:23:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=47e9e588083493414d0abfbe33fe3566879c219b'/>
<id>47e9e588083493414d0abfbe33fe3566879c219b</id>
<content type='text'>
If we want to be able to close and then re-open a library then we need to reset
the data section states when the library is closed. This commit updates
MachOPlatform and the ORC runtime to track __data and __common sections, and
reset the state in MachOPlatformRuntimeState::dlcloseDeinitialize.

This is only a first step to full support -- there are other data sections that
we're not capturing, and we'll probably want a more efficient representation
for the sections (rather than passing their string name over IPC), but this is
a reasonable first step.

This commit also contains a fix to MapperJITLinkMemoryManager that prevents it
from calling OnDeallocated twice in the case of an error.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we want to be able to close and then re-open a library then we need to reset
the data section states when the library is closed. This commit updates
MachOPlatform and the ORC runtime to track __data and __common sections, and
reset the state in MachOPlatformRuntimeState::dlcloseDeinitialize.

This is only a first step to full support -- there are other data sections that
we're not capturing, and we'll probably want a more efficient representation
for the sections (rather than passing their string name over IPC), but this is
a reasonable first step.

This commit also contains a fix to MapperJITLinkMemoryManager that prevents it
from calling OnDeallocated twice in the case of an error.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Orc] Actually save the callback</title>
<updated>2022-08-21T11:06:37+00:00</updated>
<author>
<name>Anubhab Ghosh</name>
<email>anubhabghosh.me@gmail.com</email>
</author>
<published>2022-08-20T19:49:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5df428eac37fddbe35c1a18d975ea836277708c1'/>
<id>5df428eac37fddbe35c1a18d975ea836277708c1</id>
<content type='text'>
The callback function was captured by reference but it lived on the
stack and was in danger of being overwritten and could cause a crash.

Differential Revision: https://reviews.llvm.org/D132313
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The callback function was captured by reference but it lived on the
stack and was in danger of being overwritten and could cause a crash.

Differential Revision: https://reviews.llvm.org/D132313
</pre>
</div>
</content>
</entry>
<entry>
<title>[Orc] Use IntervalMap to store free memory regions in MapperJITLinkMemoryManager</title>
<updated>2022-08-14T09:05:08+00:00</updated>
<author>
<name>Anubhab Ghosh</name>
<email>anubhabghosh.me@gmail.com</email>
</author>
<published>2022-08-09T12:22:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=23d0e71fcbc467840efd6cbb83ffdb6c13fdc610'/>
<id>23d0e71fcbc467840efd6cbb83ffdb6c13fdc610</id>
<content type='text'>
MapperJITLinkMemoryManager uses a free list to keep track of available
memory regions. Using an IntervalMap instead of vector allow automatic
coalescing of memory regions as they are freed.

Differential Revision: https://reviews.llvm.org/D131831
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MapperJITLinkMemoryManager uses a free list to keep track of available
memory regions. Using an IntervalMap instead of vector allow automatic
coalescing of memory regions as they are freed.

Differential Revision: https://reviews.llvm.org/D131831
</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply [Orc] Properly deallocate mapped memory in MapperJITLinkMemoryManager</title>
<updated>2022-08-13T07:37:50+00:00</updated>
<author>
<name>Anubhab Ghosh</name>
<email>anubhabghosh.me@gmail.com</email>
</author>
<published>2022-08-12T11:35:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a31af32183856ad6c3f24f5b0e89e1366180a780'/>
<id>a31af32183856ad6c3f24f5b0e89e1366180a780</id>
<content type='text'>
When memory is deallocated from MapperJITLinkMemoryManager deinitialize
actions are run through mapper and in case of InProcessMapper, memory
protections of the region are reset to read/write as they were previously
changed and can be reused in future.

Differential Revision: https://reviews.llvm.org/D131768
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When memory is deallocated from MapperJITLinkMemoryManager deinitialize
actions are run through mapper and in case of InProcessMapper, memory
protections of the region are reset to read/write as they were previously
changed and can be reused in future.

Differential Revision: https://reviews.llvm.org/D131768
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[Orc] Properly deallocate mapped memory in MapperJITLinkMemoryManager"</title>
<updated>2022-08-13T04:52:31+00:00</updated>
<author>
<name>Anubhab Ghosh</name>
<email>anubhabghosh.me@gmail.com</email>
</author>
<published>2022-08-13T04:50:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8180105143dcc4592fac18316527672bd3429ede'/>
<id>8180105143dcc4592fac18316527672bd3429ede</id>
<content type='text'>
This reverts commit 143555b2ed30746fbcc8ff84e9cef4267688f110.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 143555b2ed30746fbcc8ff84e9cef4267688f110.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Orc] Properly deallocate mapped memory in MapperJITLinkMemoryManager</title>
<updated>2022-08-13T04:38:25+00:00</updated>
<author>
<name>Anubhab Ghosh</name>
<email>anubhabghosh.me@gmail.com</email>
</author>
<published>2022-08-12T11:35:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=143555b2ed30746fbcc8ff84e9cef4267688f110'/>
<id>143555b2ed30746fbcc8ff84e9cef4267688f110</id>
<content type='text'>
When memory is deallocated from MapperJITLinkMemoryManager deinitialize
actions are run through mapper and in case of InProcessMapper, memory
protections of the region are reset to read/write as they were previously
changed and can be reused in future.

Differential Revision: https://reviews.llvm.org/D131768
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When memory is deallocated from MapperJITLinkMemoryManager deinitialize
actions are run through mapper and in case of InProcessMapper, memory
protections of the region are reset to read/write as they were previously
changed and can be reused in future.

Differential Revision: https://reviews.llvm.org/D131768
</pre>
</div>
</content>
</entry>
<entry>
<title>[Orc][JITLink] Slab based memory allocator to reduce RPC calls</title>
<updated>2022-08-08T09:43:41+00:00</updated>
<author>
<name>Anubhab Ghosh</name>
<email>anubhabghosh.me@gmail.com</email>
</author>
<published>2022-07-22T19:14:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1eee6de873974f55538df976bf7802f019eac70a'/>
<id>1eee6de873974f55538df976bf7802f019eac70a</id>
<content type='text'>
Calling reserve() used to require an RPC call. This commit allows large
ranges of executor address space to be reserved. Subsequent calls to
reserve() will return subranges of already reserved address space while
there is still space available.

Differential Revision: https://reviews.llvm.org/D130392
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Calling reserve() used to require an RPC call. This commit allows large
ranges of executor address space to be reserved. Subsequent calls to
reserve() will return subranges of already reserved address space while
there is still space available.

Differential Revision: https://reviews.llvm.org/D130392
</pre>
</div>
</content>
</entry>
</feed>
