From: Casey Bodley Date: Mon, 22 Nov 2021 18:51:10 +0000 (-0500) Subject: Revert "rgw: cr: add prealloc_stack()" X-Git-Tag: v18.0.0~787^2~60 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae27b46d4532cce931550a491617abcdcbb67d5b;p=ceph.git Revert "rgw: cr: add prealloc_stack()" This reverts commit 7970f355497f48ee5a18bf3a0bc034226c6d225c. Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index d5da5d80a103..56316c096b0a 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -241,10 +241,6 @@ RGWCoroutinesStack::~RGWCoroutinesStack() for (auto stack : spawned.entries) { stack->put(); } - - if (preallocated_stack) { - preallocated_stack->put(); - } } int RGWCoroutinesStack::operate(const DoutPrefixProvider *dpp, RGWCoroutinesEnv *_env) @@ -316,12 +312,7 @@ RGWCoroutinesStack *RGWCoroutinesStack::spawn(RGWCoroutine *source_op, RGWCorout rgw_spawned_stacks *s = (source_op ? &source_op->spawned : &spawned); - RGWCoroutinesStack *stack = preallocated_stack; - if (!stack) { - stack = env->manager->allocate_stack(); - } - preallocated_stack = nullptr; - + RGWCoroutinesStack *stack = env->manager->allocate_stack(); s->add_pending(stack); stack->parent = this; @@ -342,14 +333,6 @@ RGWCoroutinesStack *RGWCoroutinesStack::spawn(RGWCoroutine *op, bool wait) return spawn(NULL, op, wait); } -RGWCoroutinesStack *RGWCoroutinesStack::prealloc_stack() -{ - if (!preallocated_stack) { - preallocated_stack = env->manager->allocate_stack(); - } - return preallocated_stack; -} - int RGWCoroutinesStack::wait(const utime_t& interval) { RGWCompletionManager *completion_mgr = env->manager->get_completion_mgr(); @@ -928,16 +911,6 @@ RGWCoroutinesStack *RGWCoroutine::spawn(RGWCoroutine *op, bool wait) return stack->spawn(this, op, wait); } -RGWCoroutinesStack *RGWCoroutine::prealloc_stack() -{ - return stack->prealloc_stack(); -} - -uint64_t RGWCoroutine::prealloc_stack_id() -{ - return prealloc_stack()->get_id(); -} - bool RGWCoroutine::collect(int *ret, RGWCoroutinesStack *skip_stack, uint64_t *stack_id) /* returns true if needs to be called again */ { return stack->collect(this, ret, skip_stack, stack_id); diff --git a/src/rgw/rgw_coroutine.h b/src/rgw/rgw_coroutine.h index 25a2b60bc0a4..917543406e2d 100644 --- a/src/rgw/rgw_coroutine.h +++ b/src/rgw/rgw_coroutine.h @@ -300,9 +300,6 @@ public: bool collect(int *ret, RGWCoroutinesStack *skip_stack, uint64_t *stack_id = nullptr); /* returns true if needs to be called again */ bool collect_next(int *ret, RGWCoroutinesStack **collected_stack = NULL); /* returns true if found a stack to collect */ - RGWCoroutinesStack *prealloc_stack(); /* prepare a stack that will be used in the next spawn operation */ - uint64_t prealloc_stack_id(); /* prepare a stack that will be used in the next spawn operation, return its id */ - int wait(const utime_t& interval); bool drain_children(int num_cr_left, RGWCoroutinesStack *skip_stack = nullptr, @@ -435,8 +432,6 @@ class RGWCoroutinesStack : public RefCountedObject { rgw_spawned_stacks spawned; - RGWCoroutinesStack *preallocated_stack{nullptr}; - std::set blocked_by_stack; std::set blocking_stacks; @@ -534,7 +529,6 @@ public: void call(RGWCoroutine *next_op); RGWCoroutinesStack *spawn(RGWCoroutine *next_op, bool wait); - RGWCoroutinesStack *prealloc_stack(); int unwind(int retcode); int wait(const utime_t& interval);