]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common/buffer_seastar: fix alien threads memory
authorMatan Breizman <mbreizma@redhat.com>
Mon, 19 Feb 2024 12:24:52 +0000 (12:24 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 21 Feb 2024 09:36:49 +0000 (09:36 +0000)
commitc714c3c4f92994413e34a5900492c8987c85669e
tree8a294100358a839f67297357f0792b54fb8a970f
parent68400ff5450db1fd2c582ef016c9859829dbdf89
common/buffer_seastar: fix alien threads memory

The underlying raw_seastar_foreign_ptr::ptr is allocated from seastar.
This ptr is wrapped with seastar::foreign_ptr:
```
/// \c foreign_ptr<> wraps smart pointers -- \ref seastar::shared_ptr<>,
/// or similar, and remembers on what core this happened.
/// When the \c foreign_ptr<> object is destroyed, it sends a message to
/// the original core so that the wrapped object can be safely destroyed.
```

The issue is that once the pointer is de-allocated from an alien thread
it is unable to send a message to the original core.
Fix this issue by making use of seastar::alien integration with non-seastar applications.
In case ~raw_seastar_foreign_ptr() will be called from an alien thread, we will submit *and wait*
for the memory to be released from the origin core.

Fixes: https://tracker.ceph.com/issues/64086
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/common/buffer_seastar.cc