From: Matt Benjamin Date: Mon, 13 Feb 2017 01:18:26 +0000 (-0500) Subject: rgw_file: fix hiwat behavior X-Git-Tag: v12.0.1~423^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b8791b2217e9ca87b2d17b51f283fa14bd68b581;p=ceph.git rgw_file: fix hiwat behavior Removed logic to skip reclaim processing conditionally on hiwat, this probably meant to be related to a lowat value, which does not exist. Having exercised the hiwat reclaim behavior, noticed that the path which moves unreachable objects to LRU, could and probably should remove them altogether when q.size exceeds hiwat. Now the max unreachable float is lane hiwat, for all lanes. Signed-off-by: Matt Benjamin --- diff --git a/src/common/cohort_lru.h b/src/common/cohort_lru.h index 2c997ff68360..8a8b76699726 100644 --- a/src/common/cohort_lru.h +++ b/src/common/cohort_lru.h @@ -131,17 +131,7 @@ namespace cohort { for (int ix = 0; ix < n_lanes; ++ix, lane_ix = next_evict_lane()) { Lane& lane = qlane[lane_ix]; - /* hiwat check */ - /* XXX try the hiwat check unlocked, then recheck locked */ - if (lane.q.size() > lane_hiwat) { - lane.lock.lock(); - if (lane.q.size() <= lane_hiwat) { - lane.lock.unlock(); - continue; - } - } else - continue; - // XXXX if object at LRU has refcnt==1, take it + /* if object at LRU has refcnt==1, it may be reclaimable */ Object* o = &(lane.q.back()); #if 0 /* XXX save for refactor */ std::cout << __func__ @@ -228,7 +218,12 @@ namespace cohort { Object::Queue::iterator it = Object::Queue::s_iterator_to(*o); lane.q.erase(it); - lane.q.push_back(*o); + /* hiwat check */ + if (lane.q.size() > lane_hiwat) { + delete o; + } else { + lane.q.push_back(*o); + } } lane.lock.unlock(); }