]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Revert "rgw: cr: add prealloc_stack()"
authorCasey Bodley <cbodley@redhat.com>
Mon, 22 Nov 2021 18:51:10 +0000 (13:51 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 May 2022 19:47:33 +0000 (15:47 -0400)
This reverts commit 7970f355497f48ee5a18bf3a0bc034226c6d225c.

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_coroutine.cc
src/rgw/rgw_coroutine.h

index d5da5d80a1039b9ce0c08dd36eba714aac0322bf..56316c096b0a8bd0a141de3a6f6d05f0e7d029f0 100644 (file)
@@ -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);
index 25a2b60bc0a4e98956d54f6bd1c05ba01016fc27..917543406e2d0cb1aaa6d6456e9e53b4f7d15320 100644 (file)
@@ -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<RGWCoroutinesStack *> blocked_by_stack;
   std::set<RGWCoroutinesStack *> 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);