From: Matt Benjamin Date: Tue, 9 Aug 2016 20:49:41 +0000 (-0400) Subject: rgw file: remove busy-wait in RGWLibFS::gc() X-Git-Tag: ses5-milestone5~139^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10638%2Fhead;p=ceph.git rgw file: remove busy-wait in RGWLibFS::gc() This is a background thread. However, CPU is wasted. Signed-off-by: Matt Benjamin --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index e4540997d16..3ecd565145f 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -679,6 +679,7 @@ namespace rgw { } /* rgw_fh */ } /* event::type::READDIR */ } /* ev */ + std::this_thread::sleep_for(gc_interval); } while (! stop); } /* RGWLibFS::gc */ diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 03bc95775cd..5f871eee433 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -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 refcnt; RGWFileHandle::FHCache fh_cache;