diff options
-rw-r--r-- | src/common/WorkQueue.cc | 5 | ||||
-rw-r--r-- | src/common/WorkQueue.h | 1 | ||||
-rw-r--r-- | src/osd/OSD.cc | 4 | ||||
-rw-r--r-- | src/osd/OSD.h | 2 | ||||
-rw-r--r-- | src/osd/PG.cc | 7 | ||||
-rw-r--r-- | src/osd/PG.h | 2 |
6 files changed, 18 insertions, 3 deletions
diff --git a/src/common/WorkQueue.cc b/src/common/WorkQueue.cc index a57c0782030..6b648a78021 100644 --- a/src/common/WorkQueue.cc +++ b/src/common/WorkQueue.cc @@ -49,6 +49,11 @@ ThreadPool::ThreadPool(CephContext *cct_, string nm, int n, const char *option) } } +void ThreadPool::TPHandle::suspend_tp_timeout() +{ + cct->get_heartbeat_map()->clear_timeout(hb); +} + void ThreadPool::TPHandle::reset_tp_timeout() { cct->get_heartbeat_map()->reset_timeout( diff --git a/src/common/WorkQueue.h b/src/common/WorkQueue.h index d936d77abef..b2742accdce 100644 --- a/src/common/WorkQueue.h +++ b/src/common/WorkQueue.h @@ -49,6 +49,7 @@ public: : cct(cct), hb(hb), grace(grace), suicide_grace(suicide_grace) {} public: void reset_tp_timeout(); + void suspend_tp_timeout(); }; private: diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index a71c1e9af21..89aa1db34eb 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7050,9 +7050,9 @@ PGRef OSD::OpWQ::_dequeue() return pg; } -void OSD::OpWQ::_process(PGRef pg) +void OSD::OpWQ::_process(PGRef pg, ThreadPool::TPHandle &handle) { - pg->lock(); + pg->lock_suspend_timeout(handle); OpRequestRef op; { Mutex::Locker l(qlock); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 5bcff7442d7..478f766d145 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -911,7 +911,7 @@ private: bool _empty() { return pqueue.empty(); } - void _process(PGRef pg); + void _process(PGRef pg, ThreadPool::TPHandle &handle); } op_wq; void enqueue_op(PG *pg, OpRequestRef op); diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 9f957b8e054..f731441e8a4 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -193,6 +193,13 @@ PG::~PG() #endif } +void PG::lock_suspend_timeout(ThreadPool::TPHandle &handle) +{ + handle.suspend_tp_timeout(); + lock(); + handle.reset_tp_timeout(); +} + void PG::lock(bool no_lockdep) { _lock.Lock(no_lockdep); diff --git a/src/osd/PG.h b/src/osd/PG.h index 10e9a2544a9..8f572c75e19 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -245,6 +245,8 @@ protected: public: bool deleting; // true while in removing or OSD is shutting down + + void lock_suspend_timeout(ThreadPool::TPHandle &handle); void lock(bool no_lockdep = false); void unlock() { //generic_dout(0) << this << " " << info.pgid << " unlock" << dendl; |