A new shmem class with more flexible lifetime management
Categories
(Core :: Graphics, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox108 | --- | fixed |
People
(Reporter: nical, Assigned: nical)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
ipc::Shmem
lifetime is managed by the IPDL actors that create them and as a result are automatically deallocated along with the actors, including during abnormal IPDL shutdown (other process crashes).
This aspect does not quite click with how some of the graphics code want to use shmem. In particular there are places where we "wrap" objects around the shared memory such as draw targets or WebGPU buffers. In these cases we want the possibility for the shmem to outlive IPDL actors and simply get deallocated when there is no more references to the shmem in the process.
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D159398
Assignee | ||
Comment 3•2 years ago
|
||
TODO:
- Split the shmem class into the shmem mapping and the shmem handle.
- allocation returns a
Maybe<std::pair<ShmemHandle, ShmemMapping>>
- move into the ipc namespace
- rename into one of "UnsafeShmem", "RawShmem", or "SharedMemoryMapping/SharedMemoryHandle"
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/60b9bfda2e8b A new shared memory class with more flexible memory management. r=nika,jld https://hg.mozilla.org/integration/autoland/rev/71697f876d88 Use the new shmem classes in the WebGPU buffer impl. r=jgilbert
Comment 5•2 years ago
|
||
Backed out for causing build bustages on WebGPUParent.cpp
- Backout link
- Push with failures
- Failure Log
- Failure line: /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/c++/7/ext/new_allocator.h:136:4: error: use of deleted function 'mozilla::ipc::WritableSharedMemoryMapping::WritableSharedMemoryMapping(mozilla::ipc::WritableSharedMemoryMapping&&)'
gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:669: Unified_cpp_dom_webgpu0.o] Error 1
/builds/worker/checkouts/gecko/dom/webgpu/ipc/WebGPUParent.cpp:367:70: error: use of deleted function 'mozilla::ipc::WritableSharedMemoryMapping::WritableSharedMemoryMapping(mozilla::ipc::WritableSharedMemoryMapping&&)'
/builds/worker/checkouts/gecko/dom/webgpu/ipc/WebGPUParent.cpp:368:71: error: no matching function for call to 'std::unordered_map<long unsigned int, mozilla::webgpu::WebGPUParent::BufferMapData>::insert(std::pair<long unsigned int, mozilla::webgpu::WebGPUParent::BufferMapData>)'
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3a19cc8f5a1e A new shared memory class with more flexible memory management. r=nika,jld https://hg.mozilla.org/integration/autoland/rev/57b736500aa2 Use the new shmem classes in the WebGPU buffer impl. r=jgilbert
Assignee | ||
Updated•2 years ago
|
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3a19cc8f5a1e
https://hg.mozilla.org/mozilla-central/rev/57b736500aa2
Description
•