Skip to content

Commit 3887b27

Browse files
authored
Merge pull request ceph#62013 from Matan-B/wip-matanb-crimson-coroutine-fixes
crimson: revert coroutine workarounds Reviewed-by: Samuel Just <[email protected]> Reviewed-by: Yingxin Cheng <[email protected]>
2 parents 3ed23ca + c3a4c9b commit 3887b27

File tree

4 files changed

+9
-48
lines changed

4 files changed

+9
-48
lines changed

src/crimson/osd/ops_executer.cc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -867,19 +867,9 @@ OpsExecuter::flush_changes_and_submit(
867867
if (auto log_rit = log_entries.rbegin(); log_rit != log_entries.rend()) {
868868
ceph_assert(log_rit->version == osd_op_params->at_version);
869869
}
870-
871-
/*
872-
* This works around the gcc bug causing the generated code to incorrectly
873-
* execute unconditionally before the predicate.
874-
*
875-
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101244
876-
*/
877-
auto clone_obc = cloning_ctx
878-
? std::move(cloning_ctx->clone_obc)
879-
: nullptr;
880870
auto [_submitted, _all_completed] = co_await pg->submit_transaction(
881871
std::move(obc),
882-
std::move(clone_obc),
872+
cloning_ctx ? std::move(cloning_ctx->clone_obc) : nullptr,
883873
std::move(txn),
884874
std::move(*osd_op_params),
885875
std::move(log_entries)

src/crimson/osd/osd_operations/client_request.cc

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -219,25 +219,8 @@ ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptib
219219
DEBUGDPP("{}.{}: pg active, entering process[_pg]_op",
220220
*pgref, *this, this_instance_id);
221221

222-
{
223-
/* The following works around two different gcc bugs:
224-
* 1. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101244
225-
* This example isn't preciesly as described in the bug, but it seems
226-
* similar. It causes the generated code to incorrectly execute
227-
* process_pg_op unconditionally before the predicate. It seems to be
228-
* fixed in gcc 12.2.1.
229-
* 2. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102217
230-
* This one appears to cause the generated code to double-free
231-
* awaiter holding the future. This one seems to be fixed
232-
* in gcc 13.2.1.
233-
*
234-
* Assigning the intermediate result and moving it into the co_await
235-
* expression bypasses both bugs.
236-
*/
237-
auto fut = (is_pg_op() ? process_pg_op(pgref) :
238-
process_op(ihref, pgref, this_instance_id));
239-
co_await std::move(fut);
240-
}
222+
co_await (is_pg_op() ? process_pg_op(pgref) :
223+
process_op(ihref, pgref, this_instance_id));
241224

242225
DEBUGDPP("{}.{}: process[_pg]_op complete, completing handle",
243226
*pgref, *this, this_instance_id);

src/crimson/osd/osd_operations/replicated_request.cc

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,12 @@ RepRequest::interruptible_future<> RepRequest::with_pg_interruptible(
7070
LOG_PREFIX(RepRequest::with_pg_interruptible);
7171
DEBUGI("{}", *this);
7272
co_await this->template enter_stage<interruptor>(repop_pipeline(*pg).process);
73-
{
74-
/* Splitting this expression into a fut and a seperate co_await
75-
* works around a gcc 11 bug (observed on 11.4.1 and gcc 11.5.0)
76-
* which results in the pg ref captured by the lambda being
77-
* destructed twice. We can probably remove these workarounds
78-
* once we disallow gcc 11 */
79-
auto fut = interruptor::make_interruptible(
80-
this->template with_blocking_event<
81-
PG_OSDMapGate::OSDMapBlocker::BlockingEvent
82-
>([this, pg](auto &&trigger) {
83-
return pg->osdmap_gate.wait_for_map(
84-
std::move(trigger), req->min_epoch);
85-
}));
86-
co_await std::move(fut);
87-
}
73+
co_await interruptor::make_interruptible(this->template with_blocking_event<
74+
PG_OSDMapGate::OSDMapBlocker::BlockingEvent
75+
>([this, pg](auto &&trigger) {
76+
return pg->osdmap_gate.wait_for_map(
77+
std::move(trigger), req->min_epoch);
78+
}));
8879

8980
if (pg->can_discard_replica_op(*req)) {
9081
co_return;

src/test/crimson/test_interruptible_future.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,6 @@ TEST_F(seastar_test_suite_t, interruptible_repeat_eagain)
305305
});
306306
}
307307

308-
#if 0
309-
// This seems to cause a hang in the gcc-9 linker on bionic
310308
TEST_F(seastar_test_suite_t, handle_error)
311309
{
312310
run_async([] {
@@ -324,4 +322,3 @@ TEST_F(seastar_test_suite_t, handle_error)
324322
ret.unsafe_get();
325323
});
326324
}
327-
#endif

0 commit comments

Comments
 (0)