]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: avoid spurious sleeps 38773/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 5 Jan 2021 17:03:27 +0000 (09:03 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 6 Jan 2021 14:42:56 +0000 (06:42 -0800)
Like trim_interval, don't sleep for small amounts of time. This avoids
spurious sleeps like:

    2020-12-25T00:14:22.242+0000 7f6a95884700 20 mds.0.cache upkeep thread waiting interval 0.000000108s
    2020-12-25T00:14:22.242+0000 7f6a95884700 20 mds.0.cache upkeep thread waiting interval 0.000000108s
    2020-12-25T00:14:22.242+0000 7f6a95884700 20 mds.0.cache upkeep thread waiting interval 0.000000108s
    2020-12-25T00:14:22.242+0000 7f6a95884700 20 mds.0.cache upkeep thread waiting interval 0.000000108s
    2020-12-25T00:14:22.242+0000 7f6a95884700 20 mds.0.cache upkeep thread waiting interval 0.000000108s
    2020-12-25T00:14:22.242+0000 7f6a95884700 20 mds.0.cache upkeep thread waiting interval 0.000000108s
    2020-12-25T00:14:22.242+0000 7f6a95884700 20 mds.0.cache upkeep thread waiting interval 0.000000108s

Also, fix the same issue in the Client.

Fixes: https://tracker.ceph.com/issues/48753
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/client/Client.cc
src/mds/MDCache.cc

index d6ed10ab425017a1d4491392690cb1619c7b5252..a4d4d9eba6c4c14aaadc8291423b1bcc71618351 100644 (file)
@@ -6526,7 +6526,7 @@ void Client::start_tick_thread()
       auto d_interval = clock::duration(cct->_conf.get_val<sec>("client_debug_inject_tick_delay"));
 
       auto interval = std::max(t_interval, d_interval);
-      if (likely(since >= interval)) {
+      if (likely(since >= interval*.90)) {
         tick();
         last_tick = clock::now();
       } else {
index 7cfb3ff9154a3449b3c579972d7dd7fbf585296b..1aea36e0430927c31c0e0a4602d7897502c1b89f 100644 (file)
@@ -190,7 +190,7 @@ MDCache::MDCache(MDSRank *m, PurgeQueue &purge_queue_) :
       }
       since = now-upkeep_last_release;
       auto release_interval = clock::duration(g_conf().get_val<std::chrono::seconds>("mds_cache_release_free_interval"));
-      if (since >= release_interval) {
+      if (since >= release_interval*.90) {
         /* XXX not necessary once MDCache uses PriorityCache */
         dout(10) << "releasing free memory" << dendl;
         ceph_heap_release_free_memory();