]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw file: remove busy-wait in RGWLibFS::gc() 10638/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 9 Aug 2016 20:49:41 +0000 (16:49 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Thu, 11 Aug 2016 18:02:52 +0000 (14:02 -0400)
This is a background thread.  However, CPU is wasted.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_file.cc
src/rgw/rgw_file.h

index e4540997d16770baa27b9d11b1d81e2ab6d14aec..3ecd565145f2c7c4f9e93c4dcb0674b88ad9bb07 100644 (file)
@@ -679,6 +679,7 @@ namespace rgw {
          } /* rgw_fh */
        } /* event::type::READDIR */
       } /* ev */
+      std::this_thread::sleep_for(gc_interval);
     } while (! stop);
   } /* RGWLibFS::gc */
 
index 03bc95775cd26f5747517d12b8ae8c079de3956e..5f871eee433ea3468b1dc628ed4b3eea3a1561bd 100644 (file)
@@ -687,6 +687,9 @@ namespace rgw {
     struct rgw_fs fs;
     RGWFileHandle root_fh;
 
+    static constexpr std::chrono::seconds gc_interval =
+      std::chrono::seconds(120);
+
     mutable std::atomic<uint64_t> refcnt;
 
     RGWFileHandle::FHCache fh_cache;